import { z } from 'zod';

import { baseListQuerySchema } from '@/lib/api/list-query';

/**
 * List query for the inquiries workbench (over `website_submissions`).
 * `state` defaults to 'inbox' (open + assigned) so resolved/dismissed roll off
 * the active queue; pass 'all' for the full history.
 */
export const listInquiriesSchema = baseListQuerySchema.extend({
  kind: z.enum(['berth_inquiry', 'residence_inquiry', 'contact_form']).optional(),
  state: z.enum(['inbox', 'open', 'assigned', 'converted', 'dismissed', 'all']).default('inbox'),
});

export const triageInquirySchema = z.object({
  state: z.enum(['open', 'assigned', 'converted', 'dismissed']),
});

export const convertInquirySchema = z.object({
  target: z.enum(['client', 'interest']),
});

export type ListInquiriesInput = z.infer<typeof listInquiriesSchema>;
export type TriageInquiryInput = z.infer<typeof triageInquirySchema>;
export type ConvertInquiryInput = z.infer<typeof convertInquirySchema>;
