import { InvoicingCouponFormLocalData, InvoicingFormOption } from '@zeniai/client-epic-state'; /** * Web-components glue for the coupon form. CES owns the draft `LocalData` and the * select-option value sets; this module maps those to the form's UI value shapes * and back. Shared so the form value model stays in one place. */ export interface PickerValue { allOptions: { label: string; value: string; }[]; selectedOption?: string; } /** * Form-values shape reuses the CES localData field names verbatim — only the * fields whose *shape* differs on the form (pickers, dates) are overridden. * Every plain field (name, couponCode, couponId, …) flows through by identity, * so adding a field to the CES type needs no mapper change. */ export type CouponFormValues = Omit & { applyOn: PickerValue; /** Held as a float by `returnValueType: "floatValue"`; `null` when cleared. */ discountAmount: number | null; discountType: PickerValue; durationType: PickerValue; periodUnit: PickerValue; validFrom: Date | undefined; validTill: Date | undefined; }; export interface CouponFormOptions { applyOnOptions: InvoicingFormOption[]; discountTypeOptions: InvoicingFormOption[]; durationTypeOptions: InvoicingFormOption[]; periodUnitOptions: InvoicingFormOption[]; } export declare const localDataToCouponFormValues: (localData: InvoicingCouponFormLocalData, options: CouponFormOptions) => CouponFormValues; export declare const couponFormValuesToLocalData: (values: CouponFormValues) => InvoicingCouponFormLocalData;