/** Notification event catalogue (pure — shared by Convex functions and the web app). */
export interface NotificationEventDef {
  type: string;
  label: string;
  description: string;
  defaultPriority: "LOW" | "NORMAL" | "HIGH" | "CRITICAL";
  defaultRole: "ADMIN" | "MANAGER" | "RECEPTION" | "CLEANER" | null;
  notifyAssigned: boolean;
}
export const NOTIFICATION_EVENTS = [
  { type: "NEW_RESERVATION", label: "New reservation", description: "A reservation was created.", defaultPriority: "NORMAL", defaultRole: "ADMIN", notifyAssigned: true },
  { type: "RESERVATION_MODIFIED", label: "Reservation modified", description: "Dates, apartment or guests changed.", defaultPriority: "NORMAL", defaultRole: "ADMIN", notifyAssigned: true },
  { type: "RESERVATION_CANCELLED", label: "Reservation cancelled", description: "A reservation was cancelled.", defaultPriority: "HIGH", defaultRole: "ADMIN", notifyAssigned: true },
  { type: "PRICE_CHANGED", label: "Price changed by worker", description: "A worker changed a reservation price or discount.", defaultPriority: "HIGH", defaultRole: "ADMIN", notifyAssigned: false },
  { type: "UPCOMING_CHECKIN", label: "Upcoming check-in", description: "Reminder before a guest arrives.", defaultPriority: "NORMAL", defaultRole: "RECEPTION", notifyAssigned: true },
  { type: "UPCOMING_CHECKOUT", label: "Upcoming check-out", description: "Reminder before a guest leaves.", defaultPriority: "NORMAL", defaultRole: "RECEPTION", notifyAssigned: true },
  { type: "PAYMENT_DUE", label: "Payment due", description: "Reservation has an outstanding balance at check-in.", defaultPriority: "HIGH", defaultRole: "ADMIN", notifyAssigned: true },
  { type: "PAYMENT_RECORDED", label: "Payment recorded", description: "A payment was recorded.", defaultPriority: "LOW", defaultRole: "ADMIN", notifyAssigned: false },
  { type: "CONTRACT_MISSING", label: "Contract missing", description: "Check-in attempted without a generated contract.", defaultPriority: "HIGH", defaultRole: "ADMIN", notifyAssigned: true },
  { type: "CUSTOMER_ID_MISSING", label: "Customer ID missing", description: "Check-in attempted without ID documents.", defaultPriority: "HIGH", defaultRole: "ADMIN", notifyAssigned: true },
  { type: "APARTMENT_NEEDS_CLEANING", label: "Apartment requires cleaning", description: "A check-out was completed.", defaultPriority: "HIGH", defaultRole: "CLEANER", notifyAssigned: true },
  { type: "CLEANING_COMPLETED", label: "Cleaning completed", description: "Apartment is ready for the next guest.", defaultPriority: "LOW", defaultRole: "RECEPTION", notifyAssigned: false },
  { type: "MAINTENANCE_ALERT", label: "Maintenance alert", description: "A maintenance issue was reported or escalated.", defaultPriority: "HIGH", defaultRole: "ADMIN", notifyAssigned: true },
  { type: "NEW_EXPENSE", label: "New expense", description: "An expense was added.", defaultPriority: "LOW", defaultRole: "ADMIN", notifyAssigned: false },
  { type: "TASK_ASSIGNED", label: "Task assigned", description: "A task was assigned to a worker.", defaultPriority: "NORMAL", defaultRole: null, notifyAssigned: true },
  { type: "WORKER_ACTIVITY", label: "Worker activity alert", description: "Sensitive action performed by a worker.", defaultPriority: "NORMAL", defaultRole: "ADMIN", notifyAssigned: false },
  { type: "COMMISSION_CREATED", label: "Commission created", description: "A commission was generated for a worker.", defaultPriority: "LOW", defaultRole: null, notifyAssigned: true },
  { type: "COMMISSION_APPROVED", label: "Commission approved", description: "A commission was approved.", defaultPriority: "NORMAL", defaultRole: null, notifyAssigned: true },
  { type: "COMMISSION_PAID", label: "Commission paid", description: "A commission was paid out.", defaultPriority: "NORMAL", defaultRole: null, notifyAssigned: true },
  { type: "SECURITY_ALERT", label: "Security / login alert", description: "Failed logins, new device, permission changes.", defaultPriority: "CRITICAL", defaultRole: "ADMIN", notifyAssigned: true },
  { type: "LEAD_RECEIVED", label: "Website enquiry", description: "A visitor left their number on the website (booking request, waitlist or call-back).", defaultPriority: "HIGH", defaultRole: "ADMIN", notifyAssigned: true },
  { type: "BLOCKED_GUEST_ATTEMPT", label: "Blocked guest booking attempt", description: "A worker tried to book a blocked or restricted guest (or a profile sharing their phone / ID).", defaultPriority: "CRITICAL", defaultRole: "ADMIN", notifyAssigned: false },
  { type: "RISK_APPROVAL_REQUESTED", label: "Approval requested for a restricted guest", description: "A worker asked a manager to approve a reservation for a restricted guest.", defaultPriority: "HIGH", defaultRole: "ADMIN", notifyAssigned: false },
  { type: "CUSTOMER_INCIDENT", label: "Customer incident recorded", description: "Damage, unpaid balance, disturbance or another incident was recorded.", defaultPriority: "HIGH", defaultRole: "ADMIN", notifyAssigned: false },
] as const;
