import { Document, Types } from 'mongoose';
import { IPaginateModel } from '@/shared/interfaces/model.interface';
import { AuditFields } from '@/shared/types/common';
import {
  NotificationDevice,
  NotificationStatus,
  UserType,
} from './notification.constant';

export interface INotificationBase {
  title: string;
  description: string;
  image?: string;
  date?: string;
  time?: string;
  userType?: UserType;
  device?: NotificationDevice;
  status?: NotificationStatus;
  scheduleDateTime?: String | Date;
  user?: Types.ObjectId;
  users?: Types.ObjectId[];
}

export interface INotification extends INotificationBase, AuditFields {}

export interface INotificationDoc extends INotification, Document {}

export interface INotificationModel extends IPaginateModel<INotificationDoc> {}

export type NewCreatedNotification = INotificationBase &
  Partial<Pick<AuditFields, 'createdBy' | 'updatedBy'>>;

export type UpdateNotificationBody = Partial<INotification>;

export type NotificationAppRedirect = {
  screenType: string;
  screenId?: string | Types.ObjectId;
  id?: string | Types.ObjectId;
  projectId?: string | Types.ObjectId;
  propertyId?: string | Types.ObjectId;
  unitId?: string | Types.ObjectId;
  unitNumber?: string;
};
