/**
 * @copyright NHCarrigan
 * @license Naomi's Public License
 * @author Naomi Carrigan
 */

import type { Link } from "./common.types";

enum MangaStatus {
  reading = "READING",
  completed = "COMPLETED",
  wantToRead = "WANT_TO_READ",
  retired = "RETIRED",
}

interface Manga {
  id:             string;
  title:          string;
  author:         string;
  status:         MangaStatus;
  dateAdded:      Date;
  dateStarted?:   Date;
  dateCompleted?: Date;
  dateFinished?:  Date;
  rating?:        number;
  notes?:         string;
  coverImage?:    string;
  tags:           Array<string>;
  links:          Array<Link>;
  timeSpent?:     number;
  createdAt:      Date;
  updatedAt:      Date;
}

interface CreateMangaDto {
  title:         string;
  author:        string;
  status:        MangaStatus;
  dateStarted?:  Date;
  dateFinished?: Date;
  rating?:       number;
  notes?:        string;
  coverImage?:   string;
  tags?:         Array<string>;
  links?:        Array<Link>;
  timeSpent?:    number;
}

interface UpdateMangaDto extends Partial<CreateMangaDto> {
  dateStarted?:   Date;
  dateCompleted?: Date;
  dateFinished?:  Date;
}

export { MangaStatus };
export type { CreateMangaDto, Manga, UpdateMangaDto };
