mirror of
https://github.com/hay-kot/homebox.git
synced 2025-06-28 06:38:36 +00:00
feat: user defined currencies (#700)
* basic currency service for loading at runtime
* api endpoint for currencies
* sort slice before return
* remove currency validation
* validate using currency service
* implement selecting dynamic currency options
* bump go version
* fix type definition
* specify explicit type
* change go versions
* proper types for assetId
* log/return currency error
* make case insensative
* use ToUpper instead
* feat: adding new currencies (#715)
* fix: task swag (#710)
Co-authored-by: Quoing <pavel.cadersky@mavenir.com>
* [feat] Adding new currencies
---------
Co-authored-by: quoing <quoing@users.noreply.github.com>
Co-authored-by: Quoing <pavel.cadersky@mavenir.com>
Co-authored-by: Bradley <41597815+userbradley@users.noreply.github.com>
* remove ts file and consoldate new values into json
* move flag to options namespace
* add env config for currencies
* basic documentaion
* remove in sync test
---------
Co-authored-by: quoing <quoing@users.noreply.github.com>
Co-authored-by: Quoing <pavel.cadersky@mavenir.com>
Co-authored-by: Bradley <41597815+userbradley@users.noreply.github.com>
Former-commit-id: c4b923847a
This commit is contained in:
parent
ce923a5b4c
commit
2b79788fbe
39 changed files with 1226 additions and 328 deletions
|
@ -25,7 +25,7 @@ type Group struct {
|
|||
// Name holds the value of the "name" field.
|
||||
Name string `json:"name,omitempty"`
|
||||
// Currency holds the value of the "currency" field.
|
||||
Currency group.Currency `json:"currency,omitempty"`
|
||||
Currency string `json:"currency,omitempty"`
|
||||
// Edges holds the relations/edges for other nodes in the graph.
|
||||
// The values are being populated by the GroupQuery when eager-loading is set.
|
||||
Edges GroupEdges `json:"edges"`
|
||||
|
@ -170,7 +170,7 @@ func (gr *Group) assignValues(columns []string, values []any) error {
|
|||
if value, ok := values[i].(*sql.NullString); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field currency", values[i])
|
||||
} else if value.Valid {
|
||||
gr.Currency = group.Currency(value.String)
|
||||
gr.Currency = value.String
|
||||
}
|
||||
default:
|
||||
gr.selectValues.Set(columns[i], values[i])
|
||||
|
@ -253,7 +253,7 @@ func (gr *Group) String() string {
|
|||
builder.WriteString(gr.Name)
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("currency=")
|
||||
builder.WriteString(fmt.Sprintf("%v", gr.Currency))
|
||||
builder.WriteString(gr.Currency)
|
||||
builder.WriteByte(')')
|
||||
return builder.String()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue