tt-entities 0.0.30 → 0.0.31
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/cart-item-bundle-selection.entity.d.ts +13 -0
- package/dist/libs/tatayab-entities-library/entities/cart-item-bundle-selection.entity.js +54 -0
- package/dist/libs/tatayab-entities-library/entities/cart-item-bundle-selection.entity.js.map +1 -0
- package/dist/libs/tatayab-entities-library/entities/cart-item.entity.d.ts +26 -0
- package/dist/libs/tatayab-entities-library/entities/cart-item.entity.js +93 -0
- package/dist/libs/tatayab-entities-library/entities/cart-item.entity.js.map +1 -0
- package/dist/libs/tatayab-entities-library/entities/cart.entity.d.ts +20 -0
- package/dist/libs/tatayab-entities-library/entities/cart.entity.js +68 -0
- package/dist/libs/tatayab-entities-library/entities/cart.entity.js.map +1 -0
- package/dist/libs/tatayab-entities-library/index.d.ts +3 -0
- package/dist/libs/tatayab-entities-library/index.js +16 -2
- package/dist/libs/tatayab-entities-library/index.js.map +1 -1
- package/dist/src/main.js +262 -3
- package/libs/tatayab-entities-library/src/entities/cart-item-bundle-selection.entity.ts +36 -0
- package/libs/tatayab-entities-library/src/entities/cart-item.entity.ts +75 -0
- package/libs/tatayab-entities-library/src/entities/cart.entity.ts +58 -0
- package/libs/tatayab-entities-library/src/index.ts +15 -0
- 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"}
|
|
@@ -38,6 +38,9 @@ export { PaymentGateway, PaymentGatewayType, } from './entities/payment-gateway.
|
|
|
38
38
|
export { PaymentMethod, PaymentMethodType, } from './entities/payment-method.entity';
|
|
39
39
|
export { PaymentMethodCountry } from './entities/payment-method-country.entity';
|
|
40
40
|
export { StorePaymentMethod } from './entities/store-payment-method.entity';
|
|
41
|
+
export { Cart, CartStatus } from './entities/cart.entity';
|
|
42
|
+
export { CartItem, CartItemType } from './entities/cart-item.entity';
|
|
43
|
+
export { CartItemBundleSelection } from './entities/cart-item-bundle-selection.entity';
|
|
41
44
|
export { OsName } from './utils/enums/osName';
|
|
42
45
|
export { ProductApp } from './utils/enums/productApp';
|
|
43
46
|
export { VersionType } from './utils/enums/versiontype';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.StockMovementType = void 0;
|
|
3
|
+
exports.ProductApp = exports.OsName = exports.CartItemBundleSelection = exports.CartItemType = exports.CartItem = exports.CartStatus = exports.Cart = exports.StorePaymentMethod = exports.PaymentMethodCountry = exports.PaymentMethodType = exports.PaymentMethod = exports.PaymentGatewayType = exports.PaymentGateway = exports.RolePermission = exports.Permission = exports.PurchaseOrderItemStatus = exports.PurchaseOrderItem = exports.PurchaseOrder = exports.VendorProduct = exports.Vendor = exports.ShippingRule = exports.StockMovement = exports.InventoryStock = exports.StoreInventory = exports.Inventory = exports.ProductStore = exports.Store = exports.BundleStore = exports.BundleProduct = exports.Bundle = exports.ProductTag = exports.Tag = exports.ProductVariantOption = exports.ProductVariant = exports.MediaType = exports.ProductMedia = exports.Product = exports.VariantOption = exports.VariantType = exports.Brand = exports.Category = exports.UserFavorite = exports.UserAddress = exports.UserDevice = exports.User = exports.SysUser = exports.SysRole = exports.Area = exports.Country = exports.ApiKey = void 0;
|
|
4
|
+
exports.StockMovementType = exports.PurchaseOrderStatus = exports.Gender = exports.Status = exports.Language = exports.VersionType = void 0;
|
|
5
5
|
exports.getDbModels = getDbModels;
|
|
6
6
|
const country_entity_1 = require("./entities/country.entity");
|
|
7
7
|
const area_entity_1 = require("./entities/area.entity");
|
|
@@ -42,6 +42,9 @@ const payment_gateway_entity_1 = require("./entities/payment-gateway.entity");
|
|
|
42
42
|
const payment_method_entity_1 = require("./entities/payment-method.entity");
|
|
43
43
|
const payment_method_country_entity_1 = require("./entities/payment-method-country.entity");
|
|
44
44
|
const store_payment_method_entity_1 = require("./entities/store-payment-method.entity");
|
|
45
|
+
const cart_entity_1 = require("./entities/cart.entity");
|
|
46
|
+
const cart_item_entity_1 = require("./entities/cart-item.entity");
|
|
47
|
+
const cart_item_bundle_selection_entity_1 = require("./entities/cart-item-bundle-selection.entity");
|
|
45
48
|
var apikey_entity_2 = require("./entities/apikey.entity");
|
|
46
49
|
Object.defineProperty(exports, "ApiKey", { enumerable: true, get: function () { return apikey_entity_2.ApiKey; } });
|
|
47
50
|
var country_entity_2 = require("./entities/country.entity");
|
|
@@ -124,6 +127,14 @@ var payment_method_country_entity_2 = require("./entities/payment-method-country
|
|
|
124
127
|
Object.defineProperty(exports, "PaymentMethodCountry", { enumerable: true, get: function () { return payment_method_country_entity_2.PaymentMethodCountry; } });
|
|
125
128
|
var store_payment_method_entity_2 = require("./entities/store-payment-method.entity");
|
|
126
129
|
Object.defineProperty(exports, "StorePaymentMethod", { enumerable: true, get: function () { return store_payment_method_entity_2.StorePaymentMethod; } });
|
|
130
|
+
var cart_entity_2 = require("./entities/cart.entity");
|
|
131
|
+
Object.defineProperty(exports, "Cart", { enumerable: true, get: function () { return cart_entity_2.Cart; } });
|
|
132
|
+
Object.defineProperty(exports, "CartStatus", { enumerable: true, get: function () { return cart_entity_2.CartStatus; } });
|
|
133
|
+
var cart_item_entity_2 = require("./entities/cart-item.entity");
|
|
134
|
+
Object.defineProperty(exports, "CartItem", { enumerable: true, get: function () { return cart_item_entity_2.CartItem; } });
|
|
135
|
+
Object.defineProperty(exports, "CartItemType", { enumerable: true, get: function () { return cart_item_entity_2.CartItemType; } });
|
|
136
|
+
var cart_item_bundle_selection_entity_2 = require("./entities/cart-item-bundle-selection.entity");
|
|
137
|
+
Object.defineProperty(exports, "CartItemBundleSelection", { enumerable: true, get: function () { return cart_item_bundle_selection_entity_2.CartItemBundleSelection; } });
|
|
127
138
|
var osName_1 = require("./utils/enums/osName");
|
|
128
139
|
Object.defineProperty(exports, "OsName", { enumerable: true, get: function () { return osName_1.OsName; } });
|
|
129
140
|
var productApp_1 = require("./utils/enums/productApp");
|
|
@@ -181,6 +192,9 @@ function getDbModels() {
|
|
|
181
192
|
payment_method_entity_1.PaymentMethod,
|
|
182
193
|
payment_method_country_entity_1.PaymentMethodCountry,
|
|
183
194
|
store_payment_method_entity_1.StorePaymentMethod,
|
|
195
|
+
cart_entity_1.Cart,
|
|
196
|
+
cart_item_entity_1.CartItem,
|
|
197
|
+
cart_item_bundle_selection_entity_1.CartItemBundleSelection,
|
|
184
198
|
];
|
|
185
199
|
}
|
|
186
200
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../libs/tatayab-entities-library/src/index.ts"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../libs/tatayab-entities-library/src/index.ts"],"names":[],"mappings":";;;;AAkJA,kCA4DC;AA3MD,8DAAoD;AACpD,wDAA8C;AAC9C,gEAAqD;AACrD,gEAAqD;AACrD,wDAA8C;AAC9C,oEAA0D;AAC1D,4DAAkD;AAClD,wEAA6D;AAC7D,0EAA+D;AAG/D,gEAAsD;AACtD,0DAAgD;AAChD,wEAA6D;AAC7D,4EAAiE;AACjE,8DAAoD;AACpD,0EAA+D;AAC/D,8EAAmE;AACnE,4FAAgF;AAChF,sDAA4C;AAC5C,sEAA2D;AAC3D,4DAAkD;AAClD,4EAAiE;AACjE,wEAA6D;AAG7D,0DAAgD;AAChD,0EAA+D;AAG/D,kEAAwD;AACxD,8EAAmE;AACnE,8EAAmE;AACnE,4EAAiE;AACjE,0EAA+D;AAG/D,4DAAkD;AAClD,4EAAiE;AACjE,4EAAiE;AACjE,sFAA0E;AAG1E,oEAA0D;AAC1D,8EAAmE;AAGnE,8EAAmE;AACnE,4EAAiE;AACjE,4FAAgF;AAChF,wFAA4E;AAG5E,wDAA8C;AAC9C,kEAAuD;AACvD,oGAAuF;AAOvF,0DAAkD;AAAzC,uGAAA,MAAM,OAAA;AACf,4DAAoD;AAA3C,yGAAA,OAAO,OAAA;AAChB,sDAA8C;AAArC,mGAAA,IAAI,OAAA;AACb,8DAAqD;AAA5C,0GAAA,OAAO,OAAA;AAChB,8DAAqD;AAA5C,0GAAA,OAAO,OAAA;AAChB,sDAA8C;AAArC,mGAAA,IAAI,OAAA;AACb,kEAA0D;AAAjD,+GAAA,UAAU,OAAA;AACnB,sEAA6D;AAApD,kHAAA,WAAW,OAAA;AACpB,wEAA+D;AAAtD,oHAAA,YAAY,OAAA;AAGrB,8DAAsD;AAA7C,2GAAA,QAAQ,OAAA;AACjB,wDAAgD;AAAvC,qGAAA,KAAK,OAAA;AACd,s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