test-entity-library-asm 3.9.69 → 3.9.71
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 +5 -2
- package/dist/entities/DiscountCodeUser.js +27 -6
- package/dist/entities/DiscountCodeUserProduct.d.ts +7 -0
- package/dist/entities/DiscountCodeUserProduct.js +38 -0
- package/dist/entities/Product.d.ts +2 -1
- package/dist/entities/Product.js +4 -0
- package/dist/entities.index.d.ts +1 -0
- package/dist/entities.index.js +3 -1
- package/dist/views/DiscountsCodeUser.d.ts +4 -1
- package/dist/views/DiscountsCodeUser.js +15 -3
- package/package.json +1 -1
- package/src/entities/DiscountCodeUser.ts +29 -7
- package/src/entities/DiscountCodeUserProduct.ts +24 -0
- package/src/entities/Product.ts +7 -0
- package/src/entities.index.ts +1 -0
- package/src/views/DiscountsCodeUser.ts +12 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Local } from "..";
|
|
1
|
+
import { DiscountCodeUserProduct, Local } from "..";
|
|
2
2
|
import { CodeRedemptionHistoryUser } from "./CodeRedemptionHistoryUser";
|
|
3
3
|
import { Company } from "./Company";
|
|
4
4
|
import { Partner } from "./Partner";
|
|
@@ -7,9 +7,11 @@ export declare class DiscountCodeUser {
|
|
|
7
7
|
company: Company;
|
|
8
8
|
local: Local | null;
|
|
9
9
|
code: string;
|
|
10
|
+
name: string;
|
|
11
|
+
mode: number;
|
|
12
|
+
user_segment: number;
|
|
10
13
|
discount: string;
|
|
11
14
|
type: number;
|
|
12
|
-
single_use: number;
|
|
13
15
|
use_limit: number | null;
|
|
14
16
|
created: Date;
|
|
15
17
|
created_by: Partner;
|
|
@@ -20,4 +22,5 @@ export declare class DiscountCodeUser {
|
|
|
20
22
|
updated_by: Partner | null;
|
|
21
23
|
status: number;
|
|
22
24
|
code_redemptions_history_users: CodeRedemptionHistoryUser[];
|
|
25
|
+
discount_code_user_products: DiscountCodeUserProduct[];
|
|
23
26
|
}
|
|
@@ -51,26 +51,43 @@ __decorate([
|
|
|
51
51
|
__metadata("design:type", String)
|
|
52
52
|
], DiscountCodeUser.prototype, "code", void 0);
|
|
53
53
|
__decorate([
|
|
54
|
-
(0, typeorm_1.Column)({
|
|
54
|
+
(0, typeorm_1.Column)({
|
|
55
|
+
length: 100,
|
|
56
|
+
type: "varchar",
|
|
57
|
+
comment: "Nombre del descuento.",
|
|
58
|
+
}),
|
|
55
59
|
__metadata("design:type", String)
|
|
56
|
-
], DiscountCodeUser.prototype, "
|
|
60
|
+
], DiscountCodeUser.prototype, "name", void 0);
|
|
57
61
|
__decorate([
|
|
58
62
|
(0, typeorm_1.Column)({
|
|
63
|
+
default: 1,
|
|
59
64
|
type: "int",
|
|
60
65
|
width: 1,
|
|
61
|
-
comment: "
|
|
66
|
+
comment: "Columna para diferenciar el tipo de descuento que se va a crear:\n1: Descuento del pedido/Descuento referido.\n2: Promoción producto/s: Acá el descuento se aplica por porcentaje o monto fijo a los producto/s que se agreguen.\n3: Promoción producto: Este A diferencia del modo tipo 2, este no se aplica un descuento por porcentaje o monto fijo, se aplica en 2x1 - 2x3 o 3x4.",
|
|
62
67
|
}),
|
|
63
68
|
__metadata("design:type", Number)
|
|
64
|
-
], DiscountCodeUser.prototype, "
|
|
69
|
+
], DiscountCodeUser.prototype, "mode", void 0);
|
|
65
70
|
__decorate([
|
|
66
71
|
(0, typeorm_1.Column)({
|
|
67
72
|
default: 1,
|
|
68
73
|
type: "int",
|
|
69
74
|
width: 1,
|
|
70
|
-
comment: "
|
|
75
|
+
comment: "Segmento al que se le aplica el descuento.\n1: Todos los usuarios: Cualquier usuario puede aplicar al descuento.\n2: Nuevos usuarios: Nuevos usuarios que compren en el restaurante.\n3: Usuarios fieles: Los usuarios que más compren en ese restaurante.\n4: Usuarios perdidos: Los usuarios que han dejado de comprar en el restaurante.",
|
|
76
|
+
}),
|
|
77
|
+
__metadata("design:type", Number)
|
|
78
|
+
], DiscountCodeUser.prototype, "user_segment", void 0);
|
|
79
|
+
__decorate([
|
|
80
|
+
(0, typeorm_1.Column)({ length: 10, type: "varchar", comment: "Descuento que se aplica." }),
|
|
81
|
+
__metadata("design:type", String)
|
|
82
|
+
], DiscountCodeUser.prototype, "discount", void 0);
|
|
83
|
+
__decorate([
|
|
84
|
+
(0, typeorm_1.Column)({
|
|
85
|
+
type: "int",
|
|
86
|
+
width: 1,
|
|
87
|
+
comment: "Campo para el tipo de descuento: \r\n1. Porcentaje.\r\n2. Valor en moneda.",
|
|
71
88
|
}),
|
|
72
89
|
__metadata("design:type", Number)
|
|
73
|
-
], DiscountCodeUser.prototype, "
|
|
90
|
+
], DiscountCodeUser.prototype, "type", void 0);
|
|
74
91
|
__decorate([
|
|
75
92
|
(0, typeorm_1.Column)({
|
|
76
93
|
nullable: true,
|
|
@@ -153,6 +170,10 @@ __decorate([
|
|
|
153
170
|
(0, typeorm_1.OneToMany)(() => CodeRedemptionHistoryUser_1.CodeRedemptionHistoryUser, (codeRedemptionHistoryUser) => codeRedemptionHistoryUser.discount_code_user),
|
|
154
171
|
__metadata("design:type", Array)
|
|
155
172
|
], DiscountCodeUser.prototype, "code_redemptions_history_users", void 0);
|
|
173
|
+
__decorate([
|
|
174
|
+
(0, typeorm_1.OneToMany)(() => __1.DiscountCodeUserProduct, (discountCodeUserProduct) => discountCodeUserProduct.discount_code_user),
|
|
175
|
+
__metadata("design:type", Array)
|
|
176
|
+
], DiscountCodeUser.prototype, "discount_code_user_products", void 0);
|
|
156
177
|
exports.DiscountCodeUser = DiscountCodeUser = __decorate([
|
|
157
178
|
(0, typeorm_1.Entity)("discount_code_user", {
|
|
158
179
|
comment: "Códigos de descuento para los usuarios.",
|
|
@@ -0,0 +1,38 @@
|
|
|
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.DiscountCodeUserProduct = void 0;
|
|
13
|
+
// DiscountCodeUserProduct.ts
|
|
14
|
+
const typeorm_1 = require("typeorm");
|
|
15
|
+
const DiscountCodeUser_1 = require("./DiscountCodeUser");
|
|
16
|
+
const Product_1 = require("./Product");
|
|
17
|
+
let DiscountCodeUserProduct = class DiscountCodeUserProduct {
|
|
18
|
+
};
|
|
19
|
+
exports.DiscountCodeUserProduct = DiscountCodeUserProduct;
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, typeorm_1.PrimaryGeneratedColumn)(),
|
|
22
|
+
__metadata("design:type", Number)
|
|
23
|
+
], DiscountCodeUserProduct.prototype, "id", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, typeorm_1.ManyToOne)(() => DiscountCodeUser_1.DiscountCodeUser, (discount) => discount.discount_code_user_products, { onDelete: "CASCADE" }),
|
|
26
|
+
(0, typeorm_1.JoinColumn)({ name: "discount_code_user" }),
|
|
27
|
+
__metadata("design:type", DiscountCodeUser_1.DiscountCodeUser)
|
|
28
|
+
], DiscountCodeUserProduct.prototype, "discount_code_user", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, typeorm_1.ManyToOne)(() => Product_1.Product, (product) => product.discount_code_user_products, {
|
|
31
|
+
onDelete: "CASCADE",
|
|
32
|
+
}),
|
|
33
|
+
(0, typeorm_1.JoinColumn)({ name: "product" }),
|
|
34
|
+
__metadata("design:type", Product_1.Product)
|
|
35
|
+
], DiscountCodeUserProduct.prototype, "product", void 0);
|
|
36
|
+
exports.DiscountCodeUserProduct = DiscountCodeUserProduct = __decorate([
|
|
37
|
+
(0, typeorm_1.Entity)("discount_code_user_product")
|
|
38
|
+
], DiscountCodeUserProduct);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Gallery, Partner, ProductDate, ProductImage, ProductSchedule } from "..";
|
|
1
|
+
import { DiscountCodeUserProduct, Gallery, Partner, ProductDate, ProductImage, ProductSchedule } from "..";
|
|
2
2
|
import { Category } from "./Category";
|
|
3
3
|
import { ProductGroup } from "./ProductGroup";
|
|
4
4
|
import { ProductIngredient } from "./ProductIngredient";
|
|
@@ -31,4 +31,5 @@ export declare class Product {
|
|
|
31
31
|
product_dates: ProductDate[];
|
|
32
32
|
products_image: ProductImage[];
|
|
33
33
|
product_images: Gallery[];
|
|
34
|
+
discount_code_user_products: DiscountCodeUserProduct[];
|
|
34
35
|
}
|
package/dist/entities/Product.js
CHANGED
|
@@ -224,6 +224,10 @@ __decorate([
|
|
|
224
224
|
}),
|
|
225
225
|
__metadata("design:type", Array)
|
|
226
226
|
], Product.prototype, "product_images", void 0);
|
|
227
|
+
__decorate([
|
|
228
|
+
(0, typeorm_1.OneToMany)(() => __1.DiscountCodeUserProduct, (discountCodeUserProduct) => discountCodeUserProduct.product),
|
|
229
|
+
__metadata("design:type", Array)
|
|
230
|
+
], Product.prototype, "discount_code_user_products", void 0);
|
|
227
231
|
exports.Product = Product = __decorate([
|
|
228
232
|
(0, typeorm_1.Entity)({
|
|
229
233
|
comment: "Productos qué serán visibles a los usuarios, estos están asociados a un local.",
|
package/dist/entities.index.d.ts
CHANGED
|
@@ -75,6 +75,7 @@ export { MasterSession } from "./entities/MasterSession";
|
|
|
75
75
|
export { CountryHoliday } from "./entities/CountryHoliday";
|
|
76
76
|
export { LocalChange } from "./entities/LocalChange";
|
|
77
77
|
export { PendingModification } from "./entities/PendingModification";
|
|
78
|
+
export { DiscountCodeUserProduct } from "./entities/DiscountCodeUserProduct";
|
|
78
79
|
export { LocalsCompany } from "./views/LocalsCompany";
|
|
79
80
|
export { VerifyLocals } from "./views/VerifyLocals";
|
|
80
81
|
export { MasterNotifications } from "./views/MasterNotifications";
|
package/dist/entities.index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ToppingImage = exports.ProductDate = exports.ProductSchedule = exports.CategoryDate = exports.Bank = exports.ServicePlan = exports.PartnerPlatform = exports.PartnerPlatformSection = exports.LocalPlan = exports.MasterNotification = exports.VerifyLocal = exports.PosSystem = exports.AuthenticationCredential = exports.BusinessType = exports.UserAddress = exports.User = exports.TypeMeasureIngredient = exports.Square = exports.RequestProductGroupComplement = exports.RequestProduct = exports.Request = exports.Region = exports.ProductTopping = exports.ProductIngredient = exports.ProductGroupComplement = exports.ProductGroup = exports.Product = exports.Plan = exports.PaymentMethod = exports.PartnerRole = exports.PartnerPlatformSectionPermission = exports.PartnerNotification = exports.Partner = exports.MasterRole = exports.MasterPermission = exports.Master = exports.LocalQualification = exports.Local = exports.DiscountCodeUser = exports.DiscountCodeCompany = exports.Day = exports.Country = exports.Configuration = exports.Company = exports.CodeRedemptionHistoryUser = exports.CodeRedemptionHistoryCompany = exports.City = exports.ScheduleCategory = exports.Category = exports.BusinessTypeProduct = void 0;
|
|
4
|
-
exports.LocalsCompanyInformationForTheTable = exports.LocalsCompanyInformationForTheMap = exports.LocalReserves = exports.LocalTableZonesFilter = exports.PartnerNotifications = exports.DiscountsCodeUser = exports.Partners = exports.ViewLocalsCompanies = exports.MasterNotifications = exports.VerifyLocals = exports.LocalsCompany = exports.PendingModification = exports.LocalChange = exports.CountryHoliday = exports.MasterSession = exports.PartnerPlatformSectionPermissionAssociate = exports.VerificationCode = exports.LocalPaymentMethod = exports.ProductImage = exports.Gallery = exports.RequestLocalTable = exports.RequestInvoiceCategory = exports.RequestInvoice = exports.LocalTableReserve = exports.LocalReserveStatus = exports.LocalReserve = exports.LocalTableReservePayment = exports.DecorationReserve = exports.LocalDecorationReserve = exports.LocalTable = exports.LocalTableZone = exports.RequestPrint = exports.ReceiptConfig = exports.RequestLocalPayment = exports.UserPaymentMethod = exports.RequestLocalHistory = exports.RequestLocal = exports.PartnerSession = void 0;
|
|
4
|
+
exports.LocalsCompanyInformationForTheTable = exports.LocalsCompanyInformationForTheMap = exports.LocalReserves = exports.LocalTableZonesFilter = exports.PartnerNotifications = exports.DiscountsCodeUser = exports.Partners = exports.ViewLocalsCompanies = exports.MasterNotifications = exports.VerifyLocals = exports.LocalsCompany = exports.DiscountCodeUserProduct = exports.PendingModification = exports.LocalChange = exports.CountryHoliday = exports.MasterSession = exports.PartnerPlatformSectionPermissionAssociate = exports.VerificationCode = exports.LocalPaymentMethod = exports.ProductImage = exports.Gallery = exports.RequestLocalTable = exports.RequestInvoiceCategory = exports.RequestInvoice = exports.LocalTableReserve = exports.LocalReserveStatus = exports.LocalReserve = exports.LocalTableReservePayment = exports.DecorationReserve = exports.LocalDecorationReserve = exports.LocalTable = exports.LocalTableZone = exports.RequestPrint = exports.ReceiptConfig = exports.RequestLocalPayment = exports.UserPaymentMethod = exports.RequestLocalHistory = exports.RequestLocal = exports.PartnerSession = void 0;
|
|
5
5
|
var BusinessTypeProduct_1 = require("./entities/BusinessTypeProduct");
|
|
6
6
|
Object.defineProperty(exports, "BusinessTypeProduct", { enumerable: true, get: function () { return BusinessTypeProduct_1.BusinessTypeProduct; } });
|
|
7
7
|
var Category_1 = require("./entities/Category");
|
|
@@ -156,6 +156,8 @@ var LocalChange_1 = require("./entities/LocalChange");
|
|
|
156
156
|
Object.defineProperty(exports, "LocalChange", { enumerable: true, get: function () { return LocalChange_1.LocalChange; } });
|
|
157
157
|
var PendingModification_1 = require("./entities/PendingModification");
|
|
158
158
|
Object.defineProperty(exports, "PendingModification", { enumerable: true, get: function () { return PendingModification_1.PendingModification; } });
|
|
159
|
+
var DiscountCodeUserProduct_1 = require("./entities/DiscountCodeUserProduct");
|
|
160
|
+
Object.defineProperty(exports, "DiscountCodeUserProduct", { enumerable: true, get: function () { return DiscountCodeUserProduct_1.DiscountCodeUserProduct; } });
|
|
159
161
|
var LocalsCompany_1 = require("./views/LocalsCompany");
|
|
160
162
|
Object.defineProperty(exports, "LocalsCompany", { enumerable: true, get: function () { return LocalsCompany_1.LocalsCompany; } });
|
|
161
163
|
var VerifyLocals_1 = require("./views/VerifyLocals");
|
|
@@ -3,9 +3,11 @@ export declare class DiscountsCodeUser {
|
|
|
3
3
|
company: number;
|
|
4
4
|
local: number;
|
|
5
5
|
code: string;
|
|
6
|
+
name: string;
|
|
7
|
+
mode: number;
|
|
8
|
+
user_segment: number;
|
|
6
9
|
discount: string;
|
|
7
10
|
type: number;
|
|
8
|
-
single_use: number;
|
|
9
11
|
use_limit: number;
|
|
10
12
|
created: Date;
|
|
11
13
|
created_by: number;
|
|
@@ -35,5 +37,6 @@ export declare class DiscountsCodeUser {
|
|
|
35
37
|
partner_full_name: string;
|
|
36
38
|
partner_profile: any;
|
|
37
39
|
partner_status: number;
|
|
40
|
+
number_of_products: number;
|
|
38
41
|
number_of_times_used: number;
|
|
39
42
|
}
|
|
@@ -33,15 +33,23 @@ __decorate([
|
|
|
33
33
|
__decorate([
|
|
34
34
|
(0, typeorm_1.ViewColumn)(),
|
|
35
35
|
__metadata("design:type", String)
|
|
36
|
-
], DiscountsCodeUser.prototype, "
|
|
36
|
+
], DiscountsCodeUser.prototype, "name", void 0);
|
|
37
37
|
__decorate([
|
|
38
38
|
(0, typeorm_1.ViewColumn)(),
|
|
39
39
|
__metadata("design:type", Number)
|
|
40
|
-
], DiscountsCodeUser.prototype, "
|
|
40
|
+
], DiscountsCodeUser.prototype, "mode", void 0);
|
|
41
41
|
__decorate([
|
|
42
42
|
(0, typeorm_1.ViewColumn)(),
|
|
43
43
|
__metadata("design:type", Number)
|
|
44
|
-
], DiscountsCodeUser.prototype, "
|
|
44
|
+
], DiscountsCodeUser.prototype, "user_segment", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, typeorm_1.ViewColumn)(),
|
|
47
|
+
__metadata("design:type", String)
|
|
48
|
+
], DiscountsCodeUser.prototype, "discount", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, typeorm_1.ViewColumn)(),
|
|
51
|
+
__metadata("design:type", Number)
|
|
52
|
+
], DiscountsCodeUser.prototype, "type", void 0);
|
|
45
53
|
__decorate([
|
|
46
54
|
(0, typeorm_1.ViewColumn)(),
|
|
47
55
|
__metadata("design:type", Number)
|
|
@@ -158,6 +166,10 @@ __decorate([
|
|
|
158
166
|
(0, typeorm_1.ViewColumn)(),
|
|
159
167
|
__metadata("design:type", Number)
|
|
160
168
|
], DiscountsCodeUser.prototype, "partner_status", void 0);
|
|
169
|
+
__decorate([
|
|
170
|
+
(0, typeorm_1.ViewColumn)(),
|
|
171
|
+
__metadata("design:type", Number)
|
|
172
|
+
], DiscountsCodeUser.prototype, "number_of_products", void 0);
|
|
161
173
|
__decorate([
|
|
162
174
|
(0, typeorm_1.ViewColumn)(),
|
|
163
175
|
__metadata("design:type", Number)
|
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 { DiscountCodeUserProduct, Local } from "..";
|
|
10
10
|
import { CodeRedemptionHistoryUser } from "./CodeRedemptionHistoryUser";
|
|
11
11
|
import { Company } from "./Company";
|
|
12
12
|
import { Partner } from "./Partner";
|
|
@@ -43,25 +43,41 @@ export class DiscountCodeUser {
|
|
|
43
43
|
})
|
|
44
44
|
code: string;
|
|
45
45
|
|
|
46
|
-
@Column({
|
|
47
|
-
|
|
46
|
+
@Column({
|
|
47
|
+
length: 100,
|
|
48
|
+
type: "varchar",
|
|
49
|
+
comment: "Nombre del descuento.",
|
|
50
|
+
})
|
|
51
|
+
name: string;
|
|
48
52
|
|
|
49
53
|
@Column({
|
|
54
|
+
default: 1,
|
|
50
55
|
type: "int",
|
|
51
56
|
width: 1,
|
|
52
57
|
comment:
|
|
53
|
-
"
|
|
58
|
+
"Columna para diferenciar el tipo de descuento que se va a crear:\n1: Descuento del pedido/Descuento referido.\n2: Promoción producto/s: Acá el descuento se aplica por porcentaje o monto fijo a los producto/s que se agreguen.\n3: Promoción producto: Este A diferencia del modo tipo 2, este no se aplica un descuento por porcentaje o monto fijo, se aplica en 2x1 - 2x3 o 3x4.",
|
|
54
59
|
})
|
|
55
|
-
|
|
60
|
+
mode: number;
|
|
56
61
|
|
|
57
62
|
@Column({
|
|
58
63
|
default: 1,
|
|
59
64
|
type: "int",
|
|
60
65
|
width: 1,
|
|
61
66
|
comment:
|
|
62
|
-
"
|
|
67
|
+
"Segmento al que se le aplica el descuento.\n1: Todos los usuarios: Cualquier usuario puede aplicar al descuento.\n2: Nuevos usuarios: Nuevos usuarios que compren en el restaurante.\n3: Usuarios fieles: Los usuarios que más compren en ese restaurante.\n4: Usuarios perdidos: Los usuarios que han dejado de comprar en el restaurante.",
|
|
68
|
+
})
|
|
69
|
+
user_segment: number;
|
|
70
|
+
|
|
71
|
+
@Column({ length: 10, type: "varchar", comment: "Descuento que se aplica." })
|
|
72
|
+
discount: string;
|
|
73
|
+
|
|
74
|
+
@Column({
|
|
75
|
+
type: "int",
|
|
76
|
+
width: 1,
|
|
77
|
+
comment:
|
|
78
|
+
"Campo para el tipo de descuento: \r\n1. Porcentaje.\r\n2. Valor en moneda.",
|
|
63
79
|
})
|
|
64
|
-
|
|
80
|
+
type: number;
|
|
65
81
|
|
|
66
82
|
@Column({
|
|
67
83
|
nullable: true,
|
|
@@ -144,4 +160,10 @@ export class DiscountCodeUser {
|
|
|
144
160
|
(codeRedemptionHistoryUser) => codeRedemptionHistoryUser.discount_code_user,
|
|
145
161
|
)
|
|
146
162
|
code_redemptions_history_users: CodeRedemptionHistoryUser[];
|
|
163
|
+
|
|
164
|
+
@OneToMany(
|
|
165
|
+
() => DiscountCodeUserProduct,
|
|
166
|
+
(discountCodeUserProduct) => discountCodeUserProduct.discount_code_user,
|
|
167
|
+
)
|
|
168
|
+
discount_code_user_products: DiscountCodeUserProduct[];
|
|
147
169
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// DiscountCodeUserProduct.ts
|
|
2
|
+
import { Entity, PrimaryGeneratedColumn, ManyToOne, JoinColumn } from "typeorm";
|
|
3
|
+
import { DiscountCodeUser } from "./DiscountCodeUser";
|
|
4
|
+
import { Product } from "./Product";
|
|
5
|
+
|
|
6
|
+
@Entity("discount_code_user_product")
|
|
7
|
+
export class DiscountCodeUserProduct {
|
|
8
|
+
@PrimaryGeneratedColumn()
|
|
9
|
+
id: number;
|
|
10
|
+
|
|
11
|
+
@ManyToOne(
|
|
12
|
+
() => DiscountCodeUser,
|
|
13
|
+
(discount) => discount.discount_code_user_products,
|
|
14
|
+
{ onDelete: "CASCADE" },
|
|
15
|
+
)
|
|
16
|
+
@JoinColumn({ name: "discount_code_user" })
|
|
17
|
+
discount_code_user: DiscountCodeUser;
|
|
18
|
+
|
|
19
|
+
@ManyToOne(() => Product, (product) => product.discount_code_user_products, {
|
|
20
|
+
onDelete: "CASCADE",
|
|
21
|
+
})
|
|
22
|
+
@JoinColumn({ name: "product" })
|
|
23
|
+
product: Product;
|
|
24
|
+
}
|
package/src/entities/Product.ts
CHANGED
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
PrimaryGeneratedColumn,
|
|
10
10
|
} from "typeorm";
|
|
11
11
|
import {
|
|
12
|
+
DiscountCodeUserProduct,
|
|
12
13
|
Gallery,
|
|
13
14
|
Partner,
|
|
14
15
|
ProductDate,
|
|
@@ -215,4 +216,10 @@ export class Product {
|
|
|
215
216
|
},
|
|
216
217
|
})
|
|
217
218
|
product_images: Gallery[];
|
|
219
|
+
|
|
220
|
+
@OneToMany(
|
|
221
|
+
() => DiscountCodeUserProduct,
|
|
222
|
+
(discountCodeUserProduct) => discountCodeUserProduct.product,
|
|
223
|
+
)
|
|
224
|
+
discount_code_user_products: DiscountCodeUserProduct[];
|
|
218
225
|
}
|
package/src/entities.index.ts
CHANGED
|
@@ -75,6 +75,7 @@ export { MasterSession } from "./entities/MasterSession";
|
|
|
75
75
|
export { CountryHoliday } from "./entities/CountryHoliday";
|
|
76
76
|
export { LocalChange } from "./entities/LocalChange";
|
|
77
77
|
export { PendingModification } from "./entities/PendingModification";
|
|
78
|
+
export { DiscountCodeUserProduct } from "./entities/DiscountCodeUserProduct";
|
|
78
79
|
|
|
79
80
|
export { LocalsCompany } from "./views/LocalsCompany";
|
|
80
81
|
export { VerifyLocals } from "./views/VerifyLocals";
|
|
@@ -17,13 +17,19 @@ export class DiscountsCodeUser {
|
|
|
17
17
|
code: string;
|
|
18
18
|
|
|
19
19
|
@ViewColumn()
|
|
20
|
-
|
|
20
|
+
name: string;
|
|
21
21
|
|
|
22
22
|
@ViewColumn()
|
|
23
|
-
|
|
23
|
+
mode: number;
|
|
24
|
+
|
|
25
|
+
@ViewColumn()
|
|
26
|
+
user_segment: number;
|
|
27
|
+
|
|
28
|
+
@ViewColumn()
|
|
29
|
+
discount: string;
|
|
24
30
|
|
|
25
31
|
@ViewColumn()
|
|
26
|
-
|
|
32
|
+
type: number;
|
|
27
33
|
|
|
28
34
|
@ViewColumn()
|
|
29
35
|
use_limit: number;
|
|
@@ -112,6 +118,9 @@ export class DiscountsCodeUser {
|
|
|
112
118
|
@ViewColumn()
|
|
113
119
|
partner_status: number;
|
|
114
120
|
|
|
121
|
+
@ViewColumn()
|
|
122
|
+
number_of_products: number;
|
|
123
|
+
|
|
115
124
|
@ViewColumn()
|
|
116
125
|
number_of_times_used: number;
|
|
117
126
|
}
|