feat: add default currencies

This commit is contained in:
skeris 2023-07-25 19:12:51 +03:00
parent 8b4275c245
commit 6b9935cb43
2 changed files with 3 additions and 2 deletions

@ -22,6 +22,8 @@ type accountRepository interface {
UpdateName(ctx context.Context, userID string, name *models.Name) (*models.Account, errors.Error)
}
const defaultCurrency = "RUB"
type authClient interface {
GetUser(ctx context.Context, userID string) (*models.User, errors.Error)
}
@ -175,7 +177,7 @@ func (receiver *Service) CreateAccountByUserID(ctx context.Context, userID strin
return nil, err
}
createdAccount, err := receiver.repository.Insert(ctx, &models.Account{UserID: user.ID,Wallet: &models.Wallet{Currency: defaultCurrency}})
createdAccount, err := receiver.repository.Insert(ctx, &models.Account{UserID: user.ID,Wallet: models.Wallet{Currency: defaultCurrency}})
if err != nil {
receiver.logger.Error("failed to create account on <CreateAccountByUserID> of <AccountService>",
zap.Error(err),

@ -2,7 +2,6 @@ package wallet
import (
"context"
"fmt"
"log"
"go.uber.org/zap"