refactored payment orchestration
This commit is contained in:
@@ -11,6 +11,7 @@ import (
|
||||
"github.com/tech/sendico/pkg/merrors"
|
||||
"github.com/tech/sendico/pkg/mlogger"
|
||||
pkm "github.com/tech/sendico/pkg/model"
|
||||
"github.com/tech/sendico/pkg/model/account_role"
|
||||
"github.com/tech/sendico/pkg/mservice"
|
||||
"github.com/tech/sendico/pkg/mutil/mzap"
|
||||
"go.mongodb.org/mongo-driver/v2/bson"
|
||||
@@ -167,7 +168,7 @@ func (a *accountsStore) GetByAccountCode(ctx context.Context, orgRef bson.Object
|
||||
return result, nil
|
||||
}
|
||||
|
||||
func (a *accountsStore) GetByRole(ctx context.Context, orgRef bson.ObjectID, currency string, role pkm.AccountRole) (*pkm.LedgerAccount, error) {
|
||||
func (a *accountsStore) GetByRole(ctx context.Context, orgRef bson.ObjectID, currency string, role account_role.AccountRole) (*pkm.LedgerAccount, error) {
|
||||
if orgRef.IsZero() {
|
||||
a.logger.Warn("Attempt to get account with zero organization ID")
|
||||
return nil, merrors.InvalidArgument("accountsStore: zero organization ID")
|
||||
@@ -254,7 +255,7 @@ func (a *accountsStore) GetDefaultSettlement(ctx context.Context, orgRef bson.Ob
|
||||
query := repository.Query().
|
||||
Filter(repository.Field("organizationRef"), orgRef).
|
||||
Filter(repository.Field("currency"), currency).
|
||||
Filter(repository.Field("role"), pkm.AccountRoleSettlement).
|
||||
Filter(repository.Field("role"), account_role.AccountRoleSettlement).
|
||||
Limit(&limit)
|
||||
|
||||
result := &pkm.LedgerAccount{}
|
||||
|
||||
Reference in New Issue
Block a user