@lyxa.ai/core 1.0.24 → 1.0.26

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 (63) hide show
  1. package/dist/libraries/dispatcher/index.d.ts +1 -1
  2. package/dist/libraries/dispatcher/index.js +5 -3
  3. package/dist/libraries/dispatcher/index.js.map +1 -1
  4. package/dist/libraries/mongo/models/core-user.model.d.ts +0 -1
  5. package/dist/libraries/mongo/models/core-user.model.js +0 -5
  6. package/dist/libraries/mongo/models/core-user.model.js.map +1 -1
  7. package/dist/libraries/mongo/models/embedded/otp-fields.model.d.ts +2 -0
  8. package/dist/libraries/mongo/models/embedded/otp-fields.model.js +10 -0
  9. package/dist/libraries/mongo/models/embedded/otp-fields.model.js.map +1 -1
  10. package/dist/libraries/mongo/models/gallery.model.d.ts +9 -0
  11. package/dist/libraries/mongo/models/gallery.model.js +47 -0
  12. package/dist/libraries/mongo/models/gallery.model.js.map +1 -0
  13. package/dist/libraries/mongo/models/index.d.ts +3 -0
  14. package/dist/libraries/mongo/models/index.js +4 -1
  15. package/dist/libraries/mongo/models/index.js.map +1 -1
  16. package/dist/libraries/mongo/models/parent.model.d.ts +1 -0
  17. package/dist/libraries/mongo/models/parent.model.js +5 -0
  18. package/dist/libraries/mongo/models/parent.model.js.map +1 -1
  19. package/dist/libraries/mongo/models/product.model.js +1 -1
  20. package/dist/libraries/mongo/models/product.model.js.map +1 -1
  21. package/dist/libraries/mongo/models/providers/core-email-auth-identity.model.d.ts +1 -1
  22. package/dist/libraries/mongo/models/providers/core-email-auth-identity.model.js +29 -5
  23. package/dist/libraries/mongo/models/providers/core-email-auth-identity.model.js.map +1 -1
  24. package/dist/libraries/mongo/models/shared/address.model.d.ts +3 -0
  25. package/dist/libraries/mongo/models/shared/address.model.js +7 -1
  26. package/dist/libraries/mongo/models/shared/address.model.js.map +1 -1
  27. package/dist/libraries/secrets/index.js.map +1 -1
  28. package/dist/libraries/trpc/index.js +1 -0
  29. package/dist/libraries/trpc/index.js.map +1 -1
  30. package/dist/utilities/enum.d.ts +3 -0
  31. package/dist/utilities/enum.js +5 -1
  32. package/dist/utilities/enum.js.map +1 -1
  33. package/dist/utilities/pagination.d.ts +9 -2
  34. package/dist/utilities/pagination.js +23 -36
  35. package/dist/utilities/pagination.js.map +1 -1
  36. package/dist/utilities/validation/common-validation.d.ts +54 -0
  37. package/dist/utilities/validation/common-validation.js +5 -1
  38. package/dist/utilities/validation/common-validation.js.map +1 -1
  39. package/package.json +1 -1
  40. package/dist/libraries/mongo/models/cart-lineitem.model.d.ts +0 -29
  41. package/dist/libraries/mongo/models/cart-lineitem.model.js +0 -120
  42. package/dist/libraries/mongo/models/cart-lineitem.model.js.map +0 -1
  43. package/dist/libraries/mongo/models/cart-perticipant.model.d.ts +0 -22
  44. package/dist/libraries/mongo/models/cart-perticipant.model.js +0 -104
  45. package/dist/libraries/mongo/models/cart-perticipant.model.js.map +0 -1
  46. package/dist/libraries/mongo/models/embedded/addon.model.d.ts +0 -8
  47. package/dist/libraries/mongo/models/embedded/addon.model.js +0 -34
  48. package/dist/libraries/mongo/models/embedded/addon.model.js.map +0 -1
  49. package/dist/libraries/mongo/models/embedded/payment-details.model.d.ts +0 -9
  50. package/dist/libraries/mongo/models/embedded/payment-details.model.js +0 -52
  51. package/dist/libraries/mongo/models/embedded/payment-details.model.js.map +0 -1
  52. package/dist/libraries/mongo/models/embedded/portion.model.d.ts +0 -5
  53. package/dist/libraries/mongo/models/embedded/portion.model.js +0 -32
  54. package/dist/libraries/mongo/models/embedded/portion.model.js.map +0 -1
  55. package/dist/libraries/mongo/models/embedded/price.model.d.ts +0 -5
  56. package/dist/libraries/mongo/models/embedded/price.model.js +0 -32
  57. package/dist/libraries/mongo/models/embedded/price.model.js.map +0 -1
  58. package/dist/libraries/mongo/models/order-pricing.model.d.ts +0 -18
  59. package/dist/libraries/mongo/models/order-pricing.model.js +0 -88
  60. package/dist/libraries/mongo/models/order-pricing.model.js.map +0 -1
  61. package/dist/libraries/mongo/models/shop-product.model.d.ts +0 -25
  62. package/dist/libraries/mongo/models/shop-product.model.js +0 -102
  63. package/dist/libraries/mongo/models/shop-product.model.js.map +0 -1
