generated from PenaSide/GolangTemplate
feat: add default currencies
This commit is contained in:
parent
8b4275c245
commit
6b9935cb43
@ -22,6 +22,8 @@ type accountRepository interface {
|
|||||||
UpdateName(ctx context.Context, userID string, name *models.Name) (*models.Account, errors.Error)
|
UpdateName(ctx context.Context, userID string, name *models.Name) (*models.Account, errors.Error)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const defaultCurrency = "RUB"
|
||||||
|
|
||||||
type authClient interface {
|
type authClient interface {
|
||||||
GetUser(ctx context.Context, userID string) (*models.User, errors.Error)
|
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
|
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 {
|
if err != nil {
|
||||||
receiver.logger.Error("failed to create account on <CreateAccountByUserID> of <AccountService>",
|
receiver.logger.Error("failed to create account on <CreateAccountByUserID> of <AccountService>",
|
||||||
zap.Error(err),
|
zap.Error(err),
|
||||||
|
@ -2,7 +2,6 @@ package wallet
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
|
Loading…
Reference in New Issue
Block a user