import { CardPolicyCreateFormValues, CardPolicyModeValue } from './cardPolicyCreateFormValues'; /** * Wire-ready request payload for `POST /cards/1.0/policy-templates`. * * Structurally identical to `CreateCardPolicyTemplateRequest` exported * from `@zeniai/client-epic-state`. Defined locally here so the helper * stays buildable against the currently-installed `client-epic-state` * snapshot — keep the two in lock-step. */ export interface BuildCreateCardPolicyTemplateRequestResult { allowedEntity: { categoryCodes: string[]; merchantNames: string[]; }; applyToCards: string[]; blockedEntity: { categoryCodes: string[]; merchantNames: string[]; }; description: string; mode: CardPolicyModeValue; name: string; /** * `null` when the require-receipt toggle is off — BE treats `null` as * "no threshold configured". `0` indicates the user explicitly entered * zero with the toggle on; any positive value is the configured cap. */ requiredReceiptThreshold: number | null; spendLimits: { transaction: number | null; }; } /** * Map the manual create-page form values onto the wire-ready * `CreateCardPolicyTemplateRequest` payload consumed by the * `createCardPolicyTemplate` epic. * * Mapping rules: * - `vendorPolicy` / `categoryPolicy` produce `allowedEntity` / * `blockedEntity` based on the row's `mode`. Vendor chips contribute * `merchantNames`; category chips contribute `categoryCodes` from each * chip's `optionalCode`. Chips without `optionalCode` are dropped on the * category side (no MCC code to send). * - `applyToCards` is the id list of checked rows in `cardSelections`. * - `spendLimits.transaction` and `requiredReceiptThreshold` come from * the toggle rows of the corresponding ids when `isEnabled === true`, * and are sent as `null` ("not configured") when the toggle is off. * `0` is reserved for "user explicitly entered zero with toggle on". */ export declare const buildCreateCardPolicyTemplateRequest: (values: CardPolicyCreateFormValues) => BuildCreateCardPolicyTemplateRequestResult;