diff --git a/backend/internal/data/ent/group/group.go b/backend/internal/data/ent/group/group.go index 5d949ea..5e92129 100644 --- a/backend/internal/data/ent/group/group.go +++ b/backend/internal/data/ent/group/group.go @@ -160,6 +160,8 @@ const ( CurrencyThb Currency = "thb" CurrencyTry Currency = "try" CurrencyUsd Currency = "usd" + CurrencyXag Currency = "xag" + CurrencyXau Currency = "xau" CurrencyZar Currency = "zar" ) @@ -170,7 +172,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 CurrencyAed, CurrencyAud, CurrencyBgn, CurrencyBrl, CurrencyCad, CurrencyChf, CurrencyCny, CurrencyCzk, CurrencyDkk, CurrencyEur, CurrencyGbp, CurrencyHkd, CurrencyIdr, CurrencyInr, CurrencyJpy, CurrencyKrw, CurrencyMxn, CurrencyNok, CurrencyNzd, CurrencyPln, CurrencyRmb, CurrencyRon, CurrencyRub, CurrencySar, CurrencySek, CurrencySgd, CurrencyThb, CurrencyTry, CurrencyUsd, CurrencyZar: + case CurrencyAed, CurrencyAud, CurrencyBgn, CurrencyBrl, CurrencyCad, CurrencyChf, CurrencyCny, CurrencyCzk, CurrencyDkk, CurrencyEur, CurrencyGbp, CurrencyHkd, CurrencyIdr, CurrencyInr, CurrencyJpy, CurrencyKrw, CurrencyMxn, CurrencyNok, CurrencyNzd, CurrencyPln, CurrencyRmb, CurrencyRon, CurrencyRub, CurrencySar, CurrencySek, CurrencySgd, CurrencyThb, CurrencyTry, CurrencyUsd, CurrencyXag, CurrencyXau, CurrencyZar: return nil default: return fmt.Errorf("group: invalid enum value for currency field: %q", c) diff --git a/backend/internal/data/ent/schema/group.go b/backend/internal/data/ent/schema/group.go index 494882c..64e9d95 100644 --- a/backend/internal/data/ent/schema/group.go +++ b/backend/internal/data/ent/schema/group.go @@ -58,6 +58,8 @@ func (Group) Fields() []ent.Field { "thb", "try", "usd", + "xag", + "xau", "zar", ), } diff --git a/frontend/lib/data/currency.ts b/frontend/lib/data/currency.ts index 236fe9f..baa9b10 100644 --- a/frontend/lib/data/currency.ts +++ b/frontend/lib/data/currency.ts @@ -27,6 +27,8 @@ export type Codes = | "THB" | "TRY" | "USD" + | "XAG" + | "XAU" | "ZAR"; export type Currency = { @@ -65,5 +67,7 @@ export const currencies: Currency[] = [ { code: "THB", local: "Thailand", symbol: "฿", name: "Thai Baht" }, { code: "TRY", local: "Turkey", symbol: "₺", name: "Turkish Lira" }, { code: "USD", local: "United States", symbol: "$", name: "United States Dollar" }, + { code: "XAG", local: "Global", symbol: "XAG", name: "Silver Troy Ounce" }, + { code: "XAU", local: "Global", symbol: "XAU", name: "Gold Troy Ounce" }, { code: "ZAR", local: "South Africa", symbol: "R", name: "South African Rand" }, ];