remove currency validation

This commit is contained in:
Hayden 2024-01-05 11:35:50 -06:00
parent 2240617c8e
commit e647419eed
No known key found for this signature in database
GPG key ID: 17CF79474E257545
11 changed files with 92 additions and 143 deletions

View file

@ -28,7 +28,7 @@ func NewGroupRepository(db *ent.Client) *GroupRepository {
Name: g.Name,
CreatedAt: g.CreatedAt,
UpdatedAt: g.UpdatedAt,
Currency: strings.ToUpper(g.Currency.String()),
Currency: strings.ToUpper(g.Currency),
}
}
@ -265,11 +265,9 @@ func (r *GroupRepository) GroupCreate(ctx context.Context, name string) (Group,
}
func (r *GroupRepository) GroupUpdate(ctx context.Context, ID uuid.UUID, data GroupUpdate) (Group, error) {
currency := group.Currency(strings.ToLower(data.Currency))
entity, err := r.db.Group.UpdateOneID(ID).
SetName(data.Name).
SetCurrency(currency).
SetCurrency(strings.ToLower(data.Currency)).
Save(ctx)
return r.groupMapper.MapErr(entity, err)