Some checks failed
CI/CD Pipeline / Solidity Contracts (push) Failing after 1m22s
CI/CD Pipeline / Security Scanning (push) Successful in 2m30s
CI/CD Pipeline / Lint and Format (push) Failing after 44s
CI/CD Pipeline / Terraform Validation (push) Failing after 27s
CI/CD Pipeline / Kubernetes Validation (push) Successful in 31s
Deploy ChainID 138 / Deploy ChainID 138 (push) Failing after 56s
HYBX OMNL TypeScript & anchor / token-aggregation build + reconcile artifact (push) Failing after 29s
Validation / validate-genesis (push) Successful in 34s
Validation / validate-terraform (push) Failing after 39s
Validation / validate-kubernetes (push) Failing after 14s
Validation / validate-smart-contracts (push) Failing after 20s
Validation / validate-security (push) Failing after 1m19s
Validation / validate-documentation (push) Failing after 27s
Verify Deployment / Verify Deployment (push) Failing after 1m13s
Co-authored-by: Cursor <cursoragent@cursor.com>
34 lines
1.4 KiB
TypeScript
34 lines
1.4 KiB
TypeScript
import type { ExternalTransferRequest } from '@dbis/settlement-core';
|
|
import { loadConfig, loadOfficeProfile, settlementOfficeId } from '../config';
|
|
|
|
/** Bind every settlement request to Office 24 (same profile as OMNL terminal). */
|
|
export function bindOffice24(req: Partial<ExternalTransferRequest>): ExternalTransferRequest {
|
|
const cfg = loadConfig();
|
|
const profile = loadOfficeProfile();
|
|
const officeId = settlementOfficeId(req.officeId);
|
|
|
|
if (!req.idempotencyKey || !req.creditorIban || !req.amount) {
|
|
throw new Error('idempotencyKey, creditorIban, amount required');
|
|
}
|
|
|
|
return {
|
|
officeId,
|
|
valueDate: req.valueDate ?? new Date().toISOString().slice(0, 10),
|
|
currency: req.currency ?? profile.settlement.defaultCurrency ?? cfg.defaultCurrency,
|
|
moneyLayers: (req.moneyLayers ?? profile.settlement.moneyLayers) as ExternalTransferRequest['moneyLayers'],
|
|
rail: req.rail ?? 'SWIFT',
|
|
remittanceInfo: req.remittanceInfo ?? `OMNL Office 24 settlement — ${profile.externalId}`,
|
|
beneficiaryName: req.beneficiaryName ?? 'Beneficiary',
|
|
idempotencyKey: req.idempotencyKey,
|
|
creditorIban: req.creditorIban,
|
|
amount: req.amount,
|
|
debtorIban: req.debtorIban,
|
|
creditorBic: req.creditorBic,
|
|
orderingName: req.orderingName ?? profile.omnlLegalName,
|
|
swiftMessageKind: req.swiftMessageKind,
|
|
tradeFinance: req.tradeFinance,
|
|
rwaVerbiage: req.rwaVerbiage,
|
|
convertToCrypto: req.convertToCrypto,
|
|
};
|
|
}
|