add interfaces for entities
This commit is contained in:
parent
c09774ded9
commit
7842fadd3e
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
dist
|
||||||
|
node_modules
|
@ -1,2 +1,2 @@
|
|||||||
# leCoffre-resources
|
# leCoffre-resources
|
||||||
[owner: Arnaud Dauber] Le Coffre resources
|
[owner: Arnaud Dauber] Le Coffre shared resources between back-end and front-end
|
||||||
|
2257
package-lock.json
generated
Normal file
2257
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
35
package.json
Normal file
35
package.json
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
{
|
||||||
|
"name": "le-coffre-ressources",
|
||||||
|
"description": "lecoffre ressources",
|
||||||
|
"keywords": [
|
||||||
|
"le-coffre-ressources-package"
|
||||||
|
],
|
||||||
|
"license": "MIT",
|
||||||
|
"homepage": "",
|
||||||
|
"author": {
|
||||||
|
"name": "Smart-chain",
|
||||||
|
"email": "team.fullstack@smart-chain.fr"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/smart-chain-fr/leCoffre-resources"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"build": "tsc",
|
||||||
|
"format": "prettier --write src"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"dist"
|
||||||
|
],
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/node": "^18.11.9",
|
||||||
|
"eslint-plugin-n8n-nodes-base": "^1.5.4",
|
||||||
|
"prettier": "^2.7.1",
|
||||||
|
"ts-node": "^10.9.1",
|
||||||
|
"tslint": "^6.1.2",
|
||||||
|
"typescript": "~4.6.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"class-validator": "^0.14.0"
|
||||||
|
}
|
||||||
|
}
|
34
src/Interfaces/Enums.ts
Normal file
34
src/Interfaces/Enums.ts
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
export enum ECivility {
|
||||||
|
MALE,
|
||||||
|
FEMALE,
|
||||||
|
OTHERS,
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum EFolderStatus {
|
||||||
|
LIVE,
|
||||||
|
ARCHIVED,
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum EOfficeStatus {
|
||||||
|
ACTIVATED,
|
||||||
|
DESACTIVATED,
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum ENotificationStatus {
|
||||||
|
READ,
|
||||||
|
UNREAD,
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum ECustomerStatus {
|
||||||
|
VALIDATED,
|
||||||
|
PENDING,
|
||||||
|
ERRONED,
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum EDocumentStatus {
|
||||||
|
ASKED,
|
||||||
|
DEPOSITED,
|
||||||
|
VALIDATED,
|
||||||
|
ANCHORED,
|
||||||
|
REFUSED,
|
||||||
|
}
|
29
src/Interfaces/IAddress.ts
Normal file
29
src/Interfaces/IAddress.ts
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
@IsDate()
|
||||||
|
public updated_at?: Date;
|
||||||
|
|
||||||
|
@IsOptional()
|
||||||
|
public office?: IOffice;
|
||||||
|
|
||||||
|
@IsOptional()
|
||||||
|
public contacts?: IContact;
|
||||||
|
}
|
19
src/Interfaces/IBlockchainAnchors.ts
Normal file
19
src/Interfaces/IBlockchainAnchors.ts
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
@IsDate()
|
||||||
|
public updated_at?: Date;
|
||||||
|
|
||||||
|
@IsOptional()
|
||||||
|
public documents?: IDocument[];
|
||||||
|
}
|
43
src/Interfaces/IContact.ts
Normal file
43
src/Interfaces/IContact.ts
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
import { IsNotEmpty, IsDate, IsOptional, IsEnum } from "class-validator";
|
||||||
|
import { ECivility } from "./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!: Date;
|
||||||
|
|
||||||
|
@IsOptional()
|
||||||
|
public cell_phone_number!: Date;
|
||||||
|
|
||||||
|
@IsEnum(ECivility)
|
||||||
|
public civility!: ECivility;
|
||||||
|
|
||||||
|
@IsNotEmpty({ groups: ["create"] })
|
||||||
|
public address!: IAddress;
|
||||||
|
|
||||||
|
@IsDate()
|
||||||
|
public created_at?: Date;
|
||||||
|
|
||||||
|
@IsDate()
|
||||||
|
public updated_at?: Date;
|
||||||
|
|
||||||
|
@IsOptional()
|
||||||
|
public users?: IUser;
|
||||||
|
|
||||||
|
@IsOptional()
|
||||||
|
public customers?: ICustomer;
|
||||||
|
}
|
28
src/Interfaces/ICustomer.ts
Normal file
28
src/Interfaces/ICustomer.ts
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
import { IsNotEmpty, IsDate, IsEnum, IsOptional } from "class-validator";
|
||||||
|
import IContact from "./IContact";
|
||||||
|
import { ECustomerStatus } from "./Enums";
|
||||||
|
import IDocument from "./IDocument";
|
||||||
|
import IOfficeFolderHasCustomer from "./IOfficeFolderHasCustomer";
|
||||||
|
|
||||||
|
export default class ICustomer {
|
||||||
|
@IsNotEmpty()
|
||||||
|
public uuid!: string;
|
||||||
|
|
||||||
|
@IsEnum(ECustomerStatus)
|
||||||
|
public status!: ECustomerStatus;
|
||||||
|
|
||||||
|
@IsNotEmpty({ groups: ["create"] })
|
||||||
|
public contact!: IContact;
|
||||||
|
|
||||||
|
@IsDate()
|
||||||
|
public created_at?: Date;
|
||||||
|
|
||||||
|
@IsDate()
|
||||||
|
public updated_at?: Date;
|
||||||
|
|
||||||
|
@IsOptional()
|
||||||
|
office_folder_has_customers?: IOfficeFolderHasCustomer[];
|
||||||
|
|
||||||
|
@IsOptional()
|
||||||
|
documents?: IDocument[];
|
||||||
|
}
|
24
src/Interfaces/IDeed.ts
Normal file
24
src/Interfaces/IDeed.ts
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
import { IsNotEmpty, IsDate, IsOptional } from "class-validator";
|
||||||
|
import IOfficeFolder from "./IOfficeFolder";
|
||||||
|
import IDeedHasDocumentType from "./IDeedHasDocumentType";
|
||||||
|
import IDeedType from "./IDeedType";
|
||||||
|
|
||||||
|
export default class IDeed {
|
||||||
|
@IsNotEmpty()
|
||||||
|
public uuid!: string;
|
||||||
|
|
||||||
|
@IsNotEmpty({ groups: ["create"] })
|
||||||
|
public deed_type!: IDeedType;
|
||||||
|
|
||||||
|
@IsDate()
|
||||||
|
public created_at?: Date;
|
||||||
|
|
||||||
|
@IsDate()
|
||||||
|
public updated_at?: Date;
|
||||||
|
|
||||||
|
@IsOptional()
|
||||||
|
public deed_has_document_types?: IDeedHasDocumentType[];
|
||||||
|
|
||||||
|
@IsOptional()
|
||||||
|
public office_folder?: IOfficeFolder;
|
||||||
|
}
|
20
src/Interfaces/IDeedHasDocumentType.ts
Normal file
20
src/Interfaces/IDeedHasDocumentType.ts
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
@IsDate()
|
||||||
|
public updated_at?: Date;
|
||||||
|
}
|
35
src/Interfaces/IDeedType.ts
Normal file
35
src/Interfaces/IDeedType.ts
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
import { IsNotEmpty, IsDate, IsOptional } from "class-validator";
|
||||||
|
import IDeedTypeHasDocumentType from "./IDeedTypeHasDocumentType";
|
||||||
|
|
||||||
|
import IOffice from "./IOffice";
|
||||||
|
import IDeed from "./IDeed";
|
||||||
|
|
||||||
|
export default class IDeedType {
|
||||||
|
@IsNotEmpty()
|
||||||
|
public uuid!: string;
|
||||||
|
|
||||||
|
@IsNotEmpty({ groups: ["create"] })
|
||||||
|
public name!: string;
|
||||||
|
|
||||||
|
@IsNotEmpty({ groups: ["create"] })
|
||||||
|
public description!: string;
|
||||||
|
|
||||||
|
@IsNotEmpty({ groups: ["create"] })
|
||||||
|
@IsDate()
|
||||||
|
public archived_at!: Date;
|
||||||
|
|
||||||
|
@IsNotEmpty({ groups: ["create"] })
|
||||||
|
public office!: IOffice;
|
||||||
|
|
||||||
|
@IsDate()
|
||||||
|
public created_at?: Date;
|
||||||
|
|
||||||
|
@IsDate()
|
||||||
|
public updated_at?: Date;
|
||||||
|
|
||||||
|
@IsOptional()
|
||||||
|
public deed?: IDeed[];
|
||||||
|
|
||||||
|
@IsOptional()
|
||||||
|
public deed_type_has_document_types?: IDeedTypeHasDocumentType[];
|
||||||
|
}
|
20
src/Interfaces/IDeedTypeHasDocumentType.ts
Normal file
20
src/Interfaces/IDeedTypeHasDocumentType.ts
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
import { IsNotEmpty, IsDate } from "class-validator";
|
||||||
|
import IDeedType from "./IDeedType";
|
||||||
|
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;
|
||||||
|
|
||||||
|
@IsDate()
|
||||||
|
public updated_at?: Date;
|
||||||
|
}
|
41
src/Interfaces/IDocument.ts
Normal file
41
src/Interfaces/IDocument.ts
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
import { IsNotEmpty, IsDate, IsEnum, IsOptional } from "class-validator";
|
||||||
|
import ICustomer from "./ICustomer";
|
||||||
|
import { EDocumentStatus } from "./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"] })
|
||||||
|
@IsEnum(EDocumentStatus)
|
||||||
|
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;
|
||||||
|
|
||||||
|
@IsDate()
|
||||||
|
public updated_at?: Date;
|
||||||
|
|
||||||
|
@IsOptional()
|
||||||
|
public files?: IFile[];
|
||||||
|
|
||||||
|
@IsOptional()
|
||||||
|
public document_history?: IDocumentHistory[];
|
||||||
|
}
|
24
src/Interfaces/IDocumentHistory.ts
Normal file
24
src/Interfaces/IDocumentHistory.ts
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
import { IsNotEmpty, IsDate, IsEnum, IsOptional } from "class-validator";
|
||||||
|
import { EDocumentStatus } from "./Enums";
|
||||||
|
import IDocument from "./IDocument";
|
||||||
|
|
||||||
|
export default class IDocumentHistory {
|
||||||
|
@IsNotEmpty()
|
||||||
|
public uuid!: string;
|
||||||
|
|
||||||
|
@IsNotEmpty({ groups: ["create"] })
|
||||||
|
@IsEnum(EDocumentStatus)
|
||||||
|
public document_status!: EDocumentStatus;
|
||||||
|
|
||||||
|
@IsNotEmpty({ groups: ["create"] })
|
||||||
|
public document!: IDocument;
|
||||||
|
|
||||||
|
@IsOptional()
|
||||||
|
public refused_reason?: string;
|
||||||
|
|
||||||
|
@IsDate()
|
||||||
|
public created_at?: Date;
|
||||||
|
|
||||||
|
@IsDate()
|
||||||
|
public updated_at?: Date;
|
||||||
|
}
|
37
src/Interfaces/IDocumentType.ts
Normal file
37
src/Interfaces/IDocumentType.ts
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
@IsOptional()
|
||||||
|
@IsDate()
|
||||||
|
public archived_at?: Date;
|
||||||
|
|
||||||
|
@IsDate()
|
||||||
|
public created_at?: Date;
|
||||||
|
|
||||||
|
@IsDate()
|
||||||
|
public updated_at?: Date;
|
||||||
|
|
||||||
|
@IsOptional()
|
||||||
|
public documents?: IDocument[];
|
||||||
|
|
||||||
|
@IsOptional()
|
||||||
|
public deed_has_document_types?: IDeedHasDocumentType[];
|
||||||
|
|
||||||
|
@IsOptional()
|
||||||
|
public deed_type_has_document_types?: IDeedTypeHasDocumentType[];
|
||||||
|
}
|
19
src/Interfaces/IFile.ts
Normal file
19
src/Interfaces/IFile.ts
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
@IsDate()
|
||||||
|
public created_at?: Date;
|
||||||
|
|
||||||
|
@IsDate()
|
||||||
|
public updated_at?: Date;
|
||||||
|
}
|
23
src/Interfaces/INotification.ts
Normal file
23
src/Interfaces/INotification.ts
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
@IsDate()
|
||||||
|
public updated_at?: Date;
|
||||||
|
|
||||||
|
@IsOptional()
|
||||||
|
user_has_notifications?: IUserHasNotification[];
|
||||||
|
}
|
42
src/Interfaces/IOffice.ts
Normal file
42
src/Interfaces/IOffice.ts
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
import { IsNotEmpty, IsDate, IsEnum, IsOptional } from "class-validator";
|
||||||
|
import IAddress from "./IAddress";
|
||||||
|
import { EOfficeStatus } from "./Enums";
|
||||||
|
import IUser from "./IUser";
|
||||||
|
import IOfficeFolder from "./IOfficeFolder";
|
||||||
|
import IDeedType from "./IDeedType";
|
||||||
|
|
||||||
|
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"] })
|
||||||
|
@IsEnum(EOfficeStatus)
|
||||||
|
public office_status!: EOfficeStatus;
|
||||||
|
|
||||||
|
@IsDate()
|
||||||
|
public created_at?: Date;
|
||||||
|
|
||||||
|
@IsDate()
|
||||||
|
public updated_at?: Date;
|
||||||
|
|
||||||
|
@IsOptional()
|
||||||
|
deed_types?: IDeedType[];
|
||||||
|
|
||||||
|
@IsOptional()
|
||||||
|
users?: IUser[];
|
||||||
|
|
||||||
|
@IsOptional()
|
||||||
|
office_folders?: IOfficeFolder[];
|
||||||
|
}
|
49
src/Interfaces/IOfficeFolder.ts
Normal file
49
src/Interfaces/IOfficeFolder.ts
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
import { IsNotEmpty, IsDate, IsEnum, IsOptional } from "class-validator";
|
||||||
|
import { EFolderStatus } from "./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;
|
||||||
|
|
||||||
|
@IsOptional()
|
||||||
|
public archived_description?: string;
|
||||||
|
|
||||||
|
@IsNotEmpty({ groups: ["create"] })
|
||||||
|
@IsEnum(EFolderStatus)
|
||||||
|
public status!: EFolderStatus;
|
||||||
|
|
||||||
|
@IsNotEmpty({ groups: ["create"] })
|
||||||
|
public deed!: IDeed;
|
||||||
|
|
||||||
|
@IsNotEmpty({ groups: ["create"] })
|
||||||
|
public office!: IOffice;
|
||||||
|
|
||||||
|
@IsDate()
|
||||||
|
public created_at?: Date;
|
||||||
|
|
||||||
|
@IsDate()
|
||||||
|
public updated_at?: Date;
|
||||||
|
|
||||||
|
@IsOptional()
|
||||||
|
office_folder_has_customers?: IOfficeFolderHasCustomer[];
|
||||||
|
|
||||||
|
@IsOptional()
|
||||||
|
office_folder_has_stakeholder?: IOfficeFolderHasStakeholder[];
|
||||||
|
|
||||||
|
@IsOptional()
|
||||||
|
documents?: IDocument[];
|
||||||
|
}
|
20
src/Interfaces/IOfficeFolderHasCustomer.ts
Normal file
20
src/Interfaces/IOfficeFolderHasCustomer.ts
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
@IsDate()
|
||||||
|
public updated_at?: Date;
|
||||||
|
}
|
20
src/Interfaces/IOfficeFolderHasStakeholder.ts
Normal file
20
src/Interfaces/IOfficeFolderHasStakeholder.ts
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
@IsDate()
|
||||||
|
public updated_at?: Date;
|
||||||
|
}
|
31
src/Interfaces/IUser.ts
Normal file
31
src/Interfaces/IUser.ts
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
@IsDate()
|
||||||
|
public updated_at?: Date;
|
||||||
|
|
||||||
|
@IsOptional()
|
||||||
|
office_folder_has_stakeholders?: IOfficeFolderHasStakeholder[];
|
||||||
|
|
||||||
|
@IsOptional()
|
||||||
|
documents?: IDocument;
|
||||||
|
}
|
20
src/Interfaces/IUserHasNotification.ts
Normal file
20
src/Interfaces/IUserHasNotification.ts
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
@IsDate()
|
||||||
|
public updated_at?: Date;
|
||||||
|
}
|
48
tsconfig.json
Normal file
48
tsconfig.json
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"emitDecoratorMetadata": true,
|
||||||
|
"experimentalDecorators": true,
|
||||||
|
"lib": [
|
||||||
|
"es2017",
|
||||||
|
"es2019"
|
||||||
|
],
|
||||||
|
"types": [
|
||||||
|
"node"
|
||||||
|
],
|
||||||
|
"module": "commonjs",
|
||||||
|
"noImplicitAny": true,
|
||||||
|
"removeComments": true,
|
||||||
|
"strictNullChecks": true,
|
||||||
|
"strict": true,
|
||||||
|
"preserveConstEnums": true,
|
||||||
|
"resolveJsonModule": true,
|
||||||
|
"declaration": true,
|
||||||
|
"outDir": "./dist",
|
||||||
|
"target": "es2019",
|
||||||
|
"sourceMap": true,
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"useUnknownInCatchVariables": false,
|
||||||
|
"allowUnreachableCode": false,
|
||||||
|
"allowUnusedLabels": false,
|
||||||
|
"exactOptionalPropertyTypes": true,
|
||||||
|
"noImplicitOverride": true,
|
||||||
|
"strictFunctionTypes": true,
|
||||||
|
"strictBindCallApply": true,
|
||||||
|
"strictPropertyInitialization": true,
|
||||||
|
"noImplicitThis": true,
|
||||||
|
"alwaysStrict": true,
|
||||||
|
"noPropertyAccessFromIndexSignature": true,
|
||||||
|
"noUnusedLocals": true,
|
||||||
|
"noImplicitReturns": true,
|
||||||
|
"noUncheckedIndexedAccess": true,
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"forceConsistentCasingInFileNames": true,
|
||||||
|
},
|
||||||
|
"include": [
|
||||||
|
"src/**/*",
|
||||||
|
"src/**/*.json",
|
||||||
|
],
|
||||||
|
"exclude": [
|
||||||
|
"node_modules"
|
||||||
|
]
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user