/** * Hostex Tasks API types */ /** Task category */ export type TaskType = 'cleaning' | 'maintenance' | 'reception' | 'room_service' | 'other'; /** Task status */ export type TaskStatus = 'pending' | 'in_progress' | 'completed' | 'cancelled'; /** Cleaning level (only meaningful for cleaning tasks) */ export type TaskLevel = 'standard' | 'simple' | 'advanced'; /** * A property operations task * (Named HostexTask to avoid clashing with Task-style names in consumer codebases) */ export interface HostexTask { /** Unique identifier for the task */ id: number; /** Task type */ type: TaskType; /** Task status */ status: TaskStatus; /** Property id, null if unbound */ property_id?: number | null; /** Title of the property */ property_title?: string | null; /** Linked stay code, null when not linked to a reservation */ stay_code?: string | null; /** Assigned staff id, null if unassigned */ staff_id?: number | null; /** Assigned staff name */ staff_name?: string | null; /** Expected execution date (YYYY-MM-DD) */ expected_date?: string; /** Expected execution time (HH:mm:ss); may be null */ expected_time?: string | null; /** Expected execution datetime (YYYY-MM-DD HH:mm:ss) */ expected?: string; /** Cleaning level */ level?: TaskLevel | null; /** Currency code for the fee */ currency?: string | null; /** Task fee */ fee?: number; /** Note attached to the task */ note?: string; /** Creation time (YYYY-MM-DD HH:mm:ss) */ create_time?: string | null; /** Last update time (YYYY-MM-DD HH:mm:ss) */ update_time?: string | null; } /** * Tasks query parameters */ export interface TasksQueryParams { /** Internal id of a specific task */ id?: number; /** The starting point from which to begin returning results */ offset?: number; /** The maximum number of results to return, max 100 */ limit?: number; /** Start of the expected date range (YYYY-MM-DD) */ start_date?: string; /** End of the expected date range (YYYY-MM-DD) */ end_date?: string; /** Filter tasks assigned to the given staff id */ staff_id?: number; /** Filter tasks under the given property id */ property_id?: number; /** Filter tasks by type */ type?: TaskType; /** Filter tasks by status */ status?: TaskStatus; } /** * Tasks response data */ export interface TasksData { tasks: HostexTask[]; /** Total number of tasks */ total: number; } /** * Create task parameters */ export interface CreateTaskParams { /** Task category */ type: TaskType; /** Stay code to link the task to a reservation */ stay_code?: string; /** Property id; omit to record an unassigned task */ property_id?: number; /** Staff id to assign; omit to leave unassigned */ staff_id?: number; /** Expected execution date (YYYY-MM-DD, operator timezone) */ expected_date: string; /** Expected execution time (HH:mm:ss, operator timezone) */ expected_time?: string; /** Cleaning level (only meaningful when type=cleaning) */ level?: TaskLevel; /** Currency code for fee */ currency: string; /** Task fee (defaults to 0) */ fee?: number; /** Free-form note (max 500 characters) */ note?: string; } /** * Create task response data */ export interface CreateTaskData { /** Unique identifier of the newly created task */ task_id: number; } /** * Update task parameters */ export interface UpdateTaskParams { /** The id of the task to update */ id: number; type?: TaskType; /** Pass 0 to detach the task from any property */ property_id?: number; /** Pass 0 to unassign the task */ staff_id?: number; /** Expected execution date (YYYY-MM-DD, operator timezone) */ expected_date?: string; /** Expected execution time (HH:mm:ss, operator timezone) */ expected_time?: string; level?: TaskLevel; status?: TaskStatus; currency?: string; fee?: number; note?: string; }