import { Document, Types } from "mongoose";

export type NotificationType =
  | "connection"
  | "fuel"
  | "chat"
  | "trip_share"
  | "payment";

export type NotificationEventType =
  | "request_received"
  | "accepted"
  | "transferred"
  | "message"
  | "shared"
  | "received";

export interface INotification extends Document {
  userId: Types.ObjectId;
  type: NotificationType;
  eventType: NotificationEventType;
  title: string;
  body: string;
  data: Record<string, string>;
  isRead: boolean;
  readAt?: Date | null;
  /** Optional unique key to avoid duplicate pushes (e.g. payment settle resume). Omit when unused. */
  dedupeKey?: string;
  createdAt: Date;
  updatedAt: Date;
}
