tt-entities 0.0.30 → 0.0.32

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.
Files changed (34) hide show
  1. package/dist/libs/tatayab-entities-library/entities/cart-item-bundle-selection.entity.d.ts +13 -0
  2. package/dist/libs/tatayab-entities-library/entities/cart-item-bundle-selection.entity.js +54 -0
  3. package/dist/libs/tatayab-entities-library/entities/cart-item-bundle-selection.entity.js.map +1 -0
  4. package/dist/libs/tatayab-entities-library/entities/cart-item.entity.d.ts +26 -0
  5. package/dist/libs/tatayab-entities-library/entities/cart-item.entity.js +93 -0
  6. package/dist/libs/tatayab-entities-library/entities/cart-item.entity.js.map +1 -0
  7. package/dist/libs/tatayab-entities-library/entities/cart.entity.d.ts +20 -0
  8. package/dist/libs/tatayab-entities-library/entities/cart.entity.js +68 -0
  9. package/dist/libs/tatayab-entities-library/entities/cart.entity.js.map +1 -0
  10. package/dist/libs/tatayab-entities-library/entities/coupon-product.entity.d.ts +12 -0
  11. package/dist/libs/tatayab-entities-library/entities/coupon-product.entity.js +50 -0
  12. package/dist/libs/tatayab-entities-library/entities/coupon-product.entity.js.map +1 -0
  13. package/dist/libs/tatayab-entities-library/entities/coupon-store.entity.d.ts +9 -0
  14. package/dist/libs/tatayab-entities-library/entities/coupon-store.entity.js +40 -0
  15. package/dist/libs/tatayab-entities-library/entities/coupon-store.entity.js.map +1 -0
  16. package/dist/libs/tatayab-entities-library/entities/coupon-user.entity.d.ts +11 -0
  17. package/dist/libs/tatayab-entities-library/entities/coupon-user.entity.js +48 -0
  18. package/dist/libs/tatayab-entities-library/entities/coupon-user.entity.js.map +1 -0
  19. package/dist/libs/tatayab-entities-library/entities/coupon.entity.d.ts +44 -0
  20. package/dist/libs/tatayab-entities-library/entities/coupon.entity.js +145 -0
  21. package/dist/libs/tatayab-entities-library/entities/coupon.entity.js.map +1 -0
  22. package/dist/libs/tatayab-entities-library/index.d.ts +7 -0
  23. package/dist/libs/tatayab-entities-library/index.js +35 -2
  24. package/dist/libs/tatayab-entities-library/index.js.map +1 -1
  25. package/dist/src/main.js +604 -3
  26. package/libs/tatayab-entities-library/src/entities/cart-item-bundle-selection.entity.ts +36 -0
  27. package/libs/tatayab-entities-library/src/entities/cart-item.entity.ts +75 -0
  28. package/libs/tatayab-entities-library/src/entities/cart.entity.ts +58 -0
  29. package/libs/tatayab-entities-library/src/entities/coupon-product.entity.ts +25 -0
  30. package/libs/tatayab-entities-library/src/entities/coupon-store.entity.ts +17 -0
  31. package/libs/tatayab-entities-library/src/entities/coupon-user.entity.ts +27 -0
  32. package/libs/tatayab-entities-library/src/entities/coupon.entity.ts +126 -0
  33. package/libs/tatayab-entities-library/src/index.ts +38 -0
  34. package/package.json +1 -1
