Skip to content
This repository has been archived by the owner on Jun 12, 2024. It is now read-only.

Commit

Permalink
feat: more-currency-support (#316)
Browse files Browse the repository at this point in the history
* add polish and turkish lira

* add romanian lei

* code-gen
  • Loading branch information
hay-kot authored Feb 26, 2023
1 parent 7292937 commit 70297b9
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 13 deletions.
2 changes: 0 additions & 2 deletions backend/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,6 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/swaggo/files v1.0.0 h1:1gGXVIeUFCS/dta17rnP0iOpr6CXFwKD7EO5ID233e4=
Expand Down
5 changes: 4 additions & 1 deletion backend/internal/data/ent/group/group.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion backend/internal/data/ent/migrate/schema.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion backend/internal/data/ent/schema/group.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func (Group) Fields() []ent.Field {
NotEmpty(),
field.Enum("currency").
Default("usd").
Values("usd", "eur", "gbp", "jpy", "zar", "aud", "nok", "sek", "dkk", "inr", "rmb", "bgn","chf"),
Values("usd", "eur", "gbp", "jpy", "zar", "aud", "nok", "sek", "dkk", "inr", "rmb", "bgn", "chf", "pln", "try", "ron"),
}
}

Expand Down
37 changes: 29 additions & 8 deletions frontend/lib/data/currency.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
export type Codes =
| "USD"
| "AUD"
| "BGN"
| "CHF"
| "DKK"
| "EUR"
| "GBP"
| "INR"
| "JPY"
| "ZAR"
| "AUD"
| "NOK"
| "SEK"
| "DKK"
| "INR"
| "PLN"
| "RMB"
| "BGN"
| "CHF";
| "RON"
| "SEK"
| "TRY"
| "USD"
| "ZAR";

export type Currency = {
code: Codes;
Expand Down Expand Up @@ -69,6 +72,18 @@ export const currencies: Currency[] = [
symbol: "kr",
name: "Norwegian Krone",
},
{
code: "PLN",
local: "pl-PL",
symbol: "zł",
name: "Polish Zloty",
},
{
code: "RON",
local: "ro-RO",
symbol: "lei",
name: "Romanian Leu",
},
{
code: "ZAR",
local: "en-ZA",
Expand All @@ -81,6 +96,12 @@ export const currencies: Currency[] = [
symbol: "kr",
name: "Swedish Krona",
},
{
code: "TRY",
local: "tr-TR",
symbol: "₺",
name: "Turkish Lira",
},
{
code: "USD",
local: "en-US",
Expand Down

0 comments on commit 70297b9

Please sign in to comment.