diff --git a/dist/index.d.ts b/dist/index.d.ts index 974550e..7301b9c 100644 --- a/dist/index.d.ts +++ b/dist/index.d.ts @@ -72,3 +72,9 @@ export { default as IOfficeFolderHasCustomerCustomer } from "./Interfaces/Custom export { default as IOfficeFolderHasStakeholderCustomer } from "./Interfaces/Customer/IOfficeFolderHasStakeholder"; export { default as IUserCustomer } from "./Interfaces/Customer/IUser"; export { default as ICustomerHasNotificationCustomer } from "./Interfaces/Customer/IUserHasNotification"; +export declare type ECivility = "MALE" | "FEMALE" | "OTHERS"; +export declare type EFolderStatus = "LIVE" | "ARCHIVED"; +export declare type EOfficeStatus = "ACTIVATED" | "DESACTIVATED"; +export declare type ENotificationStatus = "READ" | "UNREAD"; +export declare type ECustomerStatus = "VALIDATED" | "PENDING" | "ERRONED"; +export declare type EDocumentStatus = "ASKED" | "DEPOSITED" | "VALIDATED" | "ANCHORED" | "REFUSED"; diff --git a/src/Enums/Enums.ts b/src/Enums/Enums.ts deleted file mode 100644 index 37ee722..0000000 --- a/src/Enums/Enums.ts +++ /dev/null @@ -1,16 +0,0 @@ -export type ECivility = "MALE" | "FEMALE" | "OTHERS" - - -export type EFolderStatus = "LIVE" | "ARCHIVED" - - -export type EOfficeStatus = "ACTIVATED" | "DESACTIVATED" - - -export type ENotificationStatus = "READ" | "UNREAD" - - -export type ECustomerStatus = "VALIDATED" | "PENDING" | "ERRONED" - - -export type EDocumentStatus = "ASKED" | "DEPOSITED" | "VALIDATED" | "ANCHORED" | "REFUSED" diff --git a/src/Interfaces/Admin/Address.ts b/src/Interfaces/Admin/Address.ts new file mode 100644 index 0000000..4120634 --- /dev/null +++ b/src/Interfaces/Admin/Address.ts @@ -0,0 +1,31 @@ +import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; +import { Contact } from "./Contact"; +import { Office } from "./Office"; + +export namespace Address { + export class IAddress { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public address!: string; + + @IsNotEmpty({ groups: ["create"] }) + public city!: string; + + @IsNotEmpty({ groups: ["create"] }) + public zip_code!: number; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + + @IsOptional() + public office?: Office.IOffice; + + @IsOptional() + public contacts?: Contact.IContact; + } +} diff --git a/src/Interfaces/Admin/Contact.ts b/src/Interfaces/Admin/Contact.ts new file mode 100644 index 0000000..c6e022a --- /dev/null +++ b/src/Interfaces/Admin/Contact.ts @@ -0,0 +1,45 @@ +import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; +import { Address } from "./Address"; +import { Customer } from "./Customer"; +import { User } from "./User"; +import { ContactNotary } from "../.."; + +export namespace Contact { + export class IContact { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public first_name!: string; + + @IsNotEmpty({ groups: ["create"] }) + public last_name!: string; + + @IsNotEmpty({ groups: ["create"] }) + public email!: string; + + @IsOptional() + public phone_number!: string; + + @IsOptional() + public cell_phone_number!: string; + + @IsNotEmpty({ groups: ["create"] }) + public civility!: ContactNotary.ECivility; + + @IsNotEmpty({ groups: ["create"] }) + public address!: Address.IAddress; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + + @IsOptional() + public users?: User.IUser; + + @IsOptional() + public customers?: Customer.ICustomer; + } +} diff --git a/src/Interfaces/Admin/Customer.ts b/src/Interfaces/Admin/Customer.ts new file mode 100644 index 0000000..8503f54 --- /dev/null +++ b/src/Interfaces/Admin/Customer.ts @@ -0,0 +1,30 @@ +import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; +import { Contact } from "./Contact"; +import { Document } from "./Document"; +import { OfficeFolderHasCustomer } from "./OfficeFolderHasCustomer"; +import { CustomerNotary } from "../.."; + +export namespace Customer { + export class ICustomer { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public status!: CustomerNotary.ECustomerStatus; + + @IsNotEmpty({ groups: ["create"] }) + public contact!: Contact.IContact; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + + @IsOptional() + office_folder_has_customers?: OfficeFolderHasCustomer.IOfficeFolderHasCustomer[]; + + @IsOptional() + documents?: Document.IDocument[]; + } +} diff --git a/src/Interfaces/Admin/Deed.ts b/src/Interfaces/Admin/Deed.ts new file mode 100644 index 0000000..c1a3bf5 --- /dev/null +++ b/src/Interfaces/Admin/Deed.ts @@ -0,0 +1,25 @@ +import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; +import { DeedType } from "./DeedType"; +import { DeedHasDocumentType } from "./DeedHasDocumentType"; +import { OfficeFolder } from "./OfficeFolder"; +export namespace Deed { + export class IDeed { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public deed_type!: DeedType.IDeedType; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + + @IsOptional() + public deed_has_document_types?: DeedHasDocumentType.IDeedHasDocumentType[]; + + @IsOptional() + public office_folder?: OfficeFolder.IOfficeFolder; + } +} diff --git a/src/Interfaces/Admin/DeedHasDocumentType.ts b/src/Interfaces/Admin/DeedHasDocumentType.ts new file mode 100644 index 0000000..ed47935 --- /dev/null +++ b/src/Interfaces/Admin/DeedHasDocumentType.ts @@ -0,0 +1,21 @@ +import { IsNotEmpty, IsDate } from "class-validator"; +import { Deed } from "./Deed"; +import { DocumentType } from "./DocumentType"; +export namespace DeedHasDocumentType { + export class IDeedHasDocumentType { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public document_type!: DocumentType.IDocumentType; + + @IsNotEmpty({ groups: ["create"] }) + public deed!: Deed.IDeed; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + } +} diff --git a/src/Interfaces/Admin/DeedType.ts b/src/Interfaces/Admin/DeedType.ts new file mode 100644 index 0000000..0e3adba --- /dev/null +++ b/src/Interfaces/Admin/DeedType.ts @@ -0,0 +1,36 @@ +import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; + +import { Deed } from "./Deed"; +import { DeedTypeHasDocumentType } from "./DeedTypeHasDocumentType"; +import { Office } from "./Office"; + +export namespace DeedType { + export class IDeedType { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public name!: string; + + @IsNotEmpty({ groups: ["create"] }) + public description!: string; + + @IsDate() + public archived_at: Date | null = null; + + @IsNotEmpty({ groups: ["create"] }) + public office!: Office.IOffice; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + + @IsOptional() + public deed?: Deed.IDeed[]; + + @IsOptional() + public deed_type_has_document_types?: DeedTypeHasDocumentType.IDeedTypeHasDocumentType[]; + } +} diff --git a/src/Interfaces/Admin/DeedTypeHasDocumentType.ts b/src/Interfaces/Admin/DeedTypeHasDocumentType.ts new file mode 100644 index 0000000..9a4ae3d --- /dev/null +++ b/src/Interfaces/Admin/DeedTypeHasDocumentType.ts @@ -0,0 +1,22 @@ +import { IsNotEmpty, IsDate } from "class-validator"; +import { DeedType } from "./DeedType"; +import { DocumentType } from "./DocumentType"; + +export namespace DeedTypeHasDocumentType { + export class IDeedTypeHasDocumentType { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public document_type!: DocumentType.IDocumentType; + + @IsNotEmpty({ groups: ["create"] }) + public deed_type!: DeedType.IDeedType; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + } +} diff --git a/src/Interfaces/Admin/Document.ts b/src/Interfaces/Admin/Document.ts new file mode 100644 index 0000000..2647b8b --- /dev/null +++ b/src/Interfaces/Admin/Document.ts @@ -0,0 +1,38 @@ +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"; +import { DocumentNotary } from "../.."; + +export namespace Document { + export class IDocument { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public document_status!: DocumentNotary.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[]; + } +} diff --git a/src/Interfaces/Admin/DocumentHistory.ts b/src/Interfaces/Admin/DocumentHistory.ts new file mode 100644 index 0000000..f13d53a --- /dev/null +++ b/src/Interfaces/Admin/DocumentHistory.ts @@ -0,0 +1,24 @@ +import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; +import { Document } from "./Document"; + +export namespace DocumentHistory { + export class IDocumentHistory { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public document_status!: Document.EDocumentStatus; + + @IsNotEmpty({ groups: ["create"] }) + public document!: Document.IDocument; + + @IsOptional() + public refused_reason: string | null = null; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + } +} diff --git a/src/Interfaces/Admin/DocumentType.ts b/src/Interfaces/Admin/DocumentType.ts new file mode 100644 index 0000000..51cf965 --- /dev/null +++ b/src/Interfaces/Admin/DocumentType.ts @@ -0,0 +1,38 @@ +import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; +import { DeedHasDocumentType } from "./DeedHasDocumentType"; +import { Document } from "./Document"; +import { DeedTypeHasDocumentType } from "./DeedTypeHasDocumentType"; + +export namespace DocumentType { + export class IDocumentType { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public name!: string; + + @IsNotEmpty({ groups: ["create"] }) + public public_description!: string; + + @IsOptional() + public private_description: string | null = null; + + @IsDate() + public archived_at: Date | null = null; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + + @IsOptional() + public documents?: Document.IDocument[]; + + @IsOptional() + public deed_has_document_types?: DeedHasDocumentType.IDeedHasDocumentType[]; + + @IsOptional() + public deed_type_has_document_types?: DeedTypeHasDocumentType.IDeedTypeHasDocumentType[]; + } +} diff --git a/src/Interfaces/Admin/File.ts b/src/Interfaces/Admin/File.ts new file mode 100644 index 0000000..bfe7ff2 --- /dev/null +++ b/src/Interfaces/Admin/File.ts @@ -0,0 +1,21 @@ +import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; +import { Document } from "./Document"; + +export namespace File { + export class IFile { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public document!: Document.IDocument; + + @IsOptional() + public file_path: string | null = null; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + } +} diff --git a/src/Interfaces/Admin/IAddress.ts b/src/Interfaces/Admin/IAddress.ts deleted file mode 100644 index 219693d..0000000 --- a/src/Interfaces/Admin/IAddress.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; -import IContact from "./IContact"; -import IOffice from "./IOffice"; - -export default class IAddress { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public address!: string; - - @IsNotEmpty({ groups: ["create"] }) - public city!: string; - - @IsNotEmpty({ groups: ["create"] }) - public zip_code!: number; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; - - @IsOptional() - public office?: IOffice; - - @IsOptional() - public contacts?: IContact; -} diff --git a/src/Interfaces/Admin/IBlockchainAnchors.ts b/src/Interfaces/Admin/IBlockchainAnchors.ts deleted file mode 100644 index f179001..0000000 --- a/src/Interfaces/Admin/IBlockchainAnchors.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; -import IDocument from "./IDocument"; - -export default class IBlockchainAnchor { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public smartSigJobId!: string; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; - - @IsOptional() - public documents?: IDocument[]; -} diff --git a/src/Interfaces/Admin/IContact.ts b/src/Interfaces/Admin/IContact.ts deleted file mode 100644 index 234b24e..0000000 --- a/src/Interfaces/Admin/IContact.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; -import { ECivility } from "../../Enums/Enums"; -import IUser from "./IUser"; -import ICustomer from "./ICustomer"; -import IAddress from "./IAddress"; - -export default class IContact { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public first_name!: string; - - @IsNotEmpty({ groups: ["create"] }) - public last_name!: string; - - @IsNotEmpty({ groups: ["create"] }) - public email!: string; - - @IsOptional() - public phone_number!: string; - - @IsOptional() - public cell_phone_number!: string; - - @IsNotEmpty({ groups: ["create"] }) - public civility!: ECivility; - - @IsNotEmpty({ groups: ["create"] }) - public address!: IAddress; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; - - @IsOptional() - public users?: IUser; - - @IsOptional() - public customers?: ICustomer; -} diff --git a/src/Interfaces/Admin/ICustomer.ts b/src/Interfaces/Admin/ICustomer.ts deleted file mode 100644 index 3f81536..0000000 --- a/src/Interfaces/Admin/ICustomer.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; -import IContact from "./IContact"; -import { ECustomerStatus } from "../../Enums/Enums"; -import IDocument from "./IDocument"; -import IOfficeFolderHasCustomer from "./IOfficeFolderHasCustomer"; - -export default class ICustomer { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public status!: ECustomerStatus; - - @IsNotEmpty({ groups: ["create"] }) - public contact!: IContact; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; - - @IsOptional() - office_folder_has_customers?: IOfficeFolderHasCustomer[]; - - @IsOptional() - documents?: IDocument[]; -} diff --git a/src/Interfaces/Admin/IDeed.ts b/src/Interfaces/Admin/IDeed.ts deleted file mode 100644 index 24f1719..0000000 --- a/src/Interfaces/Admin/IDeed.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; -import IOfficeFolder from "./IOfficeFolder"; -import IDeedHasDocumentType from "./IDeedHasDocumentType"; -import IDeedType from "./IDeedTypes"; - -export default class IDeed { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public deed_type!: IDeedType; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; - - @IsOptional() - public deed_has_document_types?: IDeedHasDocumentType[]; - - @IsOptional() - public office_folder?: IOfficeFolder; -} diff --git a/src/Interfaces/Admin/IDeedHasDocumentType.ts b/src/Interfaces/Admin/IDeedHasDocumentType.ts deleted file mode 100644 index c35baa4..0000000 --- a/src/Interfaces/Admin/IDeedHasDocumentType.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { IsNotEmpty, IsDate } from "class-validator"; -import IDeed from "./IDeed"; -import IDocumentType from "./IDocumentType"; - -export default class IDeedHasDocumentType { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public document_type!: IDocumentType; - - @IsNotEmpty({ groups: ["create"] }) - public deed!: IDeed; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; -} diff --git a/src/Interfaces/Admin/IDeedTypeHasDocumentType.ts b/src/Interfaces/Admin/IDeedTypeHasDocumentType.ts deleted file mode 100644 index f09c470..0000000 --- a/src/Interfaces/Admin/IDeedTypeHasDocumentType.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { IsNotEmpty, IsDate } from "class-validator"; -import IDeedType from "./IDeedTypes"; -import IDocumentType from "./IDocumentType"; - -export default class IDeedTypeHasDocumentType { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public document_type!: IDocumentType; - - @IsNotEmpty({ groups: ["create"] }) - public deed_type!: IDeedType; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; -} diff --git a/src/Interfaces/Admin/IDeedTypes.ts b/src/Interfaces/Admin/IDeedTypes.ts deleted file mode 100644 index 7b4a400..0000000 --- a/src/Interfaces/Admin/IDeedTypes.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; -import IDeedTypeHasDocumentType from "./IDeedTypeHasDocumentType"; - -import IOffice from "./IOffice"; -import IDeed from "./IDeed"; - -export default class IDeedTypes { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public name!: string; - - @IsNotEmpty({ groups: ["create"] }) - public description!: string; - - @IsDate() - public archived_at: Date | null = null; - - @IsNotEmpty({ groups: ["create"] }) - public office!: IOffice; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; - - @IsOptional() - public deed?: IDeed[]; - - @IsOptional() - public deed_type_has_document_types?: IDeedTypeHasDocumentType[]; -} diff --git a/src/Interfaces/Admin/IDocument.ts b/src/Interfaces/Admin/IDocument.ts deleted file mode 100644 index d362a5e..0000000 --- a/src/Interfaces/Admin/IDocument.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; -import ICustomer from "./ICustomer"; -import { EDocumentStatus } from "../../Enums/Enums"; -import IOfficeFolder from "./IOfficeFolder"; -import IDocumentType from "./IDocumentType"; -import IBlockchainAnchor from "./IBlockchainAnchors"; -import IDocumentHistory from "./IDocumentHistory"; -import IFile from "./IFile"; - -export default class IDocument { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public document_status!: EDocumentStatus; - - @IsNotEmpty({ groups: ["create"] }) - public document_type!: IDocumentType; - - @IsOptional() - public blockchain_anchor?: IBlockchainAnchor; - - @IsNotEmpty({ groups: ["create"] }) - public folder!: IOfficeFolder; - - @IsNotEmpty({ groups: ["create"] }) - public depositor!: ICustomer; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; - - @IsOptional() - public files?: IFile[]; - - @IsOptional() - public document_history?: IDocumentHistory[]; -} diff --git a/src/Interfaces/Admin/IDocumentHistory.ts b/src/Interfaces/Admin/IDocumentHistory.ts deleted file mode 100644 index 6190a90..0000000 --- a/src/Interfaces/Admin/IDocumentHistory.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; -import { EDocumentStatus } from "../../Enums/Enums"; -import IDocument from "./IDocument"; - -export default class IDocumentHistory { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public document_status!: EDocumentStatus; - - @IsNotEmpty({ groups: ["create"] }) - public document!: IDocument; - - @IsOptional() - public refused_reason: string | null = null; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; -} diff --git a/src/Interfaces/Admin/IDocumentType.ts b/src/Interfaces/Admin/IDocumentType.ts deleted file mode 100644 index 9880348..0000000 --- a/src/Interfaces/Admin/IDocumentType.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; -import IDeedHasDocumentType from "./IDeedHasDocumentType"; -import IDeedTypeHasDocumentType from "./IDeedTypeHasDocumentType"; -import IDocument from "./IDocument"; - -export default class IDocumentType { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public name!: string; - - @IsNotEmpty({ groups: ["create"] }) - public public_description!: string; - - @IsOptional() - public private_description: string | null = null; - - @IsDate() - public archived_at: Date | null = null; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; - - @IsOptional() - public documents?: IDocument[]; - - @IsOptional() - public deed_has_document_types?: IDeedHasDocumentType[]; - - @IsOptional() - public deed_type_has_document_types?: IDeedTypeHasDocumentType[]; -} diff --git a/src/Interfaces/Admin/IFile.ts b/src/Interfaces/Admin/IFile.ts deleted file mode 100644 index 4bf370f..0000000 --- a/src/Interfaces/Admin/IFile.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; -import IDocument from "./IDocument"; - -export default class IFile { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public document!: IDocument; - - @IsOptional() - public file_path: string | null = null; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; -} diff --git a/src/Interfaces/Admin/INotification.ts b/src/Interfaces/Admin/INotification.ts deleted file mode 100644 index c0e0524..0000000 --- a/src/Interfaces/Admin/INotification.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { IsNotEmpty, IsDate, IsUrl, IsOptional } from "class-validator"; -import IUserHasNotification from "./IUserHasNotification"; - -export default class INotification { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public message!: string; - - @IsNotEmpty({ groups: ["create"] }) - @IsUrl() - public redirection_url!: string; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; - - @IsOptional() - user_has_notifications?: IUserHasNotification[]; -} diff --git a/src/Interfaces/Admin/IOffice.ts b/src/Interfaces/Admin/IOffice.ts deleted file mode 100644 index 77ddcb5..0000000 --- a/src/Interfaces/Admin/IOffice.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; -import IAddress from "./IAddress"; -import { EOfficeStatus } from "../../Enums/Enums"; -import IUser from "./IUser"; -import IOfficeFolder from "./IOfficeFolder"; -import IDeedType from "./IDeedTypes"; - -export default class IOffice { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public idNot!: string; - - @IsNotEmpty({ groups: ["create"] }) - public name!: string; - - @IsNotEmpty({ groups: ["create"] }) - public crpcen!: string; - - @IsNotEmpty({ groups: ["create"] }) - public address!: IAddress; - - @IsNotEmpty({ groups: ["create"] }) - public office_status!: EOfficeStatus; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; - - @IsOptional() - deed_types?: IDeedType[]; - - @IsOptional() - users?: IUser[]; - - @IsOptional() - office_folders?: IOfficeFolder[]; -} diff --git a/src/Interfaces/Admin/IOfficeFolder.ts b/src/Interfaces/Admin/IOfficeFolder.ts deleted file mode 100644 index ccdb551..0000000 --- a/src/Interfaces/Admin/IOfficeFolder.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; -import { EFolderStatus } from "../../Enums/Enums"; -import IDeed from "./IDeed"; -import IDocument from "./IDocument"; -import IOffice from "./IOffice"; -import IOfficeFolderHasCustomer from "./IOfficeFolderHasCustomer"; -import IOfficeFolderHasStakeholder from "./IOfficeFolderHasStakeholder"; - -export default class IOfficeFolder { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public folder_number!: string; - - @IsNotEmpty({ groups: ["create"] }) - public name!: string; - - @IsOptional() - public description: string | null = null; - - @IsOptional() - public archived_description: string | null = null; - - @IsNotEmpty({ groups: ["create"] }) - public status!: EFolderStatus; - - @IsNotEmpty({ groups: ["create"] }) - public deed!: IDeed; - - @IsNotEmpty({ groups: ["create"] }) - public office!: IOffice; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; - - @IsOptional() - office_folder_has_customers?: IOfficeFolderHasCustomer[]; - - @IsOptional() - office_folder_has_stakeholder?: IOfficeFolderHasStakeholder[]; - - @IsOptional() - documents?: IDocument[]; -} diff --git a/src/Interfaces/Admin/IOfficeFolderHasCustomer.ts b/src/Interfaces/Admin/IOfficeFolderHasCustomer.ts deleted file mode 100644 index fb85cee..0000000 --- a/src/Interfaces/Admin/IOfficeFolderHasCustomer.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { IsNotEmpty, IsDate } from "class-validator"; -import ICustomer from "./ICustomer"; -import IOfficeFolder from "./IOfficeFolder"; - -export default class IOfficeFolderHasCustomer { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public customer!: ICustomer; - - @IsNotEmpty({ groups: ["create"] }) - public office_folder!: IOfficeFolder; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; -} diff --git a/src/Interfaces/Admin/IOfficeFolderHasStakeholder.ts b/src/Interfaces/Admin/IOfficeFolderHasStakeholder.ts deleted file mode 100644 index 5e27d76..0000000 --- a/src/Interfaces/Admin/IOfficeFolderHasStakeholder.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { IsNotEmpty, IsDate } from "class-validator"; -import IOfficeFolder from "./IOfficeFolder"; -import IUser from "./IUser"; - -export default class IOfficeFolderHasStakeholder { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public user_stakeholder!: IUser; - - @IsNotEmpty({ groups: ["create"] }) - public office_folder!: IOfficeFolder; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; -} diff --git a/src/Interfaces/Admin/IUser.ts b/src/Interfaces/Admin/IUser.ts deleted file mode 100644 index 237e037..0000000 --- a/src/Interfaces/Admin/IUser.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; -import IContact from "./IContact"; -import IDocument from "./IDocument"; -import OfficesEntity from "./IOffice"; -import IOfficeFolderHasStakeholder from "./IOfficeFolderHasStakeholder"; - -export default class IUser { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public idNot!: string; - - @IsNotEmpty({ groups: ["create"] }) - public contact!: IContact; - - @IsNotEmpty({ groups: ["create"] }) - public office_membership!: OfficesEntity; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; - - @IsOptional() - office_folder_has_stakeholders?: IOfficeFolderHasStakeholder[]; - - @IsOptional() - documents?: IDocument; -} diff --git a/src/Interfaces/Admin/IUserHasNotification.ts b/src/Interfaces/Admin/IUserHasNotification.ts deleted file mode 100644 index 7c134d4..0000000 --- a/src/Interfaces/Admin/IUserHasNotification.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { IsNotEmpty, IsDate } from "class-validator"; -import INotification from "./INotification"; -import IUser from "./IUser"; - -export default class IUserHasNotification { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public user!: IUser; - - @IsNotEmpty({ groups: ["create"] }) - public notification!: INotification; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; -} diff --git a/src/Interfaces/Admin/Notification.ts b/src/Interfaces/Admin/Notification.ts new file mode 100644 index 0000000..e694f68 --- /dev/null +++ b/src/Interfaces/Admin/Notification.ts @@ -0,0 +1,25 @@ +import { IsNotEmpty, IsDate, IsUrl, IsOptional } from "class-validator"; +import { UserHasNotification } from "./UserHasNotification"; + +export namespace Notification { + export class INotification { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public message!: string; + + @IsNotEmpty({ groups: ["create"] }) + @IsUrl() + public redirection_url!: string; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + + @IsOptional() + user_has_notifications?: UserHasNotification.IUserHasNotification[]; + } +} diff --git a/src/Interfaces/Admin/Office.ts b/src/Interfaces/Admin/Office.ts new file mode 100644 index 0000000..5dc3d05 --- /dev/null +++ b/src/Interfaces/Admin/Office.ts @@ -0,0 +1,43 @@ +import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; +import { Address } from "./Address"; +import { DeedType } from "./DeedType"; +import { OfficeFolder } from "./OfficeFolder"; +import { User } from "./User"; +import { OfficeNotary } from "../.."; + +export namespace Office { + export class IOffice { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public idNot!: string; + + @IsNotEmpty({ groups: ["create"] }) + public name!: string; + + @IsNotEmpty({ groups: ["create"] }) + public crpcen!: string; + + @IsNotEmpty({ groups: ["create"] }) + public address!: Address.IAddress; + + @IsNotEmpty({ groups: ["create"] }) + public office_status!: OfficeNotary.EOfficeStatus; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + + @IsOptional() + deed_types?: DeedType.IDeedType[]; + + @IsOptional() + users?: User.IUser[]; + + @IsOptional() + office_folders?: OfficeFolder.IOfficeFolder[]; + } +} diff --git a/src/Interfaces/Admin/OfficeFolder.ts b/src/Interfaces/Admin/OfficeFolder.ts new file mode 100644 index 0000000..f54a09a --- /dev/null +++ b/src/Interfaces/Admin/OfficeFolder.ts @@ -0,0 +1,50 @@ +import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; +import { Deed } from "./Deed"; +import { Document } from "./Document"; +import { Office } from "./Office"; +import { OfficeFolderHasCustomer } from "./OfficeFolderHasCustomer"; +import { OfficeFolderHasStakeholder } from "./OfficeFolderHasStakeholder"; +import { OfficeFolderNotary } from "../.."; + +export namespace OfficeFolder { + export class IOfficeFolder { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public folder_number!: string; + + @IsNotEmpty({ groups: ["create"] }) + public name!: string; + + @IsOptional() + public description: string | null = null; + + @IsOptional() + public archived_description: string | null = null; + + @IsNotEmpty({ groups: ["create"] }) + public status!: OfficeFolderNotary.EFolderStatus; + + @IsNotEmpty({ groups: ["create"] }) + public deed!: Deed.IDeed; + + @IsNotEmpty({ groups: ["create"] }) + public office!: Office.IOffice; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + + @IsOptional() + office_folder_has_customers?: OfficeFolderHasCustomer.IOfficeFolderHasCustomer[]; + + @IsOptional() + office_folder_has_stakeholder?: OfficeFolderHasStakeholder.IOfficeFolderHasStakeholder[]; + + @IsOptional() + documents?: Document.IDocument[]; + } +} diff --git a/src/Interfaces/Admin/OfficeFolderHasCustomer.ts b/src/Interfaces/Admin/OfficeFolderHasCustomer.ts new file mode 100644 index 0000000..7609423 --- /dev/null +++ b/src/Interfaces/Admin/OfficeFolderHasCustomer.ts @@ -0,0 +1,21 @@ +import { IsNotEmpty, IsDate } from "class-validator"; +import { Customer } from "./Customer"; +import { OfficeFolder } from "./OfficeFolder"; +export namespace OfficeFolderHasCustomer { + export class IOfficeFolderHasCustomer { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public customer!: Customer.ICustomer; + + @IsNotEmpty({ groups: ["create"] }) + public office_folder!: OfficeFolder.IOfficeFolder; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + } +} diff --git a/src/Interfaces/Admin/OfficeFolderHasStakeholder.ts b/src/Interfaces/Admin/OfficeFolderHasStakeholder.ts new file mode 100644 index 0000000..6099824 --- /dev/null +++ b/src/Interfaces/Admin/OfficeFolderHasStakeholder.ts @@ -0,0 +1,22 @@ +import { IsNotEmpty, IsDate } from "class-validator"; +import { OfficeFolder } from "./OfficeFolder"; +import { User } from "./User"; + +export namespace OfficeFolderHasStakeholder { + export class IOfficeFolderHasStakeholder { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public user_stakeholder!: User.IUser; + + @IsNotEmpty({ groups: ["create"] }) + public office_folder!: OfficeFolder.IOfficeFolder; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + } +} diff --git a/src/Interfaces/Admin/User.ts b/src/Interfaces/Admin/User.ts new file mode 100644 index 0000000..c882b02 --- /dev/null +++ b/src/Interfaces/Admin/User.ts @@ -0,0 +1,33 @@ +import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; +import { Contact } from "./Contact"; +import { Document } from "./Document"; +import { Office } from "./Office"; +import { OfficeFolderHasStakeholder } from "./OfficeFolderHasStakeholder"; + +export namespace User { + export class IUser { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public idNot!: string; + + @IsNotEmpty({ groups: ["create"] }) + public contact!: Contact.IContact; + + @IsNotEmpty({ groups: ["create"] }) + public office_membership!: Office.IOffice; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + + @IsOptional() + office_folder_has_stakeholders?: OfficeFolderHasStakeholder.IOfficeFolderHasStakeholder[]; + + @IsOptional() + documents?: Document.IDocument; + } +} diff --git a/src/Interfaces/Admin/UserHasNotification.ts b/src/Interfaces/Admin/UserHasNotification.ts new file mode 100644 index 0000000..8c30dee --- /dev/null +++ b/src/Interfaces/Admin/UserHasNotification.ts @@ -0,0 +1,23 @@ +import { IsNotEmpty, IsDate } from "class-validator"; +import { Notification } from "./Notification"; +import { User } from "./User"; + +export namespace UserHasNotification { + export class IUserHasNotification { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public user!: User.IUser; + + @IsNotEmpty({ groups: ["create"] }) + public notification!: Notification.INotification; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + } + export type ENotificationStatus = "READ" | "UNREAD"; +} diff --git a/src/Interfaces/Client/Address.ts b/src/Interfaces/Client/Address.ts new file mode 100644 index 0000000..4120634 --- /dev/null +++ b/src/Interfaces/Client/Address.ts @@ -0,0 +1,31 @@ +import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; +import { Contact } from "./Contact"; +import { Office } from "./Office"; + +export namespace Address { + export class IAddress { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public address!: string; + + @IsNotEmpty({ groups: ["create"] }) + public city!: string; + + @IsNotEmpty({ groups: ["create"] }) + public zip_code!: number; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + + @IsOptional() + public office?: Office.IOffice; + + @IsOptional() + public contacts?: Contact.IContact; + } +} diff --git a/src/Interfaces/Client/Contact.ts b/src/Interfaces/Client/Contact.ts new file mode 100644 index 0000000..c6e022a --- /dev/null +++ b/src/Interfaces/Client/Contact.ts @@ -0,0 +1,45 @@ +import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; +import { Address } from "./Address"; +import { Customer } from "./Customer"; +import { User } from "./User"; +import { ContactNotary } from "../.."; + +export namespace Contact { + export class IContact { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public first_name!: string; + + @IsNotEmpty({ groups: ["create"] }) + public last_name!: string; + + @IsNotEmpty({ groups: ["create"] }) + public email!: string; + + @IsOptional() + public phone_number!: string; + + @IsOptional() + public cell_phone_number!: string; + + @IsNotEmpty({ groups: ["create"] }) + public civility!: ContactNotary.ECivility; + + @IsNotEmpty({ groups: ["create"] }) + public address!: Address.IAddress; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + + @IsOptional() + public users?: User.IUser; + + @IsOptional() + public customers?: Customer.ICustomer; + } +} diff --git a/src/Interfaces/Client/Customer.ts b/src/Interfaces/Client/Customer.ts new file mode 100644 index 0000000..8503f54 --- /dev/null +++ b/src/Interfaces/Client/Customer.ts @@ -0,0 +1,30 @@ +import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; +import { Contact } from "./Contact"; +import { Document } from "./Document"; +import { OfficeFolderHasCustomer } from "./OfficeFolderHasCustomer"; +import { CustomerNotary } from "../.."; + +export namespace Customer { + export class ICustomer { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public status!: CustomerNotary.ECustomerStatus; + + @IsNotEmpty({ groups: ["create"] }) + public contact!: Contact.IContact; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + + @IsOptional() + office_folder_has_customers?: OfficeFolderHasCustomer.IOfficeFolderHasCustomer[]; + + @IsOptional() + documents?: Document.IDocument[]; + } +} diff --git a/src/Interfaces/Client/Deed.ts b/src/Interfaces/Client/Deed.ts new file mode 100644 index 0000000..c1a3bf5 --- /dev/null +++ b/src/Interfaces/Client/Deed.ts @@ -0,0 +1,25 @@ +import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; +import { DeedType } from "./DeedType"; +import { DeedHasDocumentType } from "./DeedHasDocumentType"; +import { OfficeFolder } from "./OfficeFolder"; +export namespace Deed { + export class IDeed { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public deed_type!: DeedType.IDeedType; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + + @IsOptional() + public deed_has_document_types?: DeedHasDocumentType.IDeedHasDocumentType[]; + + @IsOptional() + public office_folder?: OfficeFolder.IOfficeFolder; + } +} diff --git a/src/Interfaces/Client/DeedHasDocumentType.ts b/src/Interfaces/Client/DeedHasDocumentType.ts new file mode 100644 index 0000000..ed47935 --- /dev/null +++ b/src/Interfaces/Client/DeedHasDocumentType.ts @@ -0,0 +1,21 @@ +import { IsNotEmpty, IsDate } from "class-validator"; +import { Deed } from "./Deed"; +import { DocumentType } from "./DocumentType"; +export namespace DeedHasDocumentType { + export class IDeedHasDocumentType { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public document_type!: DocumentType.IDocumentType; + + @IsNotEmpty({ groups: ["create"] }) + public deed!: Deed.IDeed; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + } +} diff --git a/src/Interfaces/Client/DeedType.ts b/src/Interfaces/Client/DeedType.ts new file mode 100644 index 0000000..0e3adba --- /dev/null +++ b/src/Interfaces/Client/DeedType.ts @@ -0,0 +1,36 @@ +import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; + +import { Deed } from "./Deed"; +import { DeedTypeHasDocumentType } from "./DeedTypeHasDocumentType"; +import { Office } from "./Office"; + +export namespace DeedType { + export class IDeedType { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public name!: string; + + @IsNotEmpty({ groups: ["create"] }) + public description!: string; + + @IsDate() + public archived_at: Date | null = null; + + @IsNotEmpty({ groups: ["create"] }) + public office!: Office.IOffice; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + + @IsOptional() + public deed?: Deed.IDeed[]; + + @IsOptional() + public deed_type_has_document_types?: DeedTypeHasDocumentType.IDeedTypeHasDocumentType[]; + } +} diff --git a/src/Interfaces/Client/DeedTypeHasDocumentType.ts b/src/Interfaces/Client/DeedTypeHasDocumentType.ts new file mode 100644 index 0000000..9a4ae3d --- /dev/null +++ b/src/Interfaces/Client/DeedTypeHasDocumentType.ts @@ -0,0 +1,22 @@ +import { IsNotEmpty, IsDate } from "class-validator"; +import { DeedType } from "./DeedType"; +import { DocumentType } from "./DocumentType"; + +export namespace DeedTypeHasDocumentType { + export class IDeedTypeHasDocumentType { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public document_type!: DocumentType.IDocumentType; + + @IsNotEmpty({ groups: ["create"] }) + public deed_type!: DeedType.IDeedType; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + } +} diff --git a/src/Interfaces/Client/Document.ts b/src/Interfaces/Client/Document.ts new file mode 100644 index 0000000..2647b8b --- /dev/null +++ b/src/Interfaces/Client/Document.ts @@ -0,0 +1,38 @@ +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"; +import { DocumentNotary } from "../.."; + +export namespace Document { + export class IDocument { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public document_status!: DocumentNotary.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[]; + } +} diff --git a/src/Interfaces/Client/DocumentHistory.ts b/src/Interfaces/Client/DocumentHistory.ts new file mode 100644 index 0000000..f13d53a --- /dev/null +++ b/src/Interfaces/Client/DocumentHistory.ts @@ -0,0 +1,24 @@ +import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; +import { Document } from "./Document"; + +export namespace DocumentHistory { + export class IDocumentHistory { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public document_status!: Document.EDocumentStatus; + + @IsNotEmpty({ groups: ["create"] }) + public document!: Document.IDocument; + + @IsOptional() + public refused_reason: string | null = null; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + } +} diff --git a/src/Interfaces/Client/DocumentType.ts b/src/Interfaces/Client/DocumentType.ts new file mode 100644 index 0000000..51cf965 --- /dev/null +++ b/src/Interfaces/Client/DocumentType.ts @@ -0,0 +1,38 @@ +import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; +import { DeedHasDocumentType } from "./DeedHasDocumentType"; +import { Document } from "./Document"; +import { DeedTypeHasDocumentType } from "./DeedTypeHasDocumentType"; + +export namespace DocumentType { + export class IDocumentType { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public name!: string; + + @IsNotEmpty({ groups: ["create"] }) + public public_description!: string; + + @IsOptional() + public private_description: string | null = null; + + @IsDate() + public archived_at: Date | null = null; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + + @IsOptional() + public documents?: Document.IDocument[]; + + @IsOptional() + public deed_has_document_types?: DeedHasDocumentType.IDeedHasDocumentType[]; + + @IsOptional() + public deed_type_has_document_types?: DeedTypeHasDocumentType.IDeedTypeHasDocumentType[]; + } +} diff --git a/src/Interfaces/Client/File.ts b/src/Interfaces/Client/File.ts new file mode 100644 index 0000000..bfe7ff2 --- /dev/null +++ b/src/Interfaces/Client/File.ts @@ -0,0 +1,21 @@ +import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; +import { Document } from "./Document"; + +export namespace File { + export class IFile { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public document!: Document.IDocument; + + @IsOptional() + public file_path: string | null = null; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + } +} diff --git a/src/Interfaces/Client/Notification.ts b/src/Interfaces/Client/Notification.ts new file mode 100644 index 0000000..e694f68 --- /dev/null +++ b/src/Interfaces/Client/Notification.ts @@ -0,0 +1,25 @@ +import { IsNotEmpty, IsDate, IsUrl, IsOptional } from "class-validator"; +import { UserHasNotification } from "./UserHasNotification"; + +export namespace Notification { + export class INotification { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public message!: string; + + @IsNotEmpty({ groups: ["create"] }) + @IsUrl() + public redirection_url!: string; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + + @IsOptional() + user_has_notifications?: UserHasNotification.IUserHasNotification[]; + } +} diff --git a/src/Interfaces/Client/Office.ts b/src/Interfaces/Client/Office.ts new file mode 100644 index 0000000..5dc3d05 --- /dev/null +++ b/src/Interfaces/Client/Office.ts @@ -0,0 +1,43 @@ +import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; +import { Address } from "./Address"; +import { DeedType } from "./DeedType"; +import { OfficeFolder } from "./OfficeFolder"; +import { User } from "./User"; +import { OfficeNotary } from "../.."; + +export namespace Office { + export class IOffice { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public idNot!: string; + + @IsNotEmpty({ groups: ["create"] }) + public name!: string; + + @IsNotEmpty({ groups: ["create"] }) + public crpcen!: string; + + @IsNotEmpty({ groups: ["create"] }) + public address!: Address.IAddress; + + @IsNotEmpty({ groups: ["create"] }) + public office_status!: OfficeNotary.EOfficeStatus; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + + @IsOptional() + deed_types?: DeedType.IDeedType[]; + + @IsOptional() + users?: User.IUser[]; + + @IsOptional() + office_folders?: OfficeFolder.IOfficeFolder[]; + } +} diff --git a/src/Interfaces/Client/OfficeFolder.ts b/src/Interfaces/Client/OfficeFolder.ts new file mode 100644 index 0000000..f54a09a --- /dev/null +++ b/src/Interfaces/Client/OfficeFolder.ts @@ -0,0 +1,50 @@ +import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; +import { Deed } from "./Deed"; +import { Document } from "./Document"; +import { Office } from "./Office"; +import { OfficeFolderHasCustomer } from "./OfficeFolderHasCustomer"; +import { OfficeFolderHasStakeholder } from "./OfficeFolderHasStakeholder"; +import { OfficeFolderNotary } from "../.."; + +export namespace OfficeFolder { + export class IOfficeFolder { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public folder_number!: string; + + @IsNotEmpty({ groups: ["create"] }) + public name!: string; + + @IsOptional() + public description: string | null = null; + + @IsOptional() + public archived_description: string | null = null; + + @IsNotEmpty({ groups: ["create"] }) + public status!: OfficeFolderNotary.EFolderStatus; + + @IsNotEmpty({ groups: ["create"] }) + public deed!: Deed.IDeed; + + @IsNotEmpty({ groups: ["create"] }) + public office!: Office.IOffice; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + + @IsOptional() + office_folder_has_customers?: OfficeFolderHasCustomer.IOfficeFolderHasCustomer[]; + + @IsOptional() + office_folder_has_stakeholder?: OfficeFolderHasStakeholder.IOfficeFolderHasStakeholder[]; + + @IsOptional() + documents?: Document.IDocument[]; + } +} diff --git a/src/Interfaces/Client/OfficeFolderHasCustomer.ts b/src/Interfaces/Client/OfficeFolderHasCustomer.ts new file mode 100644 index 0000000..7609423 --- /dev/null +++ b/src/Interfaces/Client/OfficeFolderHasCustomer.ts @@ -0,0 +1,21 @@ +import { IsNotEmpty, IsDate } from "class-validator"; +import { Customer } from "./Customer"; +import { OfficeFolder } from "./OfficeFolder"; +export namespace OfficeFolderHasCustomer { + export class IOfficeFolderHasCustomer { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public customer!: Customer.ICustomer; + + @IsNotEmpty({ groups: ["create"] }) + public office_folder!: OfficeFolder.IOfficeFolder; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + } +} diff --git a/src/Interfaces/Client/OfficeFolderHasStakeholder.ts b/src/Interfaces/Client/OfficeFolderHasStakeholder.ts new file mode 100644 index 0000000..6099824 --- /dev/null +++ b/src/Interfaces/Client/OfficeFolderHasStakeholder.ts @@ -0,0 +1,22 @@ +import { IsNotEmpty, IsDate } from "class-validator"; +import { OfficeFolder } from "./OfficeFolder"; +import { User } from "./User"; + +export namespace OfficeFolderHasStakeholder { + export class IOfficeFolderHasStakeholder { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public user_stakeholder!: User.IUser; + + @IsNotEmpty({ groups: ["create"] }) + public office_folder!: OfficeFolder.IOfficeFolder; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + } +} diff --git a/src/Interfaces/Client/User.ts b/src/Interfaces/Client/User.ts new file mode 100644 index 0000000..c882b02 --- /dev/null +++ b/src/Interfaces/Client/User.ts @@ -0,0 +1,33 @@ +import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; +import { Contact } from "./Contact"; +import { Document } from "./Document"; +import { Office } from "./Office"; +import { OfficeFolderHasStakeholder } from "./OfficeFolderHasStakeholder"; + +export namespace User { + export class IUser { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public idNot!: string; + + @IsNotEmpty({ groups: ["create"] }) + public contact!: Contact.IContact; + + @IsNotEmpty({ groups: ["create"] }) + public office_membership!: Office.IOffice; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + + @IsOptional() + office_folder_has_stakeholders?: OfficeFolderHasStakeholder.IOfficeFolderHasStakeholder[]; + + @IsOptional() + documents?: Document.IDocument; + } +} diff --git a/src/Interfaces/Client/UserHasNotification.ts b/src/Interfaces/Client/UserHasNotification.ts new file mode 100644 index 0000000..8c30dee --- /dev/null +++ b/src/Interfaces/Client/UserHasNotification.ts @@ -0,0 +1,23 @@ +import { IsNotEmpty, IsDate } from "class-validator"; +import { Notification } from "./Notification"; +import { User } from "./User"; + +export namespace UserHasNotification { + export class IUserHasNotification { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public user!: User.IUser; + + @IsNotEmpty({ groups: ["create"] }) + public notification!: Notification.INotification; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + } + export type ENotificationStatus = "READ" | "UNREAD"; +} diff --git a/src/Interfaces/Customer/IAddress.ts b/src/Interfaces/Customer/IAddress.ts deleted file mode 100644 index 219693d..0000000 --- a/src/Interfaces/Customer/IAddress.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; -import IContact from "./IContact"; -import IOffice from "./IOffice"; - -export default class IAddress { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public address!: string; - - @IsNotEmpty({ groups: ["create"] }) - public city!: string; - - @IsNotEmpty({ groups: ["create"] }) - public zip_code!: number; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; - - @IsOptional() - public office?: IOffice; - - @IsOptional() - public contacts?: IContact; -} diff --git a/src/Interfaces/Customer/IContact.ts b/src/Interfaces/Customer/IContact.ts deleted file mode 100644 index 234b24e..0000000 --- a/src/Interfaces/Customer/IContact.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; -import { ECivility } from "../../Enums/Enums"; -import IUser from "./IUser"; -import ICustomer from "./ICustomer"; -import IAddress from "./IAddress"; - -export default class IContact { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public first_name!: string; - - @IsNotEmpty({ groups: ["create"] }) - public last_name!: string; - - @IsNotEmpty({ groups: ["create"] }) - public email!: string; - - @IsOptional() - public phone_number!: string; - - @IsOptional() - public cell_phone_number!: string; - - @IsNotEmpty({ groups: ["create"] }) - public civility!: ECivility; - - @IsNotEmpty({ groups: ["create"] }) - public address!: IAddress; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; - - @IsOptional() - public users?: IUser; - - @IsOptional() - public customers?: ICustomer; -} diff --git a/src/Interfaces/Customer/ICustomer.ts b/src/Interfaces/Customer/ICustomer.ts deleted file mode 100644 index 3f81536..0000000 --- a/src/Interfaces/Customer/ICustomer.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; -import IContact from "./IContact"; -import { ECustomerStatus } from "../../Enums/Enums"; -import IDocument from "./IDocument"; -import IOfficeFolderHasCustomer from "./IOfficeFolderHasCustomer"; - -export default class ICustomer { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public status!: ECustomerStatus; - - @IsNotEmpty({ groups: ["create"] }) - public contact!: IContact; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; - - @IsOptional() - office_folder_has_customers?: IOfficeFolderHasCustomer[]; - - @IsOptional() - documents?: IDocument[]; -} diff --git a/src/Interfaces/Customer/IDeed.ts b/src/Interfaces/Customer/IDeed.ts deleted file mode 100644 index 24f1719..0000000 --- a/src/Interfaces/Customer/IDeed.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; -import IOfficeFolder from "./IOfficeFolder"; -import IDeedHasDocumentType from "./IDeedHasDocumentType"; -import IDeedType from "./IDeedTypes"; - -export default class IDeed { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public deed_type!: IDeedType; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; - - @IsOptional() - public deed_has_document_types?: IDeedHasDocumentType[]; - - @IsOptional() - public office_folder?: IOfficeFolder; -} diff --git a/src/Interfaces/Customer/IDeedHasDocumentType.ts b/src/Interfaces/Customer/IDeedHasDocumentType.ts deleted file mode 100644 index c35baa4..0000000 --- a/src/Interfaces/Customer/IDeedHasDocumentType.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { IsNotEmpty, IsDate } from "class-validator"; -import IDeed from "./IDeed"; -import IDocumentType from "./IDocumentType"; - -export default class IDeedHasDocumentType { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public document_type!: IDocumentType; - - @IsNotEmpty({ groups: ["create"] }) - public deed!: IDeed; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; -} diff --git a/src/Interfaces/Customer/IDeedTypeHasDocumentType.ts b/src/Interfaces/Customer/IDeedTypeHasDocumentType.ts deleted file mode 100644 index f09c470..0000000 --- a/src/Interfaces/Customer/IDeedTypeHasDocumentType.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { IsNotEmpty, IsDate } from "class-validator"; -import IDeedType from "./IDeedTypes"; -import IDocumentType from "./IDocumentType"; - -export default class IDeedTypeHasDocumentType { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public document_type!: IDocumentType; - - @IsNotEmpty({ groups: ["create"] }) - public deed_type!: IDeedType; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; -} diff --git a/src/Interfaces/Customer/IDeedTypes.ts b/src/Interfaces/Customer/IDeedTypes.ts deleted file mode 100644 index 7b4a400..0000000 --- a/src/Interfaces/Customer/IDeedTypes.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; -import IDeedTypeHasDocumentType from "./IDeedTypeHasDocumentType"; - -import IOffice from "./IOffice"; -import IDeed from "./IDeed"; - -export default class IDeedTypes { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public name!: string; - - @IsNotEmpty({ groups: ["create"] }) - public description!: string; - - @IsDate() - public archived_at: Date | null = null; - - @IsNotEmpty({ groups: ["create"] }) - public office!: IOffice; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; - - @IsOptional() - public deed?: IDeed[]; - - @IsOptional() - public deed_type_has_document_types?: IDeedTypeHasDocumentType[]; -} diff --git a/src/Interfaces/Customer/IDocument.ts b/src/Interfaces/Customer/IDocument.ts deleted file mode 100644 index 0f84c57..0000000 --- a/src/Interfaces/Customer/IDocument.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; -import ICustomer from "./ICustomer"; -import { EDocumentStatus } from "../../Enums/Enums"; -import IOfficeFolder from "./IOfficeFolder"; -import IDocumentType from "./IDocumentType"; -import IDocumentHistory from "./IDocumentHistory"; -import IFile from "./IFile"; - -export default class IDocument { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public document_status!: EDocumentStatus; - - @IsNotEmpty({ groups: ["create"] }) - public document_type!: IDocumentType; - - @IsNotEmpty({ groups: ["create"] }) - public folder!: IOfficeFolder; - - @IsNotEmpty({ groups: ["create"] }) - public depositor!: ICustomer; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; - - @IsOptional() - public files?: IFile[]; - - @IsOptional() - public document_history?: IDocumentHistory[]; -} diff --git a/src/Interfaces/Customer/IDocumentHistory.ts b/src/Interfaces/Customer/IDocumentHistory.ts deleted file mode 100644 index 6190a90..0000000 --- a/src/Interfaces/Customer/IDocumentHistory.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; -import { EDocumentStatus } from "../../Enums/Enums"; -import IDocument from "./IDocument"; - -export default class IDocumentHistory { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public document_status!: EDocumentStatus; - - @IsNotEmpty({ groups: ["create"] }) - public document!: IDocument; - - @IsOptional() - public refused_reason: string | null = null; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; -} diff --git a/src/Interfaces/Customer/IDocumentType.ts b/src/Interfaces/Customer/IDocumentType.ts deleted file mode 100644 index 9880348..0000000 --- a/src/Interfaces/Customer/IDocumentType.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; -import IDeedHasDocumentType from "./IDeedHasDocumentType"; -import IDeedTypeHasDocumentType from "./IDeedTypeHasDocumentType"; -import IDocument from "./IDocument"; - -export default class IDocumentType { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public name!: string; - - @IsNotEmpty({ groups: ["create"] }) - public public_description!: string; - - @IsOptional() - public private_description: string | null = null; - - @IsDate() - public archived_at: Date | null = null; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; - - @IsOptional() - public documents?: IDocument[]; - - @IsOptional() - public deed_has_document_types?: IDeedHasDocumentType[]; - - @IsOptional() - public deed_type_has_document_types?: IDeedTypeHasDocumentType[]; -} diff --git a/src/Interfaces/Customer/IFile.ts b/src/Interfaces/Customer/IFile.ts deleted file mode 100644 index 4bf370f..0000000 --- a/src/Interfaces/Customer/IFile.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; -import IDocument from "./IDocument"; - -export default class IFile { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public document!: IDocument; - - @IsOptional() - public file_path: string | null = null; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; -} diff --git a/src/Interfaces/Customer/INotification.ts b/src/Interfaces/Customer/INotification.ts deleted file mode 100644 index c0e0524..0000000 --- a/src/Interfaces/Customer/INotification.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { IsNotEmpty, IsDate, IsUrl, IsOptional } from "class-validator"; -import IUserHasNotification from "./IUserHasNotification"; - -export default class INotification { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public message!: string; - - @IsNotEmpty({ groups: ["create"] }) - @IsUrl() - public redirection_url!: string; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; - - @IsOptional() - user_has_notifications?: IUserHasNotification[]; -} diff --git a/src/Interfaces/Customer/IOffice.ts b/src/Interfaces/Customer/IOffice.ts deleted file mode 100644 index d2e4d5e..0000000 --- a/src/Interfaces/Customer/IOffice.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; -import IAddress from "./IAddress"; -import { EOfficeStatus } from "../../Enums/Enums"; -import IUser from "./IUser"; -import IOfficeFolder from "./IOfficeFolder"; -import IDeedType from "./IDeedTypes"; - -export default class IOffice{ - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public idNot!: string; - - @IsNotEmpty({ groups: ["create"] }) - public name!: string; - - @IsNotEmpty({ groups: ["create"] }) - public crpcen!: string; - - @IsNotEmpty({ groups: ["create"] }) - public address!: IAddress; - - @IsNotEmpty({ groups: ["create"] }) - public office_status!: EOfficeStatus; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; - - @IsOptional() - deed_types?: IDeedType[]; - - @IsOptional() - users?: IUser[]; - - @IsOptional() - office_folders?: IOfficeFolder[]; -} diff --git a/src/Interfaces/Customer/IOfficeFolder.ts b/src/Interfaces/Customer/IOfficeFolder.ts deleted file mode 100644 index ccdb551..0000000 --- a/src/Interfaces/Customer/IOfficeFolder.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; -import { EFolderStatus } from "../../Enums/Enums"; -import IDeed from "./IDeed"; -import IDocument from "./IDocument"; -import IOffice from "./IOffice"; -import IOfficeFolderHasCustomer from "./IOfficeFolderHasCustomer"; -import IOfficeFolderHasStakeholder from "./IOfficeFolderHasStakeholder"; - -export default class IOfficeFolder { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public folder_number!: string; - - @IsNotEmpty({ groups: ["create"] }) - public name!: string; - - @IsOptional() - public description: string | null = null; - - @IsOptional() - public archived_description: string | null = null; - - @IsNotEmpty({ groups: ["create"] }) - public status!: EFolderStatus; - - @IsNotEmpty({ groups: ["create"] }) - public deed!: IDeed; - - @IsNotEmpty({ groups: ["create"] }) - public office!: IOffice; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; - - @IsOptional() - office_folder_has_customers?: IOfficeFolderHasCustomer[]; - - @IsOptional() - office_folder_has_stakeholder?: IOfficeFolderHasStakeholder[]; - - @IsOptional() - documents?: IDocument[]; -} diff --git a/src/Interfaces/Customer/IOfficeFolderHasCustomer.ts b/src/Interfaces/Customer/IOfficeFolderHasCustomer.ts deleted file mode 100644 index fb85cee..0000000 --- a/src/Interfaces/Customer/IOfficeFolderHasCustomer.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { IsNotEmpty, IsDate } from "class-validator"; -import ICustomer from "./ICustomer"; -import IOfficeFolder from "./IOfficeFolder"; - -export default class IOfficeFolderHasCustomer { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public customer!: ICustomer; - - @IsNotEmpty({ groups: ["create"] }) - public office_folder!: IOfficeFolder; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; -} diff --git a/src/Interfaces/Customer/IOfficeFolderHasStakeholder.ts b/src/Interfaces/Customer/IOfficeFolderHasStakeholder.ts deleted file mode 100644 index 5e27d76..0000000 --- a/src/Interfaces/Customer/IOfficeFolderHasStakeholder.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { IsNotEmpty, IsDate } from "class-validator"; -import IOfficeFolder from "./IOfficeFolder"; -import IUser from "./IUser"; - -export default class IOfficeFolderHasStakeholder { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public user_stakeholder!: IUser; - - @IsNotEmpty({ groups: ["create"] }) - public office_folder!: IOfficeFolder; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; -} diff --git a/src/Interfaces/Customer/IUser.ts b/src/Interfaces/Customer/IUser.ts deleted file mode 100644 index 237e037..0000000 --- a/src/Interfaces/Customer/IUser.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; -import IContact from "./IContact"; -import IDocument from "./IDocument"; -import OfficesEntity from "./IOffice"; -import IOfficeFolderHasStakeholder from "./IOfficeFolderHasStakeholder"; - -export default class IUser { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public idNot!: string; - - @IsNotEmpty({ groups: ["create"] }) - public contact!: IContact; - - @IsNotEmpty({ groups: ["create"] }) - public office_membership!: OfficesEntity; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; - - @IsOptional() - office_folder_has_stakeholders?: IOfficeFolderHasStakeholder[]; - - @IsOptional() - documents?: IDocument; -} diff --git a/src/Interfaces/Customer/IUserHasNotification.ts b/src/Interfaces/Customer/IUserHasNotification.ts deleted file mode 100644 index 7c134d4..0000000 --- a/src/Interfaces/Customer/IUserHasNotification.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { IsNotEmpty, IsDate } from "class-validator"; -import INotification from "./INotification"; -import IUser from "./IUser"; - -export default class IUserHasNotification { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public user!: IUser; - - @IsNotEmpty({ groups: ["create"] }) - public notification!: INotification; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; -} diff --git a/src/Interfaces/Notary/Address.ts b/src/Interfaces/Notary/Address.ts new file mode 100644 index 0000000..4120634 --- /dev/null +++ b/src/Interfaces/Notary/Address.ts @@ -0,0 +1,31 @@ +import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; +import { Contact } from "./Contact"; +import { Office } from "./Office"; + +export namespace Address { + export class IAddress { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public address!: string; + + @IsNotEmpty({ groups: ["create"] }) + public city!: string; + + @IsNotEmpty({ groups: ["create"] }) + public zip_code!: number; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + + @IsOptional() + public office?: Office.IOffice; + + @IsOptional() + public contacts?: Contact.IContact; + } +} diff --git a/src/Interfaces/Notary/Contact.ts b/src/Interfaces/Notary/Contact.ts new file mode 100644 index 0000000..d0df80b --- /dev/null +++ b/src/Interfaces/Notary/Contact.ts @@ -0,0 +1,46 @@ +import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; +import { Address } from "./Address"; +import { Customer } from "./Customer"; +import { User } from "./User"; + +export namespace Contact { + export class IContact { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public first_name!: string; + + @IsNotEmpty({ groups: ["create"] }) + public last_name!: string; + + @IsNotEmpty({ groups: ["create"] }) + public email!: string; + + @IsOptional() + public phone_number!: string; + + @IsOptional() + public cell_phone_number!: string; + + @IsNotEmpty({ groups: ["create"] }) + public civility!: ECivility; + + @IsNotEmpty({ groups: ["create"] }) + public address!: Address.IAddress; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + + @IsOptional() + public users?: User.IUser; + + @IsOptional() + public customers?: Customer.ICustomer; + } + + export type ECivility = "MALE" | "FEMALE" | "OTHERS"; +} diff --git a/src/Interfaces/Notary/Customer.ts b/src/Interfaces/Notary/Customer.ts new file mode 100644 index 0000000..cd01250 --- /dev/null +++ b/src/Interfaces/Notary/Customer.ts @@ -0,0 +1,30 @@ +import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; +import { Contact } from "./Contact"; +import { Document } from "./Document"; +import { OfficeFolderHasCustomer } from "./OfficeFolderHasCustomer"; +export namespace Customer { + export class ICustomer { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public status!: ECustomerStatus; + + @IsNotEmpty({ groups: ["create"] }) + public contact!: Contact.IContact; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + + @IsOptional() + office_folder_has_customers?: OfficeFolderHasCustomer.IOfficeFolderHasCustomer[]; + + @IsOptional() + documents?: Document.IDocument[]; + } + + export type ECustomerStatus = "VALIDATED" | "PENDING" | "ERRONED"; +} diff --git a/src/Interfaces/Notary/Deed.ts b/src/Interfaces/Notary/Deed.ts new file mode 100644 index 0000000..c1a3bf5 --- /dev/null +++ b/src/Interfaces/Notary/Deed.ts @@ -0,0 +1,25 @@ +import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; +import { DeedType } from "./DeedType"; +import { DeedHasDocumentType } from "./DeedHasDocumentType"; +import { OfficeFolder } from "./OfficeFolder"; +export namespace Deed { + export class IDeed { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public deed_type!: DeedType.IDeedType; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + + @IsOptional() + public deed_has_document_types?: DeedHasDocumentType.IDeedHasDocumentType[]; + + @IsOptional() + public office_folder?: OfficeFolder.IOfficeFolder; + } +} diff --git a/src/Interfaces/Notary/DeedHasDocumentType.ts b/src/Interfaces/Notary/DeedHasDocumentType.ts new file mode 100644 index 0000000..ed47935 --- /dev/null +++ b/src/Interfaces/Notary/DeedHasDocumentType.ts @@ -0,0 +1,21 @@ +import { IsNotEmpty, IsDate } from "class-validator"; +import { Deed } from "./Deed"; +import { DocumentType } from "./DocumentType"; +export namespace DeedHasDocumentType { + export class IDeedHasDocumentType { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public document_type!: DocumentType.IDocumentType; + + @IsNotEmpty({ groups: ["create"] }) + public deed!: Deed.IDeed; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + } +} diff --git a/src/Interfaces/Notary/DeedType.ts b/src/Interfaces/Notary/DeedType.ts new file mode 100644 index 0000000..0e3adba --- /dev/null +++ b/src/Interfaces/Notary/DeedType.ts @@ -0,0 +1,36 @@ +import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; + +import { Deed } from "./Deed"; +import { DeedTypeHasDocumentType } from "./DeedTypeHasDocumentType"; +import { Office } from "./Office"; + +export namespace DeedType { + export class IDeedType { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public name!: string; + + @IsNotEmpty({ groups: ["create"] }) + public description!: string; + + @IsDate() + public archived_at: Date | null = null; + + @IsNotEmpty({ groups: ["create"] }) + public office!: Office.IOffice; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + + @IsOptional() + public deed?: Deed.IDeed[]; + + @IsOptional() + public deed_type_has_document_types?: DeedTypeHasDocumentType.IDeedTypeHasDocumentType[]; + } +} diff --git a/src/Interfaces/Notary/DeedTypeHasDocumentType.ts b/src/Interfaces/Notary/DeedTypeHasDocumentType.ts new file mode 100644 index 0000000..9a4ae3d --- /dev/null +++ b/src/Interfaces/Notary/DeedTypeHasDocumentType.ts @@ -0,0 +1,22 @@ +import { IsNotEmpty, IsDate } from "class-validator"; +import { DeedType } from "./DeedType"; +import { DocumentType } from "./DocumentType"; + +export namespace DeedTypeHasDocumentType { + export class IDeedTypeHasDocumentType { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public document_type!: DocumentType.IDocumentType; + + @IsNotEmpty({ groups: ["create"] }) + public deed_type!: DeedType.IDeedType; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + } +} diff --git a/src/Interfaces/Notary/Document.ts b/src/Interfaces/Notary/Document.ts new file mode 100644 index 0000000..2f21c59 --- /dev/null +++ b/src/Interfaces/Notary/Document.ts @@ -0,0 +1,43 @@ +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 type EDocumentStatus = + | "ASKED" + | "DEPOSITED" + | "VALIDATED" + | "ANCHORED" + | "REFUSED"; +} diff --git a/src/Interfaces/Notary/DocumentHistory.ts b/src/Interfaces/Notary/DocumentHistory.ts new file mode 100644 index 0000000..f13d53a --- /dev/null +++ b/src/Interfaces/Notary/DocumentHistory.ts @@ -0,0 +1,24 @@ +import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; +import { Document } from "./Document"; + +export namespace DocumentHistory { + export class IDocumentHistory { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public document_status!: Document.EDocumentStatus; + + @IsNotEmpty({ groups: ["create"] }) + public document!: Document.IDocument; + + @IsOptional() + public refused_reason: string | null = null; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + } +} diff --git a/src/Interfaces/Notary/DocumentType.ts b/src/Interfaces/Notary/DocumentType.ts new file mode 100644 index 0000000..51cf965 --- /dev/null +++ b/src/Interfaces/Notary/DocumentType.ts @@ -0,0 +1,38 @@ +import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; +import { DeedHasDocumentType } from "./DeedHasDocumentType"; +import { Document } from "./Document"; +import { DeedTypeHasDocumentType } from "./DeedTypeHasDocumentType"; + +export namespace DocumentType { + export class IDocumentType { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public name!: string; + + @IsNotEmpty({ groups: ["create"] }) + public public_description!: string; + + @IsOptional() + public private_description: string | null = null; + + @IsDate() + public archived_at: Date | null = null; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + + @IsOptional() + public documents?: Document.IDocument[]; + + @IsOptional() + public deed_has_document_types?: DeedHasDocumentType.IDeedHasDocumentType[]; + + @IsOptional() + public deed_type_has_document_types?: DeedTypeHasDocumentType.IDeedTypeHasDocumentType[]; + } +} diff --git a/src/Interfaces/Notary/File.ts b/src/Interfaces/Notary/File.ts new file mode 100644 index 0000000..bfe7ff2 --- /dev/null +++ b/src/Interfaces/Notary/File.ts @@ -0,0 +1,21 @@ +import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; +import { Document } from "./Document"; + +export namespace File { + export class IFile { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public document!: Document.IDocument; + + @IsOptional() + public file_path: string | null = null; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + } +} diff --git a/src/Interfaces/Notary/Notification.ts b/src/Interfaces/Notary/Notification.ts new file mode 100644 index 0000000..e694f68 --- /dev/null +++ b/src/Interfaces/Notary/Notification.ts @@ -0,0 +1,25 @@ +import { IsNotEmpty, IsDate, IsUrl, IsOptional } from "class-validator"; +import { UserHasNotification } from "./UserHasNotification"; + +export namespace Notification { + export class INotification { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public message!: string; + + @IsNotEmpty({ groups: ["create"] }) + @IsUrl() + public redirection_url!: string; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + + @IsOptional() + user_has_notifications?: UserHasNotification.IUserHasNotification[]; + } +} diff --git a/src/Interfaces/Notary/Office.ts b/src/Interfaces/Notary/Office.ts new file mode 100644 index 0000000..847bd01 --- /dev/null +++ b/src/Interfaces/Notary/Office.ts @@ -0,0 +1,43 @@ +import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; +import { Address } from "./Address"; +import { DeedType } from "./DeedType"; +import { OfficeFolder } from "./OfficeFolder"; +import { User } from "./User"; + +export namespace Office { + export class IOffice { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public idNot!: string; + + @IsNotEmpty({ groups: ["create"] }) + public name!: string; + + @IsNotEmpty({ groups: ["create"] }) + public crpcen!: string; + + @IsNotEmpty({ groups: ["create"] }) + public address!: Address.IAddress; + + @IsNotEmpty({ groups: ["create"] }) + public office_status!: EOfficeStatus; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + + @IsOptional() + deed_types?: DeedType.IDeedType[]; + + @IsOptional() + users?: User.IUser[]; + + @IsOptional() + office_folders?: OfficeFolder.IOfficeFolder[]; + } + export type EOfficeStatus = "ACTIVATED" | "DESACTIVATED"; +} diff --git a/src/Interfaces/Notary/OfficeFolder.ts b/src/Interfaces/Notary/OfficeFolder.ts new file mode 100644 index 0000000..9e38247 --- /dev/null +++ b/src/Interfaces/Notary/OfficeFolder.ts @@ -0,0 +1,50 @@ +import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; +import { Deed } from "./Deed"; +import { Document } from "./Document"; +import { Office } from "./Office"; +import { OfficeFolderHasCustomer } from "./OfficeFolderHasCustomer"; +import { OfficeFolderHasStakeholder } from "./OfficeFolderHasStakeholder"; + +export namespace OfficeFolder { + export class IOfficeFolder { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public folder_number!: string; + + @IsNotEmpty({ groups: ["create"] }) + public name!: string; + + @IsOptional() + public description: string | null = null; + + @IsOptional() + public archived_description: string | null = null; + + @IsNotEmpty({ groups: ["create"] }) + public status!: EFolderStatus; + + @IsNotEmpty({ groups: ["create"] }) + public deed!: Deed.IDeed; + + @IsNotEmpty({ groups: ["create"] }) + public office!: Office.IOffice; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + + @IsOptional() + office_folder_has_customers?: OfficeFolderHasCustomer.IOfficeFolderHasCustomer[]; + + @IsOptional() + office_folder_has_stakeholder?: OfficeFolderHasStakeholder.IOfficeFolderHasStakeholder[]; + + @IsOptional() + documents?: Document.IDocument[]; + } + export type EFolderStatus = "LIVE" | "ARCHIVED"; +} diff --git a/src/Interfaces/Notary/OfficeFolderHasCustomer.ts b/src/Interfaces/Notary/OfficeFolderHasCustomer.ts new file mode 100644 index 0000000..7609423 --- /dev/null +++ b/src/Interfaces/Notary/OfficeFolderHasCustomer.ts @@ -0,0 +1,21 @@ +import { IsNotEmpty, IsDate } from "class-validator"; +import { Customer } from "./Customer"; +import { OfficeFolder } from "./OfficeFolder"; +export namespace OfficeFolderHasCustomer { + export class IOfficeFolderHasCustomer { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public customer!: Customer.ICustomer; + + @IsNotEmpty({ groups: ["create"] }) + public office_folder!: OfficeFolder.IOfficeFolder; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + } +} diff --git a/src/Interfaces/Notary/OfficeFolderHasStakeholder.ts b/src/Interfaces/Notary/OfficeFolderHasStakeholder.ts new file mode 100644 index 0000000..6099824 --- /dev/null +++ b/src/Interfaces/Notary/OfficeFolderHasStakeholder.ts @@ -0,0 +1,22 @@ +import { IsNotEmpty, IsDate } from "class-validator"; +import { OfficeFolder } from "./OfficeFolder"; +import { User } from "./User"; + +export namespace OfficeFolderHasStakeholder { + export class IOfficeFolderHasStakeholder { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public user_stakeholder!: User.IUser; + + @IsNotEmpty({ groups: ["create"] }) + public office_folder!: OfficeFolder.IOfficeFolder; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + } +} diff --git a/src/Interfaces/Notary/User.ts b/src/Interfaces/Notary/User.ts new file mode 100644 index 0000000..c882b02 --- /dev/null +++ b/src/Interfaces/Notary/User.ts @@ -0,0 +1,33 @@ +import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; +import { Contact } from "./Contact"; +import { Document } from "./Document"; +import { Office } from "./Office"; +import { OfficeFolderHasStakeholder } from "./OfficeFolderHasStakeholder"; + +export namespace User { + export class IUser { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public idNot!: string; + + @IsNotEmpty({ groups: ["create"] }) + public contact!: Contact.IContact; + + @IsNotEmpty({ groups: ["create"] }) + public office_membership!: Office.IOffice; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + + @IsOptional() + office_folder_has_stakeholders?: OfficeFolderHasStakeholder.IOfficeFolderHasStakeholder[]; + + @IsOptional() + documents?: Document.IDocument; + } +} diff --git a/src/Interfaces/Notary/UserHasNotification.ts b/src/Interfaces/Notary/UserHasNotification.ts new file mode 100644 index 0000000..62d0374 --- /dev/null +++ b/src/Interfaces/Notary/UserHasNotification.ts @@ -0,0 +1,22 @@ +import { IsNotEmpty, IsDate } from "class-validator"; +import { Notification } from "./Notification"; +import { User } from "./User"; + +export namespace UserHasNotification { + export class IUserHasNotification { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public user!: User.IUser; + + @IsNotEmpty({ groups: ["create"] }) + public notification!: Notification.INotification; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + } +} diff --git a/src/Interfaces/SuperAdmin/Address.ts b/src/Interfaces/SuperAdmin/Address.ts new file mode 100644 index 0000000..4120634 --- /dev/null +++ b/src/Interfaces/SuperAdmin/Address.ts @@ -0,0 +1,31 @@ +import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; +import { Contact } from "./Contact"; +import { Office } from "./Office"; + +export namespace Address { + export class IAddress { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public address!: string; + + @IsNotEmpty({ groups: ["create"] }) + public city!: string; + + @IsNotEmpty({ groups: ["create"] }) + public zip_code!: number; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + + @IsOptional() + public office?: Office.IOffice; + + @IsOptional() + public contacts?: Contact.IContact; + } +} diff --git a/src/Interfaces/SuperAdmin/Contact.ts b/src/Interfaces/SuperAdmin/Contact.ts new file mode 100644 index 0000000..c6e022a --- /dev/null +++ b/src/Interfaces/SuperAdmin/Contact.ts @@ -0,0 +1,45 @@ +import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; +import { Address } from "./Address"; +import { Customer } from "./Customer"; +import { User } from "./User"; +import { ContactNotary } from "../.."; + +export namespace Contact { + export class IContact { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public first_name!: string; + + @IsNotEmpty({ groups: ["create"] }) + public last_name!: string; + + @IsNotEmpty({ groups: ["create"] }) + public email!: string; + + @IsOptional() + public phone_number!: string; + + @IsOptional() + public cell_phone_number!: string; + + @IsNotEmpty({ groups: ["create"] }) + public civility!: ContactNotary.ECivility; + + @IsNotEmpty({ groups: ["create"] }) + public address!: Address.IAddress; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + + @IsOptional() + public users?: User.IUser; + + @IsOptional() + public customers?: Customer.ICustomer; + } +} diff --git a/src/Interfaces/SuperAdmin/Customer.ts b/src/Interfaces/SuperAdmin/Customer.ts new file mode 100644 index 0000000..8503f54 --- /dev/null +++ b/src/Interfaces/SuperAdmin/Customer.ts @@ -0,0 +1,30 @@ +import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; +import { Contact } from "./Contact"; +import { Document } from "./Document"; +import { OfficeFolderHasCustomer } from "./OfficeFolderHasCustomer"; +import { CustomerNotary } from "../.."; + +export namespace Customer { + export class ICustomer { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public status!: CustomerNotary.ECustomerStatus; + + @IsNotEmpty({ groups: ["create"] }) + public contact!: Contact.IContact; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + + @IsOptional() + office_folder_has_customers?: OfficeFolderHasCustomer.IOfficeFolderHasCustomer[]; + + @IsOptional() + documents?: Document.IDocument[]; + } +} diff --git a/src/Interfaces/SuperAdmin/Deed.ts b/src/Interfaces/SuperAdmin/Deed.ts new file mode 100644 index 0000000..c1a3bf5 --- /dev/null +++ b/src/Interfaces/SuperAdmin/Deed.ts @@ -0,0 +1,25 @@ +import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; +import { DeedType } from "./DeedType"; +import { DeedHasDocumentType } from "./DeedHasDocumentType"; +import { OfficeFolder } from "./OfficeFolder"; +export namespace Deed { + export class IDeed { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public deed_type!: DeedType.IDeedType; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + + @IsOptional() + public deed_has_document_types?: DeedHasDocumentType.IDeedHasDocumentType[]; + + @IsOptional() + public office_folder?: OfficeFolder.IOfficeFolder; + } +} diff --git a/src/Interfaces/SuperAdmin/DeedHasDocumentType.ts b/src/Interfaces/SuperAdmin/DeedHasDocumentType.ts new file mode 100644 index 0000000..ed47935 --- /dev/null +++ b/src/Interfaces/SuperAdmin/DeedHasDocumentType.ts @@ -0,0 +1,21 @@ +import { IsNotEmpty, IsDate } from "class-validator"; +import { Deed } from "./Deed"; +import { DocumentType } from "./DocumentType"; +export namespace DeedHasDocumentType { + export class IDeedHasDocumentType { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public document_type!: DocumentType.IDocumentType; + + @IsNotEmpty({ groups: ["create"] }) + public deed!: Deed.IDeed; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + } +} diff --git a/src/Interfaces/SuperAdmin/DeedType.ts b/src/Interfaces/SuperAdmin/DeedType.ts new file mode 100644 index 0000000..0e3adba --- /dev/null +++ b/src/Interfaces/SuperAdmin/DeedType.ts @@ -0,0 +1,36 @@ +import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; + +import { Deed } from "./Deed"; +import { DeedTypeHasDocumentType } from "./DeedTypeHasDocumentType"; +import { Office } from "./Office"; + +export namespace DeedType { + export class IDeedType { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public name!: string; + + @IsNotEmpty({ groups: ["create"] }) + public description!: string; + + @IsDate() + public archived_at: Date | null = null; + + @IsNotEmpty({ groups: ["create"] }) + public office!: Office.IOffice; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + + @IsOptional() + public deed?: Deed.IDeed[]; + + @IsOptional() + public deed_type_has_document_types?: DeedTypeHasDocumentType.IDeedTypeHasDocumentType[]; + } +} diff --git a/src/Interfaces/SuperAdmin/DeedTypeHasDocumentType.ts b/src/Interfaces/SuperAdmin/DeedTypeHasDocumentType.ts new file mode 100644 index 0000000..9a4ae3d --- /dev/null +++ b/src/Interfaces/SuperAdmin/DeedTypeHasDocumentType.ts @@ -0,0 +1,22 @@ +import { IsNotEmpty, IsDate } from "class-validator"; +import { DeedType } from "./DeedType"; +import { DocumentType } from "./DocumentType"; + +export namespace DeedTypeHasDocumentType { + export class IDeedTypeHasDocumentType { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public document_type!: DocumentType.IDocumentType; + + @IsNotEmpty({ groups: ["create"] }) + public deed_type!: DeedType.IDeedType; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + } +} diff --git a/src/Interfaces/SuperAdmin/Document.ts b/src/Interfaces/SuperAdmin/Document.ts new file mode 100644 index 0000000..2647b8b --- /dev/null +++ b/src/Interfaces/SuperAdmin/Document.ts @@ -0,0 +1,38 @@ +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"; +import { DocumentNotary } from "../.."; + +export namespace Document { + export class IDocument { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public document_status!: DocumentNotary.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[]; + } +} diff --git a/src/Interfaces/SuperAdmin/DocumentHistory.ts b/src/Interfaces/SuperAdmin/DocumentHistory.ts new file mode 100644 index 0000000..f13d53a --- /dev/null +++ b/src/Interfaces/SuperAdmin/DocumentHistory.ts @@ -0,0 +1,24 @@ +import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; +import { Document } from "./Document"; + +export namespace DocumentHistory { + export class IDocumentHistory { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public document_status!: Document.EDocumentStatus; + + @IsNotEmpty({ groups: ["create"] }) + public document!: Document.IDocument; + + @IsOptional() + public refused_reason: string | null = null; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + } +} diff --git a/src/Interfaces/SuperAdmin/DocumentType.ts b/src/Interfaces/SuperAdmin/DocumentType.ts new file mode 100644 index 0000000..51cf965 --- /dev/null +++ b/src/Interfaces/SuperAdmin/DocumentType.ts @@ -0,0 +1,38 @@ +import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; +import { DeedHasDocumentType } from "./DeedHasDocumentType"; +import { Document } from "./Document"; +import { DeedTypeHasDocumentType } from "./DeedTypeHasDocumentType"; + +export namespace DocumentType { + export class IDocumentType { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public name!: string; + + @IsNotEmpty({ groups: ["create"] }) + public public_description!: string; + + @IsOptional() + public private_description: string | null = null; + + @IsDate() + public archived_at: Date | null = null; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + + @IsOptional() + public documents?: Document.IDocument[]; + + @IsOptional() + public deed_has_document_types?: DeedHasDocumentType.IDeedHasDocumentType[]; + + @IsOptional() + public deed_type_has_document_types?: DeedTypeHasDocumentType.IDeedTypeHasDocumentType[]; + } +} diff --git a/src/Interfaces/SuperAdmin/File.ts b/src/Interfaces/SuperAdmin/File.ts new file mode 100644 index 0000000..bfe7ff2 --- /dev/null +++ b/src/Interfaces/SuperAdmin/File.ts @@ -0,0 +1,21 @@ +import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; +import { Document } from "./Document"; + +export namespace File { + export class IFile { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public document!: Document.IDocument; + + @IsOptional() + public file_path: string | null = null; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + } +} diff --git a/src/Interfaces/SuperAdmin/IAddress.ts b/src/Interfaces/SuperAdmin/IAddress.ts deleted file mode 100644 index 219693d..0000000 --- a/src/Interfaces/SuperAdmin/IAddress.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; -import IContact from "./IContact"; -import IOffice from "./IOffice"; - -export default class IAddress { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public address!: string; - - @IsNotEmpty({ groups: ["create"] }) - public city!: string; - - @IsNotEmpty({ groups: ["create"] }) - public zip_code!: number; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; - - @IsOptional() - public office?: IOffice; - - @IsOptional() - public contacts?: IContact; -} diff --git a/src/Interfaces/SuperAdmin/IBlockchainAnchors.ts b/src/Interfaces/SuperAdmin/IBlockchainAnchors.ts index f179001..a9ccf86 100644 --- a/src/Interfaces/SuperAdmin/IBlockchainAnchors.ts +++ b/src/Interfaces/SuperAdmin/IBlockchainAnchors.ts @@ -1,5 +1,5 @@ import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; -import IDocument from "./IDocument"; +import { Document } from "./Document"; export default class IBlockchainAnchor { @IsNotEmpty() @@ -15,5 +15,5 @@ export default class IBlockchainAnchor { public updated_at: Date | null = null; @IsOptional() - public documents?: IDocument[]; + public documents?: Document.IDocument[]; } diff --git a/src/Interfaces/SuperAdmin/IContact.ts b/src/Interfaces/SuperAdmin/IContact.ts deleted file mode 100644 index 234b24e..0000000 --- a/src/Interfaces/SuperAdmin/IContact.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; -import { ECivility } from "../../Enums/Enums"; -import IUser from "./IUser"; -import ICustomer from "./ICustomer"; -import IAddress from "./IAddress"; - -export default class IContact { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public first_name!: string; - - @IsNotEmpty({ groups: ["create"] }) - public last_name!: string; - - @IsNotEmpty({ groups: ["create"] }) - public email!: string; - - @IsOptional() - public phone_number!: string; - - @IsOptional() - public cell_phone_number!: string; - - @IsNotEmpty({ groups: ["create"] }) - public civility!: ECivility; - - @IsNotEmpty({ groups: ["create"] }) - public address!: IAddress; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; - - @IsOptional() - public users?: IUser; - - @IsOptional() - public customers?: ICustomer; -} diff --git a/src/Interfaces/SuperAdmin/ICustomer.ts b/src/Interfaces/SuperAdmin/ICustomer.ts deleted file mode 100644 index 3f81536..0000000 --- a/src/Interfaces/SuperAdmin/ICustomer.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; -import IContact from "./IContact"; -import { ECustomerStatus } from "../../Enums/Enums"; -import IDocument from "./IDocument"; -import IOfficeFolderHasCustomer from "./IOfficeFolderHasCustomer"; - -export default class ICustomer { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public status!: ECustomerStatus; - - @IsNotEmpty({ groups: ["create"] }) - public contact!: IContact; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; - - @IsOptional() - office_folder_has_customers?: IOfficeFolderHasCustomer[]; - - @IsOptional() - documents?: IDocument[]; -} diff --git a/src/Interfaces/SuperAdmin/IDeed.ts b/src/Interfaces/SuperAdmin/IDeed.ts deleted file mode 100644 index 24f1719..0000000 --- a/src/Interfaces/SuperAdmin/IDeed.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; -import IOfficeFolder from "./IOfficeFolder"; -import IDeedHasDocumentType from "./IDeedHasDocumentType"; -import IDeedType from "./IDeedTypes"; - -export default class IDeed { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public deed_type!: IDeedType; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; - - @IsOptional() - public deed_has_document_types?: IDeedHasDocumentType[]; - - @IsOptional() - public office_folder?: IOfficeFolder; -} diff --git a/src/Interfaces/SuperAdmin/IDeedHasDocumentType.ts b/src/Interfaces/SuperAdmin/IDeedHasDocumentType.ts deleted file mode 100644 index c35baa4..0000000 --- a/src/Interfaces/SuperAdmin/IDeedHasDocumentType.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { IsNotEmpty, IsDate } from "class-validator"; -import IDeed from "./IDeed"; -import IDocumentType from "./IDocumentType"; - -export default class IDeedHasDocumentType { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public document_type!: IDocumentType; - - @IsNotEmpty({ groups: ["create"] }) - public deed!: IDeed; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; -} diff --git a/src/Interfaces/SuperAdmin/IDeedTypeHasDocumentType.ts b/src/Interfaces/SuperAdmin/IDeedTypeHasDocumentType.ts deleted file mode 100644 index f09c470..0000000 --- a/src/Interfaces/SuperAdmin/IDeedTypeHasDocumentType.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { IsNotEmpty, IsDate } from "class-validator"; -import IDeedType from "./IDeedTypes"; -import IDocumentType from "./IDocumentType"; - -export default class IDeedTypeHasDocumentType { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public document_type!: IDocumentType; - - @IsNotEmpty({ groups: ["create"] }) - public deed_type!: IDeedType; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; -} diff --git a/src/Interfaces/SuperAdmin/IDeedTypes.ts b/src/Interfaces/SuperAdmin/IDeedTypes.ts deleted file mode 100644 index 7b4a400..0000000 --- a/src/Interfaces/SuperAdmin/IDeedTypes.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; -import IDeedTypeHasDocumentType from "./IDeedTypeHasDocumentType"; - -import IOffice from "./IOffice"; -import IDeed from "./IDeed"; - -export default class IDeedTypes { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public name!: string; - - @IsNotEmpty({ groups: ["create"] }) - public description!: string; - - @IsDate() - public archived_at: Date | null = null; - - @IsNotEmpty({ groups: ["create"] }) - public office!: IOffice; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; - - @IsOptional() - public deed?: IDeed[]; - - @IsOptional() - public deed_type_has_document_types?: IDeedTypeHasDocumentType[]; -} diff --git a/src/Interfaces/SuperAdmin/IDocument.ts b/src/Interfaces/SuperAdmin/IDocument.ts deleted file mode 100644 index d362a5e..0000000 --- a/src/Interfaces/SuperAdmin/IDocument.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; -import ICustomer from "./ICustomer"; -import { EDocumentStatus } from "../../Enums/Enums"; -import IOfficeFolder from "./IOfficeFolder"; -import IDocumentType from "./IDocumentType"; -import IBlockchainAnchor from "./IBlockchainAnchors"; -import IDocumentHistory from "./IDocumentHistory"; -import IFile from "./IFile"; - -export default class IDocument { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public document_status!: EDocumentStatus; - - @IsNotEmpty({ groups: ["create"] }) - public document_type!: IDocumentType; - - @IsOptional() - public blockchain_anchor?: IBlockchainAnchor; - - @IsNotEmpty({ groups: ["create"] }) - public folder!: IOfficeFolder; - - @IsNotEmpty({ groups: ["create"] }) - public depositor!: ICustomer; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; - - @IsOptional() - public files?: IFile[]; - - @IsOptional() - public document_history?: IDocumentHistory[]; -} diff --git a/src/Interfaces/SuperAdmin/IDocumentHistory.ts b/src/Interfaces/SuperAdmin/IDocumentHistory.ts deleted file mode 100644 index 6190a90..0000000 --- a/src/Interfaces/SuperAdmin/IDocumentHistory.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; -import { EDocumentStatus } from "../../Enums/Enums"; -import IDocument from "./IDocument"; - -export default class IDocumentHistory { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public document_status!: EDocumentStatus; - - @IsNotEmpty({ groups: ["create"] }) - public document!: IDocument; - - @IsOptional() - public refused_reason: string | null = null; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; -} diff --git a/src/Interfaces/SuperAdmin/IDocumentType.ts b/src/Interfaces/SuperAdmin/IDocumentType.ts deleted file mode 100644 index 9880348..0000000 --- a/src/Interfaces/SuperAdmin/IDocumentType.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; -import IDeedHasDocumentType from "./IDeedHasDocumentType"; -import IDeedTypeHasDocumentType from "./IDeedTypeHasDocumentType"; -import IDocument from "./IDocument"; - -export default class IDocumentType { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public name!: string; - - @IsNotEmpty({ groups: ["create"] }) - public public_description!: string; - - @IsOptional() - public private_description: string | null = null; - - @IsDate() - public archived_at: Date | null = null; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; - - @IsOptional() - public documents?: IDocument[]; - - @IsOptional() - public deed_has_document_types?: IDeedHasDocumentType[]; - - @IsOptional() - public deed_type_has_document_types?: IDeedTypeHasDocumentType[]; -} diff --git a/src/Interfaces/SuperAdmin/IFile.ts b/src/Interfaces/SuperAdmin/IFile.ts deleted file mode 100644 index 4bf370f..0000000 --- a/src/Interfaces/SuperAdmin/IFile.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; -import IDocument from "./IDocument"; - -export default class IFile { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public document!: IDocument; - - @IsOptional() - public file_path: string | null = null; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; -} diff --git a/src/Interfaces/SuperAdmin/INotification.ts b/src/Interfaces/SuperAdmin/INotification.ts deleted file mode 100644 index c0e0524..0000000 --- a/src/Interfaces/SuperAdmin/INotification.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { IsNotEmpty, IsDate, IsUrl, IsOptional } from "class-validator"; -import IUserHasNotification from "./IUserHasNotification"; - -export default class INotification { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public message!: string; - - @IsNotEmpty({ groups: ["create"] }) - @IsUrl() - public redirection_url!: string; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; - - @IsOptional() - user_has_notifications?: IUserHasNotification[]; -} diff --git a/src/Interfaces/SuperAdmin/IOffice.ts b/src/Interfaces/SuperAdmin/IOffice.ts deleted file mode 100644 index 77ddcb5..0000000 --- a/src/Interfaces/SuperAdmin/IOffice.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; -import IAddress from "./IAddress"; -import { EOfficeStatus } from "../../Enums/Enums"; -import IUser from "./IUser"; -import IOfficeFolder from "./IOfficeFolder"; -import IDeedType from "./IDeedTypes"; - -export default class IOffice { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public idNot!: string; - - @IsNotEmpty({ groups: ["create"] }) - public name!: string; - - @IsNotEmpty({ groups: ["create"] }) - public crpcen!: string; - - @IsNotEmpty({ groups: ["create"] }) - public address!: IAddress; - - @IsNotEmpty({ groups: ["create"] }) - public office_status!: EOfficeStatus; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; - - @IsOptional() - deed_types?: IDeedType[]; - - @IsOptional() - users?: IUser[]; - - @IsOptional() - office_folders?: IOfficeFolder[]; -} diff --git a/src/Interfaces/SuperAdmin/IOfficeFolder.ts b/src/Interfaces/SuperAdmin/IOfficeFolder.ts deleted file mode 100644 index ccdb551..0000000 --- a/src/Interfaces/SuperAdmin/IOfficeFolder.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; -import { EFolderStatus } from "../../Enums/Enums"; -import IDeed from "./IDeed"; -import IDocument from "./IDocument"; -import IOffice from "./IOffice"; -import IOfficeFolderHasCustomer from "./IOfficeFolderHasCustomer"; -import IOfficeFolderHasStakeholder from "./IOfficeFolderHasStakeholder"; - -export default class IOfficeFolder { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public folder_number!: string; - - @IsNotEmpty({ groups: ["create"] }) - public name!: string; - - @IsOptional() - public description: string | null = null; - - @IsOptional() - public archived_description: string | null = null; - - @IsNotEmpty({ groups: ["create"] }) - public status!: EFolderStatus; - - @IsNotEmpty({ groups: ["create"] }) - public deed!: IDeed; - - @IsNotEmpty({ groups: ["create"] }) - public office!: IOffice; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; - - @IsOptional() - office_folder_has_customers?: IOfficeFolderHasCustomer[]; - - @IsOptional() - office_folder_has_stakeholder?: IOfficeFolderHasStakeholder[]; - - @IsOptional() - documents?: IDocument[]; -} diff --git a/src/Interfaces/SuperAdmin/IOfficeFolderHasCustomer.ts b/src/Interfaces/SuperAdmin/IOfficeFolderHasCustomer.ts deleted file mode 100644 index fb85cee..0000000 --- a/src/Interfaces/SuperAdmin/IOfficeFolderHasCustomer.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { IsNotEmpty, IsDate } from "class-validator"; -import ICustomer from "./ICustomer"; -import IOfficeFolder from "./IOfficeFolder"; - -export default class IOfficeFolderHasCustomer { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public customer!: ICustomer; - - @IsNotEmpty({ groups: ["create"] }) - public office_folder!: IOfficeFolder; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; -} diff --git a/src/Interfaces/SuperAdmin/IOfficeFolderHasStakeholder.ts b/src/Interfaces/SuperAdmin/IOfficeFolderHasStakeholder.ts deleted file mode 100644 index 5e27d76..0000000 --- a/src/Interfaces/SuperAdmin/IOfficeFolderHasStakeholder.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { IsNotEmpty, IsDate } from "class-validator"; -import IOfficeFolder from "./IOfficeFolder"; -import IUser from "./IUser"; - -export default class IOfficeFolderHasStakeholder { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public user_stakeholder!: IUser; - - @IsNotEmpty({ groups: ["create"] }) - public office_folder!: IOfficeFolder; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; -} diff --git a/src/Interfaces/SuperAdmin/IUser.ts b/src/Interfaces/SuperAdmin/IUser.ts deleted file mode 100644 index 237e037..0000000 --- a/src/Interfaces/SuperAdmin/IUser.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; -import IContact from "./IContact"; -import IDocument from "./IDocument"; -import OfficesEntity from "./IOffice"; -import IOfficeFolderHasStakeholder from "./IOfficeFolderHasStakeholder"; - -export default class IUser { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public idNot!: string; - - @IsNotEmpty({ groups: ["create"] }) - public contact!: IContact; - - @IsNotEmpty({ groups: ["create"] }) - public office_membership!: OfficesEntity; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; - - @IsOptional() - office_folder_has_stakeholders?: IOfficeFolderHasStakeholder[]; - - @IsOptional() - documents?: IDocument; -} diff --git a/src/Interfaces/SuperAdmin/IUserHasNotification.ts b/src/Interfaces/SuperAdmin/IUserHasNotification.ts deleted file mode 100644 index 7c134d4..0000000 --- a/src/Interfaces/SuperAdmin/IUserHasNotification.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { IsNotEmpty, IsDate } from "class-validator"; -import INotification from "./INotification"; -import IUser from "./IUser"; - -export default class IUserHasNotification { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public user!: IUser; - - @IsNotEmpty({ groups: ["create"] }) - public notification!: INotification; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; -} diff --git a/src/Interfaces/SuperAdmin/Notification.ts b/src/Interfaces/SuperAdmin/Notification.ts new file mode 100644 index 0000000..e694f68 --- /dev/null +++ b/src/Interfaces/SuperAdmin/Notification.ts @@ -0,0 +1,25 @@ +import { IsNotEmpty, IsDate, IsUrl, IsOptional } from "class-validator"; +import { UserHasNotification } from "./UserHasNotification"; + +export namespace Notification { + export class INotification { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public message!: string; + + @IsNotEmpty({ groups: ["create"] }) + @IsUrl() + public redirection_url!: string; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + + @IsOptional() + user_has_notifications?: UserHasNotification.IUserHasNotification[]; + } +} diff --git a/src/Interfaces/SuperAdmin/Office.ts b/src/Interfaces/SuperAdmin/Office.ts new file mode 100644 index 0000000..5dc3d05 --- /dev/null +++ b/src/Interfaces/SuperAdmin/Office.ts @@ -0,0 +1,43 @@ +import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; +import { Address } from "./Address"; +import { DeedType } from "./DeedType"; +import { OfficeFolder } from "./OfficeFolder"; +import { User } from "./User"; +import { OfficeNotary } from "../.."; + +export namespace Office { + export class IOffice { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public idNot!: string; + + @IsNotEmpty({ groups: ["create"] }) + public name!: string; + + @IsNotEmpty({ groups: ["create"] }) + public crpcen!: string; + + @IsNotEmpty({ groups: ["create"] }) + public address!: Address.IAddress; + + @IsNotEmpty({ groups: ["create"] }) + public office_status!: OfficeNotary.EOfficeStatus; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + + @IsOptional() + deed_types?: DeedType.IDeedType[]; + + @IsOptional() + users?: User.IUser[]; + + @IsOptional() + office_folders?: OfficeFolder.IOfficeFolder[]; + } +} diff --git a/src/Interfaces/SuperAdmin/OfficeFolder.ts b/src/Interfaces/SuperAdmin/OfficeFolder.ts new file mode 100644 index 0000000..f54a09a --- /dev/null +++ b/src/Interfaces/SuperAdmin/OfficeFolder.ts @@ -0,0 +1,50 @@ +import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; +import { Deed } from "./Deed"; +import { Document } from "./Document"; +import { Office } from "./Office"; +import { OfficeFolderHasCustomer } from "./OfficeFolderHasCustomer"; +import { OfficeFolderHasStakeholder } from "./OfficeFolderHasStakeholder"; +import { OfficeFolderNotary } from "../.."; + +export namespace OfficeFolder { + export class IOfficeFolder { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public folder_number!: string; + + @IsNotEmpty({ groups: ["create"] }) + public name!: string; + + @IsOptional() + public description: string | null = null; + + @IsOptional() + public archived_description: string | null = null; + + @IsNotEmpty({ groups: ["create"] }) + public status!: OfficeFolderNotary.EFolderStatus; + + @IsNotEmpty({ groups: ["create"] }) + public deed!: Deed.IDeed; + + @IsNotEmpty({ groups: ["create"] }) + public office!: Office.IOffice; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + + @IsOptional() + office_folder_has_customers?: OfficeFolderHasCustomer.IOfficeFolderHasCustomer[]; + + @IsOptional() + office_folder_has_stakeholder?: OfficeFolderHasStakeholder.IOfficeFolderHasStakeholder[]; + + @IsOptional() + documents?: Document.IDocument[]; + } +} diff --git a/src/Interfaces/SuperAdmin/OfficeFolderHasCustomer.ts b/src/Interfaces/SuperAdmin/OfficeFolderHasCustomer.ts new file mode 100644 index 0000000..7609423 --- /dev/null +++ b/src/Interfaces/SuperAdmin/OfficeFolderHasCustomer.ts @@ -0,0 +1,21 @@ +import { IsNotEmpty, IsDate } from "class-validator"; +import { Customer } from "./Customer"; +import { OfficeFolder } from "./OfficeFolder"; +export namespace OfficeFolderHasCustomer { + export class IOfficeFolderHasCustomer { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public customer!: Customer.ICustomer; + + @IsNotEmpty({ groups: ["create"] }) + public office_folder!: OfficeFolder.IOfficeFolder; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + } +} diff --git a/src/Interfaces/SuperAdmin/OfficeFolderHasStakeholder.ts b/src/Interfaces/SuperAdmin/OfficeFolderHasStakeholder.ts new file mode 100644 index 0000000..6099824 --- /dev/null +++ b/src/Interfaces/SuperAdmin/OfficeFolderHasStakeholder.ts @@ -0,0 +1,22 @@ +import { IsNotEmpty, IsDate } from "class-validator"; +import { OfficeFolder } from "./OfficeFolder"; +import { User } from "./User"; + +export namespace OfficeFolderHasStakeholder { + export class IOfficeFolderHasStakeholder { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public user_stakeholder!: User.IUser; + + @IsNotEmpty({ groups: ["create"] }) + public office_folder!: OfficeFolder.IOfficeFolder; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + } +} diff --git a/src/Interfaces/SuperAdmin/User.ts b/src/Interfaces/SuperAdmin/User.ts new file mode 100644 index 0000000..c882b02 --- /dev/null +++ b/src/Interfaces/SuperAdmin/User.ts @@ -0,0 +1,33 @@ +import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; +import { Contact } from "./Contact"; +import { Document } from "./Document"; +import { Office } from "./Office"; +import { OfficeFolderHasStakeholder } from "./OfficeFolderHasStakeholder"; + +export namespace User { + export class IUser { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public idNot!: string; + + @IsNotEmpty({ groups: ["create"] }) + public contact!: Contact.IContact; + + @IsNotEmpty({ groups: ["create"] }) + public office_membership!: Office.IOffice; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + + @IsOptional() + office_folder_has_stakeholders?: OfficeFolderHasStakeholder.IOfficeFolderHasStakeholder[]; + + @IsOptional() + documents?: Document.IDocument; + } +} diff --git a/src/Interfaces/SuperAdmin/UserHasNotification.ts b/src/Interfaces/SuperAdmin/UserHasNotification.ts new file mode 100644 index 0000000..8c30dee --- /dev/null +++ b/src/Interfaces/SuperAdmin/UserHasNotification.ts @@ -0,0 +1,23 @@ +import { IsNotEmpty, IsDate } from "class-validator"; +import { Notification } from "./Notification"; +import { User } from "./User"; + +export namespace UserHasNotification { + export class IUserHasNotification { + @IsNotEmpty() + public uuid!: string; + + @IsNotEmpty({ groups: ["create"] }) + public user!: User.IUser; + + @IsNotEmpty({ groups: ["create"] }) + public notification!: Notification.INotification; + + @IsDate() + public created_at: Date | null = null; + + @IsDate() + public updated_at: Date | null = null; + } + export type ENotificationStatus = "READ" | "UNREAD"; +} diff --git a/src/Interfaces/User/IAddress.ts b/src/Interfaces/User/IAddress.ts deleted file mode 100644 index 219693d..0000000 --- a/src/Interfaces/User/IAddress.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; -import IContact from "./IContact"; -import IOffice from "./IOffice"; - -export default class IAddress { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public address!: string; - - @IsNotEmpty({ groups: ["create"] }) - public city!: string; - - @IsNotEmpty({ groups: ["create"] }) - public zip_code!: number; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; - - @IsOptional() - public office?: IOffice; - - @IsOptional() - public contacts?: IContact; -} diff --git a/src/Interfaces/User/IContact.ts b/src/Interfaces/User/IContact.ts deleted file mode 100644 index 234b24e..0000000 --- a/src/Interfaces/User/IContact.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; -import { ECivility } from "../../Enums/Enums"; -import IUser from "./IUser"; -import ICustomer from "./ICustomer"; -import IAddress from "./IAddress"; - -export default class IContact { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public first_name!: string; - - @IsNotEmpty({ groups: ["create"] }) - public last_name!: string; - - @IsNotEmpty({ groups: ["create"] }) - public email!: string; - - @IsOptional() - public phone_number!: string; - - @IsOptional() - public cell_phone_number!: string; - - @IsNotEmpty({ groups: ["create"] }) - public civility!: ECivility; - - @IsNotEmpty({ groups: ["create"] }) - public address!: IAddress; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; - - @IsOptional() - public users?: IUser; - - @IsOptional() - public customers?: ICustomer; -} diff --git a/src/Interfaces/User/ICustomer.ts b/src/Interfaces/User/ICustomer.ts deleted file mode 100644 index 3f81536..0000000 --- a/src/Interfaces/User/ICustomer.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; -import IContact from "./IContact"; -import { ECustomerStatus } from "../../Enums/Enums"; -import IDocument from "./IDocument"; -import IOfficeFolderHasCustomer from "./IOfficeFolderHasCustomer"; - -export default class ICustomer { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public status!: ECustomerStatus; - - @IsNotEmpty({ groups: ["create"] }) - public contact!: IContact; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; - - @IsOptional() - office_folder_has_customers?: IOfficeFolderHasCustomer[]; - - @IsOptional() - documents?: IDocument[]; -} diff --git a/src/Interfaces/User/IDeed.ts b/src/Interfaces/User/IDeed.ts deleted file mode 100644 index 24f1719..0000000 --- a/src/Interfaces/User/IDeed.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; -import IOfficeFolder from "./IOfficeFolder"; -import IDeedHasDocumentType from "./IDeedHasDocumentType"; -import IDeedType from "./IDeedTypes"; - -export default class IDeed { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public deed_type!: IDeedType; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; - - @IsOptional() - public deed_has_document_types?: IDeedHasDocumentType[]; - - @IsOptional() - public office_folder?: IOfficeFolder; -} diff --git a/src/Interfaces/User/IDeedHasDocumentType.ts b/src/Interfaces/User/IDeedHasDocumentType.ts deleted file mode 100644 index c35baa4..0000000 --- a/src/Interfaces/User/IDeedHasDocumentType.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { IsNotEmpty, IsDate } from "class-validator"; -import IDeed from "./IDeed"; -import IDocumentType from "./IDocumentType"; - -export default class IDeedHasDocumentType { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public document_type!: IDocumentType; - - @IsNotEmpty({ groups: ["create"] }) - public deed!: IDeed; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; -} diff --git a/src/Interfaces/User/IDeedTypeHasDocumentType.ts b/src/Interfaces/User/IDeedTypeHasDocumentType.ts deleted file mode 100644 index f09c470..0000000 --- a/src/Interfaces/User/IDeedTypeHasDocumentType.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { IsNotEmpty, IsDate } from "class-validator"; -import IDeedType from "./IDeedTypes"; -import IDocumentType from "./IDocumentType"; - -export default class IDeedTypeHasDocumentType { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public document_type!: IDocumentType; - - @IsNotEmpty({ groups: ["create"] }) - public deed_type!: IDeedType; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; -} diff --git a/src/Interfaces/User/IDeedTypes.ts b/src/Interfaces/User/IDeedTypes.ts deleted file mode 100644 index 7b4a400..0000000 --- a/src/Interfaces/User/IDeedTypes.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; -import IDeedTypeHasDocumentType from "./IDeedTypeHasDocumentType"; - -import IOffice from "./IOffice"; -import IDeed from "./IDeed"; - -export default class IDeedTypes { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public name!: string; - - @IsNotEmpty({ groups: ["create"] }) - public description!: string; - - @IsDate() - public archived_at: Date | null = null; - - @IsNotEmpty({ groups: ["create"] }) - public office!: IOffice; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; - - @IsOptional() - public deed?: IDeed[]; - - @IsOptional() - public deed_type_has_document_types?: IDeedTypeHasDocumentType[]; -} diff --git a/src/Interfaces/User/IDocument.ts b/src/Interfaces/User/IDocument.ts deleted file mode 100644 index 0f84c57..0000000 --- a/src/Interfaces/User/IDocument.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; -import ICustomer from "./ICustomer"; -import { EDocumentStatus } from "../../Enums/Enums"; -import IOfficeFolder from "./IOfficeFolder"; -import IDocumentType from "./IDocumentType"; -import IDocumentHistory from "./IDocumentHistory"; -import IFile from "./IFile"; - -export default class IDocument { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public document_status!: EDocumentStatus; - - @IsNotEmpty({ groups: ["create"] }) - public document_type!: IDocumentType; - - @IsNotEmpty({ groups: ["create"] }) - public folder!: IOfficeFolder; - - @IsNotEmpty({ groups: ["create"] }) - public depositor!: ICustomer; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; - - @IsOptional() - public files?: IFile[]; - - @IsOptional() - public document_history?: IDocumentHistory[]; -} diff --git a/src/Interfaces/User/IDocumentHistory.ts b/src/Interfaces/User/IDocumentHistory.ts deleted file mode 100644 index 6190a90..0000000 --- a/src/Interfaces/User/IDocumentHistory.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; -import { EDocumentStatus } from "../../Enums/Enums"; -import IDocument from "./IDocument"; - -export default class IDocumentHistory { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public document_status!: EDocumentStatus; - - @IsNotEmpty({ groups: ["create"] }) - public document!: IDocument; - - @IsOptional() - public refused_reason: string | null = null; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; -} diff --git a/src/Interfaces/User/IDocumentType.ts b/src/Interfaces/User/IDocumentType.ts deleted file mode 100644 index 9880348..0000000 --- a/src/Interfaces/User/IDocumentType.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; -import IDeedHasDocumentType from "./IDeedHasDocumentType"; -import IDeedTypeHasDocumentType from "./IDeedTypeHasDocumentType"; -import IDocument from "./IDocument"; - -export default class IDocumentType { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public name!: string; - - @IsNotEmpty({ groups: ["create"] }) - public public_description!: string; - - @IsOptional() - public private_description: string | null = null; - - @IsDate() - public archived_at: Date | null = null; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; - - @IsOptional() - public documents?: IDocument[]; - - @IsOptional() - public deed_has_document_types?: IDeedHasDocumentType[]; - - @IsOptional() - public deed_type_has_document_types?: IDeedTypeHasDocumentType[]; -} diff --git a/src/Interfaces/User/IFile.ts b/src/Interfaces/User/IFile.ts deleted file mode 100644 index 4bf370f..0000000 --- a/src/Interfaces/User/IFile.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; -import IDocument from "./IDocument"; - -export default class IFile { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public document!: IDocument; - - @IsOptional() - public file_path: string | null = null; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; -} diff --git a/src/Interfaces/User/INotification.ts b/src/Interfaces/User/INotification.ts deleted file mode 100644 index c0e0524..0000000 --- a/src/Interfaces/User/INotification.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { IsNotEmpty, IsDate, IsUrl, IsOptional } from "class-validator"; -import IUserHasNotification from "./IUserHasNotification"; - -export default class INotification { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public message!: string; - - @IsNotEmpty({ groups: ["create"] }) - @IsUrl() - public redirection_url!: string; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; - - @IsOptional() - user_has_notifications?: IUserHasNotification[]; -} diff --git a/src/Interfaces/User/IOffice.ts b/src/Interfaces/User/IOffice.ts deleted file mode 100644 index d2e4d5e..0000000 --- a/src/Interfaces/User/IOffice.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; -import IAddress from "./IAddress"; -import { EOfficeStatus } from "../../Enums/Enums"; -import IUser from "./IUser"; -import IOfficeFolder from "./IOfficeFolder"; -import IDeedType from "./IDeedTypes"; - -export default class IOffice{ - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public idNot!: string; - - @IsNotEmpty({ groups: ["create"] }) - public name!: string; - - @IsNotEmpty({ groups: ["create"] }) - public crpcen!: string; - - @IsNotEmpty({ groups: ["create"] }) - public address!: IAddress; - - @IsNotEmpty({ groups: ["create"] }) - public office_status!: EOfficeStatus; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; - - @IsOptional() - deed_types?: IDeedType[]; - - @IsOptional() - users?: IUser[]; - - @IsOptional() - office_folders?: IOfficeFolder[]; -} diff --git a/src/Interfaces/User/IOfficeFolder.ts b/src/Interfaces/User/IOfficeFolder.ts deleted file mode 100644 index ccdb551..0000000 --- a/src/Interfaces/User/IOfficeFolder.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; -import { EFolderStatus } from "../../Enums/Enums"; -import IDeed from "./IDeed"; -import IDocument from "./IDocument"; -import IOffice from "./IOffice"; -import IOfficeFolderHasCustomer from "./IOfficeFolderHasCustomer"; -import IOfficeFolderHasStakeholder from "./IOfficeFolderHasStakeholder"; - -export default class IOfficeFolder { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public folder_number!: string; - - @IsNotEmpty({ groups: ["create"] }) - public name!: string; - - @IsOptional() - public description: string | null = null; - - @IsOptional() - public archived_description: string | null = null; - - @IsNotEmpty({ groups: ["create"] }) - public status!: EFolderStatus; - - @IsNotEmpty({ groups: ["create"] }) - public deed!: IDeed; - - @IsNotEmpty({ groups: ["create"] }) - public office!: IOffice; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; - - @IsOptional() - office_folder_has_customers?: IOfficeFolderHasCustomer[]; - - @IsOptional() - office_folder_has_stakeholder?: IOfficeFolderHasStakeholder[]; - - @IsOptional() - documents?: IDocument[]; -} diff --git a/src/Interfaces/User/IOfficeFolderHasCustomer.ts b/src/Interfaces/User/IOfficeFolderHasCustomer.ts deleted file mode 100644 index fb85cee..0000000 --- a/src/Interfaces/User/IOfficeFolderHasCustomer.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { IsNotEmpty, IsDate } from "class-validator"; -import ICustomer from "./ICustomer"; -import IOfficeFolder from "./IOfficeFolder"; - -export default class IOfficeFolderHasCustomer { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public customer!: ICustomer; - - @IsNotEmpty({ groups: ["create"] }) - public office_folder!: IOfficeFolder; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; -} diff --git a/src/Interfaces/User/IOfficeFolderHasStakeholder.ts b/src/Interfaces/User/IOfficeFolderHasStakeholder.ts deleted file mode 100644 index 5e27d76..0000000 --- a/src/Interfaces/User/IOfficeFolderHasStakeholder.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { IsNotEmpty, IsDate } from "class-validator"; -import IOfficeFolder from "./IOfficeFolder"; -import IUser from "./IUser"; - -export default class IOfficeFolderHasStakeholder { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public user_stakeholder!: IUser; - - @IsNotEmpty({ groups: ["create"] }) - public office_folder!: IOfficeFolder; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; -} diff --git a/src/Interfaces/User/IUser.ts b/src/Interfaces/User/IUser.ts deleted file mode 100644 index 237e037..0000000 --- a/src/Interfaces/User/IUser.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { IsNotEmpty, IsDate, IsOptional } from "class-validator"; -import IContact from "./IContact"; -import IDocument from "./IDocument"; -import OfficesEntity from "./IOffice"; -import IOfficeFolderHasStakeholder from "./IOfficeFolderHasStakeholder"; - -export default class IUser { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public idNot!: string; - - @IsNotEmpty({ groups: ["create"] }) - public contact!: IContact; - - @IsNotEmpty({ groups: ["create"] }) - public office_membership!: OfficesEntity; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; - - @IsOptional() - office_folder_has_stakeholders?: IOfficeFolderHasStakeholder[]; - - @IsOptional() - documents?: IDocument; -} diff --git a/src/Interfaces/User/IUserHasNotification.ts b/src/Interfaces/User/IUserHasNotification.ts deleted file mode 100644 index 7c134d4..0000000 --- a/src/Interfaces/User/IUserHasNotification.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { IsNotEmpty, IsDate } from "class-validator"; -import INotification from "./INotification"; -import IUser from "./IUser"; - -export default class IUserHasNotification { - @IsNotEmpty() - public uuid!: string; - - @IsNotEmpty({ groups: ["create"] }) - public user!: IUser; - - @IsNotEmpty({ groups: ["create"] }) - public notification!: INotification; - - @IsDate() - public created_at: Date | null = null; - - @IsDate() - public updated_at: Date | null = null; -} diff --git a/src/index.ts b/src/index.ts index ff055dc..1e1627b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,76 +1,91 @@ -export { default as IAddressAdmin } from "./Interfaces/Admin/IAddress"; -export { default as IBlockchainAnchorsAdmin } from "./Interfaces/Admin/IBlockchainAnchors"; -export { default as IContactAdmin } from "./Interfaces/Admin/IContact"; -export { default as ICustomerAdmin } from "./Interfaces/Admin/ICustomer"; -export { default as IDeedAdmin } from "./Interfaces/Admin/IDeed"; -export { default as IDeedHasDocumentTypeAdmin } from "./Interfaces/Admin/IDeedHasDocumentType"; -export { default as IDeedTypeAdmin } from "./Interfaces/Admin/IDeedTypes"; -export { default as IDeedTypeHasDocumentTypeAdmin } from "./Interfaces/Admin/IDeedTypeHasDocumentType"; -export { default as IDocumentAdmin } from "./Interfaces/Admin/IDocument"; -export { default as IDocumentHistoryAdmin } from "./Interfaces/Admin/IDocumentHistory"; -export { default as IDocumentTypeAdmin } from "./Interfaces/Admin/IDocumentType"; -export { default as IFileAdmin } from "./Interfaces/Admin/IFile"; -export { default as INotificationAdmin } from "./Interfaces/Admin/INotification"; -export { default as IOfficeAdmin } from "./Interfaces/Admin/IOffice"; -export { default as IOfficeFolderAdmin } from "./Interfaces/Admin/IOfficeFolder"; -export { default as IOfficeFolderHasCustomerAdmin } from "./Interfaces/Admin/IOfficeFolderHasCustomer"; -export { default as IOfficeFolderHasStakeholderAdmin } from "./Interfaces/Admin/IOfficeFolderHasStakeholder"; -export { default as IUserAdmin } from "./Interfaces/Admin/IUser"; -export { default as IUserHasNotificationAdmin } from "./Interfaces/Admin/IUserHasNotification"; -export { default as IAddressSuperAdmin } from "./Interfaces/SuperAdmin/IAddress"; -export { default as IBlockchainAnchorsSuperAdmin } from "./Interfaces/SuperAdmin/IBlockchainAnchors"; -export { default as IContactSuperAdmin } from "./Interfaces/SuperAdmin/IContact"; -export { default as ICustomerSuperAdmin } from "./Interfaces/SuperAdmin/ICustomer"; -export { default as IDeedSuperAdmin } from "./Interfaces/SuperAdmin/IDeed"; -export { default as IDeedHasDocumentTypeSuperAdmin } from "./Interfaces/SuperAdmin/IDeedHasDocumentType"; -export { default as IDeedTypeSuperAdmin } from "./Interfaces/SuperAdmin/IDeedTypes"; -export { default as IDeedTypeHasDocumentTypeSuperAdmin } from "./Interfaces/SuperAdmin/IDeedTypeHasDocumentType"; -export { default as IDocumentSuperAdmin } from "./Interfaces/SuperAdmin/IDocument"; -export { default as IDocumentHistorySuperAdmin } from "./Interfaces/SuperAdmin/IDocumentHistory"; -export { default as IDocumentTypeSuperAdmin } from "./Interfaces/SuperAdmin/IDocumentType"; -export { default as IFileSuperAdmin } from "./Interfaces/SuperAdmin/IFile"; -export { default as INotificationSuperAdmin } from "./Interfaces/SuperAdmin/INotification"; -export { default as IOfficeSuperAdmin } from "./Interfaces/SuperAdmin/IOffice"; -export { default as IOfficeFolderSuperAdmin } from "./Interfaces/SuperAdmin/IOfficeFolder"; -export { default as IOfficeFolderHasCustomerSuperAdmin } from "./Interfaces/SuperAdmin/IOfficeFolderHasCustomer"; -export { default as IOfficeFolderHasStakeholderSuperAdmin } from "./Interfaces/SuperAdmin/IOfficeFolderHasStakeholder"; -export { default as IUserSuperAdmin } from "./Interfaces/SuperAdmin/IUser"; -export { default as IUserHasNotificationSuperAdmin } from "./Interfaces/SuperAdmin/IUserHasNotification"; -export { default as IAddressUser } from "./Interfaces/User/IAddress"; -export { default as IContactUser } from "./Interfaces/User/IContact"; -export { default as ICustomerUser } from "./Interfaces/User/ICustomer"; -export { default as IDeedUser } from "./Interfaces/User/IDeed"; -export { default as IDeedHasDocumentTypeUser } from "./Interfaces/User/IDeedHasDocumentType"; -export { default as IDeedTypeUser } from "./Interfaces/User/IDeedTypes"; -export { default as IDeedTypeHasDocumentTypeUser } from "./Interfaces/User/IDeedTypeHasDocumentType"; -export { default as IDocumentUser } from "./Interfaces/User/IDocument"; -export { default as IDocumentHistoryUser } from "./Interfaces/User/IDocumentHistory"; -export { default as IDocumentTypeUser } from "./Interfaces/User/IDocumentType"; -export { default as IFileUser } from "./Interfaces/User/IFile"; -export { default as INotificationUser } from "./Interfaces/User/INotification"; -export { default as IOfficeUser } from "./Interfaces/User/IOffice"; -export { default as IOfficeFolderUser } from "./Interfaces/User/IOfficeFolder"; -export { default as IOfficeFolderHasCustomerUser } from "./Interfaces/User/IOfficeFolderHasCustomer"; -export { default as IOfficeFolderHasStakeholderUser } from "./Interfaces/User/IOfficeFolderHasStakeholder"; -export { default as IUserUser } from "./Interfaces/User/IUser"; -export { default as IUserHasNotificationUser } from "./Interfaces/User/IUserHasNotification"; -export { default as IAddressCustomer } from "./Interfaces/Customer/IAddress"; -export { default as IContactCustomer } from "./Interfaces/Customer/IContact"; -export { default as ICustomerCustomer } from "./Interfaces/Customer/ICustomer"; -export { default as IDeedCustomer } from "./Interfaces/Customer/IDeed"; -export { default as IDeedHasDocumentTypeCustomer } from "./Interfaces/Customer/IDeedHasDocumentType"; -export { default as IDeedTypeCustomer } from "./Interfaces/Customer/IDeedTypes"; -export { default as IDeedTypeHasDocumentTypeCustomer } from "./Interfaces/Customer/IDeedTypeHasDocumentType"; -export { default as IDocumentCustomer } from "./Interfaces/Customer/IDocument"; -export { default as IDocumentHistoryCustomer } from "./Interfaces/Customer/IDocumentHistory"; -export { default as IDocumentTypeCustomer } from "./Interfaces/Customer/IDocumentType"; -export { default as IFileCustomer } from "./Interfaces/Customer/IFile"; -export { default as INotificationCustomer } from "./Interfaces/Customer/INotification"; -export { default as IOfficeCustomer } from "./Interfaces/Customer/IOffice"; -export { default as IOfficeFolderCustomer } from "./Interfaces/Customer/IOfficeFolder"; -export { default as IOfficeFolderHasCustomerCustomer } from "./Interfaces/Customer/IOfficeFolderHasCustomer"; -export { default as IOfficeFolderHasStakeholderCustomer } from "./Interfaces/Customer/IOfficeFolderHasStakeholder"; -export { default as IUserCustomer } from "./Interfaces/Customer/IUser"; -export { default as ICustomerHasNotificationCustomer } from "./Interfaces/Customer/IUserHasNotification"; +/** + * @description Namespace Notary + * It contains all the interfaces and enums for the user + */ +export { Address as AddressNotary } from "./Interfaces/Notary/Address"; +export { Contact as ContactNotary } from "./Interfaces/Notary/Contact"; +export { Customer as CustomerNotary } from "./Interfaces/Notary/Customer"; +export { Deed as DeedNotary } from "./Interfaces/Notary/Deed"; +export { DeedHasDocumentType as DeedHasDocumentTypeNotary } from "./Interfaces/Notary/DeedHasDocumentType"; +export { DeedType as DeedTypeNotary } from "./Interfaces/Notary/DeedType"; +export { DeedTypeHasDocumentType as DeedTypeHasDocumentTypeNotary } from "./Interfaces/Notary/DeedTypeHasDocumentType"; +export { Document as DocumentNotary } from "./Interfaces/Notary/Document"; +export { DocumentHistory as DocumentHistoryNotary } from "./Interfaces/Notary/DocumentHistory"; +export { DocumentType as DocumentTypeNotary } from "./Interfaces/Notary/DocumentType"; +export { File as FileNotary } from "./Interfaces/Notary/File"; +export { Notification as NotificationNotary } from "./Interfaces/Notary/Notification"; +export { Office as OfficeNotary } from "./Interfaces/Notary/Office"; +export { OfficeFolder as OfficeFolderNotary } from "./Interfaces/Notary/OfficeFolder"; +export { OfficeFolderHasCustomer as OfficeFolderHasCustomerNotary } from "./Interfaces/Notary/OfficeFolderHasCustomer"; +export { OfficeFolderHasStakeholder as OfficeFolderHasStakeholderNotary } from "./Interfaces/Notary/OfficeFolderHasStakeholder"; +export { User as UserNotary } from "./Interfaces/Notary/User"; +export { UserHasNotification as UserHasNotificationNotary } from "./Interfaces/Notary/UserHasNotification"; +/** + * @description Namespace Admin + * It contains all the interfaces and enums for the Admin + */ +export { Address as AddressAdmin } from "./Interfaces/Admin/Address"; +export { Contact as ContactAdmin } from "./Interfaces/Admin/Contact"; +export { Customer as CustomerAdmin } from "./Interfaces/Admin/Customer"; +export { Deed as DeedAdmin } from "./Interfaces/Admin/Deed"; +export { DeedHasDocumentType as DeedHasDocumentTypeAdmin } from "./Interfaces/Admin/DeedHasDocumentType"; +export { DeedType as DeedTypeAdmin } from "./Interfaces/Admin/DeedType"; +export { DeedTypeHasDocumentType as DeedTypeHasDocumentTypeAdmin } from "./Interfaces/Admin/DeedTypeHasDocumentType"; +export { Document as DocumentAdmin } from "./Interfaces/Admin/Document"; +export { DocumentHistory as DocumentHistoryAdmin } from "./Interfaces/Admin/DocumentHistory"; +export { DocumentType as DocumentTypeAdmin } from "./Interfaces/Admin/DocumentType"; +export { File as FileAdmin } from "./Interfaces/Admin/File"; +export { Notification as NotificationAdmin } from "./Interfaces/Admin/Notification"; +export { Office as OfficeAdmin } from "./Interfaces/Admin/Office"; +export { OfficeFolder as OfficeFolderAdmin } from "./Interfaces/Admin/OfficeFolder"; +export { OfficeFolderHasCustomer as OfficeFolderHasCustomerAdmin } from "./Interfaces/Admin/OfficeFolderHasCustomer"; +export { OfficeFolderHasStakeholder as OfficeFolderHasStakeholderAdmin } from "./Interfaces/Admin/OfficeFolderHasStakeholder"; +export { User as UserAdmin } from "./Interfaces/Admin/User"; +export { UserHasNotification as UserHasNotificationAdmin } from "./Interfaces/Admin/UserHasNotification"; +/** + * @description Namespace Client + * It contains all the interfaces and namespaces for the Client + */ +export { Address as AddressClient } from "./Interfaces/Client/Address"; +export { Contact as ContactClient } from "./Interfaces/Client/Contact"; +export { Customer as ClientClient } from "./Interfaces/Client/Customer"; +export { Deed as DeedClient } from "./Interfaces/Client/Deed"; +export { DeedHasDocumentType as DeedHasDocumentTypeClient } from "./Interfaces/Client/DeedHasDocumentType"; +export { DeedType as DeedTypeClient } from "./Interfaces/Client/DeedType"; +export { DeedTypeHasDocumentType as DeedTypeHasDocumentTypeClient } from "./Interfaces/Client/DeedTypeHasDocumentType"; +export { Document as DocumentClient } from "./Interfaces/Client/Document"; +export { DocumentHistory as DocumentHistoryClient } from "./Interfaces/Client/DocumentHistory"; +export { DocumentType as DocumentTypeClient } from "./Interfaces/Client/DocumentType"; +export { File as FileClient } from "./Interfaces/Client/File"; +export { Notification as NotificationClient } from "./Interfaces/Client/Notification"; +export { Office as OfficeClient } from "./Interfaces/Client/Office"; +export { OfficeFolder as OfficeFolderClient } from "./Interfaces/Client/OfficeFolder"; +export { OfficeFolderHasCustomer as OfficeFolderHasClientClient } from "./Interfaces/Client/OfficeFolderHasCustomer"; +export { OfficeFolderHasStakeholder as OfficeFolderHasStakeholderClient } from "./Interfaces/Client/OfficeFolderHasStakeholder"; +export { User as UserClient } from "./Interfaces/Client/User"; +export { UserHasNotification as UserHasNotificationClient } from "./Interfaces/Client/UserHasNotification"; + +/** + * @description Namespace SuperAdmin + * It contains all the interfaces and namespaces for the SuperAdmin + */ +export { Address as AddressSuperAdmin } from "./Interfaces/SuperAdmin/Address"; +export { Contact as ContactSuperAdmin } from "./Interfaces/SuperAdmin/Contact"; +export { Customer as SuperAdminSuperAdmin } from "./Interfaces/SuperAdmin/Customer"; +export { Deed as DeedSuperAdmin } from "./Interfaces/SuperAdmin/Deed"; +export { DeedHasDocumentType as DeedHasDocumentTypeSuperAdmin } from "./Interfaces/SuperAdmin/DeedHasDocumentType"; +export { DeedType as DeedTypeSuperAdmin } from "./Interfaces/SuperAdmin/DeedType"; +export { DeedTypeHasDocumentType as DeedTypeHasDocumentTypeSuperAdmin } from "./Interfaces/SuperAdmin/DeedTypeHasDocumentType"; +export { Document as DocumentSuperAdmin } from "./Interfaces/SuperAdmin/Document"; +export { DocumentHistory as DocumentHistorySuperAdmin } from "./Interfaces/SuperAdmin/DocumentHistory"; +export { DocumentType as DocumentTypeSuperAdmin } from "./Interfaces/SuperAdmin/DocumentType"; +export { File as FileSuperAdmin } from "./Interfaces/SuperAdmin/File"; +export { Notification as NotificationSuperAdmin } from "./Interfaces/SuperAdmin/Notification"; +export { Office as OfficeSuperAdmin } from "./Interfaces/SuperAdmin/Office"; +export { OfficeFolder as OfficeFolderSuperAdmin } from "./Interfaces/SuperAdmin/OfficeFolder"; +export { OfficeFolderHasCustomer as OfficeFolderHasSuperAdminSuperAdmin } from "./Interfaces/SuperAdmin/OfficeFolderHasCustomer"; +export { OfficeFolderHasStakeholder as OfficeFolderHasStakeholderSuperAdmin } from "./Interfaces/SuperAdmin/OfficeFolderHasStakeholder"; +export { User as UserSuperAdmin } from "./Interfaces/SuperAdmin/User"; +export { UserHasNotification as UserHasNotificationSuperAdmin } from "./Interfaces/SuperAdmin/UserHasNotification";