// ============================================================================
// Notification request / response types
// Generated from:
//   honeyDueAPI-go/internal/services/notification_service.go
//   honeyDueAPI-go/internal/models/notification.go (NotificationType enum)
// ============================================================================

// ---------------------------------------------------------------------------
// Enums
// ---------------------------------------------------------------------------

/** Matches models.NotificationType string enum in Go. */
export type NotificationType =
  | "task_due_soon"
  | "task_overdue"
  | "task_completed"
  | "task_assigned"
  | "residence_shared"
  | "warranty_expiring";

// ---------------------------------------------------------------------------
// Requests
// ---------------------------------------------------------------------------

export interface UpdatePreferencesRequest {
  task_due_soon?: boolean | null;
  task_overdue?: boolean | null;
  task_completed?: boolean | null;
  task_assigned?: boolean | null;
  residence_shared?: boolean | null;
  warranty_expiring?: boolean | null;
  daily_digest?: boolean | null;
  email_task_completed?: boolean | null;
  task_due_soon_hour?: number | null;
  task_overdue_hour?: number | null;
  warranty_expiring_hour?: number | null;
  daily_digest_hour?: number | null;
}

export interface RegisterDeviceRequest {
  name?: string;
  device_id: string;
  registration_id: string;
  platform: "ios" | "android";
}

export interface UnregisterDeviceRequest {
  registration_id: string;
  platform?: string;
}

// ---------------------------------------------------------------------------
// Responses
// ---------------------------------------------------------------------------

export interface NotificationResponse {
  id: number;
  user_id: number;
  notification_type: NotificationType;
  title: string;
  body: string;
  data: Record<string, unknown>;
  read: boolean;
  read_at: string | null;
  sent: boolean;
  sent_at: string | null;
  created_at: string;
}

export interface NotificationPreferencesResponse {
  task_due_soon: boolean;
  task_overdue: boolean;
  task_completed: boolean;
  task_assigned: boolean;
  residence_shared: boolean;
  warranty_expiring: boolean;
  daily_digest: boolean;
  email_task_completed: boolean;
  task_due_soon_hour: number | null;
  task_overdue_hour: number | null;
  warranty_expiring_hour: number | null;
  daily_digest_hour: number | null;
}

export interface DeviceResponse {
  id: number;
  name: string;
  device_id: string;
  registration_id: string;
  platform: string;
  active: boolean;
  date_created: string;
}

/** Response shape from GET /api/notifications/unread-count/ */
export interface UnreadCountResponse {
  unread_count: number;
}

/** Response shape from GET /api/notifications/ */
export interface NotificationListResponse {
  count: number;
  results: NotificationResponse[];
}
