test-entity-library-asm 3.2.3 → 3.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.RequestLocal = void 0;
|
|
13
13
|
var typeorm_1 = require("typeorm");
|
|
14
14
|
var __1 = require("..");
|
|
15
|
+
var dateTransformer_1 = require("../transformers/dateTransformer");
|
|
15
16
|
var RequestLocal = /** @class */ (function () {
|
|
16
17
|
function RequestLocal() {
|
|
17
18
|
}
|
|
@@ -47,6 +48,23 @@ var RequestLocal = /** @class */ (function () {
|
|
|
47
48
|
}),
|
|
48
49
|
__metadata("design:type", Number)
|
|
49
50
|
], RequestLocal.prototype, "status", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, typeorm_1.Column)({
|
|
53
|
+
length: 4,
|
|
54
|
+
nullable: true,
|
|
55
|
+
comment: "Columna para saber cuánto tiempo máximo (minutos) nos tomará en preparar los productos y sus toppings.\r\n\r\nEsta columna viene también al momento de crear.",
|
|
56
|
+
}),
|
|
57
|
+
__metadata("design:type", String)
|
|
58
|
+
], RequestLocal.prototype, "preparation_time", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, typeorm_1.Column)({
|
|
61
|
+
type: "datetime",
|
|
62
|
+
nullable: true,
|
|
63
|
+
comment: "Columna donde almacenamos la fecha de actualización del registro, este campo nos sirve para saber cuánto tiempo llevamos desde qué se actualizó hasta la hora actual.",
|
|
64
|
+
transformer: new dateTransformer_1.DateTransformer(),
|
|
65
|
+
}),
|
|
66
|
+
__metadata("design:type", Date)
|
|
67
|
+
], RequestLocal.prototype, "updated", void 0);
|
|
50
68
|
__decorate([
|
|
51
69
|
(0, typeorm_1.OneToMany)(function () { return __1.RequestLocalHistory; }, function (requestLocalHistory) { return requestLocalHistory.request_local; }),
|
|
52
70
|
__metadata("design:type", Array)
|
|
@@ -46,8 +46,9 @@ var RequestLocalHistory = /** @class */ (function () {
|
|
|
46
46
|
(0, typeorm_1.ManyToOne)(function () { return __1.Partner; }, function (partner) { return partner.updated_by_history; }, {
|
|
47
47
|
onDelete: "CASCADE",
|
|
48
48
|
onUpdate: "NO ACTION",
|
|
49
|
+
nullable: true,
|
|
49
50
|
}),
|
|
50
|
-
(0, typeorm_1.JoinColumn)({ name: "
|
|
51
|
+
(0, typeorm_1.JoinColumn)({ name: "updated_by" }),
|
|
51
52
|
__metadata("design:type", __1.Partner)
|
|
52
53
|
], RequestLocalHistory.prototype, "updated_by", void 0);
|
|
53
54
|
__decorate([
|
package/package.json
CHANGED
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
PrimaryGeneratedColumn,
|
|
8
8
|
} from "typeorm";
|
|
9
9
|
import { Local, Request, RequestLocalHistory } from "..";
|
|
10
|
+
import { DateTransformer } from "../transformers/dateTransformer";
|
|
10
11
|
|
|
11
12
|
@Entity({
|
|
12
13
|
comment: "Tabla para guardar las relaciones de un pedido y los locales",
|
|
@@ -41,6 +42,23 @@ export class RequestLocal {
|
|
|
41
42
|
})
|
|
42
43
|
status: number;
|
|
43
44
|
|
|
45
|
+
@Column({
|
|
46
|
+
length: 4,
|
|
47
|
+
nullable: true,
|
|
48
|
+
comment:
|
|
49
|
+
"Columna para saber cuánto tiempo máximo (minutos) nos tomará en preparar los productos y sus toppings.\r\n\r\nEsta columna viene también al momento de crear.",
|
|
50
|
+
})
|
|
51
|
+
preparation_time: string;
|
|
52
|
+
|
|
53
|
+
@Column({
|
|
54
|
+
type: "datetime",
|
|
55
|
+
nullable: true,
|
|
56
|
+
comment:
|
|
57
|
+
"Columna donde almacenamos la fecha de actualización del registro, este campo nos sirve para saber cuánto tiempo llevamos desde qué se actualizó hasta la hora actual.",
|
|
58
|
+
transformer: new DateTransformer(),
|
|
59
|
+
})
|
|
60
|
+
updated: Date;
|
|
61
|
+
|
|
44
62
|
@OneToMany(
|
|
45
63
|
() => RequestLocalHistory,
|
|
46
64
|
(requestLocalHistory) => requestLocalHistory.request_local
|
|
@@ -43,8 +43,9 @@ export class RequestLocalHistory {
|
|
|
43
43
|
@ManyToOne(() => Partner, (partner) => partner.updated_by_history, {
|
|
44
44
|
onDelete: "CASCADE",
|
|
45
45
|
onUpdate: "NO ACTION",
|
|
46
|
+
nullable: true,
|
|
46
47
|
})
|
|
47
|
-
@JoinColumn({ name: "
|
|
48
|
+
@JoinColumn({ name: "updated_by" })
|
|
48
49
|
updated_by: Partner;
|
|
49
50
|
|
|
50
51
|
@Column({
|