import type { ZodSchema } from "zod"; import { BaseService, type CommonErrors } from "../../api/base-service"; /** Common list arguments for ticketable services */ export interface TicketableListArgs { page?: number; perPage?: number; state?: string; paymentState?: string; orderBy?: "starts_at" | "ends_at" | "reference" | "created_at"; orderDirection?: "asc" | "desc"; serviceId?: number; } /** Result type for list operations */ export type TicketableListResult = CommonErrors | ["missing_id_token", null] | ["server_error", null] | ["invalid_response", null] | [null, T]; /** Result type for get operations */ export type TicketableGetResult = CommonErrors | ["missing_id_token", null] | ["server_error", null] | ["not_found", null] | ["invalid_response", null] | [null, T]; /** * Base service for ticketable resources (tickets and subscriptions). * Handles common query parameter building and response parsing. */ export declare abstract class TicketableService extends BaseService { /** * Builds query params from args, mapping camelCase to snake_case. * Returns undefined values filtered out. */ protected buildListParams(args: TicketableListArgs, categoryIdKey: string, categoryIdValue?: string): Record; /** * Converts params to query string, filtering undefined/null and converting to strings. */ protected toQueryString(params: Record): string; /** * Validates list arguments before making API request. * Uses Zod for input validation. */ protected validateListArgs(args: TicketableListArgs): boolean; /** * Generic list handler with schema validation. */ protected handleList(endpoint: string, queryString: string, schema: ZodSchema, resourceName: string, args?: TicketableListArgs): Promise>; /** * Generic get handler with schema validation. */ protected handleGet(endpoint: string, schema: ZodSchema, resourceName: string): Promise>; }