@lyxa.ai/core 1.3.230 → 1.3.251

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 (68) hide show
  1. package/dist/libraries/mongo/models/embedded/adjustment-information.model.d.ts +3 -0
  2. package/dist/libraries/mongo/models/embedded/adjustment-information.model.js +11 -0
  3. package/dist/libraries/mongo/models/embedded/adjustment-information.model.js.map +1 -1
  4. package/dist/libraries/mongo/models/embedded/cleaning-material.model.d.ts +4 -0
  5. package/dist/libraries/mongo/models/embedded/cleaning-material.model.js +27 -0
  6. package/dist/libraries/mongo/models/embedded/cleaning-material.model.js.map +1 -0
  7. package/dist/libraries/mongo/models/embedded/service-order-settings.model.d.ts +5 -5
  8. package/dist/libraries/mongo/models/embedded/service-order-settings.model.js +14 -23
  9. package/dist/libraries/mongo/models/embedded/service-order-settings.model.js.map +1 -1
  10. package/dist/libraries/mongo/models/index.d.ts +6 -9
  11. package/dist/libraries/mongo/models/index.js +7 -11
  12. package/dist/libraries/mongo/models/index.js.map +1 -1
  13. package/dist/libraries/mongo/models/line-item.model.d.ts +2 -0
  14. package/dist/libraries/mongo/models/line-item.model.js +10 -0
  15. package/dist/libraries/mongo/models/line-item.model.js.map +1 -1
  16. package/dist/libraries/mongo/models/professional-blocked-time.model.d.ts +10 -0
  17. package/dist/libraries/mongo/models/{blocked-time.model.js → professional-blocked-time.model.js} +13 -23
  18. package/dist/libraries/mongo/models/professional-blocked-time.model.js.map +1 -0
  19. package/dist/libraries/mongo/models/professional.model.d.ts +4 -8
  20. package/dist/libraries/mongo/models/professional.model.js +11 -25
  21. package/dist/libraries/mongo/models/professional.model.js.map +1 -1
  22. package/dist/libraries/mongo/models/service-addon.model.d.ts +15 -0
  23. package/dist/libraries/mongo/models/{addon.model.js → service-addon.model.js} +31 -63
  24. package/dist/libraries/mongo/models/service-addon.model.js.map +1 -0
  25. package/dist/libraries/mongo/models/service-category.model.d.ts +5 -5
  26. package/dist/libraries/mongo/models/service-category.model.js +9 -5
  27. package/dist/libraries/mongo/models/service-category.model.js.map +1 -1
  28. package/dist/libraries/mongo/models/service-line-item.model.d.ts +2 -2
  29. package/dist/libraries/mongo/models/service-line-item.model.js +2 -2
  30. package/dist/libraries/mongo/models/service-line-item.model.js.map +1 -1
  31. package/dist/libraries/mongo/models/service-package.model.d.ts +11 -12
  32. package/dist/libraries/mongo/models/service-package.model.js +25 -43
  33. package/dist/libraries/mongo/models/service-package.model.js.map +1 -1
  34. package/dist/libraries/mongo/models/service.model.d.ts +4 -5
  35. package/dist/libraries/mongo/models/service.model.js +5 -5
  36. package/dist/libraries/mongo/models/service.model.js.map +1 -1
  37. package/dist/libraries/mongo/models/shared/work-hour.model.d.ts +2 -10
  38. package/dist/libraries/mongo/models/shared/work-hour.model.js +7 -31
  39. package/dist/libraries/mongo/models/shared/work-hour.model.js.map +1 -1
  40. package/dist/libraries/mongo/models/vendor-parent.model.d.ts +3 -2
  41. package/dist/libraries/mongo/models/vendor-parent.model.js +26 -7
  42. package/dist/libraries/mongo/models/vendor-parent.model.js.map +1 -1
  43. package/dist/libraries/mongo/models/vendor.model.d.ts +3 -12
  44. package/dist/libraries/mongo/models/vendor.model.js +6 -58
  45. package/dist/libraries/mongo/models/vendor.model.js.map +1 -1
  46. package/dist/libraries/trpc/middlewares/auth.d.ts +1 -1
  47. package/dist/libraries/trpc/middlewares/createRoleProtectedProcedure.d.ts +1 -1
  48. package/dist/libraries/trpc/middlewares/phone-verified.d.ts +1 -1
  49. package/dist/libraries/trpc/middlewares/publicUserDecoder.d.ts +1 -1
  50. package/dist/types/README.md +1 -1
  51. package/dist/types/package.json +1 -1
  52. package/dist/types/utilities/enum.d.ts +7 -8
  53. package/dist/types/utilities/enum.js +8 -8
  54. package/dist/types/utilities/enum.js.map +1 -1
  55. package/dist/types/utilities/validation/common-validation.d.ts +12 -12
  56. package/dist/utilities/enum.d.ts +7 -8
  57. package/dist/utilities/enum.js +8 -8
  58. package/dist/utilities/enum.js.map +1 -1
  59. package/dist/utilities/id-generator.js +1 -0
  60. package/dist/utilities/id-generator.js.map +1 -1
  61. package/package.json +1 -1
  62. package/dist/libraries/mongo/models/addon.model.d.ts +0 -15
  63. package/dist/libraries/mongo/models/addon.model.js.map +0 -1
  64. package/dist/libraries/mongo/models/blocked-time.model.d.ts +0 -11
  65. package/dist/libraries/mongo/models/blocked-time.model.js.map +0 -1
  66. package/dist/libraries/mongo/models/professional-schedule.d.ts +0 -20
  67. package/dist/libraries/mongo/models/professional-schedule.js +0 -102
  68. package/dist/libraries/mongo/models/professional-schedule.js.map +0 -1
