// The maintenance state machine. Statuses/labels could be data, but which moves
// are LEGAL is an engine primitive — kept in code and shared by the service
// (which enforces it) and the router (which surfaces the allowed next states).
export const REQUEST_STATUSES = [
  'OPEN',
  'ACKNOWLEDGED',
  'IN_PROGRESS',
  'ON_HOLD',
  'COMPLETED',
  'CLOSED',
  'CANCELLED',
] as const;

export const REQUEST_TRANSITIONS: Record<string, string[]> = {
  OPEN: ['ACKNOWLEDGED', 'CANCELLED'],
  ACKNOWLEDGED: ['IN_PROGRESS', 'CANCELLED'],
  IN_PROGRESS: ['ON_HOLD', 'COMPLETED', 'CANCELLED'],
  ON_HOLD: ['IN_PROGRESS', 'CANCELLED'],
  COMPLETED: ['CLOSED', 'IN_PROGRESS'],
  CLOSED: [],
  CANCELLED: [],
};

export const RESPONSIBILITIES = ['LANDLORD', 'TENANT', 'SPLIT'];
export const TASK_STATUSES = ['PENDING', 'IN_PROGRESS', 'DONE', 'CANCELLED'];
