// Property File types for the frontend

export interface PropertyFileBase {
  id: string;
  name: string;
  category: string;
  description?: string;
  fileUrl: string;
  fileType: string;
  size: string;
  status: string;
}

export interface PropertyFile extends PropertyFileBase {
  propertyId: string;
  createdBy?: {
    id: string;
    firstName?: string;
    lastName?: string;
  };
  updatedBy?: {
    id: string;
    firstName?: string;
    lastName?: string;
  };
  createdAt?: string | Date;
  updatedAt?: string | Date;
}

export interface CreatePropertyFileRequest {
  name: string;
  category: string;
  description?: string;
  fileUrl: string;
  fileType: string;
  size: string;
  status?: string;
  // Some backends require propertyId in the body as well as the URL
  propertyId?: string;
}

export type UpdatePropertyFileRequest = Partial<CreatePropertyFileRequest>;

export interface PropertyFileFilterParams {
  page?: number;
  limit?: number;
  search?: string;
  sortBy?: string;
  populate?: string;
  includeTimeStamps?: boolean;
  propertyId?: string;
  category?: string;
  size?: string;
  createdBy?: string;
  status?: string;
}

export interface PropertyFileListResponse {
  results: PropertyFile[];
  page: number;
  limit: number;
  totalPages: number;
  totalResults: number;
}

export interface GetPropertyFileListResponse {
  code: number;
  message: string;
  success: boolean;
  data: PropertyFileListResponse;
  error?: object;
}

export interface GetPropertyFileByIdResponse {
  code: number;
  message: string;
  success: boolean;
  data: PropertyFile;
  error?: object;
}

