52 lines
1.3 KiB
TypeScript
52 lines
1.3 KiB
TypeScript
import { IsNotEmpty, IsDate, IsOptional } from "class-validator";
|
|
import { Customer } from "./Customer";
|
|
import { DocumentHistory } from "./DocumentHistory";
|
|
import { DocumentType } from "./DocumentType";
|
|
import { File } from "./File";
|
|
import { OfficeFolder } from "./OfficeFolder";
|
|
|
|
export namespace Document {
|
|
export class IDocument {
|
|
@IsNotEmpty()
|
|
public uuid!: string;
|
|
|
|
@IsNotEmpty({ groups: ["create"] })
|
|
public document_status!: EDocumentStatus;
|
|
|
|
@IsNotEmpty({ groups: ["create"] })
|
|
public document_type!: DocumentType.IDocumentType;
|
|
|
|
@IsNotEmpty({ groups: ["create"] })
|
|
public folder!: OfficeFolder.IOfficeFolder;
|
|
|
|
@IsNotEmpty({ groups: ["create"] })
|
|
public depositor!: Customer.ICustomer;
|
|
|
|
@IsDate()
|
|
public created_at: Date | null = null;
|
|
|
|
@IsDate()
|
|
public updated_at: Date | null = null;
|
|
|
|
@IsOptional()
|
|
public files?: File.IFile[];
|
|
|
|
@IsOptional()
|
|
public document_history?: DocumentHistory.IDocumentHistory[];
|
|
}
|
|
export enum EDocumentStatus {
|
|
ASKED = "ASKED",
|
|
DEPOSITED ="DEPOSITED",
|
|
VALIDATED = "VALIDATED",
|
|
ANCHORED = "ANCHORED",
|
|
REFUSED = "REFUSED",
|
|
}
|
|
|
|
export type TDocumentStatus =
|
|
| EDocumentStatus.ASKED
|
|
| EDocumentStatus.DEPOSITED
|
|
| EDocumentStatus.VALIDATED
|
|
| EDocumentStatus.ANCHORED
|
|
| EDocumentStatus.REFUSED;
|
|
}
|