export interface Card { id: string; mask: string; provider: string; } export interface CardFields { cardHolder: string; cardNumber: string; cardExpireDate: string; cardCvc: string; firstName: string; lastName: string; company: string; streetNumber: string; zipCode: string; city: string; country: string; } export type CustomerCardTypes = { card?: Card; fields: CardFields; }; export type GetCardsHook = { data: T['card'][] | null; input: {}; fetcherInput: { cartId?: string; }; swrState: { isEmpty: boolean; }; }; export type AddItemHook = { data: T['card']; input?: T['fields']; fetcherInput: T['fields']; body: { item: T['fields']; }; actionInput: T['fields']; }; export type UpdateItemHook = { data: T['card'] | null; input: { item?: T['fields']; wait?: number; }; fetcherInput: { itemId: string; item: T['fields']; }; body: { itemId: string; item: T['fields']; }; actionInput: T['fields'] & { id: string; }; }; export type RemoveItemHook = { data: T['card'] | null; input: { item?: T['card']; }; fetcherInput: { itemId: string; }; body: { itemId: string; }; actionInput: { id: string; }; }; export type CustomerCardHooks = { getCards: GetCardsHook; addItem: AddItemHook; updateItem: UpdateItemHook; removeItem: RemoveItemHook; }; export type CardsHandler = GetCardsHook & { body: { cartId?: string; }; }; export type AddItemHandler = AddItemHook & { body: { cartId: string; }; }; export type UpdateItemHandler = UpdateItemHook & { data: T['card']; body: { cartId: string; }; }; export type RemoveItemHandler = RemoveItemHook & { body: { cartId: string; }; }; export type CustomerCardHandlers = { getCards: GetCardsHook; addItem: AddItemHandler; updateItem: UpdateItemHandler; removeItem: RemoveItemHandler; }; export type CustomerCardSchema = { endpoint: { options: {}; handlers: CustomerCardHandlers; }; };