accounts creation
All checks were successful
ci/woodpecker/push/billing_fees Pipeline was successful
ci/woodpecker/push/db Pipeline was successful
ci/woodpecker/push/bff Pipeline was successful
ci/woodpecker/push/discovery Pipeline was successful
ci/woodpecker/push/fx_ingestor Pipeline was successful
ci/woodpecker/push/fx_oracle Pipeline was successful
ci/woodpecker/push/frontend Pipeline was successful
ci/woodpecker/push/gateway_mntx Pipeline was successful
ci/woodpecker/push/gateway_chain Pipeline was successful
ci/woodpecker/push/gateway_tgsettle Pipeline was successful
ci/woodpecker/push/nats Pipeline was successful
ci/woodpecker/push/ledger Pipeline was successful
ci/woodpecker/push/notification Pipeline was successful
ci/woodpecker/push/payments_orchestrator Pipeline was successful

This commit is contained in:
Stephan D
2026-01-23 00:13:43 +01:00
parent b677d37b99
commit 218c4e20b3
64 changed files with 1641 additions and 338 deletions

View File

@@ -1,11 +1,18 @@
import 'package:pshared/api/requests/ledger/create.dart';
import 'package:pshared/api/responses/ledger/accounts.dart';
import 'package:pshared/api/responses/ledger/balance.dart';
import 'package:pshared/data/mapper/describable.dart';
import 'package:pshared/data/mapper/ledger/account.dart';
import 'package:pshared/data/mapper/ledger/balance.dart';
import 'package:pshared/data/mapper/ledger/type.dart';
import 'package:pshared/models/currency.dart';
import 'package:pshared/models/describable.dart';
import 'package:pshared/models/ledger/account.dart';
import 'package:pshared/models/ledger/balance.dart';
import 'package:pshared/models/ledger/type.dart';
import 'package:pshared/service/authorization/service.dart';
import 'package:pshared/service/services.dart';
import 'package:pshared/utils/currency.dart';
class LedgerService {
@@ -29,4 +36,22 @@ class LedgerService {
);
return LedgerBalanceResponse.fromJson(json).balance.toDomain();
}
Future<void> create({
required String organizationRef,
required Describable describable,
required String? ownerRef,
required Currency currency,
}) async => AuthorizationService.getPOSTResponse(
_objectType,
'/$organizationRef',
CreateLedgerAccountRequest(
describable: describable.toDTO(),
ownerRef: ownerRef,
allowNegative: false,
isSettlement: false,
accountType: LedgerAccountType.asset.toDTO(),
currency: currencyCodeToString(currency),
).toJson(),
);
}