test-entity-library-asm 2.7.19 → 2.8.0
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.
- package/dist/entities/DiscountCodeCompany.d.ts +0 -2
- package/dist/entities/DiscountCodeCompany.js +0 -5
- package/dist/entities/ServiceDiscountsPlan.d.ts +7 -0
- package/dist/entities/ServiceDiscountsPlan.js +46 -0
- package/dist/entities/ServicePlan.d.ts +0 -2
- package/dist/entities/ServicePlan.js +1 -10
- package/package.json +1 -1
- package/src/entities/DiscountCodeCompany.ts +0 -3
- package/src/entities/ServiceDiscountsPlan.ts +25 -0
- package/src/entities/ServicePlan.ts +1 -9
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { CodeRedemptionHistoryCompany } from './CodeRedemptionHistoryCompany';
|
|
2
2
|
import { Master } from './Master';
|
|
3
|
-
import { ServicePlan } from './ServicePlan';
|
|
4
3
|
export declare class DiscountCodeCompany {
|
|
5
4
|
id: number;
|
|
6
5
|
code: string;
|
|
@@ -16,5 +15,4 @@ export declare class DiscountCodeCompany {
|
|
|
16
15
|
status: number;
|
|
17
16
|
updated_by: Master;
|
|
18
17
|
code_redemptions_history_company: CodeRedemptionHistoryCompany[];
|
|
19
|
-
servicePlans: ServicePlan[];
|
|
20
18
|
}
|
|
@@ -15,7 +15,6 @@ var dateTransformer_1 = require("../transformers/dateTransformer");
|
|
|
15
15
|
var jsonTransformer_1 = require("../transformers/jsonTransformer");
|
|
16
16
|
var CodeRedemptionHistoryCompany_1 = require("./CodeRedemptionHistoryCompany");
|
|
17
17
|
var Master_1 = require("./Master");
|
|
18
|
-
var ServicePlan_1 = require("./ServicePlan");
|
|
19
18
|
var DiscountCodeCompany = /** @class */ (function () {
|
|
20
19
|
function DiscountCodeCompany() {
|
|
21
20
|
}
|
|
@@ -116,10 +115,6 @@ var DiscountCodeCompany = /** @class */ (function () {
|
|
|
116
115
|
}),
|
|
117
116
|
__metadata("design:type", Array)
|
|
118
117
|
], DiscountCodeCompany.prototype, "code_redemptions_history_company", void 0);
|
|
119
|
-
__decorate([
|
|
120
|
-
(0, typeorm_1.OneToMany)(function () { return ServicePlan_1.ServicePlan; }, function (servicePlan) { return servicePlan.discount; }),
|
|
121
|
-
__metadata("design:type", Array)
|
|
122
|
-
], DiscountCodeCompany.prototype, "servicePlans", void 0);
|
|
123
118
|
DiscountCodeCompany = __decorate([
|
|
124
119
|
(0, typeorm_1.Entity)('discount_code_company', {
|
|
125
120
|
comment: 'Códigos de descuento para las empresas.',
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
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;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ServiceDiscountsPlan = void 0;
|
|
13
|
+
var typeorm_1 = require("typeorm");
|
|
14
|
+
var ServicePlan_1 = require("./ServicePlan");
|
|
15
|
+
var DiscountCodeCompany_1 = require("./DiscountCodeCompany");
|
|
16
|
+
var ServiceDiscountsPlan = /** @class */ (function () {
|
|
17
|
+
function ServiceDiscountsPlan() {
|
|
18
|
+
}
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, typeorm_1.PrimaryGeneratedColumn)(),
|
|
21
|
+
__metadata("design:type", Number)
|
|
22
|
+
], ServiceDiscountsPlan.prototype, "id", void 0);
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, typeorm_1.ManyToOne)(function () { return ServicePlan_1.ServicePlan; }, function (servicePlan) { return servicePlan.id_service_plan; }, {
|
|
25
|
+
onDelete: 'CASCADE',
|
|
26
|
+
onUpdate: 'CASCADE',
|
|
27
|
+
}),
|
|
28
|
+
(0, typeorm_1.JoinColumn)({ name: 'id_service_plan' }),
|
|
29
|
+
__metadata("design:type", Object)
|
|
30
|
+
], ServiceDiscountsPlan.prototype, "servicePlan", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, typeorm_1.ManyToOne)(function () { return DiscountCodeCompany_1.DiscountCodeCompany; }, function (discountCodeCompany) { return discountCodeCompany.discount; }, {
|
|
33
|
+
onDelete: 'CASCADE',
|
|
34
|
+
onUpdate: 'CASCADE',
|
|
35
|
+
}),
|
|
36
|
+
(0, typeorm_1.JoinColumn)({ name: 'id_discount' }),
|
|
37
|
+
__metadata("design:type", Object)
|
|
38
|
+
], ServiceDiscountsPlan.prototype, "discount", void 0);
|
|
39
|
+
ServiceDiscountsPlan = __decorate([
|
|
40
|
+
(0, typeorm_1.Entity)('service_discounts_plan', {
|
|
41
|
+
comment: 'Entidad que enlaza un plan de servicio con un código de descuento de una empresa',
|
|
42
|
+
})
|
|
43
|
+
], ServiceDiscountsPlan);
|
|
44
|
+
return ServiceDiscountsPlan;
|
|
45
|
+
}());
|
|
46
|
+
exports.ServiceDiscountsPlan = ServiceDiscountsPlan;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { DiscountCodeCompany } from './DiscountCodeCompany';
|
|
2
1
|
import { Master } from './Master';
|
|
3
2
|
export declare class ServicePlan {
|
|
4
3
|
id_service_plan: number;
|
|
@@ -14,6 +13,5 @@ export declare class ServicePlan {
|
|
|
14
13
|
information_general: any;
|
|
15
14
|
created: Date;
|
|
16
15
|
updated: Date;
|
|
17
|
-
discount: DiscountCodeCompany | null;
|
|
18
16
|
updated_by: Master;
|
|
19
17
|
}
|
|
@@ -11,7 +11,6 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.ServicePlan = void 0;
|
|
13
13
|
var typeorm_1 = require("typeorm");
|
|
14
|
-
var DiscountCodeCompany_1 = require("./DiscountCodeCompany"); // Asegúrate de ajustar el path al modelo correspondiente
|
|
15
14
|
var jsonTransformer_1 = require("../transformers/jsonTransformer");
|
|
16
15
|
var dateTransformer_1 = require("../transformers/dateTransformer");
|
|
17
16
|
var Master_1 = require("./Master");
|
|
@@ -55,7 +54,7 @@ var ServicePlan = /** @class */ (function () {
|
|
|
55
54
|
__metadata("design:type", Object)
|
|
56
55
|
], ServicePlan.prototype, "time_periods", void 0);
|
|
57
56
|
__decorate([
|
|
58
|
-
(0, typeorm_1.Column)({ type: '
|
|
57
|
+
(0, typeorm_1.Column)({ type: 'float', nullable: true }),
|
|
59
58
|
__metadata("design:type", Object)
|
|
60
59
|
], ServicePlan.prototype, "assigned_discount", void 0);
|
|
61
60
|
__decorate([
|
|
@@ -78,14 +77,6 @@ var ServicePlan = /** @class */ (function () {
|
|
|
78
77
|
}),
|
|
79
78
|
__metadata("design:type", Date)
|
|
80
79
|
], ServicePlan.prototype, "updated", void 0);
|
|
81
|
-
__decorate([
|
|
82
|
-
(0, typeorm_1.ManyToOne)(function () { return DiscountCodeCompany_1.DiscountCodeCompany; }, function (discount) { return discount.servicePlans; }, {
|
|
83
|
-
onDelete: 'CASCADE',
|
|
84
|
-
onUpdate: 'CASCADE',
|
|
85
|
-
}),
|
|
86
|
-
(0, typeorm_1.JoinColumn)({ name: 'assigned_discount' }),
|
|
87
|
-
__metadata("design:type", Object)
|
|
88
|
-
], ServicePlan.prototype, "discount", void 0);
|
|
89
80
|
__decorate([
|
|
90
81
|
(0, typeorm_1.ManyToOne)(function () { return Master_1.Master; }, function (master) { return master.id; }, {
|
|
91
82
|
onDelete: 'SET NULL',
|
package/package.json
CHANGED
|
@@ -105,7 +105,4 @@ export class DiscountCodeCompany {
|
|
|
105
105
|
codeRedemptionHistoryCompany.discount_code_company
|
|
106
106
|
)
|
|
107
107
|
code_redemptions_history_company: CodeRedemptionHistoryCompany[]
|
|
108
|
-
|
|
109
|
-
@OneToMany(() => ServicePlan, (servicePlan) => servicePlan.discount)
|
|
110
|
-
servicePlans: ServicePlan[];
|
|
111
108
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
|
|
2
|
+
import { ServicePlan } from './ServicePlan';
|
|
3
|
+
import { DiscountCodeCompany } from './DiscountCodeCompany';
|
|
4
|
+
|
|
5
|
+
@Entity('service_discounts_plan', {
|
|
6
|
+
comment: 'Entidad que enlaza un plan de servicio con un código de descuento de una empresa',
|
|
7
|
+
})
|
|
8
|
+
export class ServiceDiscountsPlan {
|
|
9
|
+
@PrimaryGeneratedColumn()
|
|
10
|
+
id: number;
|
|
11
|
+
|
|
12
|
+
@ManyToOne(() => ServicePlan, (servicePlan) => servicePlan.id_service_plan, {
|
|
13
|
+
onDelete: 'CASCADE',
|
|
14
|
+
onUpdate: 'CASCADE',
|
|
15
|
+
})
|
|
16
|
+
@JoinColumn({ name: 'id_service_plan' })
|
|
17
|
+
servicePlan: ServicePlan | null;
|
|
18
|
+
|
|
19
|
+
@ManyToOne(() => DiscountCodeCompany, (discountCodeCompany) => discountCodeCompany.discount, {
|
|
20
|
+
onDelete: 'CASCADE',
|
|
21
|
+
onUpdate: 'CASCADE',
|
|
22
|
+
})
|
|
23
|
+
@JoinColumn({ name: 'id_discount' })
|
|
24
|
+
discount: DiscountCodeCompany | null;
|
|
25
|
+
}
|
|
@@ -41,7 +41,7 @@ export class ServicePlan {
|
|
|
41
41
|
@Column({ type: 'text', nullable: true })
|
|
42
42
|
time_periods: string | null
|
|
43
43
|
|
|
44
|
-
@Column({ type: '
|
|
44
|
+
@Column({ type: 'float', nullable: true })
|
|
45
45
|
assigned_discount: number | null
|
|
46
46
|
|
|
47
47
|
@Column({ type: 'longtext', nullable: true, transformer: jsonTransformer })
|
|
@@ -61,14 +61,6 @@ export class ServicePlan {
|
|
|
61
61
|
})
|
|
62
62
|
updated: Date
|
|
63
63
|
|
|
64
|
-
@ManyToOne(() => DiscountCodeCompany, (discount) => discount.servicePlans, {
|
|
65
|
-
onDelete: 'CASCADE',
|
|
66
|
-
onUpdate: 'CASCADE',
|
|
67
|
-
})
|
|
68
|
-
|
|
69
|
-
@JoinColumn({ name: 'assigned_discount' })
|
|
70
|
-
discount: DiscountCodeCompany | null;
|
|
71
|
-
|
|
72
64
|
@ManyToOne(() => Master, (master) => master.id, {
|
|
73
65
|
onDelete: 'SET NULL',
|
|
74
66
|
onUpdate: 'CASCADE',
|