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

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

enum GameStatus {
  playing = "PLAYING",
  completed = "COMPLETED",
  backlog = "BACKLOG",
  retired = "RETIRED",
}

interface Game {
  id:             string;
  title:          string;
  platform?:      string;
  status:         GameStatus;
  dateAdded:      Date;
  dateStarted?:   Date;
  dateCompleted?: Date;
  dateFinished?:  Date;
  rating?:        number;
  notes?:         string;
  coverImage?:    string;
  tags:           Array<string>;
  links:          Array<Link>;
  series?:        string;
  seriesOrder?:   number;
  timeSpent?:     number;
  createdAt:      Date;
  updatedAt:      Date;
}

interface CreateGameDto {
  title:         string;
  platform?:     string;
  status:        GameStatus;
  dateStarted?:  Date;
  dateFinished?: Date;
  rating?:       number;
  notes?:        string;
  coverImage?:   string;
  tags?:         Array<string>;
  links?:        Array<Link>;
  series?:       string;
  seriesOrder?:  number;
  timeSpent?:    number;
}

interface UpdateGameDto extends Partial<CreateGameDto> {
  dateStarted?:   Date;
  dateCompleted?: Date;
  dateFinished?:  Date;
}

export { type CreateGameDto, type Game, GameStatus, type UpdateGameDto };