@@ -1,120 +0,0 @@
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.LineItemModel = exports.LineItem = exports.AddOn = exports.Portion = void 0;
13
- const typegoose_1 = require("@typegoose/typegoose");
14
- const core_user_model_1 = require("./core-user.model");
15
- const defaultClasses_1 = require("@typegoose/typegoose/lib/defaultClasses");
16
- const cart_model_1 = require("./cart.model");
17
- const product_model_1 = require("./product.model");
18
- const attribute_model_1 = require("./attribute.model");
19
- const attribute_item_model_1 = require("./embedded/attribute-item.model");
20
- class Portion {
21
- price;
22
- size;
23
- unit;
24
- }
25
- exports.Portion = Portion;
26
- __decorate([
27
- (0, typegoose_1.prop)({ required: true }),
28
- __metadata("design:type", Number)
29
- ], Portion.prototype, "price", void 0);
30
- __decorate([
31
- (0, typegoose_1.prop)(),
32
- __metadata("design:type", String)
33
- ], Portion.prototype, "size", void 0);
34
- __decorate([
35
- (0, typegoose_1.prop)(),
36
- __metadata("design:type", String)
37
- ], Portion.prototype, "unit", void 0);
38
- class AddOn {
39
- attribute;
40
- attributeItem;
41
- price;
42
- }
43
- exports.AddOn = AddOn;
44
- __decorate([
45
- (0, typegoose_1.prop)({ required: true, ref: () => attribute_model_1.Attribute }),
46
- __metadata("design:type", Object)
47
- ], AddOn.prototype, "attribute", void 0);
48
- __decorate([
49
- (0, typegoose_1.prop)({ required: true }),
50
- __metadata("design:type", attribute_item_model_1.AttributeItem)
51
- ], AddOn.prototype, "attributeItem", void 0);
52
- __decorate([
53
- (0, typegoose_1.prop)({ required: true, default: 0 }),
54
- __metadata("design:type", Number)
55
- ], AddOn.prototype, "price", void 0);
56
- let LineItem = class LineItem extends defaultClasses_1.TimeStamps {
57
- cart;
58
- user;
59
- product;
60
- quantity;
61
- unitPrice;
62
- portion;
63
- addOns;
64
- removedIngredients;
65
- specialInstructions;
66
- };
67
- exports.LineItem = LineItem;
68
- __decorate([
69
- (0, typegoose_1.prop)({ required: true, ref: () => cart_model_1.Cart }),
70
- __metadata("design:type", Object)
71
- ], LineItem.prototype, "cart", void 0);
72
- __decorate([
73
- (0, typegoose_1.prop)({ required: false, ref: () => core_user_model_1.CoreUser }),
74
- __metadata("design:type", Object)
75
- ], LineItem.prototype, "user", void 0);
76
- __decorate([
77
- (0, typegoose_1.prop)({ required: true, ref: () => product_model_1.Product }),
78
- __metadata("design:type", Object)
79
- ], LineItem.prototype, "product", void 0);
80
- __decorate([
81
- (0, typegoose_1.prop)({ required: true, min: 1, default: 1 }),
82
- __metadata("design:type", Number)
83
- ], LineItem.prototype, "quantity", void 0);
84
- __decorate([
85
- (0, typegoose_1.prop)(),
86
- __metadata("design:type", Number)
87
- ], LineItem.prototype, "unitPrice", void 0);
88
- __decorate([
89
- (0, typegoose_1.prop)({ type: () => Portion }),
90
- __metadata("design:type", Portion)
91
- ], LineItem.prototype, "portion", void 0);
92
- __decorate([
93
- (0, typegoose_1.prop)({ type: () => [AddOn], default: [] }),
94
- __metadata("design:type", Array)
95
- ], LineItem.prototype, "addOns", void 0);
96
- __decorate([
97
- (0, typegoose_1.prop)({ type: () => [String], default: [] }),
98
- __metadata("design:type", Array)
99
- ], LineItem.prototype, "removedIngredients", void 0);
100
- __decorate([
101
- (0, typegoose_1.prop)(),
102
- __metadata("design:type", String)
103
- ], LineItem.prototype, "specialInstructions", void 0);
104
- exports.LineItem = LineItem = __decorate([
105
- (0, typegoose_1.modelOptions)({
106
- schemaOptions: {
107
- collection: 'lineItems',
108
- toJSON: { virtuals: true },
109
- toObject: { virtuals: true },
110
- },
111
- options: {
112
- allowMixed: typegoose_1.Severity.ALLOW,
113
- },
114
- }),
115
- (0, typegoose_1.index)({ cart: 1 }),
116
- (0, typegoose_1.index)({ cart: 1, user: 1 }),
117
- (0, typegoose_1.index)({ product: 1 })
118
- ], LineItem);
119
- exports.LineItemModel = (0, typegoose_1.getModelForClass)(LineItem);
120
- //# sourceMappingURL=cart-lineitem.model.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cart-lineitem.model.js","sourceRoot":"/","sources":["libraries/mongo/models/cart-lineitem.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAQ8B;AAC9B,uDAA6C;AAC7C,4EAAqE;AACrE,6CAAoC;AACpC,mDAA0C;AAC1C,uDAA8C;AAC9C,0EAAgE;AAEhE,MAAa,OAAO;IAEZ,KAAK,CAAU;IAGf,IAAI,CAAU;IAGd,IAAI,CAAU;CACrB;AATD,0BASC;AAPO;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sCACH;AAGf;IADN,IAAA,gBAAI,GAAE;;qCACc;AAGd;IADN,IAAA,gBAAI,GAAE;;qCACc;AAGtB,MAAa,KAAK;IAEV,SAAS,CAAkB;IAG3B,aAAa,CAAiB;IAG9B,KAAK,CAAU;CACtB;AATD,sBASC;AAPO;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,2BAAS,EAAE,CAAC;;wCACb;AAG3B;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACF,oCAAa;4CAAC;AAG9B;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;oCACf;AAmBhB,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,2BAAU;IAEhC,IAAI,CAAa;IAGjB,IAAI,CAAiB;IAGrB,OAAO,CAAgB;IAGvB,QAAQ,CAAU;IAGlB,SAAS,CAAU;IAGnB,OAAO,CAAW;IAGlB,MAAM,CAAW;IAGjB,kBAAkB,CAAY;IAG9B,mBAAmB,CAAU;CACpC,CAAA;AA3BY,4BAAQ;AAEb;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,iBAAI,EAAE,CAAC;;sCAClB;AAGjB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,0BAAQ,EAAE,CAAC;;sCACnB;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,uBAAO,EAAE,CAAC;;yCACf;AAGvB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;0CACpB;AAGlB;IADN,IAAA,gBAAI,GAAE;;2CACmB;AAGnB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC;8BACb,OAAO;yCAAC;AAGlB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;wCACnB;AAGjB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;oDACP;AAG9B;IADN,IAAA,gBAAI,GAAE;;qDAC6B;mBA1BxB,QAAQ;IAbpB,IAAA,wBAAY,EAAC;QACb,aAAa,EAAE;YACd,UAAU,EAAE,WAAW;YACvB,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;YAC1B,QAAQ,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;SAC5B;QACD,OAAO,EAAE;YACR,UAAU,EAAE,oBAAQ,CAAC,KAAK;SAC1B;KACD,CAAC;IACD,IAAA,iBAAK,EAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;IAClB,IAAA,iBAAK,EAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;IAC3B,IAAA,iBAAK,EAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;GACT,QAAQ,CA2BpB;AAEY,QAAA,aAAa,GAAqC,IAAA,4BAAgB,EAAC,QAAQ,CAAC,CAAC","sourcesContent":["import {\r\n\tprop,\r\n\tgetModelForClass,\r\n\tRef,\r\n\tindex,\r\n\tmodelOptions,\r\n\tSeverity,\r\n\tReturnModelType,\r\n} from '@typegoose/typegoose';\r\nimport { CoreUser } from './core-user.model';\r\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\r\nimport { Cart } from './cart.model';\r\nimport { Product } from './product.model';\r\nimport { Attribute } from './attribute.model';\r\nimport { AttributeItem } from './embedded/attribute-item.model';\r\n\r\nexport class Portion {\r\n\t@prop({ required: true })\r\n\tpublic price!: number;\r\n\r\n\t@prop()\r\n\tpublic size?: string;\r\n\r\n\t@prop()\r\n\tpublic unit?: string;\r\n}\r\n\r\nexport class AddOn {\r\n\t@prop({ required: true, ref: () => Attribute })\r\n\tpublic attribute!: Ref<Attribute>;\r\n\r\n\t@prop({ required: true })\r\n\tpublic attributeItem!: AttributeItem;\r\n\r\n\t@prop({ required: true, default: 0 })\r\n\tpublic price!: number;\r\n}\r\n\r\n/**\r\n * LineItem model - Represents individual items in a cart\r\n */\r\n@modelOptions({\r\n\tschemaOptions: {\r\n\t\tcollection: 'lineItems',\r\n\t\ttoJSON: { virtuals: true },\r\n\t\ttoObject: { virtuals: true },\r\n\t},\r\n\toptions: {\r\n\t\tallowMixed: Severity.ALLOW,\r\n\t},\r\n})\r\n@index({ cart: 1 })\r\n@index({ cart: 1, user: 1 })\r\n@index({ product: 1 })\r\nexport class LineItem extends TimeStamps {\r\n\t@prop({ required: true, ref: () => Cart })\r\n\tpublic cart!: Ref<Cart>;\r\n\r\n\t@prop({ required: false, ref: () => CoreUser })\r\n\tpublic user?: Ref<CoreUser>;\r\n\r\n\t@prop({ required: true, ref: () => Product })\r\n\tpublic product!: Ref<Product>;\r\n\r\n\t@prop({ required: true, min: 1, default: 1 })\r\n\tpublic quantity!: number;\r\n\r\n\t@prop()\r\n\tpublic unitPrice!: number;\r\n\r\n\t@prop({ type: () => Portion })\r\n\tpublic portion?: Portion;\r\n\r\n\t@prop({ type: () => [AddOn], default: [] })\r\n\tpublic addOns?: AddOn[];\r\n\r\n\t@prop({ type: () => [String], default: [] })\r\n\tpublic removedIngredients?: string[];\r\n\r\n\t@prop()\r\n\tpublic specialInstructions?: string;\r\n}\r\n\r\nexport const LineItemModel: ReturnModelType<typeof LineItem> = getModelForClass(LineItem);\r\n"]}
@@ -1,22 +0,0 @@
1
- import { Ref, ReturnModelType } from '@typegoose/typegoose';
2
- import { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';
3
- import { Cart } from './cart.model';
4
- import { CoreUser } from './core-user.model';
5
- import { PaymentGateway, PaymentMethod } from '../../../utilities/enum';
6
- export declare class PaymentInformation {
7
- paymentGateway: PaymentGateway;
8
- referenceId?: string;
9
- transactionId?: string;
10
- }
11
- export declare class CartParticipant extends TimeStamps {
12
- cart: Ref<Cart>;
13
- user: Ref<CoreUser>;
14
- joinedAt: Date;
15
- isReady: boolean;
16
- isPaid: boolean;
17
- readyAt?: Date;
18
- spentAmount: number;
19
- paymentMethod?: PaymentMethod;
20
- paymentInformation?: PaymentInformation;
21
- }
22
- export declare const CartParticipantModel: ReturnModelType<typeof CartParticipant>;
@@ -1,104 +0,0 @@
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.CartParticipantModel = exports.CartParticipant = exports.PaymentInformation = void 0;
13
- const typegoose_1 = require("@typegoose/typegoose");
14
- const defaultClasses_1 = require("@typegoose/typegoose/lib/defaultClasses");
15
- const cart_model_1 = require("./cart.model");
16
- const core_user_model_1 = require("./core-user.model");
17
- const enum_1 = require("../../../utilities/enum");
18
- class PaymentInformation {
19
- paymentGateway;
20
- referenceId;
21
- transactionId;
22
- }
23
- exports.PaymentInformation = PaymentInformation;
24
- __decorate([
25
- (0, typegoose_1.prop)({
26
- required: true,
27
- enum: enum_1.PaymentGateway,
28
- type: String,
29
- default: enum_1.PaymentGateway.AREEBA,
30
- }),
31
- __metadata("design:type", String)
32
- ], PaymentInformation.prototype, "paymentGateway", void 0);
33
- __decorate([
34
- (0, typegoose_1.prop)(),
35
- __metadata("design:type", String)
36
- ], PaymentInformation.prototype, "referenceId", void 0);
37
- __decorate([
38
- (0, typegoose_1.prop)(),
39
- __metadata("design:type", String)
40
- ], PaymentInformation.prototype, "transactionId", void 0);
41
- let CartParticipant = class CartParticipant extends defaultClasses_1.TimeStamps {
42
- cart;
43
- user;
44
- joinedAt;
45
- isReady;
46
- isPaid;
47
- readyAt;
48
- spentAmount;
49
- paymentMethod;
50
- paymentInformation;
51
- };
52
- exports.CartParticipant = CartParticipant;
53
- __decorate([
54
- (0, typegoose_1.prop)({ required: true, ref: () => cart_model_1.Cart }),
55
- __metadata("design:type", Object)
56
- ], CartParticipant.prototype, "cart", void 0);
57
- __decorate([
58
- (0, typegoose_1.prop)({ required: true, ref: () => core_user_model_1.CoreUser }),
59
- __metadata("design:type", Object)
60
- ], CartParticipant.prototype, "user", void 0);
61
- __decorate([
62
- (0, typegoose_1.prop)({ default: () => new Date() }),
63
- __metadata("design:type", Date)
64
- ], CartParticipant.prototype, "joinedAt", void 0);
65
- __decorate([
66
- (0, typegoose_1.prop)({ default: false }),
67
- __metadata("design:type", Boolean)
68
- ], CartParticipant.prototype, "isReady", void 0);
69
- __decorate([
70
- (0, typegoose_1.prop)({ default: false }),
71
- __metadata("design:type", Boolean)
72
- ], CartParticipant.prototype, "isPaid", void 0);
73
- __decorate([
74
- (0, typegoose_1.prop)(),
75
- __metadata("design:type", Date)
76
- ], CartParticipant.prototype, "readyAt", void 0);
77
- __decorate([
78
- (0, typegoose_1.prop)({ default: 0 }),
79
- __metadata("design:type", Number)
80
- ], CartParticipant.prototype, "spentAmount", void 0);
81
- __decorate([
82
- (0, typegoose_1.prop)({ enum: enum_1.PaymentMethod, type: String }),
83
- __metadata("design:type", String)
84
- ], CartParticipant.prototype, "paymentMethod", void 0);
85
- __decorate([
86
- (0, typegoose_1.prop)({ type: () => PaymentInformation }),
87
- __metadata("design:type", PaymentInformation)
88
- ], CartParticipant.prototype, "paymentInformation", void 0);
89
- exports.CartParticipant = CartParticipant = __decorate([
90
- (0, typegoose_1.modelOptions)({
91
- schemaOptions: {
92
- collection: 'cartParticipants',
93
- toJSON: { virtuals: true },
94
- toObject: { virtuals: true },
95
- },
96
- options: {
97
- allowMixed: typegoose_1.Severity.ALLOW,
98
- },
99
- }),
100
- (0, typegoose_1.index)({ cart: 1, user: 1 }, { unique: true }),
101
- (0, typegoose_1.index)({ cart: 1 })
102
- ], CartParticipant);
103
- exports.CartParticipantModel = (0, typegoose_1.getModelForClass)(CartParticipant);
104
- //# sourceMappingURL=cart-perticipant.model.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cart-perticipant.model.js","sourceRoot":"/","sources":["libraries/mongo/models/cart-perticipant.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAQ8B;AAC9B,4EAAqE;AACrE,6CAAoC;AACpC,uDAA6C;AAC7C,kDAAwE;AAExE,MAAa,kBAAkB;IAOvB,cAAc,CAAkB;IAGhC,WAAW,CAAU;IAGrB,aAAa,CAAU;CAC9B;AAdD,gDAcC;AAPO;IANN,IAAA,gBAAI,EAAC;QACL,QAAQ,EAAE,IAAI;QACd,IAAI,EAAE,qBAAc;QACpB,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,qBAAc,CAAC,MAAM;KAC9B,CAAC;;0DACqC;AAGhC;IADN,IAAA,gBAAI,GAAE;;uDACqB;AAGrB;IADN,IAAA,gBAAI,GAAE;;yDACuB;AAkBxB,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,2BAAU;IAEvC,IAAI,CAAa;IAGjB,IAAI,CAAiB;IAGrB,QAAQ,CAAQ;IAGhB,OAAO,CAAW;IAGlB,MAAM,CAAW;IAGjB,OAAO,CAAQ;IAGf,WAAW,CAAU;IAGrB,aAAa,CAAiB;IAG9B,kBAAkB,CAAsB;CAC/C,CAAA;AA3BY,0CAAe;AAEpB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,iBAAI,EAAE,CAAC;;6CAClB;AAGjB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,0BAAQ,EAAE,CAAC;;6CAClB;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,EAAE,CAAC;8BAClB,IAAI;iDAAC;AAGhB;IADN,IAAA,gBAAI,EAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;gDACA;AAGlB;IADN,IAAA,gBAAI,EAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;+CACD;AAGjB;IADN,IAAA,gBAAI,GAAE;8BACU,IAAI;gDAAC;AAGf;IADN,IAAA,gBAAI,EAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;oDACO;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,oBAAa,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;sDACP;AAG9B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,kBAAkB,EAAE,CAAC;8BACb,kBAAkB;2DAAC;0BA1BnC,eAAe;IAZ3B,IAAA,wBAAY,EAAC;QACb,aAAa,EAAE;YACd,UAAU,EAAE,kBAAkB;YAC9B,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;YAC1B,QAAQ,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;SAC5B;QACD,OAAO,EAAE;YACR,UAAU,EAAE,oBAAQ,CAAC,KAAK;SAC1B;KACD,CAAC;IACD,IAAA,iBAAK,EAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAC7C,IAAA,iBAAK,EAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;GACN,eAAe,CA2B3B;AAEY,QAAA,oBAAoB,GAChC,IAAA,4BAAgB,EAAC,eAAe,CAAC,CAAC","sourcesContent":["import {\r\n\tprop,\r\n\tgetModelForClass,\r\n\tRef,\r\n\tindex,\r\n\tmodelOptions,\r\n\tSeverity,\r\n\tReturnModelType,\r\n} from '@typegoose/typegoose';\r\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\r\nimport { Cart } from './cart.model';\r\nimport { CoreUser } from './core-user.model';\r\nimport { PaymentGateway, PaymentMethod } from '../../../utilities/enum';\r\n\r\nexport class PaymentInformation {\r\n\t@prop({\r\n\t\trequired: true,\r\n\t\tenum: PaymentGateway,\r\n\t\ttype: String,\r\n\t\tdefault: PaymentGateway.AREEBA,\r\n\t})\r\n\tpublic paymentGateway!: PaymentGateway;\r\n\r\n\t@prop()\r\n\tpublic referenceId?: string;\r\n\r\n\t@prop()\r\n\tpublic transactionId?: string;\r\n}\r\n\r\n/**\r\n * CartParticipant model - Tracks users participating in a group cart\r\n */\r\n@modelOptions({\r\n\tschemaOptions: {\r\n\t\tcollection: 'cartParticipants',\r\n\t\ttoJSON: { virtuals: true },\r\n\t\ttoObject: { virtuals: true },\r\n\t},\r\n\toptions: {\r\n\t\tallowMixed: Severity.ALLOW,\r\n\t},\r\n})\r\n@index({ cart: 1, user: 1 }, { unique: true })\r\n@index({ cart: 1 })\r\nexport class CartParticipant extends TimeStamps {\r\n\t@prop({ required: true, ref: () => Cart })\r\n\tpublic cart!: Ref<Cart>;\r\n\r\n\t@prop({ required: true, ref: () => CoreUser })\r\n\tpublic user!: Ref<CoreUser>;\r\n\r\n\t@prop({ default: () => new Date() })\r\n\tpublic joinedAt!: Date;\r\n\r\n\t@prop({ default: false })\r\n\tpublic isReady!: boolean;\r\n\r\n\t@prop({ default: false })\r\n\tpublic isPaid!: boolean;\r\n\r\n\t@prop()\r\n\tpublic readyAt?: Date;\r\n\r\n\t@prop({ default: 0 })\r\n\tpublic spentAmount!: number;\r\n\r\n\t@prop({ enum: PaymentMethod, type: String })\r\n\tpublic paymentMethod?: PaymentMethod;\r\n\r\n\t@prop({ type: () => PaymentInformation })\r\n\tpublic paymentInformation?: PaymentInformation;\r\n}\r\n\r\nexport const CartParticipantModel: ReturnModelType<typeof CartParticipant> =\r\n\tgetModelForClass(CartParticipant);\r\n"]}
@@ -1,8 +0,0 @@
1
- import { Ref } from '@typegoose/typegoose';
2
- import { Attribute } from '../attribute.model';
3
- import { AttributeItem } from '../embedded/attribute-item.model';
4
- export declare class AddOn {
5
- attribute: Ref<Attribute>;
6
- attributeItem: AttributeItem;
7
- price: number;
8
- }
@@ -1,34 +0,0 @@
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.AddOn = void 0;
13
- const typegoose_1 = require("@typegoose/typegoose");
14
- const attribute_model_1 = require("../attribute.model");
15
- const attribute_item_model_1 = require("../embedded/attribute-item.model");
16
- class AddOn {
17
- attribute;
18
- attributeItem;
19
- price;
20
- }
21
- exports.AddOn = AddOn;
22
- __decorate([
23
- (0, typegoose_1.prop)({ required: true, ref: () => attribute_model_1.Attribute }),
24
- __metadata("design:type", Object)
25
- ], AddOn.prototype, "attribute", void 0);
26
- __decorate([
27
- (0, typegoose_1.prop)({ required: true }),
28
- __metadata("design:type", attribute_item_model_1.AttributeItem)
29
- ], AddOn.prototype, "attributeItem", void 0);
30
- __decorate([
31
- (0, typegoose_1.prop)({ required: true, default: 0 }),
32
- __metadata("design:type", Number)
33
- ], AddOn.prototype, "price", void 0);
34
- //# sourceMappingURL=addon.model.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"addon.model.js","sourceRoot":"/","sources":["libraries/mongo/models/embedded/addon.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAiD;AACjD,wDAA+C;AAC/C,2EAAiE;AAEjE,MAAa,KAAK;IAEV,SAAS,CAAkB;IAG3B,aAAa,CAAiB;IAG9B,KAAK,CAAU;CACtB;AATD,sBASC;AAPO;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,2BAAS,EAAE,CAAC;;wCACb;AAG3B;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACF,oCAAa;4CAAC;AAG9B;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;oCACf","sourcesContent":["import { prop, Ref } from '@typegoose/typegoose';\r\nimport { Attribute } from '../attribute.model';\r\nimport { AttributeItem } from '../embedded/attribute-item.model';\r\n\r\nexport class AddOn {\r\n\t@prop({ required: true, ref: () => Attribute })\r\n\tpublic attribute!: Ref<Attribute>;\r\n\r\n\t@prop({ required: true })\r\n\tpublic attributeItem!: AttributeItem;\r\n\r\n\t@prop({ required: true, default: 0 })\r\n\tpublic price!: number;\r\n}\r\n"]}
@@ -1,9 +0,0 @@
1
- import { Ref } from '@typegoose/typegoose';
2
- import { Transaction } from '../transaction.model';
3
- export declare class PaymentDetails {
4
- method: string;
5
- status: string;
6
- transaction?: Ref<Transaction>;
7
- paymentReference?: string;
8
- receiptUrl?: string;
9
- }
@@ -1,52 +0,0 @@
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.PaymentDetails = void 0;
13
- const typegoose_1 = require("@typegoose/typegoose");
14
- const transaction_model_1 = require("../transaction.model");
15
- const enum_1 = require("../../../../utilities/enum");
16
- class PaymentDetails {
17
- method;
18
- status;
19
- transaction;
20
- paymentReference;
21
- receiptUrl;
22
- }
23
- exports.PaymentDetails = PaymentDetails;
24
- __decorate([
25
- (0, typegoose_1.prop)({
26
- type: String,
27
- enum: enum_1.PaymentMethod,
28
- required: true,
29
- }),
30
- __metadata("design:type", String)
31
- ], PaymentDetails.prototype, "method", void 0);
32
- __decorate([
33
- (0, typegoose_1.prop)({
34
- type: String,
35
- enum: Object.values(enum_1.PaymentStatus),
36
- default: enum_1.PaymentStatus.PENDING,
37
- }),
38
- __metadata("design:type", String)
39
- ], PaymentDetails.prototype, "status", void 0);
40
- __decorate([
41
- (0, typegoose_1.prop)({ ref: () => transaction_model_1.Transaction }),
42
- __metadata("design:type", Object)
43
- ], PaymentDetails.prototype, "transaction", void 0);
44
- __decorate([
45
- (0, typegoose_1.prop)(),
46
- __metadata("design:type", String)
47
- ], PaymentDetails.prototype, "paymentReference", void 0);
48
- __decorate([
49
- (0, typegoose_1.prop)(),
50
- __metadata("design:type", String)
51
- ], PaymentDetails.prototype, "receiptUrl", void 0);
52
- //# sourceMappingURL=payment-details.model.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"payment-details.model.js","sourceRoot":"/","sources":["libraries/mongo/models/embedded/payment-details.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAiD;AACjD,4DAAmD;AACnD,qDAA0E;AAE1E,MAAa,cAAc;IAM1B,MAAM,CAAS;IAOf,MAAM,CAAS;IAGf,WAAW,CAAoB;IAG/B,gBAAgB,CAAU;IAG1B,UAAU,CAAU;CACpB;AAvBD,wCAuBC;AAjBA;IALC,IAAA,gBAAI,EAAC;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,oBAAa;QACnB,QAAQ,EAAE,IAAI;KACd,CAAC;;8CACa;AAOf;IALC,IAAA,gBAAI,EAAC;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,oBAAa,CAAC;QAClC,OAAO,EAAE,oBAAa,CAAC,OAAO;KAC9B,CAAC;;8CACa;AAGf;IADC,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,+BAAW,EAAE,CAAC;;mDACF;AAG/B;IADC,IAAA,gBAAI,GAAE;;wDACmB;AAG1B;IADC,IAAA,gBAAI,GAAE;;kDACa","sourcesContent":["import { prop, Ref } from '@typegoose/typegoose';\r\nimport { Transaction } from '../transaction.model';\r\nimport { PaymentMethod, PaymentStatus } from '../../../../utilities/enum';\r\n\r\nexport class PaymentDetails {\r\n\t@prop({\r\n\t\ttype: String,\r\n\t\tenum: PaymentMethod,\r\n\t\trequired: true,\r\n\t})\r\n\tmethod: string;\r\n\r\n\t@prop({\r\n\t\ttype: String,\r\n\t\tenum: Object.values(PaymentStatus),\r\n\t\tdefault: PaymentStatus.PENDING,\r\n\t})\r\n\tstatus: string;\r\n\r\n\t@prop({ ref: () => Transaction })\r\n\ttransaction?: Ref<Transaction>;\r\n\r\n\t@prop()\r\n\tpaymentReference?: string;\r\n\r\n\t@prop()\r\n\treceiptUrl?: string;\r\n}\r\n"]}
@@ -1,5 +0,0 @@
1
- export declare class Portion {
2
- price: number;
3
- size?: string;
4
- unit?: string;
5
- }
@@ -1,32 +0,0 @@
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.Portion = void 0;
13
- const typegoose_1 = require("@typegoose/typegoose");
14
- class Portion {
15
- price;
16
- size;
17
- unit;
18
- }
19
- exports.Portion = Portion;
20
- __decorate([
21
- (0, typegoose_1.prop)({ required: true }),
22
- __metadata("design:type", Number)
23
- ], Portion.prototype, "price", void 0);
24
- __decorate([
25
- (0, typegoose_1.prop)(),
26
- __metadata("design:type", String)
27
- ], Portion.prototype, "size", void 0);
28
- __decorate([
29
- (0, typegoose_1.prop)(),
30
- __metadata("design:type", String)
31
- ], Portion.prototype, "unit", void 0);
32
- //# sourceMappingURL=portion.model.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"portion.model.js","sourceRoot":"/","sources":["libraries/mongo/models/embedded/portion.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA4C;AAE5C,MAAa,OAAO;IAEZ,KAAK,CAAU;IAGf,IAAI,CAAU;IAGd,IAAI,CAAU;CACrB;AATD,0BASC;AAPO;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sCACH;AAGf;IADN,IAAA,gBAAI,GAAE;;qCACc;AAGd;IADN,IAAA,gBAAI,GAAE;;qCACc","sourcesContent":["import { prop } from '@typegoose/typegoose';\r\n\r\nexport class Portion {\r\n\t@prop({ required: true })\r\n\tpublic price!: number;\r\n\r\n\t@prop()\r\n\tpublic size?: string;\r\n\r\n\t@prop()\r\n\tpublic unit?: string;\r\n}\r\n"]}
@@ -1,5 +0,0 @@
1
- export declare class Price {
2
- unit?: string;
3
- unitValue?: number;
4
- price: number;
5
- }
@@ -1,32 +0,0 @@
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.Price = void 0;
13
- const typegoose_1 = require("@typegoose/typegoose");
14
- class Price {
15
- unit;
16
- unitValue;
17
- price;
18
- }
19
- exports.Price = Price;
20
- __decorate([
21
- (0, typegoose_1.prop)({ type: String }),
22
- __metadata("design:type", String)
23
- ], Price.prototype, "unit", void 0);
24
- __decorate([
25
- (0, typegoose_1.prop)({ type: Number, min: 0 }),
26
- __metadata("design:type", Number)
27
- ], Price.prototype, "unitValue", void 0);
28
- __decorate([
29
- (0, typegoose_1.prop)({ required: true, type: Number, min: 0 }),
30
- __metadata("design:type", Number)
31
- ], Price.prototype, "price", void 0);
32
- //# sourceMappingURL=price.model.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"price.model.js","sourceRoot":"/","sources":["libraries/mongo/models/embedded/price.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA4C;AAE5C,MAAa,KAAK;IAEV,IAAI,CAAU;IAGd,SAAS,CAAU;IAGnB,KAAK,CAAU;CACtB;AATD,sBASC;AAPO;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;mCACF;AAGd;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;;wCACL;AAGnB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;;oCACzB","sourcesContent":["import { prop } from '@typegoose/typegoose';\n\nexport class Price {\n\t@prop({ type: String })\n\tpublic unit?: string;\n\n\t@prop({ type: Number, min: 0 })\n\tpublic unitValue?: number;\n\n\t@prop({ required: true, type: Number, min: 0 })\n\tpublic price!: number;\n}\n"]}
@@ -1,18 +0,0 @@
1
- import { Ref } from "@typegoose/typegoose";
2
- import { Coupon } from "./coupon.model";
3
- export declare class OrderPricing {
4
- subtotal: number;
5
- secondarySubtotal: number;
6
- deliveryFee: number;
7
- secondaryDeliveryFee: number;
8
- vat: number;
9
- secondaryVat: number;
10
- appliedCoupon?: Ref<Coupon>;
11
- appliedCouponSnapshot?: Record<string, any>;
12
- discountValue: number;
13
- secondaryDiscountValue: number;
14
- serviceCharge: number;
15
- secondaryServiceCharge: number;
16
- total: number;
17
- secondaryTotal: number;
18
- }
@@ -1,88 +0,0 @@
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.OrderPricing = void 0;
13
- const typegoose_1 = require("@typegoose/typegoose");
14
- const coupon_model_1 = require("./coupon.model");
15
- class OrderPricing {
16
- subtotal;
17
- secondarySubtotal;
18
- deliveryFee;
19
- secondaryDeliveryFee;
20
- vat;
21
- secondaryVat;
22
- appliedCoupon;
23
- appliedCouponSnapshot;
24
- discountValue;
25
- secondaryDiscountValue;
26
- serviceCharge;
27
- secondaryServiceCharge;
28
- total;
29
- secondaryTotal;
30
- }
31
- exports.OrderPricing = OrderPricing;
32
- __decorate([
33
- (0, typegoose_1.prop)({ required: true, default: 0 }),
34
- __metadata("design:type", Number)
35
- ], OrderPricing.prototype, "subtotal", void 0);
36
- __decorate([
37
- (0, typegoose_1.prop)({ default: 0 }),
38
- __metadata("design:type", Number)
39
- ], OrderPricing.prototype, "secondarySubtotal", void 0);
40
- __decorate([
41
- (0, typegoose_1.prop)({ default: 0 }),
42
- __metadata("design:type", Number)
43
- ], OrderPricing.prototype, "deliveryFee", void 0);
44
- __decorate([
45
- (0, typegoose_1.prop)({ default: 0 }),
46
- __metadata("design:type", Number)
47
- ], OrderPricing.prototype, "secondaryDeliveryFee", void 0);
48
- __decorate([
49
- (0, typegoose_1.prop)({ default: 0 }),
50
- __metadata("design:type", Number)
51
- ], OrderPricing.prototype, "vat", void 0);
52
- __decorate([
53
- (0, typegoose_1.prop)({ default: 0 }),
54
- __metadata("design:type", Number)
55
- ], OrderPricing.prototype, "secondaryVat", void 0);
56
- __decorate([
57
- (0, typegoose_1.prop)({ ref: () => coupon_model_1.Coupon }),
58
- __metadata("design:type", Object)
59
- ], OrderPricing.prototype, "appliedCoupon", void 0);
60
- __decorate([
61
- (0, typegoose_1.prop)({ type: () => Object, default: {} }),
62
- __metadata("design:type", Object)
63
- ], OrderPricing.prototype, "appliedCouponSnapshot", void 0);
64
- __decorate([
65
- (0, typegoose_1.prop)({ default: 0 }),
66
- __metadata("design:type", Number)
67
- ], OrderPricing.prototype, "discountValue", void 0);
68
- __decorate([
69
- (0, typegoose_1.prop)({ default: 0 }),
70
- __metadata("design:type", Number)
71
- ], OrderPricing.prototype, "secondaryDiscountValue", void 0);
72
- __decorate([
73
- (0, typegoose_1.prop)({ default: 0 }),
74
- __metadata("design:type", Number)
75
- ], OrderPricing.prototype, "serviceCharge", void 0);
76
- __decorate([
77
- (0, typegoose_1.prop)({ default: 0 }),
78
- __metadata("design:type", Number)
79
- ], OrderPricing.prototype, "secondaryServiceCharge", void 0);
80
- __decorate([
81
- (0, typegoose_1.prop)({ required: true, default: 0 }),
82
- __metadata("design:type", Number)
83
- ], OrderPricing.prototype, "total", void 0);
84
- __decorate([
85
- (0, typegoose_1.prop)({ default: 0 }),
86
- __metadata("design:type", Number)
87
- ], OrderPricing.prototype, "secondaryTotal", void 0);
88
- //# sourceMappingURL=order-pricing.model.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"order-pricing.model.js","sourceRoot":"/","sources":["libraries/mongo/models/order-pricing.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAiD;AACjD,iDAAwC;AAExC,MAAa,YAAY;IAExB,QAAQ,CAAS;IAGjB,iBAAiB,CAAS;IAG1B,WAAW,CAAS;IAGpB,oBAAoB,CAAS;IAG7B,GAAG,CAAS;IAGZ,YAAY,CAAS;IAGrB,aAAa,CAAe;IAM5B,qBAAqB,CAAuB;IAG5C,aAAa,CAAS;IAGtB,sBAAsB,CAAS;IAG/B,aAAa,CAAS;IAGtB,sBAAsB,CAAS;IAG/B,KAAK,CAAS;IAGd,cAAc,CAAS;CACvB;AA7CD,oCA6CC;AA3CA;IADC,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;8CACpB;AAGjB;IADC,IAAA,gBAAI,EAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;uDACK;AAG1B;IADC,IAAA,gBAAI,EAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;iDACD;AAGpB;IADC,IAAA,gBAAI,EAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;0DACQ;AAG7B;IADC,IAAA,gBAAI,EAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;yCACT;AAGZ;IADC,IAAA,gBAAI,EAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;kDACA;AAGrB;IADC,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,qBAAM,EAAE,CAAC;;mDACA;AAM5B;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;2DACE;AAG5C;IADC,IAAA,gBAAI,EAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;mDACC;AAGtB;IADC,IAAA,gBAAI,EAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;4DACU;AAG/B;IADC,IAAA,gBAAI,EAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;mDACC;AAGtB;IADC,IAAA,gBAAI,EAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;4DACU;AAG/B;IADC,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;2CACvB;AAGd;IADC,IAAA,gBAAI,EAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;oDACE","sourcesContent":["import { prop, Ref } from \"@typegoose/typegoose\";\r\nimport { Coupon } from \"./coupon.model\";\r\n\r\nexport class OrderPricing {\r\n\t@prop({ required: true, default: 0 })\r\n\tsubtotal: number;\r\n\r\n\t@prop({ default: 0 })\r\n\tsecondarySubtotal: number;\r\n\r\n\t@prop({ default: 0 })\r\n\tdeliveryFee: number;\r\n\r\n\t@prop({ default: 0 })\r\n\tsecondaryDeliveryFee: number;\r\n\r\n\t@prop({ default: 0 })\r\n\tvat: number;\r\n\r\n\t@prop({ default: 0 })\r\n\tsecondaryVat: number;\r\n\r\n\t@prop({ ref: () => Coupon })\r\n\tappliedCoupon?: Ref<Coupon>;\r\n\r\n\t// Optional snapshot of the line items at time of order\r\n\t// This is useful if we need to reference order contents directly\r\n\t// without requiring a cart lookup, and protects against cart modifications\r\n\t@prop({ type: () => Object, default: {} })\r\n\tappliedCouponSnapshot?: Record<string, any>;\r\n\r\n\t@prop({ default: 0 })\r\n\tdiscountValue: number;\r\n\r\n\t@prop({ default: 0 })\r\n\tsecondaryDiscountValue: number;\r\n\r\n\t@prop({ default: 0 })\r\n\tserviceCharge: number;\r\n\r\n\t@prop({ default: 0 })\r\n\tsecondaryServiceCharge: number;\r\n\r\n\t@prop({ required: true, default: 0 })\r\n\ttotal: number;\r\n\r\n\t@prop({ default: 0 })\r\n\tsecondaryTotal: number;\r\n}"]}
@@ -1,25 +0,0 @@
1
- import { Ref } from '@typegoose/typegoose';
2
- import { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';
3
- import { PriceOption, Status } from '../../../utilities/enum';
4
- import { AttributeMap } from './embedded/attribute-map.model';
5
- import { PriceBreakdown } from './embedded/price-breakdown.model';
6
- import { Product } from './product.model';
7
- import { ShopCategory } from './shop-category.model';
8
- import { Shop } from './shop.model';
9
- export declare class ShopProduct extends TimeStamps {
10
- product: Ref<Product>;
11
- shop: Ref<Shop>;
12
- priceOption?: PriceOption;
13
- priceBreakdowns?: PriceBreakdown[];
14
- description?: string;
15
- attributeMaps?: AttributeMap[];
16
- addons?: Ref<ShopProduct>[];
17
- status?: Status;
18
- shopCategory: Ref<ShopCategory>;
19
- sortingOrder?: number;
20
- isStockEnabled?: boolean;
21
- stockQuantity?: number;
22
- note?: string;
23
- isDrinkIncluded?: boolean;
24
- orderQuantityLimit?: number;
25
- }