diff --git a/dist/Notary/DocumentNotary.d.ts b/dist/Notary/DocumentNotary.d.ts index 74e901f..62d6a59 100644 --- a/dist/Notary/DocumentNotary.d.ts +++ b/dist/Notary/DocumentNotary.d.ts @@ -2,10 +2,13 @@ import File from "./File"; import OfficeFolder from "./OfficeFolder"; import Resource from "../Resource"; import User from "."; +import Customer from "../Customer"; export default class Document extends Resource { uid?: string; + name: string; folder?: OfficeFolder; depositor?: User; + customer?: Customer; created_at: Date | null; updated_at: Date | null; files?: File[]; diff --git a/dist/Notary/DocumentNotary.js b/dist/Notary/DocumentNotary.js index 729f16e..acadc2f 100644 --- a/dist/Notary/DocumentNotary.js +++ b/dist/Notary/DocumentNotary.js @@ -18,6 +18,7 @@ const OfficeFolder_1 = __importDefault(require("./OfficeFolder")); const Resource_1 = __importDefault(require("../Resource")); const class_transformer_1 = require("class-transformer"); const _1 = __importDefault(require(".")); +const Customer_1 = __importDefault(require("../Customer")); class Document extends Resource_1.default { constructor() { super(...arguments); @@ -30,6 +31,10 @@ __decorate([ (0, class_validator_1.IsNotEmpty)({ groups: ["createFile"], message: "UID is required" }), __metadata("design:type", String) ], Document.prototype, "uid", void 0); +__decorate([ + (0, class_transformer_1.Expose)(), + __metadata("design:type", String) +], Document.prototype, "name", void 0); __decorate([ (0, class_transformer_1.Expose)(), (0, class_transformer_1.Type)(() => OfficeFolder_1.default), @@ -40,6 +45,11 @@ __decorate([ (0, class_transformer_1.Type)(() => _1.default), __metadata("design:type", _1.default) ], Document.prototype, "depositor", void 0); +__decorate([ + (0, class_transformer_1.Expose)(), + (0, class_transformer_1.Type)(() => Customer_1.default), + __metadata("design:type", Customer_1.default) +], Document.prototype, "customer", void 0); __decorate([ (0, class_transformer_1.Expose)(), (0, class_validator_1.IsDate)(), diff --git a/dist/Notary/FileNotary.d.ts b/dist/Notary/FileNotary.d.ts new file mode 100644 index 0000000..0e6b135 --- /dev/null +++ b/dist/Notary/FileNotary.d.ts @@ -0,0 +1,13 @@ +import Resource from "../Resource"; +import { DocumentNotary } from "."; +export default class FileNotary extends Resource { + uid?: string; + document?: DocumentNotary; + file_name: string; + file_path: string; + mimetype: string; + hash: string; + size: number; + created_at: Date | null; + updated_at: Date | null; +} diff --git a/dist/Notary/FileNotary.js b/dist/Notary/FileNotary.js new file mode 100644 index 0000000..56698ec --- /dev/null +++ b/dist/Notary/FileNotary.js @@ -0,0 +1,66 @@ +"use strict"; +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const class_validator_1 = require("class-validator"); +const Document_1 = __importDefault(require("./Document")); +const Resource_1 = __importDefault(require("../Resource")); +const class_transformer_1 = require("class-transformer"); +const _1 = require("."); +class FileNotary extends Resource_1.default { + constructor() { + super(...arguments); + this.created_at = null; + this.updated_at = null; + } +} +__decorate([ + (0, class_transformer_1.Expose)(), + __metadata("design:type", String) +], FileNotary.prototype, "uid", void 0); +__decorate([ + (0, class_transformer_1.Expose)(), + (0, class_transformer_1.Type)(() => Document_1.default), + __metadata("design:type", _1.DocumentNotary) +], FileNotary.prototype, "document", void 0); +__decorate([ + (0, class_transformer_1.Expose)(), + __metadata("design:type", String) +], FileNotary.prototype, "file_name", void 0); +__decorate([ + (0, class_transformer_1.Expose)(), + __metadata("design:type", String) +], FileNotary.prototype, "file_path", void 0); +__decorate([ + (0, class_transformer_1.Expose)(), + __metadata("design:type", String) +], FileNotary.prototype, "mimetype", void 0); +__decorate([ + (0, class_transformer_1.Expose)(), + __metadata("design:type", String) +], FileNotary.prototype, "hash", void 0); +__decorate([ + (0, class_transformer_1.Expose)(), + __metadata("design:type", Number) +], FileNotary.prototype, "size", void 0); +__decorate([ + (0, class_transformer_1.Expose)(), + (0, class_validator_1.IsDate)(), + __metadata("design:type", Object) +], FileNotary.prototype, "created_at", void 0); +__decorate([ + (0, class_transformer_1.Expose)(), + (0, class_validator_1.IsDate)(), + __metadata("design:type", Object) +], FileNotary.prototype, "updated_at", void 0); +exports.default = FileNotary; diff --git a/src/Notary/DocumentNotary.ts b/src/Notary/DocumentNotary.ts index 13831fd..6e05833 100644 --- a/src/Notary/DocumentNotary.ts +++ b/src/Notary/DocumentNotary.ts @@ -4,12 +4,16 @@ import OfficeFolder from "./OfficeFolder"; import Resource from "../Resource"; import { Expose, Type } from "class-transformer"; import User from "."; +import Customer from "../Customer"; export default class Document extends Resource { @Expose() @IsNotEmpty({ groups: ["createFile"], message: "UID is required" }) public uid?: string; + @Expose() + public name!: string; + @Expose() @Type(() => OfficeFolder) public folder?: OfficeFolder; @@ -18,6 +22,10 @@ export default class Document extends Resource { @Type(() => User) public depositor?: User; + @Expose() + @Type(() => Customer) + public customer?: Customer; + @Expose() @IsDate() public created_at: Date | null = null; diff --git a/src/Notary/FileNotary.ts b/src/Notary/FileNotary.ts new file mode 100644 index 0000000..7bdac1c --- /dev/null +++ b/src/Notary/FileNotary.ts @@ -0,0 +1,37 @@ +import { IsDate } from "class-validator"; +import Document from "./Document"; +import Resource from "../Resource"; +import { Expose, Type } from "class-transformer"; +import { DocumentNotary } from "."; + +export default class FileNotary extends Resource { + @Expose() + public uid?: string; + + @Expose() + @Type(() => Document) + public document?: DocumentNotary; + + @Expose() + public file_name!: string; + + @Expose() + public file_path!: string; + + @Expose() + public mimetype!: string; + + @Expose() + public hash!: string; + + @Expose() + public size!: number; + + @Expose() + @IsDate() + public created_at: Date | null = null; + + @Expose() + @IsDate() + public updated_at: Date | null = null; +}