improved tgsettle messages + storage fixes
This commit is contained in:
@@ -120,6 +120,24 @@ func (a *botServiceAdapter) GetActiveRequestForAccount(ctx context.Context, ledg
|
||||
return a.svc.GetActiveRequestForAccount(ctx, ledgerAccountID)
|
||||
}
|
||||
|
||||
func (a *botServiceAdapter) GetAccountProfile(ctx context.Context, ledgerAccountID string) (*bot.AccountProfile, error) {
|
||||
if a == nil || a.svc == nil {
|
||||
return nil, merrors.Internal("treasury service unavailable")
|
||||
}
|
||||
profile, err := a.svc.GetAccountProfile(ctx, ledgerAccountID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if profile == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return &bot.AccountProfile{
|
||||
AccountID: strings.TrimSpace(profile.AccountID),
|
||||
AccountCode: strings.TrimSpace(profile.AccountCode),
|
||||
Currency: strings.TrimSpace(profile.Currency),
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (a *botServiceAdapter) CreateRequest(ctx context.Context, input bot.CreateRequestInput) (*storagemodel.TreasuryRequest, error) {
|
||||
if a == nil || a.svc == nil {
|
||||
return nil, merrors.Internal("treasury service unavailable")
|
||||
|
||||
Reference in New Issue
Block a user