/** * Transaction Update Payload Splitting * * Scoped transaction resources accept flattened update payloads (base fields * and activity fields at the root level). Before sending them to the API, * the payload must be split into base update fields (sent at the root) and * activity-specific fields (nested under `scopeData`). */ /** * Nests activity fields under the `scopeData` path the API expects. The path is * the same one each scoped resource declares as its `SCOPE_PATH`, e.g. * `["MX", "actividadVulnerable", "AVI"]` → * `{ MX: { actividadVulnerable: { AVI: activity } } }`, or * `["MX", "cnbv", "TRANSMISOR"]` → `{ MX: { cnbv: { TRANSMISOR: activity } } }`. */ export declare function wrapScopeData(activity: Record, scopeDataPath: readonly string[]): Record; /** * Splits a flattened scoped transaction update payload into base update fields * (sent at the root) and the nested `scopeData` the API expects. Keys with * `undefined` values are dropped (PATCH semantics — absent means unchanged). * * When no activity fields are present (a base-only update), only the top-level * scope container is emitted (`{ MX: {} }`) rather than nesting an empty * activity object. The API update service deep-merges `scopeData` * (apps/api/src/services/transactions/update.ts → mergeEntityData → * deepMergeScopeData), so the bare marker keeps the record filterable by * jurisdiction without wiping existing activity data — and avoids sending an * empty activity object the activity union would reject (no discriminator). */ export declare function splitTransactionUpdateFields(input: Record, scopeDataPath: readonly string[]): { base: Record; scopeData: Record; }; /** * Splits a flattened scoped transaction CREATE/UPSERT payload into base fields * (sent at the root) and the nested `scopeData` the API expects (activity * fields wrapped under `scopeDataPath` via {@link wrapScopeData}). * * Unlike the update split, required base fields (`amount`, `currency`, * `timestamp`, `relatedClientIds`) are always present here because the payload * was already validated against the scoped create schema before this runs. * Keys with `undefined` values are dropped (optional base/activity fields that * were not provided). */ export declare function splitTransactionCreateFields(input: Record, scopeDataPath: readonly string[]): { base: Record; scopeData: Record; };