import { Document, Types } from 'mongoose';
import { IPaginateModel } from '@/shared/interfaces/model.interface';
import { AuditFields } from '@/shared/types/common';
import { Status } from '@/shared/constants/enum.constant';

// Base Interface
export interface IFileBase {
  name: string;
  category: string;
  description?: string;
  fileUrl: string;
  fileType: string;
  size: string;
  project: Types.ObjectId;
  status: Status;
}

// Main Interface with audit fields
export interface IFile extends IFileBase, AuditFields {}

// Mongoose Document Interface
export interface IFileDoc extends IFile, Document {}

// Mongoose Model Interface
export interface IFileModel extends IPaginateModel<IFileDoc> {}

export type NewCreatedFile = IFileBase &
  Partial<Pick<AuditFields, 'createdBy' | 'updatedBy'>>;

export type UpdateFileBody = Partial<IFile>;

export interface IFileFilter {
  project?: Types.ObjectId | string;
  category?: string;
  search?: string;
  size?: string;
  createdBy?: Types.ObjectId | string;
  status?: Status;
}