tt-entities 0.0.31 → 0.0.33
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/libs/tatayab-entities-library/entities/coupon-product.entity.d.ts +12 -0
- package/dist/libs/tatayab-entities-library/entities/coupon-product.entity.js +50 -0
- package/dist/libs/tatayab-entities-library/entities/coupon-product.entity.js.map +1 -0
- package/dist/libs/tatayab-entities-library/entities/coupon-store.entity.d.ts +9 -0
- package/dist/libs/tatayab-entities-library/entities/coupon-store.entity.js +40 -0
- package/dist/libs/tatayab-entities-library/entities/coupon-store.entity.js.map +1 -0
- package/dist/libs/tatayab-entities-library/entities/coupon-user.entity.d.ts +11 -0
- package/dist/libs/tatayab-entities-library/entities/coupon-user.entity.js +48 -0
- package/dist/libs/tatayab-entities-library/entities/coupon-user.entity.js.map +1 -0
- package/dist/libs/tatayab-entities-library/entities/coupon.entity.d.ts +44 -0
- package/dist/libs/tatayab-entities-library/entities/coupon.entity.js +145 -0
- package/dist/libs/tatayab-entities-library/entities/coupon.entity.js.map +1 -0
- package/dist/libs/tatayab-entities-library/entities/order-item-bundle-selection.entity.d.ts +17 -0
- package/dist/libs/tatayab-entities-library/entities/order-item-bundle-selection.entity.js +70 -0
- package/dist/libs/tatayab-entities-library/entities/order-item-bundle-selection.entity.js.map +1 -0
- package/dist/libs/tatayab-entities-library/entities/order-item.entity.d.ts +50 -0
- package/dist/libs/tatayab-entities-library/entities/order-item.entity.js +153 -0
- package/dist/libs/tatayab-entities-library/entities/order-item.entity.js.map +1 -0
- package/dist/libs/tatayab-entities-library/entities/order-status-history.entity.d.ts +12 -0
- package/dist/libs/tatayab-entities-library/entities/order-status-history.entity.js +54 -0
- package/dist/libs/tatayab-entities-library/entities/order-status-history.entity.js.map +1 -0
- package/dist/libs/tatayab-entities-library/entities/order-status.entity.d.ts +37 -0
- package/dist/libs/tatayab-entities-library/entities/order-status.entity.js +94 -0
- package/dist/libs/tatayab-entities-library/entities/order-status.entity.js.map +1 -0
- package/dist/libs/tatayab-entities-library/entities/order.entity.d.ts +57 -0
- package/dist/libs/tatayab-entities-library/entities/order.entity.js +219 -0
- package/dist/libs/tatayab-entities-library/entities/order.entity.js.map +1 -0
- package/dist/libs/tatayab-entities-library/entities/purchase-order-order-item.entity.d.ts +16 -0
- package/dist/libs/tatayab-entities-library/entities/purchase-order-order-item.entity.js +64 -0
- package/dist/libs/tatayab-entities-library/entities/purchase-order-order-item.entity.js.map +1 -0
- package/dist/libs/tatayab-entities-library/entities/user-transaction.entity.d.ts +33 -0
- package/dist/libs/tatayab-entities-library/entities/user-transaction.entity.js +99 -0
- package/dist/libs/tatayab-entities-library/entities/user-transaction.entity.js.map +1 -0
- package/dist/libs/tatayab-entities-library/entities/user.entity.d.ts +7 -0
- package/dist/libs/tatayab-entities-library/entities/user.entity.js +19 -0
- package/dist/libs/tatayab-entities-library/entities/user.entity.js.map +1 -1
- package/dist/libs/tatayab-entities-library/index.d.ts +11 -0
- package/dist/libs/tatayab-entities-library/index.js +54 -2
- package/dist/libs/tatayab-entities-library/index.js.map +1 -1
- package/dist/src/main.js +1302 -86
- package/libs/tatayab-entities-library/src/entities/coupon-product.entity.ts +25 -0
- package/libs/tatayab-entities-library/src/entities/coupon-store.entity.ts +17 -0
- package/libs/tatayab-entities-library/src/entities/coupon-user.entity.ts +27 -0
- package/libs/tatayab-entities-library/src/entities/coupon.entity.ts +126 -0
- package/libs/tatayab-entities-library/src/entities/order-item-bundle-selection.entity.ts +38 -0
- package/libs/tatayab-entities-library/src/entities/order-item.entity.ts +132 -0
- package/libs/tatayab-entities-library/src/entities/order-status-history.entity.ts +34 -0
- package/libs/tatayab-entities-library/src/entities/order-status.entity.ts +70 -0
- package/libs/tatayab-entities-library/src/entities/order.entity.ts +175 -0
- package/libs/tatayab-entities-library/src/entities/purchase-order-order-item.entity.ts +38 -0
- package/libs/tatayab-entities-library/src/entities/user-transaction.entity.ts +81 -0
- package/libs/tatayab-entities-library/src/entities/user.entity.ts +15 -0
- package/libs/tatayab-entities-library/src/index.ts +60 -0
- package/package.json +1 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Model } from 'sequelize-typescript';
|
|
2
|
+
import { Coupon } from './coupon.entity';
|
|
3
|
+
import { Product } from './product.entity';
|
|
4
|
+
import { ProductVariant } from './product-variant.entity';
|
|
5
|
+
export declare class CouponProduct extends Model {
|
|
6
|
+
couponId: number;
|
|
7
|
+
productId: number;
|
|
8
|
+
productVariantId?: number;
|
|
9
|
+
coupon: Coupon;
|
|
10
|
+
product: Product;
|
|
11
|
+
variant?: ProductVariant;
|
|
12
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
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.CouponProduct = void 0;
|
|
13
|
+
const sequelize_typescript_1 = require("sequelize-typescript");
|
|
14
|
+
const coupon_entity_1 = require("./coupon.entity");
|
|
15
|
+
const product_entity_1 = require("./product.entity");
|
|
16
|
+
const product_variant_entity_1 = require("./product-variant.entity");
|
|
17
|
+
let CouponProduct = class CouponProduct extends sequelize_typescript_1.Model {
|
|
18
|
+
};
|
|
19
|
+
exports.CouponProduct = CouponProduct;
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, sequelize_typescript_1.ForeignKey)(() => coupon_entity_1.Coupon),
|
|
22
|
+
(0, sequelize_typescript_1.Column)({ allowNull: false }),
|
|
23
|
+
__metadata("design:type", Number)
|
|
24
|
+
], CouponProduct.prototype, "couponId", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, sequelize_typescript_1.ForeignKey)(() => product_entity_1.Product),
|
|
27
|
+
(0, sequelize_typescript_1.Column)({ allowNull: false }),
|
|
28
|
+
__metadata("design:type", Number)
|
|
29
|
+
], CouponProduct.prototype, "productId", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, sequelize_typescript_1.ForeignKey)(() => product_variant_entity_1.ProductVariant),
|
|
32
|
+
(0, sequelize_typescript_1.Column)({ allowNull: true }),
|
|
33
|
+
__metadata("design:type", Number)
|
|
34
|
+
], CouponProduct.prototype, "productVariantId", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, sequelize_typescript_1.BelongsTo)(() => coupon_entity_1.Coupon),
|
|
37
|
+
__metadata("design:type", coupon_entity_1.Coupon)
|
|
38
|
+
], CouponProduct.prototype, "coupon", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, sequelize_typescript_1.BelongsTo)(() => product_entity_1.Product),
|
|
41
|
+
__metadata("design:type", product_entity_1.Product)
|
|
42
|
+
], CouponProduct.prototype, "product", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, sequelize_typescript_1.BelongsTo)(() => product_variant_entity_1.ProductVariant),
|
|
45
|
+
__metadata("design:type", product_variant_entity_1.ProductVariant)
|
|
46
|
+
], CouponProduct.prototype, "variant", void 0);
|
|
47
|
+
exports.CouponProduct = CouponProduct = __decorate([
|
|
48
|
+
sequelize_typescript_1.Table
|
|
49
|
+
], CouponProduct);
|
|
50
|
+
//# sourceMappingURL=coupon-product.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coupon-product.entity.js","sourceRoot":"","sources":["../../../../libs/tatayab-entities-library/src/entities/coupon-product.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+DAAmF;AACnF,mDAAyC;AACzC,qDAA2C;AAC3C,qEAA0D;AAGnD,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,4BAAK;CAkBvC,CAAA;AAlBY,sCAAa;AAGhB;IAFP,IAAA,iCAAU,EAAC,GAAG,EAAE,CAAC,sBAAM,CAAC;IACxB,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;+CACJ;AAIjB;IAFP,IAAA,iCAAU,EAAC,GAAG,EAAE,CAAC,wBAAO,CAAC;IACzB,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;gDACH;AAMlB;IAFP,IAAA,iCAAU,EAAC,GAAG,EAAE,CAAC,uCAAc,CAAC;IAChC,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;;uDACM;AAEO;IAAxC,IAAA,gCAAS,EAAC,GAAG,EAAE,CAAC,sBAAM,CAAC;8BAAyB,sBAAM;6CAAC;AACf;IAAxC,IAAA,gCAAS,EAAC,GAAG,EAAE,CAAC,wBAAO,CAAC;8BAAyB,wBAAO;8CAAC;AACjB;IAAxC,IAAA,gCAAS,EAAC,GAAG,EAAE,CAAC,uCAAc,CAAC;8BAAmB,uCAAc;8CAAC;wBAjBvD,aAAa;IADzB,4BAAK;GACO,aAAa,CAkBzB"}
|
|
@@ -0,0 +1,40 @@
|
|
|
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.CouponStore = void 0;
|
|
13
|
+
const sequelize_typescript_1 = require("sequelize-typescript");
|
|
14
|
+
const coupon_entity_1 = require("./coupon.entity");
|
|
15
|
+
const store_entity_1 = require("./store.entity");
|
|
16
|
+
let CouponStore = class CouponStore extends sequelize_typescript_1.Model {
|
|
17
|
+
};
|
|
18
|
+
exports.CouponStore = CouponStore;
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, sequelize_typescript_1.ForeignKey)(() => coupon_entity_1.Coupon),
|
|
21
|
+
(0, sequelize_typescript_1.Column)({ allowNull: false }),
|
|
22
|
+
__metadata("design:type", Number)
|
|
23
|
+
], CouponStore.prototype, "couponId", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, sequelize_typescript_1.ForeignKey)(() => store_entity_1.Store),
|
|
26
|
+
(0, sequelize_typescript_1.Column)({ allowNull: false }),
|
|
27
|
+
__metadata("design:type", Number)
|
|
28
|
+
], CouponStore.prototype, "storeId", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, sequelize_typescript_1.BelongsTo)(() => coupon_entity_1.Coupon),
|
|
31
|
+
__metadata("design:type", coupon_entity_1.Coupon)
|
|
32
|
+
], CouponStore.prototype, "coupon", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, sequelize_typescript_1.BelongsTo)(() => store_entity_1.Store),
|
|
35
|
+
__metadata("design:type", store_entity_1.Store)
|
|
36
|
+
], CouponStore.prototype, "store", void 0);
|
|
37
|
+
exports.CouponStore = CouponStore = __decorate([
|
|
38
|
+
sequelize_typescript_1.Table
|
|
39
|
+
], CouponStore);
|
|
40
|
+
//# sourceMappingURL=coupon-store.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coupon-store.entity.js","sourceRoot":"","sources":["../../../../libs/tatayab-entities-library/src/entities/coupon-store.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+DAAmF;AACnF,mDAAyC;AACzC,iDAAuC;AAGhC,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,4BAAK;CAWrC,CAAA;AAXY,kCAAW;AAGd;IAFP,IAAA,iCAAU,EAAC,GAAG,EAAE,CAAC,sBAAM,CAAC;IACxB,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;6CACJ;AAIjB;IAFP,IAAA,iCAAU,EAAC,GAAG,EAAE,CAAC,oBAAK,CAAC;IACvB,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;4CACL;AAES;IAAhC,IAAA,gCAAS,EAAC,GAAG,EAAE,CAAC,sBAAM,CAAC;8BAAiB,sBAAM;2CAAC;AACf;IAAhC,IAAA,gCAAS,EAAC,GAAG,EAAE,CAAC,oBAAK,CAAC;8BAAiB,oBAAK;0CAAC;sBAVnC,WAAW;IADvB,4BAAK;GACO,WAAW,CAWvB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Model } from 'sequelize-typescript';
|
|
2
|
+
import { Coupon } from './coupon.entity';
|
|
3
|
+
import { User } from './user.entity';
|
|
4
|
+
export declare class CouponUser extends Model {
|
|
5
|
+
couponId: number;
|
|
6
|
+
userId: number;
|
|
7
|
+
usedCount: number;
|
|
8
|
+
isPreAssigned: boolean;
|
|
9
|
+
coupon: Coupon;
|
|
10
|
+
user: User;
|
|
11
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
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.CouponUser = void 0;
|
|
13
|
+
const sequelize_typescript_1 = require("sequelize-typescript");
|
|
14
|
+
const coupon_entity_1 = require("./coupon.entity");
|
|
15
|
+
const user_entity_1 = require("./user.entity");
|
|
16
|
+
let CouponUser = class CouponUser extends sequelize_typescript_1.Model {
|
|
17
|
+
};
|
|
18
|
+
exports.CouponUser = CouponUser;
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, sequelize_typescript_1.ForeignKey)(() => coupon_entity_1.Coupon),
|
|
21
|
+
(0, sequelize_typescript_1.Column)({ allowNull: false }),
|
|
22
|
+
__metadata("design:type", Number)
|
|
23
|
+
], CouponUser.prototype, "couponId", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, sequelize_typescript_1.ForeignKey)(() => user_entity_1.User),
|
|
26
|
+
(0, sequelize_typescript_1.Column)({ allowNull: false }),
|
|
27
|
+
__metadata("design:type", Number)
|
|
28
|
+
], CouponUser.prototype, "userId", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, sequelize_typescript_1.Column)({ allowNull: false, defaultValue: 0 }),
|
|
31
|
+
__metadata("design:type", Number)
|
|
32
|
+
], CouponUser.prototype, "usedCount", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, sequelize_typescript_1.Column)({ allowNull: false, defaultValue: false }),
|
|
35
|
+
__metadata("design:type", Boolean)
|
|
36
|
+
], CouponUser.prototype, "isPreAssigned", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, sequelize_typescript_1.BelongsTo)(() => coupon_entity_1.Coupon),
|
|
39
|
+
__metadata("design:type", coupon_entity_1.Coupon)
|
|
40
|
+
], CouponUser.prototype, "coupon", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, sequelize_typescript_1.BelongsTo)(() => user_entity_1.User),
|
|
43
|
+
__metadata("design:type", user_entity_1.User)
|
|
44
|
+
], CouponUser.prototype, "user", void 0);
|
|
45
|
+
exports.CouponUser = CouponUser = __decorate([
|
|
46
|
+
sequelize_typescript_1.Table
|
|
47
|
+
], CouponUser);
|
|
48
|
+
//# sourceMappingURL=coupon-user.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coupon-user.entity.js","sourceRoot":"","sources":["../../../../libs/tatayab-entities-library/src/entities/coupon-user.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+DAAmF;AACnF,mDAAyC;AACzC,+CAAqC;AAG9B,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,4BAAK;CAqBpC,CAAA;AArBY,gCAAU;AAGb;IAFP,IAAA,iCAAU,EAAC,GAAG,EAAE,CAAC,sBAAM,CAAC;IACxB,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;4CACJ;AAIjB;IAFP,IAAA,iCAAU,EAAC,GAAG,EAAE,CAAC,kBAAI,CAAC;IACtB,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;0CACN;AAIf;IADP,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,EAAE,CAAC;;6CACpB;AAMlB;IADP,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC;;iDACnB;AAEE;IAAhC,IAAA,gCAAS,EAAC,GAAG,EAAE,CAAC,sBAAM,CAAC;8BAAiB,sBAAM;0CAAC;AACf;IAAhC,IAAA,gCAAS,EAAC,GAAG,EAAE,CAAC,kBAAI,CAAC;8BAAiB,kBAAI;wCAAC;qBApBjC,UAAU;IADtB,4BAAK;GACO,UAAU,CAqBtB"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Model } from 'sequelize-typescript';
|
|
2
|
+
import { CouponStore } from './coupon-store.entity';
|
|
3
|
+
import { CouponProduct } from './coupon-product.entity';
|
|
4
|
+
import { CouponUser } from './coupon-user.entity';
|
|
5
|
+
export declare enum CouponDiscountType {
|
|
6
|
+
FIXED = "fixed",
|
|
7
|
+
PERCENTAGE = "percentage"
|
|
8
|
+
}
|
|
9
|
+
export declare enum CouponAppliesTo {
|
|
10
|
+
SUBTOTAL = "subtotal",
|
|
11
|
+
DELIVERY = "delivery",
|
|
12
|
+
VAT = "vat"
|
|
13
|
+
}
|
|
14
|
+
export declare enum CouponOsTarget {
|
|
15
|
+
ALL = "all",
|
|
16
|
+
IOS = "ios",
|
|
17
|
+
ANDROID = "android",
|
|
18
|
+
WEB = "web"
|
|
19
|
+
}
|
|
20
|
+
export declare class Coupon extends Model {
|
|
21
|
+
code: string;
|
|
22
|
+
nameEn: string;
|
|
23
|
+
nameAr: string;
|
|
24
|
+
descriptionEn?: string;
|
|
25
|
+
descriptionAr?: string;
|
|
26
|
+
startsAt: Date;
|
|
27
|
+
expiresAt: Date;
|
|
28
|
+
discountType: CouponDiscountType;
|
|
29
|
+
discountValue: number;
|
|
30
|
+
maxDiscountAmount?: number;
|
|
31
|
+
appliesTo: CouponAppliesTo;
|
|
32
|
+
minOrderAmount?: number;
|
|
33
|
+
osTarget: CouponOsTarget;
|
|
34
|
+
maxUsesTotal?: number;
|
|
35
|
+
maxUsesPerUser?: number;
|
|
36
|
+
totalUsed: number;
|
|
37
|
+
isStoreSpecific: boolean;
|
|
38
|
+
isProductSpecific: boolean;
|
|
39
|
+
isUserSpecific: boolean;
|
|
40
|
+
isActive: boolean;
|
|
41
|
+
couponStores: CouponStore[];
|
|
42
|
+
couponProducts: CouponProduct[];
|
|
43
|
+
couponUsers: CouponUser[];
|
|
44
|
+
}
|
|
@@ -0,0 +1,145 @@
|
|
|
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.Coupon = exports.CouponOsTarget = exports.CouponAppliesTo = exports.CouponDiscountType = void 0;
|
|
13
|
+
const sequelize_typescript_1 = require("sequelize-typescript");
|
|
14
|
+
const coupon_store_entity_1 = require("./coupon-store.entity");
|
|
15
|
+
const coupon_product_entity_1 = require("./coupon-product.entity");
|
|
16
|
+
const coupon_user_entity_1 = require("./coupon-user.entity");
|
|
17
|
+
var CouponDiscountType;
|
|
18
|
+
(function (CouponDiscountType) {
|
|
19
|
+
CouponDiscountType["FIXED"] = "fixed";
|
|
20
|
+
CouponDiscountType["PERCENTAGE"] = "percentage";
|
|
21
|
+
})(CouponDiscountType || (exports.CouponDiscountType = CouponDiscountType = {}));
|
|
22
|
+
var CouponAppliesTo;
|
|
23
|
+
(function (CouponAppliesTo) {
|
|
24
|
+
CouponAppliesTo["SUBTOTAL"] = "subtotal";
|
|
25
|
+
CouponAppliesTo["DELIVERY"] = "delivery";
|
|
26
|
+
CouponAppliesTo["VAT"] = "vat";
|
|
27
|
+
})(CouponAppliesTo || (exports.CouponAppliesTo = CouponAppliesTo = {}));
|
|
28
|
+
var CouponOsTarget;
|
|
29
|
+
(function (CouponOsTarget) {
|
|
30
|
+
CouponOsTarget["ALL"] = "all";
|
|
31
|
+
CouponOsTarget["IOS"] = "ios";
|
|
32
|
+
CouponOsTarget["ANDROID"] = "android";
|
|
33
|
+
CouponOsTarget["WEB"] = "web";
|
|
34
|
+
})(CouponOsTarget || (exports.CouponOsTarget = CouponOsTarget = {}));
|
|
35
|
+
let Coupon = class Coupon extends sequelize_typescript_1.Model {
|
|
36
|
+
};
|
|
37
|
+
exports.Coupon = Coupon;
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, sequelize_typescript_1.Column)({ allowNull: false, unique: true }),
|
|
40
|
+
__metadata("design:type", String)
|
|
41
|
+
], Coupon.prototype, "code", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, sequelize_typescript_1.Column)({ allowNull: false }),
|
|
44
|
+
__metadata("design:type", String)
|
|
45
|
+
], Coupon.prototype, "nameEn", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, sequelize_typescript_1.Column)({ allowNull: false }),
|
|
48
|
+
__metadata("design:type", String)
|
|
49
|
+
], Coupon.prototype, "nameAr", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, sequelize_typescript_1.Column)({ type: sequelize_typescript_1.DataType.TEXT, allowNull: true }),
|
|
52
|
+
__metadata("design:type", String)
|
|
53
|
+
], Coupon.prototype, "descriptionEn", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, sequelize_typescript_1.Column)({ type: sequelize_typescript_1.DataType.TEXT, allowNull: true }),
|
|
56
|
+
__metadata("design:type", String)
|
|
57
|
+
], Coupon.prototype, "descriptionAr", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, sequelize_typescript_1.Column)({ type: sequelize_typescript_1.DataType.DATE, allowNull: false }),
|
|
60
|
+
__metadata("design:type", Date)
|
|
61
|
+
], Coupon.prototype, "startsAt", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, sequelize_typescript_1.Column)({ type: sequelize_typescript_1.DataType.DATE, allowNull: false }),
|
|
64
|
+
__metadata("design:type", Date)
|
|
65
|
+
], Coupon.prototype, "expiresAt", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
(0, sequelize_typescript_1.Column)({
|
|
68
|
+
type: sequelize_typescript_1.DataType.ENUM(...Object.values(CouponDiscountType)),
|
|
69
|
+
allowNull: false,
|
|
70
|
+
defaultValue: CouponDiscountType.PERCENTAGE,
|
|
71
|
+
}),
|
|
72
|
+
__metadata("design:type", String)
|
|
73
|
+
], Coupon.prototype, "discountType", void 0);
|
|
74
|
+
__decorate([
|
|
75
|
+
(0, sequelize_typescript_1.Column)({ type: sequelize_typescript_1.DataType.DECIMAL(10, 3), allowNull: false }),
|
|
76
|
+
__metadata("design:type", Number)
|
|
77
|
+
], Coupon.prototype, "discountValue", void 0);
|
|
78
|
+
__decorate([
|
|
79
|
+
(0, sequelize_typescript_1.Column)({ type: sequelize_typescript_1.DataType.DECIMAL(10, 3), allowNull: true }),
|
|
80
|
+
__metadata("design:type", Number)
|
|
81
|
+
], Coupon.prototype, "maxDiscountAmount", void 0);
|
|
82
|
+
__decorate([
|
|
83
|
+
(0, sequelize_typescript_1.Column)({
|
|
84
|
+
type: sequelize_typescript_1.DataType.ENUM(...Object.values(CouponAppliesTo)),
|
|
85
|
+
allowNull: false,
|
|
86
|
+
defaultValue: CouponAppliesTo.SUBTOTAL,
|
|
87
|
+
}),
|
|
88
|
+
__metadata("design:type", String)
|
|
89
|
+
], Coupon.prototype, "appliesTo", void 0);
|
|
90
|
+
__decorate([
|
|
91
|
+
(0, sequelize_typescript_1.Column)({ type: sequelize_typescript_1.DataType.DECIMAL(10, 3), allowNull: true, defaultValue: 0 }),
|
|
92
|
+
__metadata("design:type", Number)
|
|
93
|
+
], Coupon.prototype, "minOrderAmount", void 0);
|
|
94
|
+
__decorate([
|
|
95
|
+
(0, sequelize_typescript_1.Column)({
|
|
96
|
+
type: sequelize_typescript_1.DataType.ENUM(...Object.values(CouponOsTarget)),
|
|
97
|
+
allowNull: false,
|
|
98
|
+
defaultValue: CouponOsTarget.ALL,
|
|
99
|
+
}),
|
|
100
|
+
__metadata("design:type", String)
|
|
101
|
+
], Coupon.prototype, "osTarget", void 0);
|
|
102
|
+
__decorate([
|
|
103
|
+
(0, sequelize_typescript_1.Column)({ type: sequelize_typescript_1.DataType.INTEGER, allowNull: true }),
|
|
104
|
+
__metadata("design:type", Number)
|
|
105
|
+
], Coupon.prototype, "maxUsesTotal", void 0);
|
|
106
|
+
__decorate([
|
|
107
|
+
(0, sequelize_typescript_1.Column)({ type: sequelize_typescript_1.DataType.INTEGER, allowNull: true, defaultValue: 1 }),
|
|
108
|
+
__metadata("design:type", Number)
|
|
109
|
+
], Coupon.prototype, "maxUsesPerUser", void 0);
|
|
110
|
+
__decorate([
|
|
111
|
+
(0, sequelize_typescript_1.Column)({ type: sequelize_typescript_1.DataType.INTEGER, allowNull: false, defaultValue: 0 }),
|
|
112
|
+
__metadata("design:type", Number)
|
|
113
|
+
], Coupon.prototype, "totalUsed", void 0);
|
|
114
|
+
__decorate([
|
|
115
|
+
(0, sequelize_typescript_1.Column)({ allowNull: false, defaultValue: false }),
|
|
116
|
+
__metadata("design:type", Boolean)
|
|
117
|
+
], Coupon.prototype, "isStoreSpecific", void 0);
|
|
118
|
+
__decorate([
|
|
119
|
+
(0, sequelize_typescript_1.Column)({ allowNull: false, defaultValue: false }),
|
|
120
|
+
__metadata("design:type", Boolean)
|
|
121
|
+
], Coupon.prototype, "isProductSpecific", void 0);
|
|
122
|
+
__decorate([
|
|
123
|
+
(0, sequelize_typescript_1.Column)({ allowNull: false, defaultValue: false }),
|
|
124
|
+
__metadata("design:type", Boolean)
|
|
125
|
+
], Coupon.prototype, "isUserSpecific", void 0);
|
|
126
|
+
__decorate([
|
|
127
|
+
(0, sequelize_typescript_1.Column)({ allowNull: false, defaultValue: true }),
|
|
128
|
+
__metadata("design:type", Boolean)
|
|
129
|
+
], Coupon.prototype, "isActive", void 0);
|
|
130
|
+
__decorate([
|
|
131
|
+
(0, sequelize_typescript_1.HasMany)(() => coupon_store_entity_1.CouponStore),
|
|
132
|
+
__metadata("design:type", Array)
|
|
133
|
+
], Coupon.prototype, "couponStores", void 0);
|
|
134
|
+
__decorate([
|
|
135
|
+
(0, sequelize_typescript_1.HasMany)(() => coupon_product_entity_1.CouponProduct),
|
|
136
|
+
__metadata("design:type", Array)
|
|
137
|
+
], Coupon.prototype, "couponProducts", void 0);
|
|
138
|
+
__decorate([
|
|
139
|
+
(0, sequelize_typescript_1.HasMany)(() => coupon_user_entity_1.CouponUser),
|
|
140
|
+
__metadata("design:type", Array)
|
|
141
|
+
], Coupon.prototype, "couponUsers", void 0);
|
|
142
|
+
exports.Coupon = Coupon = __decorate([
|
|
143
|
+
sequelize_typescript_1.Table
|
|
144
|
+
], Coupon);
|
|
145
|
+
//# sourceMappingURL=coupon.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coupon.entity.js","sourceRoot":"","sources":["../../../../libs/tatayab-entities-library/src/entities/coupon.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+DAE8B;AAC9B,+DAAoD;AACpD,mEAAwD;AACxD,6DAAkD;AAElD,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC5B,qCAAoB,CAAA;IACpB,+CAAyB,CAAA;AAC3B,CAAC,EAHW,kBAAkB,kCAAlB,kBAAkB,QAG7B;AAED,IAAY,eAIX;AAJD,WAAY,eAAe;IACzB,wCAAsB,CAAA;IACtB,wCAAsB,CAAA;IACtB,8BAAiB,CAAA;AACnB,CAAC,EAJW,eAAe,+BAAf,eAAe,QAI1B;AAED,IAAY,cAKX;AALD,WAAY,cAAc;IACxB,6BAAe,CAAA;IACf,6BAAe,CAAA;IACf,qCAAmB,CAAA;IACnB,6BAAe,CAAA;AACjB,CAAC,EALW,cAAc,8BAAd,cAAc,QAKzB;AAGM,IAAM,MAAM,GAAZ,MAAM,MAAO,SAAQ,4BAAK;CAmGhC,CAAA;AAnGY,wBAAM;AAGT;IADP,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;;oCACtB;AAGb;IADP,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;sCACN;AAGf;IADP,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;sCACN;AAGf;IADP,IAAA,6BAAM,EAAC,EAAE,IAAI,EAAE,+BAAQ,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;;6CAClB;AAGvB;IADP,IAAA,6BAAM,EAAC,EAAE,IAAI,EAAE,+BAAQ,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;;6CAClB;AAIvB;IADP,IAAA,6BAAM,EAAC,EAAE,IAAI,EAAE,+BAAQ,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;8BAChC,IAAI;wCAAC;AAGf;IADP,IAAA,6BAAM,EAAC,EAAE,IAAI,EAAE,+BAAQ,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;8BAC/B,IAAI;yCAAC;AAQhB;IALP,IAAA,6BAAM,EAAC;QACN,IAAI,EAAE,+BAAQ,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;QACzD,SAAS,EAAE,KAAK;QAChB,YAAY,EAAE,kBAAkB,CAAC,UAAU;KAC5C,CAAC;;4CACuC;AAIjC;IADP,IAAA,6BAAM,EAAC,EAAE,IAAI,EAAE,+BAAQ,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;6CAC9B;AAKtB;IADP,IAAA,6BAAM,EAAC,EAAE,IAAI,EAAE,+BAAQ,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;;iDACxB;AAQ3B;IALP,IAAA,6BAAM,EAAC;QACN,IAAI,EAAE,+BAAQ,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;QACtD,SAAS,EAAE,KAAK;QAChB,YAAY,EAAE,eAAe,CAAC,QAAQ;KACvC,CAAC;;yCACiC;AAI3B;IADP,IAAA,6BAAM,EAAC,EAAE,IAAI,EAAE,+BAAQ,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,EAAE,CAAC;;8CAC5C;AAQxB;IALP,IAAA,6BAAM,EAAC;QACN,IAAI,EAAE,+BAAQ,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;QACrD,SAAS,EAAE,KAAK;QAChB,YAAY,EAAE,cAAc,CAAC,GAAG;KACjC,CAAC;;wCAC+B;AAKzB;IADP,IAAA,6BAAM,EAAC,EAAE,IAAI,EAAE,+BAAQ,CAAC,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;;4CACtB;AAItB;IADP,IAAA,6BAAM,EAAC,EAAE,IAAI,EAAE,+BAAQ,CAAC,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,EAAE,CAAC;;8CACrC;AAIxB;IADP,IAAA,6BAAM,EAAC,EAAE,IAAI,EAAE,+BAAQ,CAAC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,EAAE,CAAC;;yCAC5C;AAMlB;IADP,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC;;+CACjB;AAGzB;IADP,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC;;iDACf;AAG3B;IADP,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC;;8CAClB;AAGxB;IADP,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC;;wCACvB;AAKlB;IADP,IAAA,8BAAO,EAAC,GAAG,EAAE,CAAC,iCAAW,CAAC;;4CACS;AAG5B;IADP,IAAA,8BAAO,EAAC,GAAG,EAAE,CAAC,qCAAa,CAAC;;8CACW;AAGhC;IADP,IAAA,8BAAO,EAAC,GAAG,EAAE,CAAC,+BAAU,CAAC;;2CACQ;iBAlGvB,MAAM;IADlB,4BAAK;GACO,MAAM,CAmGlB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Model } from 'sequelize-typescript';
|
|
2
|
+
import { OrderItem } from './order-item.entity';
|
|
3
|
+
import { Product } from './product.entity';
|
|
4
|
+
import { ProductVariant } from './product-variant.entity';
|
|
5
|
+
export declare class OrderItemBundleSelection extends Model {
|
|
6
|
+
orderItemId: number;
|
|
7
|
+
productId: number;
|
|
8
|
+
productVariantId?: number;
|
|
9
|
+
productNameEn?: string;
|
|
10
|
+
productNameAr?: string;
|
|
11
|
+
variantLabelEn?: string;
|
|
12
|
+
variantLabelAr?: string;
|
|
13
|
+
sortOrder: number;
|
|
14
|
+
orderItem: OrderItem;
|
|
15
|
+
product: Product;
|
|
16
|
+
variant?: ProductVariant;
|
|
17
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
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.OrderItemBundleSelection = void 0;
|
|
13
|
+
const sequelize_typescript_1 = require("sequelize-typescript");
|
|
14
|
+
const order_item_entity_1 = require("./order-item.entity");
|
|
15
|
+
const product_entity_1 = require("./product.entity");
|
|
16
|
+
const product_variant_entity_1 = require("./product-variant.entity");
|
|
17
|
+
let OrderItemBundleSelection = class OrderItemBundleSelection extends sequelize_typescript_1.Model {
|
|
18
|
+
};
|
|
19
|
+
exports.OrderItemBundleSelection = OrderItemBundleSelection;
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, sequelize_typescript_1.ForeignKey)(() => order_item_entity_1.OrderItem),
|
|
22
|
+
(0, sequelize_typescript_1.Column)({ allowNull: false }),
|
|
23
|
+
__metadata("design:type", Number)
|
|
24
|
+
], OrderItemBundleSelection.prototype, "orderItemId", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, sequelize_typescript_1.ForeignKey)(() => product_entity_1.Product),
|
|
27
|
+
(0, sequelize_typescript_1.Column)({ allowNull: false }),
|
|
28
|
+
__metadata("design:type", Number)
|
|
29
|
+
], OrderItemBundleSelection.prototype, "productId", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, sequelize_typescript_1.ForeignKey)(() => product_variant_entity_1.ProductVariant),
|
|
32
|
+
(0, sequelize_typescript_1.Column)({ allowNull: true }),
|
|
33
|
+
__metadata("design:type", Number)
|
|
34
|
+
], OrderItemBundleSelection.prototype, "productVariantId", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, sequelize_typescript_1.Column)({ allowNull: true }),
|
|
37
|
+
__metadata("design:type", String)
|
|
38
|
+
], OrderItemBundleSelection.prototype, "productNameEn", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, sequelize_typescript_1.Column)({ allowNull: true }),
|
|
41
|
+
__metadata("design:type", String)
|
|
42
|
+
], OrderItemBundleSelection.prototype, "productNameAr", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, sequelize_typescript_1.Column)({ allowNull: true }),
|
|
45
|
+
__metadata("design:type", String)
|
|
46
|
+
], OrderItemBundleSelection.prototype, "variantLabelEn", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, sequelize_typescript_1.Column)({ allowNull: true }),
|
|
49
|
+
__metadata("design:type", String)
|
|
50
|
+
], OrderItemBundleSelection.prototype, "variantLabelAr", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, sequelize_typescript_1.Column)({ allowNull: false, defaultValue: 0 }),
|
|
53
|
+
__metadata("design:type", Number)
|
|
54
|
+
], OrderItemBundleSelection.prototype, "sortOrder", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, sequelize_typescript_1.BelongsTo)(() => order_item_entity_1.OrderItem),
|
|
57
|
+
__metadata("design:type", order_item_entity_1.OrderItem)
|
|
58
|
+
], OrderItemBundleSelection.prototype, "orderItem", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, sequelize_typescript_1.BelongsTo)(() => product_entity_1.Product),
|
|
61
|
+
__metadata("design:type", product_entity_1.Product)
|
|
62
|
+
], OrderItemBundleSelection.prototype, "product", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, sequelize_typescript_1.BelongsTo)(() => product_variant_entity_1.ProductVariant),
|
|
65
|
+
__metadata("design:type", product_variant_entity_1.ProductVariant)
|
|
66
|
+
], OrderItemBundleSelection.prototype, "variant", void 0);
|
|
67
|
+
exports.OrderItemBundleSelection = OrderItemBundleSelection = __decorate([
|
|
68
|
+
sequelize_typescript_1.Table
|
|
69
|
+
], OrderItemBundleSelection);
|
|
70
|
+
//# sourceMappingURL=order-item-bundle-selection.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"order-item-bundle-selection.entity.js","sourceRoot":"","sources":["../../../../libs/tatayab-entities-library/src/entities/order-item-bundle-selection.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+DAAmF;AACnF,2DAAgD;AAChD,qDAA2C;AAC3C,qEAA0D;AAGnD,IAAM,wBAAwB,GAA9B,MAAM,wBAAyB,SAAQ,4BAAK;CA+BlD,CAAA;AA/BY,4DAAwB;AAG3B;IAFP,IAAA,iCAAU,EAAC,GAAG,EAAE,CAAC,6BAAS,CAAC;IAC3B,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;6DACD;AAIpB;IAFP,IAAA,iCAAU,EAAC,GAAG,EAAE,CAAC,wBAAO,CAAC;IACzB,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;2DACH;AAIlB;IAFP,IAAA,iCAAU,EAAC,GAAG,EAAE,CAAC,uCAAc,CAAC;IAChC,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;;kEACM;AAG1B;IADP,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;;+DACG;AAGvB;IADP,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;;+DACG;AAGvB;IADP,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;;gEACI;AAGxB;IADP,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;;gEACI;AAGxB;IADP,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,EAAE,CAAC;;2DACpB;AAEW;IAApC,IAAA,gCAAS,EAAC,GAAG,EAAE,CAAC,6BAAS,CAAC;8BAAqB,6BAAS;2DAAC;AACrB;IAApC,IAAA,gCAAS,EAAC,GAAG,EAAE,CAAC,wBAAO,CAAC;8BAAqB,wBAAO;yDAAC;AACb;IAAxC,IAAA,gCAAS,EAAC,GAAG,EAAE,CAAC,uCAAc,CAAC;8BAAmB,uCAAc;yDAAC;mCA9BvD,wBAAwB;IADpC,4BAAK;GACO,wBAAwB,CA+BpC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Model } from 'sequelize-typescript';
|
|
2
|
+
import { Order } from './order.entity';
|
|
3
|
+
import { Product } from './product.entity';
|
|
4
|
+
import { ProductVariant } from './product-variant.entity';
|
|
5
|
+
import { Bundle } from './bundle.entity';
|
|
6
|
+
import { OrderItemBundleSelection } from './order-item-bundle-selection.entity';
|
|
7
|
+
import { PurchaseOrderOrderItem } from './purchase-order-order-item.entity';
|
|
8
|
+
export declare enum OrderItemType {
|
|
9
|
+
PRODUCT = "product",
|
|
10
|
+
BUNDLE = "bundle"
|
|
11
|
+
}
|
|
12
|
+
export declare enum OrderItemFulfillmentStatus {
|
|
13
|
+
PENDING = "pending",
|
|
14
|
+
AWAITING_STOCK = "awaiting_stock",
|
|
15
|
+
PO_LINKED = "po_linked",
|
|
16
|
+
PO_RECEIVED = "po_received",
|
|
17
|
+
STOCK_RESERVED = "stock_reserved",
|
|
18
|
+
PACKED = "packed",
|
|
19
|
+
SHIPPED = "shipped",
|
|
20
|
+
DELIVERED = "delivered",
|
|
21
|
+
CANCELLED = "cancelled",
|
|
22
|
+
RETURN_REQUESTED = "return_requested",
|
|
23
|
+
RETURNED = "returned"
|
|
24
|
+
}
|
|
25
|
+
export declare class OrderItem extends Model {
|
|
26
|
+
orderId: number;
|
|
27
|
+
itemType: OrderItemType;
|
|
28
|
+
productId?: number;
|
|
29
|
+
productVariantId?: number;
|
|
30
|
+
bundleId?: number;
|
|
31
|
+
composedSku?: string;
|
|
32
|
+
productNameEn?: string;
|
|
33
|
+
productNameAr?: string;
|
|
34
|
+
sku?: string;
|
|
35
|
+
variantLabelEn?: string;
|
|
36
|
+
variantLabelAr?: string;
|
|
37
|
+
productImage?: string;
|
|
38
|
+
quantity: number;
|
|
39
|
+
unitPrice: number;
|
|
40
|
+
lineTotal: number;
|
|
41
|
+
fulfillmentInventoryId?: number;
|
|
42
|
+
shipmentGroup: number;
|
|
43
|
+
fulfillmentStatus: OrderItemFulfillmentStatus;
|
|
44
|
+
order: Order;
|
|
45
|
+
product?: Product;
|
|
46
|
+
variant?: ProductVariant;
|
|
47
|
+
bundle?: Bundle;
|
|
48
|
+
bundleSelections: OrderItemBundleSelection[];
|
|
49
|
+
poLink?: PurchaseOrderOrderItem;
|
|
50
|
+
}
|