import { INotificationType } from "./notifications";
import { IAccountRole } from "./lib/roles";

export interface IAccount {
  id: number;
  username: string;
  created_at: string;
  role: IAccountRole;
}

/**
 * TODO: [mapped type](https://www.typescriptlang.org/docs/handbook/2/mapped-types.html)
 */
export interface INotification {
  id: number;
  account_id: number;

  type: INotificationType;
  created_at: string;
  extra_info: { old_role: IAccountRole; new_role: IAccountRole };
  isSeen: boolean;
}

export interface IFavouriteArtist {
  id: string;
  name: string;
  service: string;
  indexed: string;
  updated: string;
  public_id: string | null;
  relation_id: number | null;
  /**
   * An integer.
   */
  faved_seq: number;
  last_imported: string;
}

export interface IAutoImportKey {
  id: number
  service: string
  added: string
  dead: boolean
  contributor_id?: number
  encrypted_key?: string
  discord_channel_ids?: string
}

export interface IProfileLinkRequest {
  id: string
  requester: {
    username: string
    role: IAccountRole
  }
  from_creator: {
    service: string
    id: string
    name: string
  }
  to_creator: {
    service: string
    id: string
    name: string
  }

  reason?: string
}

export interface IFavouritePost {
  service: string
  user: string
  id: string
  faved_seq: number
  published: string
}
