@lyxa.ai/core 1.0.304 → 1.0.305
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/libraries/mongo/models/embedded/product-snap.model.d.ts +9 -1
- package/dist/libraries/mongo/models/embedded/product-snap.model.js +27 -0
- package/dist/libraries/mongo/models/embedded/product-snap.model.js.map +1 -1
- package/dist/libraries/mongo/models/line-item.model.js +1 -1
- package/dist/libraries/mongo/models/line-item.model.js.map +1 -1
- package/dist/types/README.md +1 -1
- package/dist/types/package.json +1 -1
- package/package.json +2 -2
|
@@ -1,10 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ref } from '@typegoose/typegoose';
|
|
2
|
+
import { PriceOption, ProductType } from '../../../../utilities/enum';
|
|
3
|
+
import { ProductMarketing } from '../product-marketing.model';
|
|
4
|
+
import { PriceBreakdown } from './price-breakdown.model';
|
|
2
5
|
export declare class ProductSnap {
|
|
3
6
|
name: string;
|
|
4
7
|
barcode?: string;
|
|
5
8
|
productType?: ProductType;
|
|
6
9
|
logo?: string;
|
|
7
10
|
images?: string[];
|
|
11
|
+
priceOption?: PriceOption;
|
|
12
|
+
priceBreakdowns?: PriceBreakdown[];
|
|
8
13
|
description?: string;
|
|
9
14
|
isDrinkIncluded?: boolean;
|
|
15
|
+
isStockEnabled?: boolean;
|
|
16
|
+
stockQuantity?: number;
|
|
17
|
+
productMarketing?: Ref<ProductMarketing>;
|
|
10
18
|
}
|
|
@@ -12,14 +12,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.ProductSnap = void 0;
|
|
13
13
|
const typegoose_1 = require("@typegoose/typegoose");
|
|
14
14
|
const enum_1 = require("../../../../utilities/enum");
|
|
15
|
+
const product_marketing_model_1 = require("../product-marketing.model");
|
|
16
|
+
const price_breakdown_model_1 = require("./price-breakdown.model");
|
|
15
17
|
class ProductSnap {
|
|
16
18
|
name;
|
|
17
19
|
barcode;
|
|
18
20
|
productType;
|
|
19
21
|
logo;
|
|
20
22
|
images;
|
|
23
|
+
priceOption;
|
|
24
|
+
priceBreakdowns;
|
|
21
25
|
description;
|
|
22
26
|
isDrinkIncluded;
|
|
27
|
+
isStockEnabled;
|
|
28
|
+
stockQuantity;
|
|
29
|
+
productMarketing;
|
|
23
30
|
}
|
|
24
31
|
exports.ProductSnap = ProductSnap;
|
|
25
32
|
__decorate([
|
|
@@ -42,6 +49,14 @@ __decorate([
|
|
|
42
49
|
(0, typegoose_1.prop)({ type: [String], default: [] }),
|
|
43
50
|
__metadata("design:type", Array)
|
|
44
51
|
], ProductSnap.prototype, "images", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, typegoose_1.prop)({ type: String, enum: enum_1.PriceOption }),
|
|
54
|
+
__metadata("design:type", String)
|
|
55
|
+
], ProductSnap.prototype, "priceOption", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, typegoose_1.prop)({ type: [price_breakdown_model_1.PriceBreakdown] }),
|
|
58
|
+
__metadata("design:type", Array)
|
|
59
|
+
], ProductSnap.prototype, "priceBreakdowns", void 0);
|
|
45
60
|
__decorate([
|
|
46
61
|
(0, typegoose_1.prop)({ type: String }),
|
|
47
62
|
__metadata("design:type", String)
|
|
@@ -50,4 +65,16 @@ __decorate([
|
|
|
50
65
|
(0, typegoose_1.prop)({ type: Boolean, default: false }),
|
|
51
66
|
__metadata("design:type", Boolean)
|
|
52
67
|
], ProductSnap.prototype, "isDrinkIncluded", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, typegoose_1.prop)({ type: Boolean, default: false }),
|
|
70
|
+
__metadata("design:type", Boolean)
|
|
71
|
+
], ProductSnap.prototype, "isStockEnabled", void 0);
|
|
72
|
+
__decorate([
|
|
73
|
+
(0, typegoose_1.prop)({ type: Number }),
|
|
74
|
+
__metadata("design:type", Number)
|
|
75
|
+
], ProductSnap.prototype, "stockQuantity", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
(0, typegoose_1.prop)({ ref: () => product_marketing_model_1.ProductMarketing }),
|
|
78
|
+
__metadata("design:type", Object)
|
|
79
|
+
], ProductSnap.prototype, "productMarketing", void 0);
|
|
53
80
|
//# sourceMappingURL=product-snap.model.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"product-snap.model.js","sourceRoot":"/","sources":["libraries/mongo/models/embedded/product-snap.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"product-snap.model.js","sourceRoot":"/","sources":["libraries/mongo/models/embedded/product-snap.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAiD;AACjD,qDAAsE;AACtE,wEAA8D;AAC9D,mEAAyD;AAEzD,MAAa,WAAW;IAEhB,IAAI,CAAU;IAGd,OAAO,CAAU;IAGjB,WAAW,CAAe;IAG1B,IAAI,CAAU;IAGd,MAAM,CAAY;IAGlB,WAAW,CAAe;IAG1B,eAAe,CAAoB;IAGnC,WAAW,CAAU;IAGrB,eAAe,CAAW;IAG1B,cAAc,CAAW;IAGzB,aAAa,CAAU;IAGvB,gBAAgB,CAAyB;CAChD;AApCD,kCAoCC;AAlCO;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;yCAClB;AAGd;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;4CACC;AAGjB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAW,EAAE,CAAC;;gDACT;AAG1B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;yCACF;AAGd;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;2CACb;AAGlB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAW,EAAE,CAAC;;gDACT;AAG1B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,CAAC,sCAAc,CAAC,EAAE,CAAC;;oDACS;AAGnC;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;gDACK;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;oDACP;AAG1B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;mDACR;AAGzB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;kDACO;AAGvB;IADN,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,0CAAgB,EAAE,CAAC;;qDACU","sourcesContent":["import { prop, Ref } from '@typegoose/typegoose';\nimport { PriceOption, ProductType } from '../../../../utilities/enum';\nimport { ProductMarketing } from '../product-marketing.model';\nimport { PriceBreakdown } from './price-breakdown.model';\n\nexport class ProductSnap {\n\t@prop({ required: true, type: String })\n\tpublic name!: string;\n\n\t@prop({ type: String })\n\tpublic barcode?: string;\n\n\t@prop({ type: String, enum: ProductType })\n\tpublic productType?: ProductType;\n\n\t@prop({ type: String })\n\tpublic logo?: string;\n\n\t@prop({ type: [String], default: [] })\n\tpublic images?: string[];\n\n\t@prop({ type: String, enum: PriceOption })\n\tpublic priceOption?: PriceOption;\n\n\t@prop({ type: [PriceBreakdown] })\n\tpublic priceBreakdowns?: PriceBreakdown[];\n\n\t@prop({ type: String })\n\tpublic description?: string;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isDrinkIncluded?: boolean;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isStockEnabled?: boolean;\n\n\t@prop({ type: Number })\n\tpublic stockQuantity?: number;\n\n\t@prop({ ref: () => ProductMarketing })\n\tpublic productMarketing?: Ref<ProductMarketing>;\n}\n"]}
|
|
@@ -71,7 +71,7 @@ __decorate([
|
|
|
71
71
|
__metadata("design:type", Object)
|
|
72
72
|
], LineItem.prototype, "product", void 0);
|
|
73
73
|
__decorate([
|
|
74
|
-
(0, typegoose_1.prop)({ type: product_snap_model_1.ProductSnap }),
|
|
74
|
+
(0, typegoose_1.prop)({ type: product_snap_model_1.ProductSnap, _id: false }),
|
|
75
75
|
__metadata("design:type", product_snap_model_1.ProductSnap)
|
|
76
76
|
], LineItem.prototype, "productSnap", void 0);
|
|
77
77
|
__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"line-item.model.js","sourceRoot":"/","sources":["libraries/mongo/models/line-item.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA0F;AAC1F,4EAAqE;AACrE,6CAAoC;AACpC,mDAA0C;AAC1C,4EAAuE;AACvE,kDAA6E;AAC7E,oFAAyE;AACzE,6CAAoC;AACpC,6CAAoC;AACpC,iDAAwC;AACxC,qDAA4C;AAC5C,uDAA8C;AAC9C,sEAA4D;AAoBrD,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,2BAAU;IAEhC,IAAI,CAAa;IAGjB,IAAI,CAAa;IAGjB,IAAI,CAAa;IAGjB,MAAM,CAAc;IAGpB,QAAQ,CAAY;IAGpB,QAAQ,CAAiB;IAGzB,OAAO,CAAgB;IAGvB,WAAW,CAAe;IAG1B,UAAU,CAAoB;IAG9B,QAAQ,CAAU;IAGlB,WAAW,CAAe;IAG1B,cAAc,CAAsB;IAGpC,UAAU,CAAuB;IAGjC,kBAAkB,CAAY;IAG9B,mBAAmB,CAAU;IAG7B,eAAe,CAA2B;CACjD,CAAA;AAhDY,4BAAQ;AAEb;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,iBAAI,EAAE,CAAC;;sCAClB;AAGjB;IADN,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AClB,IAAA,iBAAK,EAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;IAC3B,IAAA,iBAAK,EAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;IACrB,IAAA,iBAAK,EAAC,EAAE,IAAI,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC;IAChC,IAAA,iBAAK,EAAC,EAAE,IAAI,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC;GACpB,QAAQ,CAgDpB","sourcesContent":["import { prop, Ref, index, modelOptions, Severity, mongoose } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { Cart } from './cart.model';\nimport { Product } from './product.model';\nimport { OrderPriceBreakdown } from './embedded/price-breakdown.model';\nimport { ItemType, PriceOption, ProductType } from '../../../utilities/enum';\nimport { LineItemAttribute } from './embedded/line-item-attribute.model';\nimport { User } from './user.model';\nimport { Shop } from './shop.model';\nimport { Parent } from './parent.model';\nimport { Category } from './category.model';\nimport { Marketing } from './marketing.model';\nimport { ProductSnap } from './embedded/product-snap.model';\n\n/**\n * LineItem model - Represents individual items in a cart\n */\n@modelOptions({\n\tschemaOptions: {\n\t\tcollection: 'lineItems',\n\t\ttoJSON: { virtuals: true },\n\t\ttoObject: { virtuals: true },\n\t},\n\toptions: {\n\t\tallowMixed: Severity.ALLOW,\n\t},\n})\n@index({ cart: 1 })\n@index({ cart: 1, user: 1 })\n@index({ product: 1 })\n@index({ shop: 1, deletedAt: 1 })\n@index({ shop: 1, createdAt: 1 })\nexport class LineItem extends TimeStamps {\n\t@prop({ required: true, ref: () => Cart })\n\tpublic cart!: Ref<Cart>;\n\n\t@prop({ required: true, ref: () => User })\n\tpublic user!: Ref<User>;\n\n\t@prop({ required: true, ref: () => Shop })\n\tpublic shop!: Ref<Shop>;\n\n\t@prop({ required: true, ref: () => Parent })\n\tpublic parent: Ref<Parent>;\n\n\t@prop({ required: true, type: String, enum: ItemType })\n\tpublic itemType!: ItemType;\n\n\t@prop({ required: true, ref: () => Category })\n\tpublic category!: Ref<Category>;\n\n\t@prop({ required: true, ref: () => Product })\n\tpublic product!: Ref<Product>;\n\n\t@prop({ type: ProductSnap, _id: false })\n\tpublic productSnap?: ProductSnap;\n\n\t@prop({ ref: () => Marketing, default: [] })\n\tpublic marketings?: Ref<Marketing>[];\n\n\t@prop({ min: 1, default: 1 })\n\tpublic quantity?: number;\n\n\t@prop({ type: String, enum: PriceOption, default: PriceOption.SINGLE_PRICE })\n\tpublic priceOption?: PriceOption;\n\n\t@prop({ required: true, type: OrderPriceBreakdown })\n\tpublic priceBreakdown: OrderPriceBreakdown;\n\n\t@prop({ type: () => [LineItemAttribute], default: [] })\n\tpublic attributes?: LineItemAttribute[];\n\n\t@prop({ type: () => [String], default: [] })\n\tpublic removedIngredients?: string[];\n\n\t@prop({ type: String })\n\tpublic specialInstructions?: string;\n\n\t@prop({ type: mongoose.Schema.Types.Mixed })\n\tpublic calculationSnap?: Record<string, unknown>;\n}\n"]}
|
package/dist/types/README.md
CHANGED
package/dist/types/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lyxa.ai/core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.305",
|
|
4
4
|
"description": "The Core system of the Lyxa services.",
|
|
5
5
|
"author": "elie <42282499+Internalizable@users.noreply.github.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
],
|
|
10
10
|
"main": "dist/index.js",
|
|
11
11
|
"types": "dist/index.d.ts",
|
|
12
|
-
"scripts": {
|
|
12
|
+
"scripts": {
|
|
13
13
|
"build": "node build.js",
|
|
14
14
|
"clean": "rimraf dist",
|
|
15
15
|
"start": "npx ts-node src/index.ts",
|