@@ -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,kDAAgE;AAChE,oFAAyE;AACzE,6CAAoC;AACpC,6CAAoC;AACpC,iDAAwC;AACxC,qDAA4C;AAC5C,uDAA8C;AAC9C,sEAA4D;AAC5D,qEAA2D;AAC3D,uEAA6D;AAqBtD,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,2BAAU;IAEhC,IAAI,CAAa;IAGjB,IAAI,CAAa;IAGjB,IAAI,CAAa;IAGjB,MAAM,CAAe;IAGrB,QAAQ,CAAY;IAGpB,QAAQ,CAAiB;IAGzB,OAAO,CAAgB;IAGvB,WAAW,CAAe;IAG1B,UAAU,CAAW;IAGrB,UAAU,CAAoB;IAG9B,iBAAiB,CAA2B;IAG5C,QAAQ,CAAU;IAGlB,WAAW,CAAe;IAG1B,cAAc,CAAuB;IAGrC,UAAU,CAAyB;IAGnC,kBAAkB,CAAY;IAG9B,mBAAmB,CAAU;IAG7B,eAAe,CAA2B;IAG1C,UAAU,CAAW;IAGrB,iBAAiB,CAAW;IAG5B,gBAAgB,CAAU;IAG1B,MAAM,CAAW;IAGjB,YAAY,CAAU;IAGtB,Y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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;IACrB,IAAA,iBAAK,EAAC,EAAE,YAAY,EAAE,CAAC,EAAE,CAAC;IAC1B,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,CA0FpB","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 } 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';\nimport { CartParticipant } from './cart-participant.model';\nimport { ProductMarketing } from './product-marketing.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({ lineItemHash: 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({ type: Boolean, default: false })\n\tpublic isStockOut?: boolean;\n\n\t@prop({ ref: () => Marketing, default: [] })\n\tpublic marketings?: Ref<Marketing>[];\n\n\t@prop({ ref: () => ProductMarketing, default: [] })\n\tpublic productMarketings?: Ref<ProductMarketing>[];\n\n\t@prop({ min: 1, default: 1 })\n\tpublic quantity?: number;\n\n\t@prop({ type: String, enum: PriceOption, default: PriceOption.SINGLE_PRICE, _id: false })\n\tpublic priceOption?: PriceOption;\n\n\t@prop({ required: true, type: OrderPriceBreakdown, _id: false })\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, _id: false })\n\tpublic calculationSnap?: Record<string, unknown>;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isAdjusted?: boolean;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isPartialAdjusted?: boolean;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic adjustedQuantity?: number;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isB1G1?: boolean;\n\n\t@prop({ type: String })\n\tpublic adjustReason?: string;\n\n\t@prop({ type: String, select: false })\n\tpublic lineItemHash?: string;\n\n\t@prop({ type: String, select: false })\n\tpublic adjustmentRef?: string;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isSkipped?: boolean;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isAddedAfterAdjustmentReq?: boolean;\n\n\t@prop({\n\t\tref: () => CartParticipant,\n\t\tforeignField: 'cart',\n\t\tlocalField: 'cart',\n\t\tjustOne: true,\n\t\tmatch: (doc: LineItem) => ({ user: doc.user }),\n\t})\n\tpublic cartParticipant?: Ref<CartParticipant>;\n}\n"]}
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,kDAAgE;AAChE,oFAAyE;AACzE,6CAAoC;AACpC,6CAAoC;AACpC,iDAAwC;AACxC,qDAA4C;AAC5C,uDAA8C;AAC9C,sEAA4D;AAC5D,qEAA2D;AAC3D,uEAA6D;AAqBtD,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,2BAAU;IAEhC,IAAI,CAAa;IAGjB,IAAI,CAAa;IAGjB,IAAI,CAAa;IAGjB,MAAM,CAAe;IAGrB,QAAQ,CAAY;IAGpB,QAAQ,CAAiB;IAGzB,OAAO,CAAgB;IAGvB,WAAW,CAAe;IAG1B,UAAU,CAAW;IAGrB,UAAU,CAAoB;IAG9B,iBAAiB,CAA2B;IAG5C,QAAQ,CAAU;IAGlB,WAAW,CAAe;IAG1B,cAAc,CAAuB;IAGrC,UAAU,CAAyB;IAGnC,kBAAkB,CAAY;IAG9B,mBAAmB,CAAU;IAG7B,eAAe,CAA2B;IAG1C,UAAU,CAAW;IAGrB,iBAAiB,CAAW;IAG5B,uBAAuB,CAAW;IAGlC,kBAAkB,CAAyB;IAG3C,gBAAgB,CAAU;IAG1B,MAAM,CAAW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,CAAC;;iDAC4C;mBA/FlC,QAAQ;IAhBpB,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;IACrB,IAAA,iBAAK,EAAC,EAAE,YAAY,EAAE,CAAC,EAAE,CAAC;IAC1B,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,CAgGpB","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 } 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';\nimport { CartParticipant } from './cart-participant.model';\nimport { ProductMarketing } from './product-marketing.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({ lineItemHash: 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({ type: Boolean, default: false })\n\tpublic isStockOut?: boolean;\n\n\t@prop({ ref: () => Marketing, default: [] })\n\tpublic marketings?: Ref<Marketing>[];\n\n\t@prop({ ref: () => ProductMarketing, default: [] })\n\tpublic productMarketings?: Ref<ProductMarketing>[];\n\n\t@prop({ min: 1, default: 1 })\n\tpublic quantity?: number;\n\n\t@prop({ type: String, enum: PriceOption, default: PriceOption.SINGLE_PRICE, _id: false })\n\tpublic priceOption?: PriceOption;\n\n\t@prop({ required: true, type: OrderPriceBreakdown, _id: false })\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, _id: false })\n\tpublic calculationSnap?: Record<string, unknown>;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isAdjusted?: boolean;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isPartialAdjusted?: boolean;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isAttributeAdjustedOnly?: boolean;\n\n\t@prop({ type: () => [[LineItemAttribute]], default: [] })\n\tpublic adjustedAttributes?: LineItemAttribute[][];\n\n\t@prop({ type: Number, default: 0 })\n\tpublic adjustedQuantity?: number;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isB1G1?: boolean;\n\n\t@prop({ type: String })\n\tpublic adjustReason?: string;\n\n\t@prop({ type: String, select: false })\n\tpublic lineItemHash?: string;\n\n\t@prop({ type: String, select: false })\n\tpublic adjustmentRef?: string;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isSkipped?: boolean;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isAddedAfterAdjustmentReq?: boolean;\n\n\t@prop({\n\t\tref: () => CartParticipant,\n\t\tforeignField: 'cart',\n\t\tlocalField: 'cart',\n\t\tjustOne: true,\n\t\tmatch: (doc: LineItem) => ({ user: doc.user }),\n\t})\n\tpublic cartParticipant?: Ref<CartParticipant>;\n}\n"]}
@@ -0,0 +1,10 @@
1
+ import { Ref } from '@typegoose/typegoose';
2
+ import { Vendor } from './vendor.model';
3
+ import { Professional } from './professional.model';
4
+ export declare class ProfessionalBlockedTime {
5
+ vendor: Ref<Vendor>;
6
+ timeFrom: Date;
7
+ timeTo: Date;
8
+ professionals: Ref<Professional>[];
9
+ reason?: string;
10
+ }
@@ -9,51 +9,41 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.BlockedTime = void 0;
12
+ exports.ProfessionalBlockedTime = void 0;
13
13
  const typegoose_1 = require("@typegoose/typegoose");
14
14
  const vendor_model_1 = require("./vendor.model");
15
15
  const professional_model_1 = require("./professional.model");
16
16
  const mongoose_1 = require("mongoose");
