import {Attachment} from '@interfaces/attachments';
import {User} from '@interfaces/user';

export enum SignatureStatus {
  PENDING = 'PENDING',
  SIGNATURE_NOT_NEEDED = 'SIGNATURE_NOT_NEEDED',
  SIGNED = 'SIGNED',
  SIGNED_IN_AGREEMENT = 'SIGNED_IN_AGREEMENT',
  SIGNED_IN_DISAGREEMENT = 'SIGNED_IN_DISAGREEMENT',
}

export enum FileHierarchies {
  File = 'FILE',
  Folder = 'FOLDER',
}

export interface File {
  // File
  createdAt: string;
  depth: number;
  extension: Nullable<string>;
  id: number;
  name: string;
  parentId: Nullable<number>;
  parentName: Nullable<string>;
  position: number;
  public: boolean;
  shared: boolean;
  size: Nullable<string>;
  source: string;
  type: string;
  updatedAt: Nullable<string>;
  uploader: User;
  // Document File
  allowDisagreement: boolean;
  canBeSigned: boolean;
  folderId: number;
  owner: User;
  ownerId: number;
  signatureDate: Nullable<string>;
  signatureStatus: SignatureStatus;
  signatureUrl: Nullable<string>;
  // TODO: Fix this bad type!
  url?: string;
}

export type FileAndAttachment = File & Attachment;
