File Notary
This commit is contained in:
parent
a320ed8759
commit
a78a2f4199
3
dist/Notary/DocumentNotary.d.ts
vendored
3
dist/Notary/DocumentNotary.d.ts
vendored
@ -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[];
|
||||
|
10
dist/Notary/DocumentNotary.js
vendored
10
dist/Notary/DocumentNotary.js
vendored
@ -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)(),
|
||||
|
13
dist/Notary/FileNotary.d.ts
vendored
Normal file
13
dist/Notary/FileNotary.d.ts
vendored
Normal file
@ -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;
|
||||
}
|
66
dist/Notary/FileNotary.js
vendored
Normal file
66
dist/Notary/FileNotary.js
vendored
Normal file
@ -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;
|
@ -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;
|
||||
|
37
src/Notary/FileNotary.ts
Normal file
37
src/Notary/FileNotary.ts
Normal file
@ -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;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user