import type { IResponse } from "@/types/response.types";

export type NotificationUser = {
  id: string;
  createdAt: string;
  updatedAt: string;
  deletedAt: string | null;
  firstName: string;
  lastName: string;
  birthDate: string;
  marriageDate: string;
  referrer: string | null;
  isActive: boolean;
  gender: boolean;
  avatarUrl: string | null;
  phone: string;
};

export type NotificationItemType = {
  id: string;
  createdAt: string;
  updatedAt: string;
  deletedAt: string | null;
  restaurant: string;
  user: NotificationUser;
  admin: string | null;
  title: string;
  content: string;
  seenAt: string | null;
};

export type NotificationPager = {
  page: number;
  totalPages: number;
};

export type NotificationData = {
  notifications: NotificationItemType[];
  pager: NotificationPager;
};

export type GetNotificationsResponse = IResponse<NotificationItemType[]> & {
  nextCursor?: string;
};

export type UnseenCountData = {
  count: number;
};

export type GetUnseenCountResponse = IResponse<UnseenCountData>;

export enum NotificationTypeEnum {
  USER_LOGIN = "USER_LOGIN",
  ANNOUNCEMENT = "ANNOUNCEMENT",

  // Finance category
  WALLET_CHARGE = "WALLET_CHARGE",
  WALLET_DEDUCTION = "WALLET_DEDUCTION",

  //Invoice
  BILL_INVOICE_REMINDER = "BILL_INVOICE_REMINDER",
  BILL_INVOICE = "BILL_INVOICE",
  CREATE_INVOICE = "CREATE_INVOICE",

  // Service category
  CREATE_SERVICE = "CREATE_SERVICE",
  UNBLOCK_SERVICE = "UNBLOCK_SERVICE",
  BLOCK_SERVICE = "BLOCK_SERVICE",

  // Support category
  ANSWER_TICKET = "ANSWER_TICKET",
  CREATE_TICKET = "CREATE_TICKET",
}