17
- let BlockedTime = class BlockedTime {
17
+ let ProfessionalBlockedTime = class ProfessionalBlockedTime {
18
18
  vendor;
19
19
  timeFrom;
20
20
  timeTo;
21
21
  professionals;
22
22
  reason;
23
- createdBy;
24
23
  };
25
- exports.BlockedTime = BlockedTime;
24
+ exports.ProfessionalBlockedTime = ProfessionalBlockedTime;
26
25
  __decorate([
27
26
  (0, typegoose_1.prop)({ ref: () => vendor_model_1.Vendor, required: true }),
28
27
  __metadata("design:type", Object)
29
- ], BlockedTime.prototype, "vendor", void 0);
28
+ ], ProfessionalBlockedTime.prototype, "vendor", void 0);
30
29
  __decorate([
31
30
  (0, typegoose_1.prop)({ required: true }),
32
31
  __metadata("design:type", Date)
33
- ], BlockedTime.prototype, "timeFrom", void 0);
32
+ ], ProfessionalBlockedTime.prototype, "timeFrom", void 0);
34
33
  __decorate([
35
34
  (0, typegoose_1.prop)({ required: true }),
36
35
  __metadata("design:type", Date)
37
- ], BlockedTime.prototype, "timeTo", void 0);
36
+ ], ProfessionalBlockedTime.prototype, "timeTo", void 0);
38
37
  __decorate([
39
38
  (0, typegoose_1.prop)({ ref: () => professional_model_1.Professional, type: () => [mongoose_1.Types.ObjectId] }),
40
39
  __metadata("design:type", Array)
41
- ], BlockedTime.prototype, "professionals", void 0);
40
+ ], ProfessionalBlockedTime.prototype, "professionals", void 0);
42
41
  __decorate([
43
42
  (0, typegoose_1.prop)({ type: String }),
44
43
  __metadata("design:type", String)
45
- ], BlockedTime.prototype, "reason", void 0);
46
- __decorate([
47
- (0, typegoose_1.prop)({ ref: () => vendor_model_1.Vendor }),
48
- __metadata("design:type", Object)
49
- ], BlockedTime.prototype, "createdBy", void 0);
50
- exports.BlockedTime = BlockedTime = __decorate([
51
- (0, typegoose_1.index)({ vendor: 1, date: 1 }),
52
- (0, typegoose_1.modelOptions)({
53
- schemaOptions: {
54
- collection: 'blockedTimes',
55
- timestamps: true
56
- }
57
- })
58
- ], BlockedTime);
59
- //# sourceMappingURL=blocked-time.model.js.map
44
+ ], ProfessionalBlockedTime.prototype, "reason", void 0);
45
+ exports.ProfessionalBlockedTime = ProfessionalBlockedTime = __decorate([
46
+ (0, typegoose_1.modelOptions)({ schemaOptions: { collection: 'professionalBlockedTimes', timestamps: true } }),
47
+ (0, typegoose_1.index)({ vendor: 1, date: 1 })
48
+ ], ProfessionalBlockedTime);
49
+ //# sourceMappingURL=professional-blocked-time.model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"professional-blocked-time.model.js","sourceRoot":"/","sources":["libraries/mongo/models/professional-blocked-time.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAsE;AACtE,iDAAwC;AACxC,6DAAoD;AACpD,uCAAiC;AAI1B,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAE5B,MAAM,CAAe;IAGrB,QAAQ,CAAQ;IAGhB,MAAM,CAAQ;IAGd,aAAa,CAAuB;IAGpC,MAAM,CAAU;CACvB,CAAA;AAfY,0DAAuB;AAE5B;IADN,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,qBAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uDAChB;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACP,IAAI;yDAAC;AAGhB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACT,IAAI;uDAAC;AAGd;IADN,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,iCAAY,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,gBAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;;8DACrB;AAGpC;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;uDACA;kCAdX,uBAAuB;IAFnC,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,0BAA0B,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,CAAC;IAC7F,IAAA,iBAAK,EAAC,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;GACjB,uBAAuB,CAenC","sourcesContent":["import { index, modelOptions, prop, Ref } from '@typegoose/typegoose';\nimport { Vendor } from './vendor.model';\nimport { Professional } from './professional.model';\nimport { Types } from 'mongoose';\n\n@modelOptions({ schemaOptions: { collection: 'professionalBlockedTimes', timestamps: true } })\n@index({ vendor: 1, date: 1 })\nexport class ProfessionalBlockedTime {\n\t@prop({ ref: () => Vendor, required: true })\n\tpublic vendor!: Ref<Vendor>;\n\n\t@prop({ required: true })\n\tpublic timeFrom!: Date;\n\n\t@prop({ required: true })\n\tpublic timeTo!: Date;\n \n\t@prop({ ref: () => Professional, type: () => [Types.ObjectId] })\n\tpublic professionals!: Ref<Professional>[];\n \n\t@prop({ type: String })\n\tpublic reason?: string;\t\n}\n"]}
@@ -1,8 +1,7 @@
1
1
  import { Ref } from '@typegoose/typegoose';
2
2
  import { Vendor } from './vendor.model';
