import { Entity } from '@/core/domain/Entity';
import { Customer } from './Customer';
import { Photo } from './Photo';

type ShootingProps = {
  name: string;
  description: Date;
  customerId: string;
  customer?: Customer;
  photos?: Photo[];
  createdAt: Date;
  updatedAt: Date;
  deleted?: boolean;
  allowDownload?: boolean;
  shareMessage?: string;
  masonryMode?: boolean;
};

export class Shooting extends Entity<ShootingProps> {
  get name() {
    return this.props.name;
  }

  get description() {
    return this.props.description;
  }

  get customerId() {
    return this.props.customerId;
  }

  get customer() {
    return this.props.customer;
  }

  get photos() {
    return this.props.photos;
  }

  get createdAt() {
    return this.props.createdAt;
  }

  get updatedAt() {
    return this.props.updatedAt;
  }

  get deleted() {
    return this.props.deleted;
  }

  get allowDownload() {
    return this.props.allowDownload;
  }

  get shareMessage() {
    return this.props.shareMessage;
  }

  get masonryMode() {
    return this.props.masonryMode;
  }

  set name(name: string) {
    this.props.name = name;
  }

  set description(description: Date) {
    this.props.description = description;
  }

  set customerId(customerId: string) {
    this.props.customerId = customerId;
  }

  set customer(customer: Customer) {
    this.props.customer = customer;
  }

  set photos(photos: Photo[] | undefined) {
    this.props.photos = photos;
  }

  set createdAt(createdAt: Date) {
    this.props.createdAt = createdAt;
  }

  set updatedAt(updatedAt: Date) {
    this.props.updatedAt = updatedAt;
  }

  set deleted(deleted: boolean) {
    this.props.deleted = deleted;
  }

  set allowDownload(allowDownload: boolean) {
    this.props.allowDownload = allowDownload;
  }

  set shareMessage(shareMessage: string) {
    this.props.shareMessage = shareMessage;
  }

  set masonryMode(masonryMode: boolean) {
    this.props.masonryMode = masonryMode;
  }

  public static create(props: ShootingProps, id?: string) {
    return new Shooting({ ...props, deleted: props.deleted ?? false }, id);
  }

  constructor(props: ShootingProps, id?: string) {
    super(props, id);
  }
}
