forked from mirrors/homebox
feat: more-currency-support (#316)
* add polish and turkish lira * add romanian lei * code-gen
This commit is contained in:
parent
729293745f
commit
70297b9d27
5 changed files with 36 additions and 14 deletions
|
@ -133,6 +133,9 @@ const (
|
|||
CurrencyRmb Currency = "rmb"
|
||||
CurrencyBgn Currency = "bgn"
|
||||
CurrencyChf Currency = "chf"
|
||||
CurrencyPln Currency = "pln"
|
||||
CurrencyTry Currency = "try"
|
||||
CurrencyRon Currency = "ron"
|
||||
)
|
||||
|
||||
func (c Currency) String() string {
|
||||
|
@ -142,7 +145,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, CurrencyZar, CurrencyAud, CurrencyNok, CurrencySek, CurrencyDkk, CurrencyInr, CurrencyRmb, CurrencyBgn, CurrencyChf:
|
||||
case CurrencyUsd, CurrencyEur, CurrencyGbp, CurrencyJpy, CurrencyZar, CurrencyAud, CurrencyNok, CurrencySek, CurrencyDkk, CurrencyInr, CurrencyRmb, CurrencyBgn, CurrencyChf, CurrencyPln, CurrencyTry, CurrencyRon:
|
||||
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