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

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

enum MusicType {
  album = "ALBUM",
  single = "SINGLE",
  ep = "EP",
}

enum MusicStatus {
  listening = "LISTENING",
  completed = "COMPLETED",
  wantToListen = "WANT_TO_LISTEN",
  retired = "RETIRED",
}

interface Music {
  id:             string;
  title:          string;
  artist:         string;
  type:           MusicType;
  status:         MusicStatus;
  dateAdded:      Date;
  dateStarted?:   Date;
  dateCompleted?: Date;
  dateFinished?:  Date;
  rating?:        number;
  notes?:         string;
  coverArt?:      string;
  tags:           Array<string>;
  links:          Array<Link>;
  timeSpent?:     number;
  createdAt:      Date;
  updatedAt:      Date;
}

interface CreateMusicDto {
  title:         string;
  artist:        string;
  type:          MusicType;
  status:        MusicStatus;
  dateStarted?:  Date;
  dateFinished?: Date;
  rating?:       number;
  notes?:        string;
  coverArt?:     string;
  tags?:         Array<string>;
  links?:        Array<Link>;
  timeSpent?:    number;
}

interface UpdateMusicDto extends Partial<CreateMusicDto> {
  dateStarted?:   Date;
  dateCompleted?: Date;
  dateFinished?:  Date;
}

export { MusicStatus, MusicType };
export type { CreateMusicDto, Music, UpdateMusicDto };