@@ -0,0 +1,13 @@
1
+ import { Model } from 'sequelize-typescript';
2
+ import { CartItem } from './cart-item.entity';
3
+ import { Product } from './product.entity';
4
+ import { ProductVariant } from './product-variant.entity';
5
+ export declare class CartItemBundleSelection extends Model {
6
+ cartItemId: number;
7
+ productId: number;
8
+ productVariantId?: number;
9
+ sortOrder: number;
10
+ cartItem: CartItem;
11
+ product: Product;
12
+ variant?: ProductVariant;
13
+ }
@@ -0,0 +1,54 @@
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.CartItemBundleSelection = void 0;
13
+ const sequelize_typescript_1 = require("sequelize-typescript");
14
+ const cart_item_entity_1 = require("./cart-item.entity");
15
+ const product_entity_1 = require("./product.entity");
16
+ const product_variant_entity_1 = require("./product-variant.entity");
17
+ let CartItemBundleSelection = class CartItemBundleSelection extends sequelize_typescript_1.Model {
18
+ };
19
+ exports.CartItemBundleSelection = CartItemBundleSelection;
20
+ __decorate([
21
+ (0, sequelize_typescript_1.ForeignKey)(() => cart_item_entity_1.CartItem),
22
+ (0, sequelize_typescript_1.Column)({ allowNull: false }),
23
+ __metadata("design:type", Number)
24
+ ], CartItemBundleSelection.prototype, "cartItemId", 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
+ ], CartItemBundleSelection.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
+ ], CartItemBundleSelection.prototype, "productVariantId", void 0);
35
+ __decorate([
36
+ (0, sequelize_typescript_1.Column)({ allowNull: false, defaultValue: 0 }),
37
+ __metadata("design:type", Number)
38
+ ], CartItemBundleSelection.prototype, "sortOrder", void 0);
39
+ __decorate([
40
+ (0, sequelize_typescript_1.BelongsTo)(() => cart_item_entity_1.CartItem),
41
+ __metadata("design:type", cart_item_entity_1.CartItem)
42
+ ], CartItemBundleSelection.prototype, "cartItem", void 0);
43
+ __decorate([
44
+ (0, sequelize_typescript_1.BelongsTo)(() => product_entity_1.Product),
45
+ __metadata("design:type", product_entity_1.Product)
46
+ ], CartItemBundleSelection.prototype, "product", void 0);
47
+ __decorate([
48
+ (0, sequelize_typescript_1.BelongsTo)(() => product_variant_entity_1.ProductVariant),
49
+ __metadata("design:type", product_variant_entity_1.ProductVariant)
50
+ ], CartItemBundleSelection.prototype, "variant", void 0);
51
+ exports.CartItemBundleSelection = CartItemBundleSelection = __decorate([
52
+ sequelize_typescript_1.Table
53
+ ], CartItemBundleSelection);
54
+ //# sourceMappingURL=cart-item-bundle-selection.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cart-item-bundle-selection.entity.js","sourceRoot":"","sources":["../../../../libs/tatayab-entities-library/src/entities/cart-item-bundle-selection.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+DAE8B;AAC9B,yDAA8C;AAC9C,qDAA2C;AAC3C,qEAA0D;AAGnD,IAAM,uBAAuB,GAA7B,MAAM,uBAAwB,SAAQ,4BAAK;CA2BjD,CAAA;AA3BY,0DAAuB;AAG1B;IAFP,IAAA,iCAAU,EAAC,GAAG,EAAE,CAAC,2BAAQ,CAAC;IAC1B,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;2DACF;AAInB;IAFP,IAAA,iCAAU,EAAC,GAAG,EAAE,CAAC,wBAAO,CAAC;IACzB,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;0DACH;AAIlB;IAFP,IAAA,iCAAU,EAAC,GAAG,EAAE,CAAC,uCAAc,CAAC;IAChC,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;;iEACM;AAI1B;IADP,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,EAAE,CAAC;;0DACpB;AAKlB;IADP,IAAA,gCAAS,EAAC,GAAG,EAAE,CAAC,2BAAQ,CAAC;8BACR,2BAAQ;yDAAC;AAGnB;IADP,IAAA,gCAAS,EAAC,GAAG,EAAE,CAAC,wBAAO,CAAC;8BACR,wBAAO;wDAAC;AAGjB;IADP,IAAA,gCAAS,EAAC,GAAG,EAAE,CAAC,uCAAc,CAAC;8BACd,uCAAc;wDAAC;kCA1BtB,uBAAuB;IADnC,4BAAK;GACO,uBAAuB,CA2BnC"}
@@ -0,0 +1,26 @@
1
+ import { Model } from 'sequelize-typescript';
2
+ import { Cart } from './cart.entity';
3
+ import { Product } from './product.entity';
4
+ import { ProductVariant } from './product-variant.entity';
5
+ import { Bundle } from './bundle.entity';
6
+ import { CartItemBundleSelection } from './cart-item-bundle-selection.entity';
7
+ export declare enum CartItemType {
8
+ PRODUCT = "product",
9
+ BUNDLE = "bundle"
10
+ }
11
+ export declare class CartItem extends Model {
12
+ cartId: number;
13
+ itemType: CartItemType;
14
+ productId?: number;
15
+ productVariantId?: number;
16
+ bundleId?: number;
17
+ composedSku?: string;
18
+ quantity: number;
19
+ unitPrice: number;
20
+ isOutOfStock: boolean;
21
+ cart: Cart;
22
+ product?: Product;
23
+ variant?: ProductVariant;
24
+ bundle?: Bundle;
25
+ bundleSelections: CartItemBundleSelection[];
26
+ }
@@ -0,0 +1,93 @@
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.CartItem = exports.CartItemType = void 0;
13
+ const sequelize_typescript_1 = require("sequelize-typescript");
14
+ const cart_entity_1 = require("./cart.entity");
15
+ const product_entity_1 = require("./product.entity");
16
+ const product_variant_entity_1 = require("./product-variant.entity");
17
+ const bundle_entity_1 = require("./bundle.entity");
18
+ const cart_item_bundle_selection_entity_1 = require("./cart-item-bundle-selection.entity");
19
+ var CartItemType;
20
+ (function (CartItemType) {
21
+ CartItemType["PRODUCT"] = "product";
22
+ CartItemType["BUNDLE"] = "bundle";
23
+ })(CartItemType || (exports.CartItemType = CartItemType = {}));
24
+ let CartItem = class CartItem extends sequelize_typescript_1.Model {
25
+ };
26
+ exports.CartItem = CartItem;
27
+ __decorate([
28
+ (0, sequelize_typescript_1.ForeignKey)(() => cart_entity_1.Cart),
29
+ (0, sequelize_typescript_1.Column)({ allowNull: false }),
30
+ __metadata("design:type", Number)
31
+ ], CartItem.prototype, "cartId", void 0);
32
+ __decorate([
33
+ (0, sequelize_typescript_1.Column)({
34
+ type: sequelize_typescript_1.DataType.ENUM(...Object.values(CartItemType)),
35
+ allowNull: false,
36
+ }),
37
+ __metadata("design:type", String)
38
+ ], CartItem.prototype, "itemType", void 0);
39
+ __decorate([
40
+ (0, sequelize_typescript_1.ForeignKey)(() => product_entity_1.Product),
41
+ (0, sequelize_typescript_1.Column)({ allowNull: true }),
42
+ __metadata("design:type", Number)
43
+ ], CartItem.prototype, "productId", void 0);
44
+ __decorate([
45
+ (0, sequelize_typescript_1.ForeignKey)(() => product_variant_entity_1.ProductVariant),
46
+ (0, sequelize_typescript_1.Column)({ allowNull: true }),
47
+ __metadata("design:type", Number)
48
+ ], CartItem.prototype, "productVariantId", void 0);
49
+ __decorate([
50
+ (0, sequelize_typescript_1.ForeignKey)(() => bundle_entity_1.Bundle),
51
+ (0, sequelize_typescript_1.Column)({ allowNull: true }),
52
+ __metadata("design:type", Number)
53
+ ], CartItem.prototype, "bundleId", void 0);
54
+ __decorate([
55
+ (0, sequelize_typescript_1.Column)({ allowNull: true }),
56
+ __metadata("design:type", String)
57
+ ], CartItem.prototype, "composedSku", void 0);
58
+ __decorate([
59
+ (0, sequelize_typescript_1.Column)({ allowNull: false, defaultValue: 1 }),
60
+ __metadata("design:type", Number)
61
+ ], CartItem.prototype, "quantity", void 0);
62
+ __decorate([
63
+ (0, sequelize_typescript_1.Column)({ type: sequelize_typescript_1.DataType.DECIMAL(10, 3), allowNull: false }),
64
+ __metadata("design:type", Number)
65
+ ], CartItem.prototype, "unitPrice", void 0);
66
+ __decorate([
67
+ (0, sequelize_typescript_1.Column)({ allowNull: false, defaultValue: false }),
68
+ __metadata("design:type", Boolean)
69
+ ], CartItem.prototype, "isOutOfStock", void 0);
70
+ __decorate([
71
+ (0, sequelize_typescript_1.BelongsTo)(() => cart_entity_1.Cart),
72
+ __metadata("design:type", cart_entity_1.Cart)
73
+ ], CartItem.prototype, "cart", void 0);
74
+ __decorate([
75
+ (0, sequelize_typescript_1.BelongsTo)(() => product_entity_1.Product),
76
+ __metadata("design:type", product_entity_1.Product)
77
+ ], CartItem.prototype, "product", void 0);
78
+ __decorate([
79
+ (0, sequelize_typescript_1.BelongsTo)(() => product_variant_entity_1.ProductVariant),
80
+ __metadata("design:type", product_variant_entity_1.ProductVariant)
81
+ ], CartItem.prototype, "variant", void 0);
82
+ __decorate([
83
+ (0, sequelize_typescript_1.BelongsTo)(() => bundle_entity_1.Bundle),
84
+ __metadata("design:type", bundle_entity_1.Bundle)
85
+ ], CartItem.prototype, "bundle", void 0);
86
+ __decorate([
87
+ (0, sequelize_typescript_1.HasMany)(() => cart_item_bundle_selection_entity_1.CartItemBundleSelection),
88
+ __metadata("design:type", Array)
89
+ ], CartItem.prototype, "bundleSelections", void 0);
90
+ exports.CartItem = CartItem = __decorate([
91
+ sequelize_typescript_1.Table
92
+ ], CartItem);
93
+ //# sourceMappingURL=cart-item.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cart-item.entity.js","sourceRoot":"","sources":["../../../../libs/tatayab-entities-library/src/entities/cart-item.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+DAG8B;AAC9B,+CAAqC;AACrC,qDAA2C;AAC3C,qEAA0D;AAC1D,mDAAyC;AACzC,2FAA8E;AAE9E,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,mCAAmB,CAAA;IACnB,iCAAkB,CAAA;AACpB,CAAC,EAHW,YAAY,4BAAZ,YAAY,QAGvB;AAGM,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,4BAAK;CA0DlC,CAAA;AA1DY,4BAAQ;AAGX;IAFP,IAAA,iCAAU,EAAC,GAAG,EAAE,CAAC,kBAAI,CAAC;IACtB,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;wCACN;AAMf;IAJP,IAAA,6BAAM,EAAC;QACN,IAAI,EAAE,+BAAQ,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;QACnD,SAAS,EAAE,KAAK;KACjB,CAAC;;0CAC6B;AAKvB;IAFP,IAAA,iCAAU,EAAC,GAAG,EAAE,CAAC,wBAAO,CAAC;IACzB,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;;2CACD;AAInB;IAFP,IAAA,iCAAU,EAAC,GAAG,EAAE,CAAC,uCAAc,CAAC;IAChC,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;;kDACM;AAK1B;IAFP,IAAA,iCAAU,EAAC,GAAG,EAAE,CAAC,sBAAM,CAAC;IACxB,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;;0CACF;AAIlB;IADP,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;;6CACC;AAIrB;IADP,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,EAAE,CAAC;;0CACrB;AAIjB;IADP,IAAA,6BAAM,EAAC,EAAE,IAAI,EAAE,+BAAQ,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;2CAClC;AAKlB;IADP,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC;;8CACpB;AAKtB;IADP,IAAA,gCAAS,EAAC,GAAG,EAAE,CAAC,kBAAI,CAAC;8BACR,kBAAI;sCAAC;AAGX;IADP,IAAA,gCAAS,EAAC,GAAG,EAAE,CAAC,wBAAO,CAAC;8BACP,wBAAO;yCAAC;AAGlB;IADP,IAAA,gCAAS,EAAC,GAAG,EAAE,CAAC,uCAAc,CAAC;8BACd,uCAAc;yCAAC;AAGzB;IADP,IAAA,gCAAS,EAAC,GAAG,EAAE,CAAC,sBAAM,CAAC;8BACP,sBAAM;wCAAC;AAGhB;IADP,IAAA,8BAAO,EAAC,GAAG,EAAE,CAAC,2DAAuB,CAAC;;kDACa;mBAzDzC,QAAQ;IADpB,4BAAK;GACO,QAAQ,CA0DpB"}
@@ -0,0 +1,20 @@
1
+ import { Model } from 'sequelize-typescript';
2
+ import { User } from './user.entity';
3
+ import { Store } from './store.entity';
4
+ import { CartItem } from './cart-item.entity';
5
+ export declare enum CartStatus {
6
+ ACTIVE = "active",
7
+ MERGED = "merged",
8
+ CONVERTED = "converted",
9
+ ABANDONED = "abandoned"
10
+ }
11
+ export declare class Cart extends Model {
12
+ userId?: number;
13
+ guestToken?: string;
14
+ storeId: number;
15
+ status: CartStatus;
16
+ expiresAt?: Date;
17
+ user?: User;
18
+ store: Store;
19
+ items: CartItem[];
20
+ }
@@ -0,0 +1,68 @@
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.Cart = exports.CartStatus = void 0;
13
+ const sequelize_typescript_1 = require("sequelize-typescript");
14
+ const user_entity_1 = require("./user.entity");
15
+ const store_entity_1 = require("./store.entity");
16
+ const cart_item_entity_1 = require("./cart-item.entity");
17
+ var CartStatus;
18
+ (function (CartStatus) {
19
+ CartStatus["ACTIVE"] = "active";
20
+ CartStatus["MERGED"] = "merged";
21
+ CartStatus["CONVERTED"] = "converted";
22
+ CartStatus["ABANDONED"] = "abandoned";
23
+ })(CartStatus || (exports.CartStatus = CartStatus = {}));
24
+ let Cart = class Cart extends sequelize_typescript_1.Model {
25
+ };
26
+ exports.Cart = Cart;
27
+ __decorate([
28
+ (0, sequelize_typescript_1.ForeignKey)(() => user_entity_1.User),
29
+ (0, sequelize_typescript_1.Column)({ allowNull: true }),
30
+ __metadata("design:type", Number)
31
+ ], Cart.prototype, "userId", void 0);
32
+ __decorate([
33
+ (0, sequelize_typescript_1.Column)({ allowNull: true }),
34
+ __metadata("design:type", String)
35
+ ], Cart.prototype, "guestToken", void 0);
36
+ __decorate([
37
+ (0, sequelize_typescript_1.ForeignKey)(() => store_entity_1.Store),
38
+ (0, sequelize_typescript_1.Column)({ allowNull: false }),
39
+ __metadata("design:type", Number)
40
+ ], Cart.prototype, "storeId", void 0);
41
+ __decorate([
42
+ (0, sequelize_typescript_1.Column)({
43
+ type: sequelize_typescript_1.DataType.ENUM(...Object.values(CartStatus)),
44
+ allowNull: false,
45
+ defaultValue: CartStatus.ACTIVE,
46
+ }),
47
+ __metadata("design:type", String)
48
+ ], Cart.prototype, "status", void 0);
49
+ __decorate([
50
+ (0, sequelize_typescript_1.Column)({ type: sequelize_typescript_1.DataType.DATE, allowNull: true }),
51
+ __metadata("design:type", Date)
52
+ ], Cart.prototype, "expiresAt", void 0);
53
+ __decorate([
54
+ (0, sequelize_typescript_1.BelongsTo)(() => user_entity_1.User),
55
+ __metadata("design:type", user_entity_1.User)
56
+ ], Cart.prototype, "user", void 0);
57
+ __decorate([
58
+ (0, sequelize_typescript_1.BelongsTo)(() => store_entity_1.Store),
59
+ __metadata("design:type", store_entity_1.Store)
60
+ ], Cart.prototype, "store", void 0);
61
+ __decorate([
62
+ (0, sequelize_typescript_1.HasMany)(() => cart_item_entity_1.CartItem),
63
+ __metadata("design:type", Array)
64
+ ], Cart.prototype, "items", void 0);
65
+ exports.Cart = Cart = __decorate([
66
+ sequelize_typescript_1.Table
67
+ ], Cart);
68
+ //# sourceMappingURL=cart.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cart.entity.js","sourceRoot":"","sources":["../../../../libs/tatayab-entities-library/src/entities/cart.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+DAG8B;AAC9B,+CAAqC;AACrC,iDAAuC;AACvC,yDAA8C;AAE9C,IAAY,UAKX;AALD,WAAY,UAAU;IACpB,+BAAoB,CAAA;IACpB,+BAAoB,CAAA;IACpB,qCAAuB,CAAA;IACvB,qCAAuB,CAAA;AACzB,CAAC,EALW,UAAU,0BAAV,UAAU,QAKrB;AAGM,IAAM,IAAI,GAAV,MAAM,IAAK,SAAQ,4BAAK;CAyC9B,CAAA;AAzCY,oBAAI;AAMP;IAFP,IAAA,iCAAU,EAAC,GAAG,EAAE,CAAC,kBAAI,CAAC;IACtB,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;;oCACJ;AAKhB;IADP,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;;wCACA;AAKpB;IAFP,IAAA,iCAAU,EAAC,GAAG,EAAE,CAAC,oBAAK,CAAC;IACvB,IAAA,6BAAM,EAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;qCACL;AAQhB;IALP,IAAA,6BAAM,EAAC;QACN,IAAI,EAAE,+BAAQ,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QACjD,SAAS,EAAE,KAAK;QAChB,YAAY,EAAE,UAAU,CAAC,MAAM;KAChC,CAAC;;oCACyB;AAKnB;IADP,IAAA,6BAAM,EAAC,EAAE,IAAI,EAAE,+BAAQ,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;8BAC7B,IAAI;uCAAC;AAKjB;IADP,IAAA,gCAAS,EAAC,GAAG,EAAE,CAAC,kBAAI,CAAC;8BACP,kBAAI;kCAAC;AAGZ;IADP,IAAA,gCAAS,EAAC,GAAG,EAAE,CAAC,oBAAK,CAAC;8BACR,oBAAK;mCAAC;AAGb;IADP,IAAA,8BAAO,EAAC,GAAG,EAAE,CAAC,2BAAQ,CAAC;;mCACE;eAxCf,IAAI;IADhB,4BAAK;GACO,IAAI,CAyChB"}
@@ -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,9 @@
1
+ import { Model } from 'sequelize-typescript';
2
+ import { Coupon } from './coupon.entity';
3
+ import { Store } from './store.entity';
4
+ export declare class CouponStore extends Model {
5
+ couponId: number;
6
+ storeId: number;
7
+ coupon: Coupon;
8
+ store: Store;
9
+ }
@@ -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
+ }