import { SearchRequest } from ".";
import { CreateCustomerDTO, CustomerDTO } from "./customer.types";

export type ISODateString = string;

export type ShootingDTO = {
  id: string;
  name: string;
  description: ISODateString;
  customer?: CustomerDTO;
  photos?: PhotoDTO[];
  manifest_url: string;
  guest_manifest_url: string;
  allowDownload: boolean;
  shareMessage?: string;
  masonryMode?: boolean;
  createdAt: string;
  updatedAt: string;
};

export type CreateShootingDTO = {
  name: string;
  description: ISODateString;
  customerId?: string;
  customer?: CreateCustomerDTO;
  allowDownload: boolean;
  masonryMode: boolean;
};

export type UpdateShootingDTO = {
  id: string;
  name?: string;
  description?: ISODateString;
  allowDownload?: boolean;
  shareMessage?: string;
  masonryMode?: boolean;
};

export type SearchShootingDTO = SearchRequest<{
  customerIds?: string[];
  orderBy?: {
    field: "description" | "createdAt" | "updatedAt";
    direction: "asc" | "desc";
  };
}>;

export type SingleFileDto = {
  photo_url: string;
};

export type MultipleFileDto = {
  photo_url: string[];
};

export type PhotoDTO = {
  id: string;
  filename: string;
  originalname: string;
  shootingId: string;
  order: number;
  url: string;
};

export type SearchPhotoDTO = SearchRequest<{
  shootingIds?: string[];
}>;

export type UpdatePhotosOrderDTO = {
  shootingId: string;
  photoOrders: Array<{
    id: string;
    order: number;
  }>;
};

export type ShareShootingDTO = {
  emails: string[];
  name?: string;
  shootingId: string;
  message: string;
};

export type DuplicateShootingDTO = {
  customerId: string;
};