3
- import { ProfessionalStatus, Status } from '../../../utilities/enum';
4
- import { TeamMemberWorkHourSetting } from './shared/work-hour.model';
5
- import { Service } from './service.model';
3
+ import { Status, SubServiceType } from '../../../utilities/enum';
4
+ import { TeamMemberAvailability } from './shared/work-hour.model';
6
5
  export declare class Professional {
7
6
  professionalId: string;
8
7
  name: string;
@@ -12,10 +11,7 @@ export declare class Professional {
12
11
  password: string;
13
12
  nationality?: string;
14
13
  vendor: Ref<Vendor>;
15
- availability: TeamMemberWorkHourSetting[];
16
- worksOn: Ref<Service>[];
17
- avgRating?: number;
18
- totalReviews: number;
14
+ availability: TeamMemberAvailability[];
15
+ worksOn: SubServiceType[];
19
16
  status: Status;
20
- currentStatus?: ProfessionalStatus;
21
17
  }
@@ -15,7 +15,6 @@ const vendor_model_1 = require("./vendor.model");
15
15
  const enum_1 = require("../../../utilities/enum");
16
16
  const password_1 = require("../../../utilities/password");
17
17
  const work_hour_model_1 = require("./shared/work-hour.model");
18
- const service_model_1 = require("./service.model");
19
18
  const id_generator_1 = require("../../../utilities/id-generator");
20
19
  const _1 = require(".");
21
20
  let Professional = class Professional {
@@ -29,10 +28,7 @@ let Professional = class Professional {
29
28
  vendor;
30
29
  availability;
31
30
  worksOn;
32
- avgRating;
33
- totalReviews;
34
31
  status;
35
- currentStatus;
36
32
  };
37
33
  exports.Professional = Professional;
38
34
  __decorate([
@@ -40,19 +36,19 @@ __decorate([
40
36
  __metadata("design:type", String)
41
37
  ], Professional.prototype, "professionalId", void 0);
42
38
  __decorate([
43
- (0, typegoose_1.prop)({ required: true, trim: true }),
39
+ (0, typegoose_1.prop)({ required: true, type: String, trim: true }),
44
40
  __metadata("design:type", String)
45
41
  ], Professional.prototype, "name", void 0);
46
42
  __decorate([
47
- (0, typegoose_1.prop)({ required: true }),
43
+ (0, typegoose_1.prop)({ required: true, type: String }),
48
44
  __metadata("design:type", String)
49
45
  ], Professional.prototype, "image", void 0);
50
46
  __decorate([
51
- (0, typegoose_1.prop)({ required: true, unique: true }),
47
+ (0, typegoose_1.prop)({ required: true, type: String }),
52
48
  __metadata("design:type", String)
53
49
  ], Professional.prototype, "phoneNumber", void 0);
54
50
  __decorate([
55
- (0, typegoose_1.prop)({ required: true, unique: true }),
51
+ (0, typegoose_1.prop)({ required: true, type: String }),
56
52
  __metadata("design:type", String)
57
53
  ], Professional.prototype, "email", void 0);
58
54
  __decorate([
@@ -60,37 +56,25 @@ __decorate([
60
56
  __metadata("design:type", String)
61
57
  ], Professional.prototype, "password", void 0);
62
58
  __decorate([
63
- (0, typegoose_1.prop)(),
59
+ (0, typegoose_1.prop)({ type: String }),
64
60
  __metadata("design:type", String)
65
61
  ], Professional.prototype, "nationality", void 0);
66
62
  __decorate([
67
- (0, typegoose_1.prop)({ ref: () => vendor_model_1.Vendor, required: true }),
63
+ (0, typegoose_1.prop)({ required: true, ref: () => vendor_model_1.Vendor }),
68
64
  __metadata("design:type", Object)
69
65
  ], Professional.prototype, "vendor", void 0);
70
66
  __decorate([
71
- (0, typegoose_1.prop)({ type: () => work_hour_model_1.TeamMemberWorkHourSetting, default: [] }),
67
+ (0, typegoose_1.prop)({ type: () => work_hour_model_1.TeamMemberAvailability, default: [] }),
72
68
  __metadata("design:type", Array)
73
69
  ], Professional.prototype, "availability", void 0);
74
70
  __decorate([
75
- (0, typegoose_1.prop)({ ref: () => service_model_1.Service, default: [] }),
71
+ (0, typegoose_1.prop)({ required: true, type: String, enum: enum_1.SubServiceType }),
76
72
  __metadata("design:type", Array)
77
73
  ], Professional.prototype, "worksOn", void 0);
78
- __decorate([
79
- (0, typegoose_1.prop)({ type: Number, default: 0 }),
80
- __metadata("design:type", Number)
81
- ], Professional.prototype, "avgRating", void 0);
82
- __decorate([
83
- (0, typegoose_1.prop)({ type: Number, default: 0 }),
84
- __metadata("design:type", Number)
85
- ], Professional.prototype, "totalReviews", void 0);
86
74
  __decorate([
87
75
  (0, typegoose_1.prop)({ required: true, type: String, enum: enum_1.Status, default: enum_1.Status.ACTIVE }),
88
76
  __metadata("design:type", String)
89
77
  ], Professional.prototype, "status", void 0);
90
- __decorate([
91
- (0, typegoose_1.prop)({ required: true, type: String, enum: enum_1.ProfessionalStatus, default: enum_1.ProfessionalStatus.AVAILABLE }),
92
- __metadata("design:type", String)
93
- ], Professional.prototype, "currentStatus", void 0);
94
78
  exports.Professional = Professional = __decorate([
95
79
  (0, typegoose_1.modelOptions)({ schemaOptions: { collection: 'professionals', timestamps: true } }),
96
80
  (0, typegoose_1.pre)('save', async function () {
@@ -100,6 +84,8 @@ exports.Professional = Professional = __decorate([
100
84
  if (this.isModified('password')) {
101
85
  this.password = await (0, password_1.hashPassword)(this.password);
102
86
  }
103
- })
87
+ }),
88
+ (0, typegoose_1.Index)({ phoneNumber: 1 }, { unique: true, partialFilterExpression: { deletedAt: null } }),
89
+ (0, typegoose_1.Index)({ email: 1 }, { unique: true, partialFilterExpression: { deletedAt: null } })
104
90
  ], Professional);
105
91
  //# sourceMappingURL=professional.model.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"professional.model.js","sourceRoot":"/","sources":["libraries/mongo/models/professional.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAoE;AACpE,iDAAwC;AACxC,kDAAkF;AAClF,0DAA2D;AAC3D,8DAAqE;AACrE,mDAA0C;AAC1C,kEAA6D;AAC7D,wBAAiC;AAmB1B,IAAM,YAAY,GAAlB,MAAM,YAAY;IAEjB,cAAc,CAAU;IAGxB,IAAI,CAAU;IAGd,KAAK,CAAU;IAGf,WAAW,CAAU;IAGrB,KAAK,CAAU;IAGf,QAAQ,CAAU;IAGlB,WAAW,CAAU;IAGrB,MAAM,CAAe;IAGrB,YAAY,CAA8B;IAG1C,OAAO,CAAkB;IAGzB,SAAS,CAAU;IAGnB,YAAY,CAAU;IAGtB,MAAM,CAAU;IAGhB,aAAa,CAAsB;CAC1C,CAAA;AA1CY,oCAAY;AAEjB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;;oDACnB;AAGxB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;;0CAChB;AAGd;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CACH;AAGf;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;;iDACX;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;;2CACjB;AAGf;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAA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,WAAW,CACvB,CAAC;QACH,CAAC;QAED,IAAI,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;YACjC,IAAI,CAAC,QAAQ,GAAG,MAAM,IAAA,uBAAY,EAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACnD,CAAC;IACF,CAAC,CAAC;GAGW,YAAY,CA0CxB","sourcesContent":["import { prop, Ref, modelOptions, pre } from '@typegoose/typegoose';\nimport { Vendor } from './vendor.model';\nimport { CounterType, ProfessionalStatus, Status } from '../../../utilities/enum';\nimport { hashPassword } from '../../../utilities/password';\nimport { TeamMemberWorkHourSetting } from './shared/work-hour.model';\nimport { Service } from './service.model';\nimport { generateId } from '../../../utilities/id-generator';\nimport { CounterModel } from '.';\n\n\n@modelOptions({ schemaOptions: { collection: 'professionals', timestamps: true } })\n@pre<Professional>('save', async function () {\n\n\tif (this.isNew) {\n\t\tthis.professionalId = await generateId(\n\t\t\tCounterModel,\n\t\t\tCounterType.TEAM_MEMBER\n\t\t);\n\t}\n\n\tif (this.isModified('password')) {\n\t\tthis.password = await hashPassword(this.password);\n\t}\n})\n\n\nexport class Professional {\n\t@prop({ type: String, unique: true, index: true })\n\tpublic professionalId!: string;\n\n\t@prop({ required: true, trim: true })\n\tpublic name!: string;\n\n\t@prop({ required: true })\n\tpublic image!: string;\n\n\t@prop({ required: true, unique: true })\n\tpublic phoneNumber!: string;\n\n\t@prop({ required: true, unique: true })\n\tpublic email!: string;\n\n\t@prop({ type: String })\n\tpublic password!: string;\n\n\t@prop()\n\tpublic nationality?: string;\n\n\t@prop({ ref: () => Vendor, required: true })\n\tpublic vendor!: Ref<Vendor>;\n\n\t@prop({ type: () => TeamMemberWorkHourSetting, default: [] })\n\tpublic availability!: TeamMemberWorkHourSetting[]\n\n\t@prop({ ref: () => Service, default: [] })\n\tpublic worksOn!: Ref<Service>[];\n\n\t@prop({ type: Number, default: 0 })\n\tpublic avgRating?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic totalReviews!: number;\n\n\t@prop({ required: true, type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status!: Status;\n\n\t@prop({ required: true, type: String, enum: ProfessionalStatus, default: ProfessionalStatus.AVAILABLE })\n\tpublic currentStatus?: ProfessionalStatus;\n}\n"]}
1
+ {"version":3,"file":"professional.model.js","sourceRoot":"/","sources":["libraries/mongo/models/professional.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA2E;AAC3E,iDAAwC;AACxC,kDAA8E;AAC9E,0DAA2D;AAC3D,8DAAkE;AAClE,kEAA6D;AAC7D,wBAAiC;AAc1B,IAAM,YAAY,GAAlB,MAAM,YAAY;IAEjB,cAAc,CAAU;IAGxB,IAAI,CAAU;IAGd,KAAK,CAAU;IAGf,WAAW,CAAU;IAGrB,KAAK,CAAU;IAGf,QAAQ,CAAU;IAGlB,WAAW,CAAU;IAGrB,MAAM,CAAe;IAGrB,YAAY,CAA4B;IAGxC,OAAO,CAAoB;IAG3B,MAAM,CAAU;CACvB,CAAA;AAjCY,oCAAY;AAEjB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;;oDACnB;AAGxB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;;0CAC9B;AAGd;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;2CACjB;AAGf;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;iDACX;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;2CACjB;AAGf;IADN,IAAA,gBAAI,EAAC,EAAE,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AuB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC;IACzF,IAAA,iBAAK,EAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,uBAAuB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC;GACvE,YAAY,CAiCxB","sourcesContent":["import { prop, Ref, modelOptions, pre, Index } from '@typegoose/typegoose';\nimport { Vendor } from './vendor.model';\nimport { CounterType, Status, SubServiceType } from '../../../utilities/enum';\nimport { hashPassword } from '../../../utilities/password';\nimport { TeamMemberAvailability } from './shared/work-hour.model';\nimport { generateId } from '../../../utilities/id-generator';\nimport { CounterModel } from '.';\n\n@modelOptions({ schemaOptions: { collection: 'professionals', timestamps: true } })\n@pre<Professional>('save', async function () {\n\tif (this.isNew) {\n\t\tthis.professionalId = await generateId(CounterModel, CounterType.TEAM_MEMBER);\n\t}\n\n\tif (this.isModified('password')) {\n\t\tthis.password = await hashPassword(this.password);\n\t}\n})\n@Index({ phoneNumber: 1 }, { unique: true, partialFilterExpression: { deletedAt: null } })\n@Index({ email: 1 }, { unique: true, partialFilterExpression: { deletedAt: null } })\nexport class Professional {\n\t@prop({ type: String, unique: true, index: true })\n\tpublic professionalId!: string;\n\n\t@prop({ required: true, type: String, trim: true })\n\tpublic name!: string;\n\n\t@prop({ required: true, type: String })\n\tpublic image!: string;\n\n\t@prop({ required: true, type: String })\n\tpublic phoneNumber!: string;\n\n\t@prop({ required: true, type: String })\n\tpublic email!: string;\n\n\t@prop({ type: String })\n\tpublic password!: string;\n\n\t@prop({ type: String })\n\tpublic nationality?: string;\n\n\t@prop({ required: true, ref: () => Vendor })\n\tpublic vendor!: Ref<Vendor>;\n\n\t@prop({ type: () => TeamMemberAvailability, default: [] })\n\tpublic availability!: TeamMemberAvailability[];\n\n\t@prop({ required: true, type: String, enum: SubServiceType })\n\tpublic worksOn!: SubServiceType[];\n\n\t@prop({ required: true, type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status!: Status;\n}\n"]}
@@ -0,0 +1,15 @@
1
+ import { Ref } from '@typegoose/typegoose';
2
+ import { Vendor } from './index';
3
+ import { ServiceType, Status, SubServiceType } from '../../../utilities/enum';
4
+ import { PreparingTime } from './embedded/preparing-time.model';
5
+ export declare class ServiceAddon {
6
+ name: string;
7
+ serviceType: ServiceType;
8
+ subServiceType?: SubServiceType;
9
+ vendor: Ref<Vendor>;
10
+ image: string;
11
+ price: number;
12
+ duration: PreparingTime;
13
+ description?: string;
14
+ status: Status;
15
+ }
@@ -12,99 +12,67 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.AddOn = void 0;
15
+ exports.ServiceAddon = void 0;
16
16
  const typegoose_1 = require("@typegoose/typegoose");
17
17
  const mongoose_1 = __importDefault(require("mongoose"));
18
18
  const index_1 = require("./index");
19
19
  const enum_1 = require("../../../utilities/enum");
20
- let AddOn = class AddOn {
20
+ const preparing_time_model_1 = require("./embedded/preparing-time.model");
21
+ let ServiceAddon = class ServiceAddon {
21
22
  name;
22
- service;
23
+ serviceType;
24
+ subServiceType;
23
25
  vendor;
24
26
  image;
25
27
  price;
26
- hours;
27
- minutes;
28
+ duration;
28
29
  description;
29
30
  status;
30
- isVisible;
31
31
  };
32
- exports.AddOn = AddOn;
32
+ exports.ServiceAddon = ServiceAddon;
33
33
  __decorate([
34
34
  (0, typegoose_1.prop)({ required: true, trim: true }),
35
35
  __metadata("design:type", String)
36
- ], AddOn.prototype, "name", void 0);
36
+ ], ServiceAddon.prototype, "name", void 0);
37
37
  __decorate([
38
- (0, typegoose_1.prop)({
39
- required: true,
40
- type: () => [mongoose_1.default.Types.ObjectId],
41
- ref: () => index_1.Service,
42
- }),
43
- __metadata("design:type", Array)
44
- ], AddOn.prototype, "service", void 0);
38
+ (0, typegoose_1.prop)({ required: true, type: String, enum: enum_1.ServiceType }),
39
+ __metadata("design:type", String)
40
+ ], ServiceAddon.prototype, "serviceType", void 0);
45
41
  __decorate([
46
- (0, typegoose_1.prop)({
47
- required: true,
48
- type: () => mongoose_1.default.Types.ObjectId,
49
- ref: () => index_1.Vendor,
50
- }),
42
+ (0, typegoose_1.prop)({ type: String, enum: enum_1.SubServiceType }),
43
+ __metadata("design:type", String)
44
+ ], ServiceAddon.prototype, "subServiceType", void 0);
45
+ __decorate([
46
+ (0, typegoose_1.prop)({ required: true, type: () => mongoose_1.default.Types.ObjectId, ref: () => index_1.Vendor }),
51
47
  __metadata("design:type", Object)
52
- ], AddOn.prototype, "vendor", void 0);
48
+ ], ServiceAddon.prototype, "vendor", void 0);
53
49
  __decorate([
54
- (0, typegoose_1.prop)({
55
- required: true,
56
- type: String,
57
- trim: true,
58
- }),
50
+ (0, typegoose_1.prop)({ required: true, type: String, trim: true }),
59
51
  __metadata("design:type", String)
60
- ], AddOn.prototype, "image", void 0);
61
- __decorate([
62
- (0, typegoose_1.prop)({
63
- required: true,
64
- type: Number,
65
- min: 0,
66
- }),
67
- __metadata("design:type", Number)
68
- ], AddOn.prototype, "price", void 0);
52
+ ], ServiceAddon.prototype, "image", void 0);
69
53
  __decorate([
70
- (0, typegoose_1.prop)({
71
- required: true,
72
- type: Number,
73
- min: 0,
74
- }),
54
+ (0, typegoose_1.prop)({ required: true, type: Number, min: 0 }),
75
55
  __metadata("design:type", Number)
76
- ], AddOn.prototype, "hours", void 0);
56
+ ], ServiceAddon.prototype, "price", void 0);
77
57
  __decorate([
78
- (0, typegoose_1.prop)({
79
- required: true,
80
- type: Number,
81
- min: 0,
82
- max: 59,
83
- }),
84
- __metadata("design:type", Number)
85
- ], AddOn.prototype, "minutes", void 0);
58
+ (0, typegoose_1.prop)({ required: true, type: preparing_time_model_1.PreparingTime }),
59
+ __metadata("design:type", preparing_time_model_1.PreparingTime)
60
+ ], ServiceAddon.prototype, "duration", void 0);
86
61
  __decorate([
87
- (0, typegoose_1.prop)({
88
- maxlength: 250,
89
- trim: true,
90
- }),
62
+ (0, typegoose_1.prop)({ maxlength: 250, trim: true }),
91
63
  __metadata("design:type", String)
92
- ], AddOn.prototype, "description", void 0);
64
+ ], ServiceAddon.prototype, "description", void 0);
93
65
  __decorate([
94
66
  (0, typegoose_1.prop)({ type: String, enum: enum_1.Status, default: enum_1.Status.ACTIVE }),
95
67
  __metadata("design:type", String)
96
- ], AddOn.prototype, "status", void 0);
97
- __decorate([
98
- (0, typegoose_1.prop)({ type: Boolean, deafult: true }),
99
- __metadata("design:type", Boolean)
100
- ], AddOn.prototype, "isVisible", void 0);
101
- exports.AddOn = AddOn = __decorate([
68
+ ], ServiceAddon.prototype, "status", void 0);
69
+ exports.ServiceAddon = ServiceAddon = __decorate([
102
70
  (0, typegoose_1.modelOptions)({
103
71
  schemaOptions: {
104
- collection: "addons",
72
+ collection: 'serviceAddons',
105
73
  timestamps: true,
106
74
  },
107
75
  }),
108
76
  (0, typegoose_1.index)({ name: 1, service: 1 }, { unique: false })
109
- ], AddOn);
110
- //# sourceMappingURL=addon.model.js.map
77
+ ], ServiceAddon);
78
+ //# sourceMappingURL=service-addon.model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"service-addon.model.js","sourceRoot":"/","sources":["libraries/mongo/models/service-addon.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,oDAAsE;AACtE,wDAAgC;AAChC,mCAAiC;AACjC,kDAA8E;AAC9E,0EAAgE;AASzD,IAAM,YAAY,GAAlB,MAAM,YAAY;IAEjB,IAAI,CAAU;IAGd,WAAW,CAAe;IAG1B,cAAc,CAAkB;IAGhC,MAAM,CAAe;IAGrB,KAAK,CAAU;IAGf,KAAK,CAAU;IAGf,QAAQ,CAAiB;IAGzB,WAAW,CAAU;IAGrB,MAAM,CAAS;CACtB,CAAA;AA3BY,oCAAY;AAEjB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,IAA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EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;GACrC,YAAY,CA2BxB","sourcesContent":["import { prop, modelOptions, Ref, index } from '@typegoose/typegoose';\nimport mongoose from 'mongoose';\nimport { Vendor } from './index';\nimport { ServiceType, Status, SubServiceType } from '../../../utilities/enum';\nimport { PreparingTime } from './embedded/preparing-time.model';\n\n@modelOptions({\n\tschemaOptions: {\n\t\tcollection: 'serviceAddons',\n\t\ttimestamps: true,\n\t},\n})\n@index({ name: 1, service: 1 }, { unique: false })\nexport class ServiceAddon {\n\t@prop({ required: true, trim: true })\n\tpublic name!: string;\n\n\t@prop({ required: true, type: String, enum: ServiceType })\n\tpublic serviceType!: ServiceType;\n\n\t@prop({ type: String, enum: SubServiceType })\n\tpublic subServiceType?: SubServiceType;\n\n\t@prop({ required: true, type: () => mongoose.Types.ObjectId, ref: () => Vendor })\n\tpublic vendor!: Ref<Vendor>;\n\n\t@prop({ required: true, type: String, trim: true })\n\tpublic image!: string;\n\n\t@prop({ required: true, type: Number, min: 0 })\n\tpublic price!: number;\n\n\t@prop({ required: true, type: PreparingTime })\n\tpublic duration!: PreparingTime;\n\n\t@prop({ maxlength: 250, trim: true })\n\tpublic description?: string;\n\n\t@prop({ type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status: Status;\n}\n"]}
@@ -1,14 +1,14 @@
1
1
  import { Ref } from '@typegoose/typegoose';
