test-entity-library-asm 3.7.2 → 3.7.4
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/DiscountCodeUser.d.ts +2 -1
- package/dist/entities/DiscountCodeUser.js +4 -0
- package/dist/entities/RequestLocal.d.ts +2 -1
- package/dist/entities/RequestLocal.js +9 -0
- package/dist/entities/RequestProduct.js +2 -1
- package/dist/entities/RequestProductGroupComplement.js +2 -1
- package/package.json +1 -1
- package/src/entities/DiscountCodeUser.ts +4 -1
- package/src/entities/RequestLocal.ts +14 -1
- package/src/entities/RequestProduct.ts +2 -0
- package/src/entities/RequestProductGroupComplement.ts +2 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Local } from "..";
|
|
1
|
+
import { Local, RequestLocal } from "..";
|
|
2
2
|
import { CodeRedemptionHistoryUser } from "./CodeRedemptionHistoryUser";
|
|
3
3
|
import { Company } from "./Company";
|
|
4
4
|
import { Partner } from "./Partner";
|
|
@@ -19,4 +19,5 @@ export declare class DiscountCodeUser {
|
|
|
19
19
|
updated: Date;
|
|
20
20
|
status: number;
|
|
21
21
|
code_redemptions_history_users: CodeRedemptionHistoryUser[];
|
|
22
|
+
discount_request_locals: RequestLocal[];
|
|
22
23
|
}
|
|
@@ -145,6 +145,10 @@ var DiscountCodeUser = /** @class */ (function () {
|
|
|
145
145
|
(0, typeorm_1.OneToMany)(function () { return CodeRedemptionHistoryUser_1.CodeRedemptionHistoryUser; }, function (codeRedemptionHistoryUser) { return codeRedemptionHistoryUser.discount_code_user; }),
|
|
146
146
|
__metadata("design:type", Array)
|
|
147
147
|
], DiscountCodeUser.prototype, "code_redemptions_history_users", void 0);
|
|
148
|
+
__decorate([
|
|
149
|
+
(0, typeorm_1.OneToMany)(function () { return __1.RequestLocal; }, function (requestLocal) { return requestLocal.discount; }),
|
|
150
|
+
__metadata("design:type", Array)
|
|
151
|
+
], DiscountCodeUser.prototype, "discount_request_locals", void 0);
|
|
148
152
|
DiscountCodeUser = __decorate([
|
|
149
153
|
(0, typeorm_1.Entity)("discount_code_user", {
|
|
150
154
|
comment: "Códigos de descuento para los usuarios.",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Local, Partner, Request, RequestLocalHistory, RequestLocalPayment, RequestLocalTable, RequestProduct, RequestProductGroupComplement } from "..";
|
|
1
|
+
import { DiscountCodeUser, Local, Partner, Request, RequestLocalHistory, RequestLocalPayment, RequestLocalTable, RequestProduct, RequestProductGroupComplement } from "..";
|
|
2
2
|
export declare class RequestLocal {
|
|
3
3
|
id: number;
|
|
4
4
|
request: Request;
|
|
@@ -10,6 +10,7 @@ export declare class RequestLocal {
|
|
|
10
10
|
updated: Date | null;
|
|
11
11
|
order_number: number;
|
|
12
12
|
order_number_day: number;
|
|
13
|
+
discount: DiscountCodeUser | null;
|
|
13
14
|
partner: Partner | null;
|
|
14
15
|
is_notified: number;
|
|
15
16
|
requests_local_history: RequestLocalHistory[];
|
|
@@ -102,6 +102,15 @@ var RequestLocal = /** @class */ (function () {
|
|
|
102
102
|
}),
|
|
103
103
|
__metadata("design:type", Number)
|
|
104
104
|
], RequestLocal.prototype, "order_number_day", void 0);
|
|
105
|
+
__decorate([
|
|
106
|
+
(0, typeorm_1.ManyToOne)(function () { return __1.DiscountCodeUser; }, function (discountCodeUser) { return discountCodeUser.discount_request_locals; }, {
|
|
107
|
+
onDelete: "SET NULL",
|
|
108
|
+
onUpdate: "NO ACTION",
|
|
109
|
+
nullable: true,
|
|
110
|
+
}),
|
|
111
|
+
(0, typeorm_1.JoinColumn)({ name: "discount" }),
|
|
112
|
+
__metadata("design:type", Object)
|
|
113
|
+
], RequestLocal.prototype, "discount", void 0);
|
|
105
114
|
__decorate([
|
|
106
115
|
(0, typeorm_1.ManyToOne)(function () { return __1.Partner; }, function (partner) { return partner.partner_request_locals; }, {
|
|
107
116
|
onDelete: "CASCADE",
|
|
@@ -66,7 +66,8 @@ var RequestProduct = /** @class */ (function () {
|
|
|
66
66
|
RequestProduct = __decorate([
|
|
67
67
|
(0, typeorm_1.Entity)("request_product", {
|
|
68
68
|
comment: "Productos que están en el pedido.",
|
|
69
|
-
})
|
|
69
|
+
}),
|
|
70
|
+
(0, typeorm_1.Unique)(["request", "product"])
|
|
70
71
|
], RequestProduct);
|
|
71
72
|
return RequestProduct;
|
|
72
73
|
}());
|
|
@@ -58,7 +58,8 @@ var RequestProductGroupComplement = /** @class */ (function () {
|
|
|
58
58
|
RequestProductGroupComplement = __decorate([
|
|
59
59
|
(0, typeorm_1.Entity)("request_product_group_complement", {
|
|
60
60
|
comment: "Complementos (toppings) que el usuario va a poder agregar por cada producto.",
|
|
61
|
-
})
|
|
61
|
+
}),
|
|
62
|
+
(0, typeorm_1.Unique)(["request", "product_group_complement"])
|
|
62
63
|
], RequestProductGroupComplement);
|
|
63
64
|
return RequestProductGroupComplement;
|
|
64
65
|
}());
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
OneToMany,
|
|
7
7
|
PrimaryGeneratedColumn,
|
|
8
8
|
} from "typeorm";
|
|
9
|
-
import { Local } from "..";
|
|
9
|
+
import { Local, RequestLocal } from "..";
|
|
10
10
|
import { DateTransformer } from "../transformers/dateTransformer";
|
|
11
11
|
import { jsonTransformer } from "../transformers/jsonTransformer";
|
|
12
12
|
import { CodeRedemptionHistoryUser } from "./CodeRedemptionHistoryUser";
|
|
@@ -133,4 +133,7 @@ export class DiscountCodeUser {
|
|
|
133
133
|
(codeRedemptionHistoryUser) => codeRedemptionHistoryUser.discount_code_user
|
|
134
134
|
)
|
|
135
135
|
code_redemptions_history_users: CodeRedemptionHistoryUser[];
|
|
136
|
+
|
|
137
|
+
@OneToMany(() => RequestLocal, (requestLocal) => requestLocal.discount)
|
|
138
|
+
discount_request_locals: RequestLocal[];
|
|
136
139
|
}
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
PrimaryGeneratedColumn,
|
|
8
8
|
} from "typeorm";
|
|
9
9
|
import {
|
|
10
|
+
DiscountCodeUser,
|
|
10
11
|
Local,
|
|
11
12
|
Partner,
|
|
12
13
|
Request,
|
|
@@ -14,7 +15,7 @@ import {
|
|
|
14
15
|
RequestLocalPayment,
|
|
15
16
|
RequestLocalTable,
|
|
16
17
|
RequestProduct,
|
|
17
|
-
RequestProductGroupComplement
|
|
18
|
+
RequestProductGroupComplement,
|
|
18
19
|
} from "..";
|
|
19
20
|
import { DateTransformer } from "../transformers/dateTransformer";
|
|
20
21
|
|
|
@@ -104,6 +105,18 @@ export class RequestLocal {
|
|
|
104
105
|
})
|
|
105
106
|
order_number_day: number;
|
|
106
107
|
|
|
108
|
+
@ManyToOne(
|
|
109
|
+
() => DiscountCodeUser,
|
|
110
|
+
(discountCodeUser) => discountCodeUser.discount_request_locals,
|
|
111
|
+
{
|
|
112
|
+
onDelete: "SET NULL",
|
|
113
|
+
onUpdate: "NO ACTION",
|
|
114
|
+
nullable: true,
|
|
115
|
+
}
|
|
116
|
+
)
|
|
117
|
+
@JoinColumn({ name: "discount" })
|
|
118
|
+
discount: DiscountCodeUser | null;
|
|
119
|
+
|
|
107
120
|
@ManyToOne(() => Partner, (partner) => partner.partner_request_locals, {
|
|
108
121
|
onDelete: "CASCADE",
|
|
109
122
|
onUpdate: "NO ACTION",
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
JoinColumn,
|
|
5
5
|
ManyToOne,
|
|
6
6
|
PrimaryGeneratedColumn,
|
|
7
|
+
Unique,
|
|
7
8
|
} from "typeorm";
|
|
8
9
|
import { Product } from "./Product";
|
|
9
10
|
import { RequestLocal } from "./RequestLocal";
|
|
@@ -12,6 +13,7 @@ import { User } from "./User";
|
|
|
12
13
|
@Entity("request_product", {
|
|
13
14
|
comment: "Productos que están en el pedido.",
|
|
14
15
|
})
|
|
16
|
+
@Unique(["request", "product"])
|
|
15
17
|
export class RequestProduct {
|
|
16
18
|
@PrimaryGeneratedColumn({
|
|
17
19
|
type: "int",
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
JoinColumn,
|
|
5
5
|
ManyToOne,
|
|
6
6
|
PrimaryGeneratedColumn,
|
|
7
|
+
Unique,
|
|
7
8
|
} from "typeorm";
|
|
8
9
|
import { ProductGroupComplement } from "./productGroupComplement";
|
|
9
10
|
import { RequestLocal } from "./RequestLocal";
|
|
@@ -13,6 +14,7 @@ import { User } from "./User";
|
|
|
13
14
|
comment:
|
|
14
15
|
"Complementos (toppings) que el usuario va a poder agregar por cada producto.",
|
|
15
16
|
})
|
|
17
|
+
@Unique(["request", "product_group_complement"])
|
|
16
18
|
export class RequestProductGroupComplement {
|
|
17
19
|
@PrimaryGeneratedColumn({
|
|
18
20
|
type: "int",
|