refactored payment orchestration

This commit is contained in:
Stephan D
2026-02-03 00:40:46 +01:00
parent 05d998e0f7
commit 5e87e2f2f9
184 changed files with 3920 additions and 2219 deletions

View File

@@ -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{}