forked from mirrors/homebox
feat: add additional currencies (#125)
Add additional currencies and ensure Frontend/Backend currencies are synched via testing
This commit is contained in:
parent
7e0f1fac23
commit
2fb5a437a2
8 changed files with 45 additions and 5 deletions
|
@ -124,6 +124,8 @@ const (
|
|||
CurrencyEur Currency = "eur"
|
||||
CurrencyGbp Currency = "gbp"
|
||||
CurrencyJpy Currency = "jpy"
|
||||
CurrencyZar Currency = "zar"
|
||||
CurrencyAud Currency = "aud"
|
||||
)
|
||||
|
||||
func (c Currency) String() string {
|
||||
|
@ -133,7 +135,7 @@ func (c Currency) String() string {
|
|||
// CurrencyValidator is a validator for the "currency" field enum values. It is called by the builders before save.
|
||||
func CurrencyValidator(c Currency) error {
|
||||
switch c {
|
||||
case CurrencyUsd, CurrencyEur, CurrencyGbp, CurrencyJpy:
|
||||
case CurrencyUsd, CurrencyEur, CurrencyGbp, CurrencyJpy, CurrencyZar, CurrencyAud:
|
||||
return nil
|
||||
default:
|
||||
return fmt.Errorf("group: invalid enum value for currency field: %q", c)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue