import { RpcMethod } from './commonTypes'; export type VouchersService_GetPools = RpcMethod; export type VouchersService_CreatePool = RpcMethod; export type VouchersService_AddVouchers = RpcMethod; export type VouchersService_ExportVouchers = RpcMethod; export type VouchersService_GetPoolStats = RpcMethod; export type VouchersService_DeleteVouchers = RpcMethod; export type VouchersService_DeletePool = RpcMethod; export interface VouchersService { /** Lists voucher pools for an application (code XXXXX-XXXXX) with paging and an optional name search, returning each pool's total and free voucher counts. Use to browse pools or find a pool name before fetching stats, exporting, or adding vouchers. */ GetPools: VouchersService_GetPools; /** Creates a new voucher pool in an application (code XXXXX-XXXXX) with an optional expiry date and optional initial voucher codes. Use to set up a pool; use create_vouchers to add codes to an existing pool. */ CreatePool: VouchersService_CreatePool; /** Adds voucher codes to an existing pool in an application (code XXXXX-XXXXX), up to 10000 codes per request. Use to top up a pool created earlier; create_voucher_pool creates the pool itself. */ AddVouchers: VouchersService_AddVouchers; /** Generates a ZIP containing a CSV of every voucher in a pool (code, status, user id, used-at timestamp) and returns its download URL. Use to download the full contents of a pool for an application (code XXXXX-XXXXX). */ ExportVouchers: VouchersService_ExportVouchers; /** Returns total and free (unused) voucher counts for a single pool in an application (code XXXXX-XXXXX). Use for a quick availability check on one pool without listing all pools. */ GetPoolStats: VouchersService_GetPoolStats; /** Deletes specific voucher codes from a pool in an application (code XXXXX-XXXXX), up to 10000 codes per request. Removes only the listed codes; use delete_voucher_pool to remove the whole pool. */ DeleteVouchers: VouchersService_DeleteVouchers; /** Deletes an entire voucher pool and all of its vouchers from an application (code XXXXX-XXXXX). Irreversible; use delete_vouchers to remove only selected codes. */ DeletePool: VouchersService_DeletePool; } export type CreatePoolRequest = { /** Application code (XXXXX-XXXXX) the pool belongs to. */ application?: string; /** Name for the new voucher pool. */ name?: string; /** Optional expiry date after which the pool's vouchers are no longer valid; must be in the future. */ expiry?: Date; /** Optional initial voucher codes to seed the pool with. */ vouchers?: string[]; }; export type CreatePoolResponse = {}; export type AddVouchersRequest = { /** Application code (XXXXX-XXXXX) the pool belongs to. */ application?: string; /** Name of the voucher pool to add codes to. */ pool?: string; /** Voucher codes to add to the pool. */ vouchers?: string[]; }; export type AddVouchersResponse = {}; export type GetPoolsRequest = { /** Application code (XXXXX-XXXXX) whose pools to list. */ application?: string; /** Number of pools per page. */ perPage?: number; /** Zero-based page number. */ page?: number; /** Optional free-text filter matching pool names. */ searchByName?: string; }; export type GetPoolsResponse = { pools: Pool[]; total: number; }; export type Pool = { name: string; expiry: Date; createdAt: Date; totalVouchers: number; freeVouchers: number; }; export type ExportVouchersRequest = { /** Application code (XXXXX-XXXXX) the pool belongs to. */ application?: string; /** Name of the voucher pool to export. */ pool?: string; }; export type ExportVouchersResponse = { url: string; filename: string; }; export type GetPoolStatsRequest = { /** Application code (XXXXX-XXXXX) the pool belongs to. */ application?: string; /** Name of the voucher pool to get stats for. */ pool?: string; }; export type GetPoolStatsResponse = { totalVouchers: number; freeVouchers: number; }; export type DeleteVouchersRequest = { /** Application code (XXXXX-XXXXX) the pool belongs to. */ application?: string; /** Name of the voucher pool to delete codes from. */ pool?: string; /** Voucher codes to delete from the pool. */ vouchers?: string[]; }; export type DeleteVouchersResponse = {}; export type DeletePoolRequest = { /** Application code (XXXXX-XXXXX) the pool belongs to. */ application?: string; /** Name of the voucher pool to delete. */ pool?: string; }; export type DeletePoolResponse = {};