@bolttech/server-side-next
Version:
This library was generated with [Nx](https://nx.dev).
35 lines (34 loc) • 1.63 kB
TypeScript
import { IPaymentMethod } from '../../common/interface/payment.interface';
import { DefaultParams } from '../../common/interface/request.interface';
export interface VoucherServiceInterface {
validateVoucher<PAYMENT_METHODS>({ query, headers, voucher, paymentMethod, }: ValidateVoucherParams<PAYMENT_METHODS>): Promise<Record<string, unknown>>;
resetVoucher<PAYMENT_METHODS>({ query, headers, host, paymentMethod, }: ResetVoucherParams<PAYMENT_METHODS>): Promise<Record<string, unknown>>;
voucherPageLoad<T>({ query, headers, data, }: VoucherPageLoadParams<T & Record<string, unknown>>): Promise<T>;
}
export declare type TVoucherMapper<PAYMENT_METHODS extends string> = {
[key in PAYMENT_METHODS]?: IApplyVoucherPayload<PAYMENT_METHODS>;
};
export interface IApplyVoucherPayload<PAYMENT_METHODS> {
paymentMethod: PAYMENT_METHODS;
voucherCode: string;
bankPrefixCode?: string;
}
export interface ApplyVoucherParams<PAYMENT_METHODS> extends DefaultParams {
body: IApplyVoucherPayload<PAYMENT_METHODS>;
}
export interface ValidateVoucherParams<PAYMENT_METHODS> extends DefaultParams {
voucher: Record<string, unknown>;
paymentMethod: PAYMENT_METHODS;
}
export interface ResetVoucherParams<PAYMENT_METHODS> extends DefaultParams {
paymentMethod: PAYMENT_METHODS;
}
export interface VoucherPageLoadParams<ICheckoutState> extends DefaultParams {
data?: ICheckoutState;
}
export declare type IPropertiesToAdd<T, PAYMENT_METHODS> = T & {
paymentOptions: IPaymentMethod<PAYMENT_METHODS>[];
order: {
voucher: Record<string, unknown>;
};
};