test-entity-library-asm 2.7.18 → 2.7.19
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.
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { DiscountCodeCompany } from './DiscountCodeCompany';
|
|
2
|
+
import { Master } from './Master';
|
|
2
3
|
export declare class ServicePlan {
|
|
3
4
|
id_service_plan: number;
|
|
4
5
|
name: string;
|
|
@@ -11,5 +12,8 @@ export declare class ServicePlan {
|
|
|
11
12
|
time_periods: string | null;
|
|
12
13
|
assigned_discount: number | null;
|
|
13
14
|
information_general: any;
|
|
15
|
+
created: Date;
|
|
16
|
+
updated: Date;
|
|
14
17
|
discount: DiscountCodeCompany | null;
|
|
18
|
+
updated_by: Master;
|
|
15
19
|
}
|
|
@@ -13,6 +13,8 @@ exports.ServicePlan = void 0;
|
|
|
13
13
|
var typeorm_1 = require("typeorm");
|
|
14
14
|
var DiscountCodeCompany_1 = require("./DiscountCodeCompany"); // Asegúrate de ajustar el path al modelo correspondiente
|
|
15
15
|
var jsonTransformer_1 = require("../transformers/jsonTransformer");
|
|
16
|
+
var dateTransformer_1 = require("../transformers/dateTransformer");
|
|
17
|
+
var Master_1 = require("./Master");
|
|
16
18
|
var ServicePlan = /** @class */ (function () {
|
|
17
19
|
function ServicePlan() {
|
|
18
20
|
}
|
|
@@ -60,6 +62,22 @@ var ServicePlan = /** @class */ (function () {
|
|
|
60
62
|
(0, typeorm_1.Column)({ type: 'longtext', nullable: true, transformer: jsonTransformer_1.jsonTransformer }),
|
|
61
63
|
__metadata("design:type", Object)
|
|
62
64
|
], ServicePlan.prototype, "information_general", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, typeorm_1.Column)({
|
|
67
|
+
type: 'datetime',
|
|
68
|
+
transformer: new dateTransformer_1.DateTransformer(),
|
|
69
|
+
comment: 'Fecha de creación del registro.',
|
|
70
|
+
}),
|
|
71
|
+
__metadata("design:type", Date)
|
|
72
|
+
], ServicePlan.prototype, "created", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
(0, typeorm_1.Column)({
|
|
75
|
+
type: 'datetime',
|
|
76
|
+
transformer: new dateTransformer_1.DateTransformer(),
|
|
77
|
+
comment: 'Fecha de creación de actualizacion.',
|
|
78
|
+
}),
|
|
79
|
+
__metadata("design:type", Date)
|
|
80
|
+
], ServicePlan.prototype, "updated", void 0);
|
|
63
81
|
__decorate([
|
|
64
82
|
(0, typeorm_1.ManyToOne)(function () { return DiscountCodeCompany_1.DiscountCodeCompany; }, function (discount) { return discount.servicePlans; }, {
|
|
65
83
|
onDelete: 'CASCADE',
|
|
@@ -68,6 +86,15 @@ var ServicePlan = /** @class */ (function () {
|
|
|
68
86
|
(0, typeorm_1.JoinColumn)({ name: 'assigned_discount' }),
|
|
69
87
|
__metadata("design:type", Object)
|
|
70
88
|
], ServicePlan.prototype, "discount", void 0);
|
|
89
|
+
__decorate([
|
|
90
|
+
(0, typeorm_1.ManyToOne)(function () { return Master_1.Master; }, function (master) { return master.id; }, {
|
|
91
|
+
onDelete: 'SET NULL',
|
|
92
|
+
onUpdate: 'CASCADE',
|
|
93
|
+
nullable: true,
|
|
94
|
+
}),
|
|
95
|
+
(0, typeorm_1.JoinColumn)({ name: 'updated_by' }),
|
|
96
|
+
__metadata("design:type", Master_1.Master)
|
|
97
|
+
], ServicePlan.prototype, "updated_by", void 0);
|
|
71
98
|
ServicePlan = __decorate([
|
|
72
99
|
(0, typeorm_1.Entity)('service_plan'),
|
|
73
100
|
(0, typeorm_1.Unique)(['code'])
|
package/package.json
CHANGED
|
@@ -8,6 +8,8 @@ import {
|
|
|
8
8
|
} from 'typeorm'
|
|
9
9
|
import { DiscountCodeCompany } from './DiscountCodeCompany' // Asegúrate de ajustar el path al modelo correspondiente
|
|
10
10
|
import { jsonTransformer } from '../transformers/jsonTransformer'
|
|
11
|
+
import { DateTransformer } from '../transformers/dateTransformer'
|
|
12
|
+
import { Master } from './Master'
|
|
11
13
|
|
|
12
14
|
@Entity('service_plan')
|
|
13
15
|
@Unique(['code'])
|
|
@@ -45,10 +47,34 @@ export class ServicePlan {
|
|
|
45
47
|
@Column({ type: 'longtext', nullable: true, transformer: jsonTransformer })
|
|
46
48
|
information_general: any
|
|
47
49
|
|
|
50
|
+
@Column({
|
|
51
|
+
type: 'datetime',
|
|
52
|
+
transformer: new DateTransformer(),
|
|
53
|
+
comment: 'Fecha de creación del registro.',
|
|
54
|
+
})
|
|
55
|
+
created: Date
|
|
56
|
+
|
|
57
|
+
@Column({
|
|
58
|
+
type: 'datetime',
|
|
59
|
+
transformer: new DateTransformer(),
|
|
60
|
+
comment: 'Fecha de creación de actualizacion.',
|
|
61
|
+
})
|
|
62
|
+
updated: Date
|
|
63
|
+
|
|
48
64
|
@ManyToOne(() => DiscountCodeCompany, (discount) => discount.servicePlans, {
|
|
49
65
|
onDelete: 'CASCADE',
|
|
50
66
|
onUpdate: 'CASCADE',
|
|
51
67
|
})
|
|
68
|
+
|
|
52
69
|
@JoinColumn({ name: 'assigned_discount' })
|
|
53
70
|
discount: DiscountCodeCompany | null;
|
|
71
|
+
|
|
72
|
+
@ManyToOne(() => Master, (master) => master.id, {
|
|
73
|
+
onDelete: 'SET NULL',
|
|
74
|
+
onUpdate: 'CASCADE',
|
|
75
|
+
nullable: true,
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
@JoinColumn({ name: 'updated_by' })
|
|
79
|
+
updated_by: Master;
|
|
54
80
|
}
|