2
2
  import { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';
3
- import { Status } from '../../../utilities/enum';
3
+ import { ServiceType, Status, SubServiceType } from '../../../utilities/enum';
4
4
  import { Vendor } from './vendor.model';
5
- import { Service } from './service.model';
6
5
  export declare class ServiceCategory extends TimeStamps {
7
6
  name: string;
8
- service: Ref<Service>;
7
+ serviceType: ServiceType;
8
+ subServiceType?: SubServiceType;
9
9
  vendor: Ref<Vendor>;
10
10
  image?: string;
11
- status: Status;
12
- isVisible: boolean;
11
+ status?: Status;
12
+ isVisible?: boolean;
13
13
  sortingOrder?: number;
14
14
  }
@@ -14,11 +14,11 @@ const typegoose_1 = require("@typegoose/typegoose");
14
14
  const defaultClasses_1 = require("@typegoose/typegoose/lib/defaultClasses");
15
15
  const enum_1 = require("../../../utilities/enum");
16
16
  const vendor_model_1 = require("./vendor.model");
17
- const service_model_1 = require("./service.model");
18
17
  const _1 = require(".");
19
18
  let ServiceCategory = class ServiceCategory extends defaultClasses_1.TimeStamps {
20
19
  name;
21
- service;
20
+ serviceType;
21
+ subServiceType;
22
22
  vendor;
23
23
  image;
24
24
  status;
@@ -31,9 +31,13 @@ __decorate([
31
31
  __metadata("design:type", String)
32
32
  ], ServiceCategory.prototype, "name", void 0);
33
33
  __decorate([
34
- (0, typegoose_1.prop)({ required: true, ref: () => service_model_1.Service }),
35
- __metadata("design:type", Object)
36
- ], ServiceCategory.prototype, "service", void 0);
34
+ (0, typegoose_1.prop)({ required: true, type: String, enum: enum_1.ServiceType }),
35
+ __metadata("design:type", String)
36
+ ], ServiceCategory.prototype, "serviceType", void 0);
37
+ __decorate([
38
+ (0, typegoose_1.prop)({ type: String, enum: enum_1.SubServiceType }),
39
+ __metadata("design:type", String)
40
+ ], ServiceCategory.prototype, "subServiceType", void 0);
37
41
  __decorate([
38
42
  (0, typegoose_1.prop)({ required: true, ref: () => vendor_model_1.Vendor }),
39
43
  __metadata("design:type", Object)
@@ -1 +1 @@
1
- {"version":3,"file":"service-category.model.js","sourceRoot":"/","sources":["libraries/mongo/models/service-category.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA2E;AAC3E,4EAAqE;AACrE,kDAAiD;AACjD,iDAAwC;AACxC,mDAA0C;AAC1C,wBAAyC;AA2BlC,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,2BAAU;IAEvC,IAAI,CAAU;IAGd,OAAO,CAAgB;IAGvB,MAAM,CAAe;IAGrB,KAAK,CAAU;IAGf,MAAM,CAAU;IAGhB,SAAS,CAAS;IAGlB,YAAY,CAAU;CAC7B,CAAA;AArB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I,CAAC;gBAEJ,MAAM,eAAe,GAAG,MAAM,uBAAoB,CAAC,SAAS,CAA8B;oBACzF;wBACC,MAAM,EAAE;4BACP,GAAG,EAAE,IAAI;4BACT,eAAe,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE;yBAC1C;qBACD;iBACD,CAAC,CAAC,IAAI,EAAE,CAAC;gBAGV,IAAI,CAAC,YAAY,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,eAAe,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;YACrE,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,OAAO,IAAI,CAAC,KAAc,CAAC,CAAC;YAC7B,CAAC;QACF,CAAC;QACD,IAAI,EAAE,CAAC;IACR,CAAC,CAAC;GACW,eAAe,CAqB3B","sourcesContent":["import { Index, modelOptions, pre, prop, Ref } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { Status } from '../../../utilities/enum';\nimport { Vendor } from './vendor.model';\nimport { Service } from './service.model';\nimport { ServiceCategoryModel } from '.';\n\n\n@Index({ name: 1, vendor: 1 }, { unique: true, collation: { locale: 'en', strength: 2 } })\n@modelOptions({ schemaOptions: { collection: 'serviceCategories' } })\n@pre<ServiceCategory>('save', async function (next) {\n\t// Only set sortingOrder if it's a new document or sortingOrder is not set\n\tif (this.isNew || typeof this.sortingOrder === 'undefined') {\n\t\ttry {\n\t\t\t// Find the maximum sortingOrder for shops with the same itemType that aren't deleted\n\t\t\tconst maxSortingOrder = await ServiceCategoryModel.aggregate<{ maxSortingOrder: number }>([\n\t\t\t\t{\n\t\t\t\t\t$group: {\n\t\t\t\t\t\t_id: null,\n\t\t\t\t\t\tmaxSortingOrder: { $max: '$sortingOrder' },\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t]).exec();\n\n\t\t\t// Set the new sortingOrder to max + 1 (or 0 if no items found)\n\t\t\tthis.sortingOrder = (maxSortingOrder[0]?.maxSortingOrder ?? -1) + 1;\n\t\t} catch (error) {\n\t\t\treturn next(error as Error);\n\t\t}\n\t}\n\tnext();\n})\nexport class ServiceCategory extends TimeStamps {\n\t@prop({ required: true, type: String, trim: true, maxlength: 20 })\n\tpublic name!: string;\n\n\t@prop({ required: true, ref: () => Service })\n\tpublic service!: Ref<Service>;\n\n\t@prop({ required: true, ref: () => Vendor })\n\tpublic vendor!: Ref<Vendor>;\n\n\t@prop({ type: String })\n\tpublic image?: string;\n\n\t@prop({ type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status!: Status;\n\n\t@prop({ type: Boolean, deafult: true })\n\tpublic isVisible: boolean\n\n\t@prop({ type: Number })\n\tpublic sortingOrder?: number;\n}\n"]}
1
+ {"version":3,"file":"service-category.model.js","sourceRoot":"/","sources":["libraries/mongo/models/service-category.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA2E;AAC3E,4EAAqE;AACrE,kDAA8E;AAC9E,iDAAwC;AACxC,wBAAyC;AA0BlC,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,2BAAU;IAEvC,IAAI,CAAU;IAGd,WAAW,CAAe;IAG1B,cAAc,CAAkB;IAGhC,MAAM,CAAe;IAGrB,KAAK,CAAU;IAGf,MAAM,CAAU;IAGhB,SAAS,CAAW;IAGpB,YAAY,CAAU;CAC7B,CAAA;AAxBY,0CAAe;AAEpB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;;6CAC7C;AAGd;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAW,EAAE,CAAC;;oDACzB;AAG1B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,qBAAc,EAAE,CAAC;;uDACN;AAGhC;I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eAAe,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;YACrE,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,OAAO,IAAI,CAAC,KAAc,CAAC,CAAC;YAC7B,CAAC;QACF,CAAC;QACD,IAAI,EAAE,CAAC;IACR,CAAC,CAAC;GACW,eAAe,CAwB3B","sourcesContent":["import { Index, modelOptions, pre, prop, Ref } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { ServiceType, Status, SubServiceType } from '../../../utilities/enum';\nimport { Vendor } from './vendor.model';\nimport { ServiceCategoryModel } from '.';\n\n@Index({ name: 1, vendor: 1 }, { unique: true, collation: { locale: 'en', strength: 2 } })\n@modelOptions({ schemaOptions: { collection: 'serviceCategories' } })\n@pre<ServiceCategory>('save', async function (next) {\n\t// Only set sortingOrder if it's a new document or sortingOrder is not set\n\tif (this.isNew || typeof this.sortingOrder === 'undefined') {\n\t\ttry {\n\t\t\t// Find the maximum sortingOrder for shops with the same itemType that aren't deleted\n\t\t\tconst maxSortingOrder = await ServiceCategoryModel.aggregate<{ maxSortingOrder: number }>([\n\t\t\t\t{\n\t\t\t\t\t$group: {\n\t\t\t\t\t\t_id: null,\n\t\t\t\t\t\tmaxSortingOrder: { $max: '$sortingOrder' },\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t]).exec();\n\n\t\t\t// Set the new sortingOrder to max + 1 (or 0 if no items found)\n\t\t\tthis.sortingOrder = (maxSortingOrder[0]?.maxSortingOrder ?? -1) + 1;\n\t\t} catch (error) {\n\t\t\treturn next(error as Error);\n\t\t}\n\t}\n\tnext();\n})\nexport class ServiceCategory extends TimeStamps {\n\t@prop({ required: true, type: String, trim: true, maxlength: 20 })\n\tpublic name!: string;\n\n\t@prop({ required: true, type: String, enum: ServiceType })\n\tpublic serviceType!: ServiceType;\n\n\t@prop({ type: String, enum: SubServiceType })\n\tpublic subServiceType?: SubServiceType;\n\n\t@prop({ required: true, ref: () => Vendor })\n\tpublic vendor!: Ref<Vendor>;\n\n\t@prop({ type: String })\n\tpublic image?: string;\n\n\t@prop({ type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status?: Status;\n\n\t@prop({ type: Boolean, deafult: true })\n\tpublic isVisible?: boolean;\n\n\t@prop({ type: Number })\n\tpublic sortingOrder?: number;\n}\n"]}
@@ -4,14 +4,14 @@ import { ServiceCart } from './service-cart.model';
4
4
  import { User } from './user.model';
5
5
  import { Vendor } from './vendor.model';
6
6
  import { ServicePackage } from './service-package.model';
7
- import { AddOn } from './addon.model';
7
+ import { ServiceAddon } from './service-addon.model';
8
8
  import { Status } from '../../../utilities/enum';
9
9
  export declare class ServiceLineItem extends TimeStamps {
10
10
  cart: Ref<ServiceCart>;
11
11
  user: Ref<User>;
12
12
  vendor: Ref<Vendor>;
13
13
  servicePackage?: Ref<ServicePackage>;
14
- addOn?: Ref<AddOn>;
14
+ addOn?: Ref<ServiceAddon>;
15
15
  quantity?: number;
16
16
  isAddon: boolean;
17
17
  status: Status;
@@ -20,7 +20,7 @@ const user_model_1 = require("./user.model");
20
20
  const vendor_model_1 = require("./vendor.model");
21
21
  const service_package_model_1 = require("./service-package.model");
22
22
  const mongoose_1 = __importDefault(require("mongoose"));
23
- const addon_model_1 = require("./addon.model");
23
+ const service_addon_model_1 = require("./service-addon.model");
24
24
  const enum_1 = require("../../../utilities/enum");
25
25
  let ServiceLineItem = class ServiceLineItem extends defaultClasses_1.TimeStamps {
26
26
  cart;
@@ -51,7 +51,7 @@ __decorate([
51
51
  __metadata("design:type", Object)
52
52
  ], ServiceLineItem.prototype, "servicePackage", void 0);
53
53
  __decorate([
54
- (0, typegoose_1.prop)({ ref: () => addon_model_1.AddOn }),
54
+ (0, typegoose_1.prop)({ ref: () => service_addon_model_1.ServiceAddon }),
55
55
  __metadata("design:type", Object)
56
56
  ], ServiceLineItem.prototype, "addOn", void 0);
57
57
  __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"service-line-item.model.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BAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,aAAM,EAAE,OAAO,EAAE,aAAM,CAAC,MAAM,EAAE,CAAC;;+CACxC;AAGd;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,kBAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;;wDACK;0BA1BrC,eAAe;IAd3B,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,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;IACrB,IAAA,iBAAK,EAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;GACR,eAAe,CA2B3B","sourcesContent":["import { Index, modelOptions, prop, Ref, Severity } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { ServiceCart } from './service-cart.model';\nimport { User } from './user.model';\nimport { Vendor } from './vendor.model';\nimport { ServicePackage } from './service-package.model';\nimport mongoose from 'mongoose';\nimport { AddOn } from './addon.model';\nimport { Status } from '../../../utilities/enum';\n\n/**\n * ServiceLineItem model - Represents individual items in a cart\n */\n\n@modelOptions({\n\tschemaOptions: {\n\t\tcollection: 'serviceLineItems',\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({ package: 1 })\n@Index({ vendor: 1 })\nexport class ServiceLineItem extends TimeStamps {\n\t@prop({ require: true, ref: () => ServiceCart })\n\tpublic cart!: Ref<ServiceCart>;\n\n\t@prop({ required: true, ref: () => User })\n\tpublic user!: Ref<User>;\n\n\t@prop({ required: true, ref: () => Vendor })\n\tpublic vendor!: Ref<Vendor>;\n\n\t@prop({ ref: () => ServicePackage })\n\tpublic servicePackage?: Ref<ServicePackage>;\n\n\t@prop({ ref: () => AddOn })\n\tpublic addOn?: Ref<AddOn>;\n\n\t@prop({ min: 1, default: 1 })\n\tpublic quantity?: number;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isAddon: boolean;\n\n\t@prop({ type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status: Status\n\n\t@prop({ type: mongoose.Schema.Types.Mixed })\n\tpublic calculationSnap?: Record<string, unknown>;\n}\n"]}
1
+ {"version":3,"file":"service-line-item.model.js","sourceRoot":"/","sources":["libraries/mongo/models/service-line-item.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,oDAAgF;AAChF,4EAAqE;AACrE,6DAAmD;AACnD,6CAAoC;AACpC,iDAAwC;AACxC,mEAAyD;AACzD,wDAAgC;AAChC,+DAAqD;AACrD,kDAAiD;AAoB1C,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,2BAAU;IAEvC,IAAI,CAAoB;IAGxB,IAAI,CAAa;IAGjB,MAAM,CAAe;IAGrB,cAAc,CAAuB;IAGrC,KAAK,CAAqB;IAG1B,QAAQ,CAAU;IAGlB,OAAO,CAAU;IAGjB,MAAM,CAAS;IAGf,eAAe,CAA2B;CACjD,CAAA;AA3BY,0CAAe;AAEpB;IADN,IAAA,gBAAI,EAAC,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,gCAAW,EAAE,CAAC;;6CACjB;AAGxB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EA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AE,CAAC;IAC3B,IAAA,iBAAK,EAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;IACrB,IAAA,iBAAK,EAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;GACR,eAAe,CA2B3B","sourcesContent":["import { Index, modelOptions, prop, Ref, Severity } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { ServiceCart } from './service-cart.model';\nimport { User } from './user.model';\nimport { Vendor } from './vendor.model';\nimport { ServicePackage } from './service-package.model';\nimport mongoose from 'mongoose';\nimport { ServiceAddon } from './service-addon.model';\nimport { Status } from '../../../utilities/enum';\n\n/**\n * ServiceLineItem model - Represents individual items in a cart\n */\n\n@modelOptions({\n\tschemaOptions: {\n\t\tcollection: 'serviceLineItems',\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({ package: 1 })\n@Index({ vendor: 1 })\nexport class ServiceLineItem extends TimeStamps {\n\t@prop({ require: true, ref: () => ServiceCart })\n\tpublic cart!: Ref<ServiceCart>;\n\n\t@prop({ required: true, ref: () => User })\n\tpublic user!: Ref<User>;\n\n\t@prop({ required: true, ref: () => Vendor })\n\tpublic vendor!: Ref<Vendor>;\n\n\t@prop({ ref: () => ServicePackage })\n\tpublic servicePackage?: Ref<ServicePackage>;\n\n\t@prop({ ref: () => ServiceAddon })\n\tpublic addOn?: Ref<ServiceAddon>;\n\n\t@prop({ min: 1, default: 1 })\n\tpublic quantity?: number;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isAddon: boolean;\n\n\t@prop({ type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status: Status;\n\n\t@prop({ type: mongoose.Schema.Types.Mixed })\n\tpublic calculationSnap?: Record<string, unknown>;\n}\n"]}
@@ -1,26 +1,25 @@
1
1
  import { Ref } from '@typegoose/typegoose';
2
2
  import { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';
3
- import { Status } from '../../../utilities/enum';
3
+ import { ServiceType, Status, SubServiceType } from '../../../utilities/enum';
4
4
  import { Vendor } from './vendor.model';
5
5
  import { ServiceCategory } from './service-category.model';
6
- import { Service } from "./service.model";
7
- import { AddOn } from './index';
6
+ import { ServiceAddon } from './index';
7
+ import { PreparingTime } from './embedded/preparing-time.model';
8
+ import { CleaningMaterial } from './embedded/cleaning-material.model';
8
9
  export declare class ServicePackage extends TimeStamps {
9
10
  name: string;
10
11
  vendor: Ref<Vendor>;
11
- service: Ref<Service>;
12
+ serviceType: ServiceType;
13
+ subServiceType?: SubServiceType;
14
+ description?: string;
12
15
  category: Ref<ServiceCategory>;
13
16
  price: number;
14
- hours: number;
15
- minutes: number;
16
- numberOfProfessionals?: number;
17
- description?: string;
17
+ duration: PreparingTime;
18
+ numberOfProfessionals: number;
18
19
  image: string;
19
20
  vendorNotes?: string;
20
- addons?: Ref<AddOn>[];
21
+ addons?: Ref<ServiceAddon>[];
21
22
  status: Status;
22
- includeMaterials: boolean;
23
- materialsCost?: number;
23
+ cleaningMaterial: CleaningMaterial;
24
24
  sortingOrder?: number;
25
- isVisible: boolean;
26
25
  }