/** * Hostex Automation Actions API types */ import { ChannelType } from './common.js'; /** Kind of scheduled automation action */ export type AutomationActionType = 'message' | 'review'; /** * A scheduled automation action */ export interface AutomationAction { /** Automation plan id */ id: number; /** Action kind */ type: AutomationActionType; /** Human-readable title */ name: string; /** Recipient hint from the plan detail */ send_to: string; /** Linked stay code, or null if not tied to a stay */ stay_code: string | null; /** Hostex property id for this plan */ property_id: number; /** Property display title */ property_title: string; /** When the action is scheduled to run (operator's local timezone) */ scheduled_at: string; /** The channel type of the linked thread */ channel_type: ChannelType | null; } /** * Automation actions query parameters */ export interface AutomationActionsQueryParams { /** Kind of scheduled action (required) */ type: AutomationActionType; /** Optional text matched against the plan detail payload */ keyword?: string; /** The code of the stay */ stay_code?: string; /** Comma-separated property ids (e.g. "1,2,3") */ property_ids?: string; /** Include only actions scheduled at or after this time (inclusive) */ start_time?: string; /** Include only actions scheduled at or before this time (inclusive) */ end_time?: string; /** Comma-separated channel names (e.g. "airbnb,agoda") */ channel_types?: string; /** Zero-based index of the first row (default 0) */ offset?: number; /** Maximum rows to return, 1-100 (default 20) */ limit?: number; } /** * Automation actions response data */ export interface AutomationActionsData { /** Scheduled actions, ordered by scheduled_at */ actions: AutomationAction[]; /** Total number of matching actions */ total: number; }