@lyxa.ai/core 1.3.259 → 1.3.262

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 (104) hide show
  1. package/dist/libraries/event/EventEnums.d.ts +2 -1
  2. package/dist/libraries/event/EventEnums.js +1 -0
  3. package/dist/libraries/event/EventEnums.js.map +1 -1
  4. package/dist/libraries/event/events/index.d.ts +1 -0
  5. package/dist/libraries/event/events/index.js +18 -0
  6. package/dist/libraries/event/events/index.js.map +1 -0
  7. package/dist/libraries/event/events/order/order-created.event.d.ts +4 -0
  8. package/dist/libraries/event/events/order/order-created.event.js +8 -0
  9. package/dist/libraries/event/events/order/order-created.event.js.map +1 -0
  10. package/dist/libraries/event/events/punch-marketing/sync-user-shop-punch-marketing-history-event.d.ts +2 -2
  11. package/dist/libraries/event/events/rider/index.d.ts +1 -0
  12. package/dist/libraries/event/events/rider/index.js +18 -0
  13. package/dist/libraries/event/events/rider/index.js.map +1 -0
  14. package/dist/libraries/event/events/rider/scoring/index.d.ts +5 -0
  15. package/dist/libraries/event/events/rider/scoring/index.js +14 -0
  16. package/dist/libraries/event/events/rider/scoring/index.js.map +1 -0
  17. package/dist/libraries/event/events/rider/scoring/rider-accepted-order.event.d.ts +11 -0
  18. package/dist/libraries/event/events/rider/scoring/rider-accepted-order.event.js +21 -0
  19. package/dist/libraries/event/events/rider/scoring/rider-accepted-order.event.js.map +1 -0
  20. package/dist/libraries/event/events/rider/scoring/rider-arrived-at-store.event.d.ts +13 -0
  21. package/dist/libraries/event/events/rider/scoring/rider-arrived-at-store.event.js +25 -0
  22. package/dist/libraries/event/events/rider/scoring/rider-arrived-at-store.event.js.map +1 -0
  23. package/dist/libraries/event/events/rider/scoring/rider-delivered-order.event.d.ts +13 -0
  24. package/dist/libraries/event/events/rider/scoring/rider-delivered-order.event.js +25 -0
  25. package/dist/libraries/event/events/rider/scoring/rider-delivered-order.event.js.map +1 -0
  26. package/dist/libraries/event/events/rider/scoring/rider-rejected-order.event.d.ts +11 -0
  27. package/dist/libraries/event/events/rider/scoring/rider-rejected-order.event.js +21 -0
  28. package/dist/libraries/event/events/rider/scoring/rider-rejected-order.event.js.map +1 -0
  29. package/dist/libraries/event/events/rider/scoring/rider-score-event.d.ts +16 -0
  30. package/dist/libraries/event/events/rider/scoring/rider-score-event.js +23 -0
  31. package/dist/libraries/event/events/rider/scoring/rider-score-event.js.map +1 -0
  32. package/dist/libraries/event/events/sync-order-again-sections-for-shop-event.d.ts +2 -2
  33. package/dist/libraries/firebase/fcmService.js +7 -7
  34. package/dist/libraries/firebase/fcmService.js.map +1 -1
  35. package/dist/libraries/mongo/models/embedded/profit.model.js.map +1 -1
  36. package/dist/libraries/mongo/models/embedded/rider-statistics.d.ts +11 -0
  37. package/dist/libraries/mongo/models/embedded/rider-statistics.js +62 -0
  38. package/dist/libraries/mongo/models/embedded/rider-statistics.js.map +1 -0
  39. package/dist/libraries/mongo/models/embedded/service-line-item.model.d.ts +23 -0
  40. package/dist/libraries/mongo/models/embedded/service-line-item.model.js +95 -0
  41. package/dist/libraries/mongo/models/embedded/service-line-item.model.js.map +1 -0
  42. package/dist/libraries/mongo/models/embedded/service-order-cance.model.d.ts +1 -1
  43. package/dist/libraries/mongo/models/embedded/service-order-cance.model.js +1 -5
  44. package/dist/libraries/mongo/models/embedded/service-order-cance.model.js.map +1 -1
  45. package/dist/libraries/mongo/models/embedded/service-order-finance.model.d.ts +6 -7
  46. package/dist/libraries/mongo/models/embedded/service-order-finance.model.js +17 -18
  47. package/dist/libraries/mongo/models/embedded/service-order-finance.model.js.map +1 -1
  48. package/dist/libraries/mongo/models/embedded/service-order-flag.model.d.ts +4 -4
  49. package/dist/libraries/mongo/models/embedded/service-order-flag.model.js +12 -7
  50. package/dist/libraries/mongo/models/embedded/service-order-flag.model.js.map +1 -1
  51. package/dist/libraries/mongo/models/embedded/service-order-pricing.model.d.ts +9 -5
  52. package/dist/libraries/mongo/models/embedded/service-order-pricing.model.js +30 -10
  53. package/dist/libraries/mongo/models/embedded/service-order-pricing.model.js.map +1 -1
  54. package/dist/libraries/mongo/models/embedded/status-timeline.model.d.ts +3 -3
  55. package/dist/libraries/mongo/models/embedded/status-timeline.model.js +2 -9
  56. package/dist/libraries/mongo/models/embedded/status-timeline.model.js.map +1 -1
  57. package/dist/libraries/mongo/models/index.d.ts +0 -3
  58. package/dist/libraries/mongo/models/index.js +1 -5
  59. package/dist/libraries/mongo/models/index.js.map +1 -1
  60. package/dist/libraries/mongo/models/rider.model.d.ts +2 -0
  61. package/dist/libraries/mongo/models/rider.model.js +18 -0
  62. package/dist/libraries/mongo/models/rider.model.js.map +1 -1
  63. package/dist/libraries/mongo/models/service-addon.model.js +3 -3
  64. package/dist/libraries/mongo/models/service-addon.model.js.map +1 -1
  65. package/dist/libraries/mongo/models/service-cart.model.d.ts +6 -11
  66. package/dist/libraries/mongo/models/service-cart.model.js +15 -56
  67. package/dist/libraries/mongo/models/service-cart.model.js.map +1 -1
  68. package/dist/libraries/mongo/models/service-order.model.d.ts +33 -33
  69. package/dist/libraries/mongo/models/service-order.model.js +86 -89
  70. package/dist/libraries/mongo/models/service-order.model.js.map +1 -1
  71. package/dist/libraries/mongo/models/service-package.model.js +1 -1
  72. package/dist/libraries/mongo/models/service-package.model.js.map +1 -1
  73. package/dist/libraries/mongo/models/service-promotion.model.d.ts +7 -5
  74. package/dist/libraries/mongo/models/service-promotion.model.js +30 -24
  75. package/dist/libraries/mongo/models/service-promotion.model.js.map +1 -1
  76. package/dist/libraries/mongo/models/shared/duration.model.d.ts +10 -0
  77. package/dist/libraries/mongo/models/shared/duration.model.js +34 -2
  78. package/dist/libraries/mongo/models/shared/duration.model.js.map +1 -1
  79. package/dist/libraries/socket/events/order-actions.socket.event.d.ts +4 -4
  80. package/dist/libraries/trpc/middlewares/auth.d.ts +1 -1
  81. package/dist/libraries/trpc/middlewares/createRoleProtectedProcedure.d.ts +1 -1
  82. package/dist/libraries/trpc/middlewares/phone-verified.d.ts +1 -1
  83. package/dist/libraries/trpc/middlewares/publicUserDecoder.d.ts +1 -1
  84. package/dist/types/README.md +1 -1
  85. package/dist/types/package.json +1 -1
  86. package/dist/types/utilities/enum.d.ts +13 -5
  87. package/dist/types/utilities/enum.js +15 -5
  88. package/dist/types/utilities/enum.js.map +1 -1
  89. package/dist/types/utilities/validation/common-validation.d.ts +12 -12
  90. package/dist/utilities/app-instance.js +1 -1
  91. package/dist/utilities/app-instance.js.map +1 -1
  92. package/dist/utilities/enum.d.ts +13 -5
  93. package/dist/utilities/enum.js +15 -5
  94. package/dist/utilities/enum.js.map +1 -1
  95. package/package.json +1 -1
  96. package/dist/libraries/mongo/models/embedded/service-timer.model.d.ts +0 -5
  97. package/dist/libraries/mongo/models/embedded/service-timer.model.js +0 -32
  98. package/dist/libraries/mongo/models/embedded/service-timer.model.js.map +0 -1
  99. package/dist/libraries/mongo/models/service-line-item.model.d.ts +0 -19
  100. package/dist/libraries/mongo/models/service-line-item.model.js +0 -89
  101. package/dist/libraries/mongo/models/service-line-item.model.js.map +0 -1
  102. package/dist/libraries/mongo/models/shared/promotion-duration.model.d.ts +0 -11
  103. package/dist/libraries/mongo/models/shared/promotion-duration.model.js +0 -46
  104. package/dist/libraries/mongo/models/shared/promotion-duration.model.js.map +0 -1
@@ -15,51 +15,49 @@ const user_model_1 = require("./user.model");
15
15
  const vendor_model_1 = require("./vendor.model");
16
16
  const enum_1 = require("../../../utilities/enum");
17
17
  const professional_model_1 = require("./professional.model");
18
- const service_timer_model_1 = require("./embedded/service-timer.model");
19
18
  const service_order_flag_model_1 = require("./embedded/service-order-flag.model");
20
19
  const service_cart_model_1 = require("./service-cart.model");
21
- const payment_infromation_model_1 = require("./embedded/payment-infromation.model");
22
20
  const service_order_finance_model_1 = require("./embedded/service-order-finance.model");
23
21
  const service_order_cance_model_1 = require("./embedded/service-order-cance.model");
24
22
  const status_timeline_model_1 = require("./embedded/status-timeline.model");
25
- const service_model_1 = require("./service.model");
26
- const mongoose_1 = require("mongoose");
27
23
  const id_generator_1 = require("../../../utilities/id-generator");
28
24
  const _1 = require(".");
29
25
  const address_model_1 = require("./shared/address.model");
30
- let ServiceOrder = class ServiceOrder {
26
+ const duration_model_1 = require("./shared/duration.model");
27
+ const defaultClasses_1 = require("@typegoose/typegoose/lib/defaultClasses");
28
+ let ServiceOrder = class ServiceOrder extends defaultClasses_1.TimeStamps {
31
29
  orderId;
32
- service;
33
30
  user;
34
31
  vendor;
32
+ serviceType;
33
+ subServiceType;
35
34
  cart;
36
35
  location;
36
+ slotRange;
37
37
  status;
38
- priority;
39
- date;
40
- timeFrom;
41
- timeTo;
42
38
  userNotes;
43
39
  vendorNotes;
44
40
  professionals;
45
41
  responsibleProfessional;
46
- serviceTimer;
47
42
  flag;
48
- confirmedAt;
49
- autoConfirmedAt;
50
- isUrgent;
43
+ processedAt;
44
+ placedAt;
45
+ startedAt;
46
+ estimatedCompletionTime;
47
+ completedAt;
48
+ completionTimeInMinutes;
49
+ isUrgentOrder;
51
50
  urgentAt;
52
51
  isOverdue;
53
52
  overdueAt;
54
- adjustedFinance;
55
- recurrencePattern;
56
- isPaid;
57
- paymentMethod;
58
- paymentInformation;
53
+ finance;
59
54
  orderCancel;
60
55
  statusTimeline;
61
- serviceDuration;
62
56
  bufferTime;
57
+ instruction;
58
+ isOrderReviewed;
59
+ isReviewNotificationSent;
60
+ reviews;
63
61
  };
64
62
  exports.ServiceOrder = ServiceOrder;
65
63
  __decorate([
@@ -67,45 +65,37 @@ __decorate([
67
65
  __metadata("design:type", String)
68
66
  ], ServiceOrder.prototype, "orderId", void 0);
69
67
  __decorate([
70
- (0, typegoose_1.prop)({ ref: () => service_model_1.Service, required: true }),
71
- __metadata("design:type", Object)
72
- ], ServiceOrder.prototype, "service", void 0);
73
- __decorate([
74
- (0, typegoose_1.prop)({ ref: () => user_model_1.User, required: true }),
68
+ (0, typegoose_1.prop)({ required: true, ref: () => user_model_1.User }),
75
69
  __metadata("design:type", Object)
76
70
  ], ServiceOrder.prototype, "user", void 0);
77
71
  __decorate([
78
- (0, typegoose_1.prop)({ ref: () => vendor_model_1.Vendor, required: true }),
72
+ (0, typegoose_1.prop)({ required: true, ref: () => vendor_model_1.Vendor }),
79
73
  __metadata("design:type", Object)
80
74
  ], ServiceOrder.prototype, "vendor", void 0);
81
75
  __decorate([
82
- (0, typegoose_1.prop)({ ref: () => service_cart_model_1.ServiceCart, required: true }),
76
+ (0, typegoose_1.prop)({ required: true, type: String, enum: enum_1.ServiceType }),
77
+ __metadata("design:type", String)
78
+ ], ServiceOrder.prototype, "serviceType", void 0);
79
+ __decorate([
80
+ (0, typegoose_1.prop)({ type: String, enum: enum_1.SubServiceType }),
81
+ __metadata("design:type", String)
82
+ ], ServiceOrder.prototype, "subServiceType", void 0);
83
+ __decorate([
84
+ (0, typegoose_1.prop)({ required: true, ref: () => service_cart_model_1.ServiceCart }),
83
85
  __metadata("design:type", Object)
84
86
  ], ServiceOrder.prototype, "cart", void 0);
85
87
  __decorate([
86
- (0, typegoose_1.prop)({ type: () => address_model_1.UserAddress }),
88
+ (0, typegoose_1.prop)({ required: true, type: () => address_model_1.UserAddress }),
87
89
  __metadata("design:type", address_model_1.UserAddress)
88
90
  ], ServiceOrder.prototype, "location", void 0);
89
91
  __decorate([
90
- (0, typegoose_1.prop)({ enum: enum_1.ServiceOrderStatus, default: enum_1.ServiceOrderStatus.PENDING }),
91
- __metadata("design:type", String)
92
- ], ServiceOrder.prototype, "status", void 0);
92
+ (0, typegoose_1.prop)({ required: true, type: duration_model_1.OrderSlotRange, _id: false }),
93
+ __metadata("design:type", duration_model_1.OrderSlotRange)
94
+ ], ServiceOrder.prototype, "slotRange", void 0);
93
95
  __decorate([
94
- (0, typegoose_1.prop)({ enum: enum_1.ServiceOrderPriority, default: enum_1.ServiceOrderPriority.NORMAL }),
96
+ (0, typegoose_1.prop)({ type: String, enum: enum_1.ServiceOrderStatus, default: enum_1.ServiceOrderStatus.PENDING }),
95
97
  __metadata("design:type", String)
96
- ], ServiceOrder.prototype, "priority", void 0);
97
- __decorate([
98
- (0, typegoose_1.prop)({ type: Date, required: true }),
99
- __metadata("design:type", Date)
100
- ], ServiceOrder.prototype, "date", void 0);
101
- __decorate([
102
- (0, typegoose_1.prop)({ required: true }),
103
- __metadata("design:type", Date)
104
- ], ServiceOrder.prototype, "timeFrom", void 0);
105
- __decorate([
106
- (0, typegoose_1.prop)({ required: true }),
107
- __metadata("design:type", Date)
108
- ], ServiceOrder.prototype, "timeTo", void 0);
98
+ ], ServiceOrder.prototype, "status", void 0);
109
99
  __decorate([
110
100
  (0, typegoose_1.prop)({ type: String }),
111
101
  __metadata("design:type", String)
@@ -115,7 +105,7 @@ __decorate([
115
105
  __metadata("design:type", String)
116
106
  ], ServiceOrder.prototype, "vendorNotes", void 0);
117
107
  __decorate([
118
- (0, typegoose_1.prop)({ ref: () => professional_model_1.Professional, type: () => [mongoose_1.Types.ObjectId] }),
108
+ (0, typegoose_1.prop)({ ref: () => professional_model_1.Professional }),
119
109
  __metadata("design:type", Array)
120
110
  ], ServiceOrder.prototype, "professionals", void 0);
121
111
  __decorate([
@@ -123,84 +113,91 @@ __decorate([
123
113
  __metadata("design:type", Object)
124
114
  ], ServiceOrder.prototype, "responsibleProfessional", void 0);
125
115
  __decorate([
126
- (0, typegoose_1.prop)({ type: () => service_timer_model_1.ServiceTimer }),
127
- __metadata("design:type", service_timer_model_1.ServiceTimer)
128
- ], ServiceOrder.prototype, "serviceTimer", void 0);
129
- __decorate([
130
- (0, typegoose_1.prop)({ type: () => service_order_flag_model_1.ServiceOrderFlag }),
116
+ (0, typegoose_1.prop)({ type: () => service_order_flag_model_1.ServiceOrderFlag, _id: false }),
131
117
  __metadata("design:type", service_order_flag_model_1.ServiceOrderFlag)
132
118
  ], ServiceOrder.prototype, "flag", void 0);
133
119
  __decorate([
134
- (0, typegoose_1.prop)(),
120
+ (0, typegoose_1.prop)({ type: Date, default: new Date() }),
121
+ __metadata("design:type", Date)
122
+ ], ServiceOrder.prototype, "processedAt", void 0);
123
+ __decorate([
124
+ (0, typegoose_1.prop)({ type: Date }),
125
+ __metadata("design:type", Date)
126
+ ], ServiceOrder.prototype, "placedAt", void 0);
127
+ __decorate([
128
+ (0, typegoose_1.prop)({ type: Date }),
135
129
  __metadata("design:type", Date)
136
- ], ServiceOrder.prototype, "confirmedAt", void 0);
130
+ ], ServiceOrder.prototype, "startedAt", void 0);
137
131
  __decorate([
138
- (0, typegoose_1.prop)(),
132
+ (0, typegoose_1.prop)({ type: Date }),
139
133
  __metadata("design:type", Date)
140
- ], ServiceOrder.prototype, "autoConfirmedAt", void 0);
134
+ ], ServiceOrder.prototype, "estimatedCompletionTime", void 0);
135
+ __decorate([
136
+ (0, typegoose_1.prop)({ type: Date }),
137
+ __metadata("design:type", Date)
138
+ ], ServiceOrder.prototype, "completedAt", void 0);
139
+ __decorate([
140
+ (0, typegoose_1.prop)({ type: Number }),
141
+ __metadata("design:type", Number)
142
+ ], ServiceOrder.prototype, "completionTimeInMinutes", void 0);
141
143
  __decorate([
142
- (0, typegoose_1.prop)({ default: false }),
144
+ (0, typegoose_1.prop)({ type: Boolean, default: false }),
143
145
  __metadata("design:type", Boolean)
144
- ], ServiceOrder.prototype, "isUrgent", void 0);
146
+ ], ServiceOrder.prototype, "isUrgentOrder", void 0);
145
147
  __decorate([
146
- (0, typegoose_1.prop)(),
148
+ (0, typegoose_1.prop)({ type: Date }),
147
149
  __metadata("design:type", Date)
148
150
  ], ServiceOrder.prototype, "urgentAt", void 0);
149
151
  __decorate([
150
- (0, typegoose_1.prop)({ default: false }),
152
+ (0, typegoose_1.prop)({ type: Boolean, default: false }),
151
153
  __metadata("design:type", Boolean)
152
154
  ], ServiceOrder.prototype, "isOverdue", void 0);
153
155
  __decorate([
154
- (0, typegoose_1.prop)(),
156
+ (0, typegoose_1.prop)({ type: Date }),
155
157
  __metadata("design:type", Date)
156
158
  ], ServiceOrder.prototype, "overdueAt", void 0);
157
159
  __decorate([
158
- (0, typegoose_1.prop)({ required: true, type: service_order_finance_model_1.ServiceOrderFinance }),
160
+ (0, typegoose_1.prop)({ required: true, type: service_order_finance_model_1.ServiceOrderFinance, _id: false }),
159
161
  __metadata("design:type", service_order_finance_model_1.ServiceOrderFinance)
160
- ], ServiceOrder.prototype, "adjustedFinance", void 0);
161
- __decorate([
162
- (0, typegoose_1.prop)({ enum: enum_1.ServiceOrderRecurrencePattern, default: enum_1.ServiceOrderRecurrencePattern.ONETIME }),
163
- __metadata("design:type", String)
164
- ], ServiceOrder.prototype, "recurrencePattern", void 0);
165
- __decorate([
166
- (0, typegoose_1.prop)({ default: false }),
167
- __metadata("design:type", Boolean)
168
- ], ServiceOrder.prototype, "isPaid", void 0);
162
+ ], ServiceOrder.prototype, "finance", void 0);
169
163
  __decorate([
170
- (0, typegoose_1.prop)({ enum: enum_1.PaymentMethod, type: String }),
171
- __metadata("design:type", String)
172
- ], ServiceOrder.prototype, "paymentMethod", void 0);
173
- __decorate([
174
- (0, typegoose_1.prop)({ type: () => payment_infromation_model_1.PaymentInformation }),
175
- __metadata("design:type", payment_infromation_model_1.PaymentInformation)
176
- ], ServiceOrder.prototype, "paymentInformation", void 0);
177
- __decorate([
178
- (0, typegoose_1.prop)({ type: () => service_order_cance_model_1.ServiceOrderCancel }),
164
+ (0, typegoose_1.prop)({ type: () => service_order_cance_model_1.ServiceOrderCancel, _id: false }),
179
165
  __metadata("design:type", service_order_cance_model_1.ServiceOrderCancel)
180
166
  ], ServiceOrder.prototype, "orderCancel", void 0);
181
167
  __decorate([
182
168
  (0, typegoose_1.prop)({ type: () => [status_timeline_model_1.ServiceOrderStatusTimeline], default: [] }),
183
169
  __metadata("design:type", Array)
184
170
  ], ServiceOrder.prototype, "statusTimeline", void 0);
185
- __decorate([
186
- (0, typegoose_1.prop)({ type: Number }),
187
- __metadata("design:type", Number)
188
- ], ServiceOrder.prototype, "serviceDuration", void 0);
189
171
  __decorate([
190
172
  (0, typegoose_1.prop)({ type: Number }),
191
173
  __metadata("design:type", Number)
192
174
  ], ServiceOrder.prototype, "bufferTime", void 0);
175
+ __decorate([
176
+ (0, typegoose_1.prop)({ type: String }),
177
+ __metadata("design:type", String)
178
+ ], ServiceOrder.prototype, "instruction", void 0);
179
+ __decorate([
180
+ (0, typegoose_1.prop)({ type: Boolean, default: false }),
181
+ __metadata("design:type", Boolean)
182
+ ], ServiceOrder.prototype, "isOrderReviewed", void 0);
183
+ __decorate([
184
+ (0, typegoose_1.prop)({ type: Boolean, default: false }),
185
+ __metadata("design:type", Boolean)
186
+ ], ServiceOrder.prototype, "isReviewNotificationSent", void 0);
187
+ __decorate([
188
+ (0, typegoose_1.prop)({
189
+ ref: () => _1.Review,
190
+ foreignField: 'serviceOrder',
191
+ localField: '_id',
192
+ }),
193
+ __metadata("design:type", Array)
194
+ ], ServiceOrder.prototype, "reviews", void 0);
193
195
  exports.ServiceOrder = ServiceOrder = __decorate([
196
+ (0, typegoose_1.modelOptions)({ schemaOptions: { collection: 'serviceOrders', timestamps: true } }),
194
197
  (0, typegoose_1.pre)('save', async function () {
195
198
  if (this.isNew) {
196
199
  this.orderId = await (0, id_generator_1.generateId)(_1.CounterModel, enum_1.CounterType.BOOKING);
197
200
  }
198
- }),
199
- (0, typegoose_1.modelOptions)({
200
- schemaOptions: {
201
- collection: "serviceOrder",
202
- timestamps: true
203
- }
204
201
  })
205
202
  ], ServiceOrder);
206
203
  //# sourceMappingURL=service-order.model.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"service-order.model.js","sourceRoot":"/","sources":["libraries/mongo/models/service-order.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAoE;AACpE,6CAAoC;AACpC,iDAAwC;AAExC,kDAA8I;AAC9I,6DAAoD;AACpD,wEAA8D;AAC9D,kFAAuE;AACvE,6DAAmD;AACnD,oFAA0E;AAC1E,wFAA6E;AAC7E,oFAA0E;AAC1E,4EAA8E;AAC9E,mDAA0C;AAC1C,uCAAiC;AACjC,kEAA6D;AAC7D,wBAAiC;AACjC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BAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;qDACS;AAGzB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;gDACG;uBA/FjB,YAAY;IAdxB,IAAA,eAAG,EAAe,MAAM,EAAE,KAAK;QAC5B,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YACb,IAAI,CAAC,OAAO,GAAG,MAAM,IAAA,yBAAU,EAAC,eAAY,EAAE,kBAAW,CAAC,OAAO,CAAC,CAAC;QACvE,CAAC;IACL,CAAC,CAAC;IAGD,IAAA,wBAAY,EAAC;QACV,aAAa,EAAE;YACX,UAAU,EAAE,cAAc;YAC1B,UAAU,EAAE,IAAI;SACnB;KACJ,CAAC;GAEW,YAAY,CAgGxB","sourcesContent":["import { modelOptions, pre, prop, Ref } from \"@typegoose/typegoose\";\nimport { User } from \"./user.model\";\nimport { Vendor } from \"./vendor.model\";\nimport { ServicePackage } from \"./service-package.model\";\nimport { ServiceOrderRecurrencePattern, PaymentMethod, ServiceOrderPriority, ServiceOrderStatus, CounterType } from \"../../../utilities/enum\";\nimport { Professional } from \"./professional.model\";\nimport { ServiceTimer } from \"./embedded/service-timer.model\";\nimport { ServiceOrderFlag } from \"./embedded/service-order-flag.model\";\nimport { ServiceCart } from \"./service-cart.model\";\nimport { PaymentInformation } from \"./embedded/payment-infromation.model\";\nimport { ServiceOrderFinance } from \"./embedded/service-order-finance.model\";\nimport { ServiceOrderCancel } from \"./embedded/service-order-cance.model\";\nimport { ServiceOrderStatusTimeline } from \"./embedded/status-timeline.model\";\nimport { Service } from \"./service.model\";\nimport { Types } from \"mongoose\";\nimport { generateId } from \"../../../utilities/id-generator\";\nimport { CounterModel } from \".\";\nimport { UserAddress } from \"./shared/address.model\";\n\n@pre<ServiceOrder>('save', async function () {\n if (this.isNew) {\n this.orderId = await generateId(CounterModel, CounterType.BOOKING);\n }\n})\n\n\n@modelOptions({\n schemaOptions: {\n collection: \"serviceOrder\",\n timestamps: true\n }\n})\n\nexport class ServiceOrder {\n @prop({ type: String, unique: true })\n public orderId!: string\n\n @prop({ ref: () => Service, required: true })\n public service!: Ref<Service>\n\n @prop({ ref: () => User, required: true })\n public user!: Ref<User>\n\n @prop({ ref: () => Vendor, required: true })\n public vendor!: Ref<Vendor>\n\n @prop({ ref: () => ServiceCart, required: true })\n public cart!: Ref<ServiceCart>\n\n @prop({ type: () => UserAddress })\n public location?: UserAddress\n\n @prop({ enum: ServiceOrderStatus, default: ServiceOrderStatus.PENDING })\n status!: ServiceOrderStatus\n\n @prop({ enum: ServiceOrderPriority, default: ServiceOrderPriority.NORMAL })\n public priority!: ServiceOrderPriority\n\n @prop({ type: Date, required: true })\n public date!: Date;\n\n @prop({ required: true })\n public timeFrom!: Date;\n\n @prop({ required: true })\n public timeTo!: Date;\n\n @prop({ type: String })\n public userNotes?: string;\n\n @prop({ type: String })\n public vendorNotes?: string;\n\n @prop({ ref: () => Professional, type: () => [Types.ObjectId] })\n public professionals!: Ref<Professional>[];\n\n @prop({ ref: () => Professional })\n public responsibleProfessional?: Ref<Professional>;\n\n @prop({ type: () => ServiceTimer })\n public serviceTimer?: ServiceTimer\n\n @prop({ type: () => ServiceOrderFlag })\n public flag?: ServiceOrderFlag\n\n @prop()\n public confirmedAt?: Date;\n\n @prop()\n public autoConfirmedAt?: Date;\n\n @prop({ default: false })\n public isUrgent!: boolean;\n\n @prop()\n public urgentAt?: Date;\n\n @prop({ default: false })\n public isOverdue!: boolean;\n\n @prop()\n public overdueAt?: Date;\n\n @prop({ required: true, type: ServiceOrderFinance })\n public adjustedFinance: ServiceOrderFinance\n \n @prop({ enum: ServiceOrderRecurrencePattern, default: ServiceOrderRecurrencePattern.ONETIME })\n public recurrencePattern?: ServiceOrderRecurrencePattern\n \n @prop({ default: false })\n public isPaid!: boolean;\n\n @prop({ enum: PaymentMethod, type: String })\n public paymentMethod?: PaymentMethod;\n\n @prop({ type: () => PaymentInformation })\n public paymentInformation?: PaymentInformation;\n\n @prop({ type: () => ServiceOrderCancel })\n public orderCancel?: ServiceOrderCancel;\n\n @prop({ type: () => [ServiceOrderStatusTimeline], default: [] })\n public statusTimeline: ServiceOrderStatusTimeline[];\n\n @prop({ type: Number })\n public serviceDuration!: number; // minutes\n\n @prop({ type: Number })\n public bufferTime: number; // minutes\n}"]}
1
+ {"version":3,"file":"service-order.model.js","sourceRoot":"/","sources":["libraries/mongo/models/service-order.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAoE;AACpE,6CAAoC;AACpC,iDAAwC;AACxC,kDAAuG;AACvG,6DAAoD;AACpD,kFAAuE;AACvE,6DAAmD;AACnD,wFAA6E;AAC7E,oFAA0E;AAC1E,4EAA8E;AAC9E,kEAA6D;AAC7D,wBAAyC;AACzC,0DAAqD;AACrD,4DAAyD;AACzD,4EAAqE;AAQ9D,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,2BAAU;IAEpC,OAAO,CAAU;IAGjB,IAAI,CAAa;IAGjB,MAAM,CAAe;IAGrB,WAAW,CAAe;IAG1B,cAAc,CAAkB;IAGhC,IAAI,CAAoB;IAGxB,QAAQ,CAAe;IAGvB,SAAS,CAAkB;IAG3B,MAAM,CAAsB;IAG5B,SAAS,CAAU;IAGnB,WAAW,CAAU;IAGrB,aAAa,CAAuB;IAGpC,uBAAuB,CAAqB;IAG5C,IAAI,CAAoB;IAGxB,WAAW,CAAQ;IAGnB,QAAQ,CAAQ;IAGhB,SAAS,CAAQ;IAGjB,uBAAuB,CAAQ;IAG/B,WAAW,CAAQ;IAGnB,uBAAuB,CAAU;IAGjC,aAAa,CAAW;IAGxB,QAAQ,CAAQ;IAGhB,SAAS,CAAW;IAGpB,SAAS,CAAQ;IAGjB,OAAO,CAAuB;IAG9B,WAAW,CAAsB;IAGjC,cAAc,CAA+B;IAG7C,UAAU,CAAS;IAGnB,WAAW,CAAU;IAIrB,eAAe,CAAW;IAG1B,wBAAwB,CAAW;IAOnC,OAAO,CAAiB;CAC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CAAC,OAAO,CAAC,CAAC;QACpE,CAAC;IACF,CAAC,CAAC;GACW,YAAY,CAqGxB","sourcesContent":["import { modelOptions, pre, prop, Ref } from '@typegoose/typegoose';\nimport { User } from './user.model';\nimport { Vendor } from './vendor.model';\nimport { ServiceOrderStatus, CounterType, ServiceType, SubServiceType } from '../../../utilities/enum';\nimport { Professional } from './professional.model';\nimport { ServiceOrderFlag } from './embedded/service-order-flag.model';\nimport { ServiceCart } from './service-cart.model';\nimport { ServiceOrderFinance } from './embedded/service-order-finance.model';\nimport { ServiceOrderCancel } from './embedded/service-order-cance.model';\nimport { ServiceOrderStatusTimeline } from './embedded/status-timeline.model';\nimport { generateId } from '../../../utilities/id-generator';\nimport { CounterModel, Review } from '.';\nimport { UserAddress } from './shared/address.model';\nimport { OrderSlotRange } from './shared/duration.model';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\n\n@modelOptions({ schemaOptions: { collection: 'serviceOrders', timestamps: true } })\n@pre<ServiceOrder>('save', async function () {\n\tif (this.isNew) {\n\t\tthis.orderId = await generateId(CounterModel, CounterType.BOOKING);\n\t}\n})\nexport class ServiceOrder extends TimeStamps {\n\t@prop({ type: String, unique: true })\n\tpublic orderId?: string;\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({ 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: () => ServiceCart })\n\tpublic cart!: Ref<ServiceCart>;\n\n\t@prop({ required: true, type: () => UserAddress })\n\tpublic location!: UserAddress;\n\n\t@prop({ required: true, type: OrderSlotRange, _id: false })\n\tpublic slotRange!: OrderSlotRange;\n\n\t@prop({ type: String, enum: ServiceOrderStatus, default: ServiceOrderStatus.PENDING })\n\tpublic status!: ServiceOrderStatus;\n\n\t@prop({ type: String })\n\tpublic userNotes?: string;\n\n\t@prop({ type: String })\n\tpublic vendorNotes?: string;\n\n\t@prop({ ref: () => Professional })\n\tpublic professionals?: Ref<Professional>[];\n\n\t@prop({ ref: () => Professional })\n\tpublic responsibleProfessional?: Ref<Professional>;\n\n\t@prop({ type: () => ServiceOrderFlag, _id: false })\n\tpublic flag?: ServiceOrderFlag;\n\n\t@prop({ type: Date, default: new Date() })\n\tpublic processedAt?: Date;\n\n\t@prop({ type: Date })\n\tpublic placedAt?: Date;\n\n\t@prop({ type: Date })\n\tpublic startedAt?: Date;\n\n\t@prop({ type: Date })\n\tpublic estimatedCompletionTime?: Date;\n\n\t@prop({ type: Date })\n\tpublic completedAt?: Date;\n\n\t@prop({ type: Number })\n\tpublic completionTimeInMinutes?: number;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isUrgentOrder?: boolean;\n\n\t@prop({ type: Date })\n\tpublic urgentAt?: Date;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isOverdue!: boolean;\n\n\t@prop({ type: Date })\n\tpublic overdueAt?: Date;\n\n\t@prop({ required: true, type: ServiceOrderFinance, _id: false })\n\tpublic finance!: ServiceOrderFinance;\n\n\t@prop({ type: () => ServiceOrderCancel, _id: false })\n\tpublic orderCancel?: ServiceOrderCancel;\n\n\t@prop({ type: () => [ServiceOrderStatusTimeline], default: [] })\n\tpublic statusTimeline: ServiceOrderStatusTimeline[];\n\n\t@prop({ type: Number })\n\tpublic bufferTime: number; // minutes\n\n\t@prop({ type: String })\n\tpublic instruction?: string;\n\n\t// Review feature\n\t@prop({ type: Boolean, default: false })\n\tpublic isOrderReviewed?: boolean;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isReviewNotificationSent?: boolean;\n\n\t@prop({\n\t\tref: () => Review,\n\t\tforeignField: 'serviceOrder',\n\t\tlocalField: '_id',\n\t})\n\tpublic reviews?: Ref<Review>[];\n}\n"]}
@@ -73,7 +73,7 @@ __decorate([
73
73
  __metadata("design:type", Number)
74
74
  ], ServicePackage.prototype, "numberOfProfessionals", void 0);
75
75
  __decorate([
76
- (0, typegoose_1.prop)({ type: String }),
76
+ (0, typegoose_1.prop)({ required: true, type: String }),
77
77
  __metadata("design:type", String)
78
78
  ], ServicePackage.prototype, "image", void 0);
79
79
  __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"service-package.model.js","sourceRoot":"/","sources":["libraries/mongo/models/service-package.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA2E;AAC3E,4EAAqE;AACrE,kDAA8E;AAC9E,iDAAwC;AACxC,qEAA2D;AAC3D,mCAA4D;AAC5D,0EAAgE;AAChE,gFAAsE;AA0B/D,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,2BAAU;IAEtC,IAAI,CAAU;IAGd,MAAM,CAAe;IAGrB,WAAW,CAAe;IAG1B,cAAc,CAAkB;IAGhC,WAAW,CAAU;IAGrB,QAAQ,CAAwB;IAGhC,KAAK,CAAU;IAGf,QAAQ,CAAiB;IAGzB,qBAAqB,CAAU;IAG/B,KAAK,CAAU;IAGf,WAAW,CAAU;IAGrB,MAAM,CAAuB;IAG7B,MAAM,CAAS;IAGf,gBAAgB,CAAoB;IAGpC,YAAY,CAAU;CAC7B,CAAA;AA7CY,wCAAc;AAEnB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;;4CAC7C;AAGd;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,qBAAM,EAAE,CAAC;;8CAChB;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAW,EAAE,CAAC;;mDACzB;AAG1B;IADN,IAAA,gBAAI,EAAC,EAAE,IAA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,MAAM,EAAE,CAAC;;oDACM;yBA5CjB,cAAc;IAxB1B,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,iBAAiB,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,CAAC;IACpF,IAAA,iBAAK,EAAC,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,uBAAuB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC;IAC7F,IAAA,eAAG,EAAiB,MAAM,EAAE,KAAK,WAAW,IAAI;QAEhD,IAAI,IAAI,CAAC,KAAK,IAAI,OAAO,IAAI,CAAC,YAAY,KAAK,WAAW,EAAE,CAAC;YAC5D,IAAI,CAAC;gBAEJ,MAAM,eAAe,GAAG,MAAM,2BAAmB,CAAC,SAAS,CAA8B;oBACxF;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,cAAc,CA6C1B","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 { ServiceCategory } from './service-category.model';\nimport { ServiceAddon, ServicePackageModel } from './index';\nimport { PreparingTime } from './embedded/preparing-time.model';\nimport { CleaningMaterial } from './embedded/cleaning-material.model';\n\n@modelOptions({ schemaOptions: { collection: 'servicePackages', timestamps: true } })\n@Index({ name: 1, vendor: 1 }, { unique: true, partialFilterExpression: { deletedAt: null } })\n@pre<ServicePackage>('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 ServicePackageModel.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 ServicePackage extends TimeStamps {\n\t@prop({ required: true, type: String, trim: true, maxlength: 20 })\n\tpublic name!: string;\n\n\t@prop({ required: true, ref: () => Vendor })\n\tpublic vendor!: Ref<Vendor>;\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({ type: String, trim: true })\n\tpublic description?: string;\n\n\t@prop({ required: true, ref: () => ServiceCategory })\n\tpublic category!: Ref<ServiceCategory>;\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({ required: true, type: Number, min: 1 })\n\tpublic numberOfProfessionals!: number;\n\n\t@prop({ type: String })\n\tpublic image!: string;\n\n\t@prop({ type: String, maxlength: 250 })\n\tpublic vendorNotes?: string;\n\n\t@prop({ ref: () => ServiceAddon, default: [] })\n\tpublic addons?: Ref<ServiceAddon>[];\n\n\t@prop({ type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status: Status;\n\n\t@prop({ required: true, type: CleaningMaterial })\n\tpublic cleaningMaterial!: CleaningMaterial;\n\n\t@prop({ type: Number })\n\tpublic sortingOrder?: number;\n}\n"]}
1
+ {"version":3,"file":"service-package.model.js","sourceRoot":"/","sources":["libraries/mongo/models/service-package.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA2E;AAC3E,4EAAqE;AACrE,kDAA8E;AAC9E,iDAAwC;AACxC,qEAA2D;AAC3D,mCAA4D;AAC5D,0EAAgE;AAChE,gFAAsE;AA0B/D,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,2BAAU;IAEtC,IAAI,CAAU;IAGd,MAAM,CAAe;IAGrB,WAAW,CAAe;IAG1B,cAAc,CAAkB;IAGhC,WAAW,CAAU;IAGrB,QAAQ,CAAwB;IAGhC,KAAK,CAAU;IAGf,QAAQ,CAAiB;IAGzB,qBAAqB,CAAU;IAG/B,KAAK,CAAU;IAGf,WAAW,CAAU;IAGrB,MAAM,CAAuB;IAG7B,MAAM,CAAS;IAGf,gBAAgB,CAAoB;IAGpC,YAAY,CAAU;CAC7B,CAAA;AA7CY,wCAAc;AAEnB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;;4CAC7C;AAGd;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,qBAAM,EAAE,CAAC;;8CAChB;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAW,EAAE,CAAC;;mDACzB;AAG1B;IAD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B;wDAAC;AAGpC;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;oDACM;yBA5CjB,cAAc;IAxB1B,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,iBAAiB,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,CAAC;IACpF,IAAA,iBAAK,EAAC,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,uBAAuB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC;IAC7F,IAAA,eAAG,EAAiB,MAAM,EAAE,KAAK,WAAW,IAAI;QAEhD,IAAI,IAAI,CAAC,KAAK,IAAI,OAAO,IAAI,CAAC,YAAY,KAAK,WAAW,EAAE,CAAC;YAC5D,IAAI,CAAC;gBAEJ,MAAM,eAAe,GAAG,MAAM,2BAAmB,CAAC,SAAS,CAA8B;oBACxF;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,cAAc,CA6C1B","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 { ServiceCategory } from './service-category.model';\nimport { ServiceAddon, ServicePackageModel } from './index';\nimport { PreparingTime } from './embedded/preparing-time.model';\nimport { CleaningMaterial } from './embedded/cleaning-material.model';\n\n@modelOptions({ schemaOptions: { collection: 'servicePackages', timestamps: true } })\n@Index({ name: 1, vendor: 1 }, { unique: true, partialFilterExpression: { deletedAt: null } })\n@pre<ServicePackage>('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 ServicePackageModel.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 ServicePackage extends TimeStamps {\n\t@prop({ required: true, type: String, trim: true, maxlength: 20 })\n\tpublic name!: string;\n\n\t@prop({ required: true, ref: () => Vendor })\n\tpublic vendor!: Ref<Vendor>;\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({ type: String, trim: true })\n\tpublic description?: string;\n\n\t@prop({ required: true, ref: () => ServiceCategory })\n\tpublic category!: Ref<ServiceCategory>;\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({ required: true, type: Number, min: 1 })\n\tpublic numberOfProfessionals!: number;\n\n\t@prop({ required: true, type: String })\n\tpublic image!: string;\n\n\t@prop({ type: String, maxlength: 250 })\n\tpublic vendorNotes?: string;\n\n\t@prop({ ref: () => ServiceAddon, default: [] })\n\tpublic addons?: Ref<ServiceAddon>[];\n\n\t@prop({ type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status: Status;\n\n\t@prop({ required: true, type: CleaningMaterial })\n\tpublic cleaningMaterial!: CleaningMaterial;\n\n\t@prop({ type: Number })\n\tpublic sortingOrder?: number;\n}\n"]}
@@ -1,18 +1,19 @@
1
1
  import { Ref } from '@typegoose/typegoose';
2
2
  import { Vendor } from './vendor.model';
3
3
  import { MarketingStatus, PromotionType, ValueType } from '../../../utilities/enum';
4
- import { Duration, SlotRange } from './shared/promotion-duration.model';
5
4
  import { ServicePackage } from './service-package.model';
6
5
  import { Admin } from './admin.model';
6
+ import { Duration, SlotRange } from './shared/duration.model';
7
+ import { ServiceAddon } from './service-addon.model';
7
8
  export declare class ServicePromotion {
8
9
  vendor: Ref<Vendor>;
9
- admin?: Ref<Admin>;
10
10
  promotionType: PromotionType;
11
11
  duration: Duration;
12
12
  isAppliedByCompany: boolean;
13
13
  servicePackages?: Ref<ServicePackage>[];
14
+ addons?: Ref<ServiceAddon>[];
14
15
  isEntireMenu?: boolean;
15
- slotRange?: SlotRange[];
16
+ slotRanges?: SlotRange[];
16
17
  isMaxDiscountPerOrderEnabled?: boolean;
17
18
  maxDiscountPerOrder?: number;
18
19
  isSpendLimitEnabled?: boolean;
@@ -20,7 +21,8 @@ export declare class ServicePromotion {
20
21
  spendAmount?: number;
21
22
  valueType?: ValueType;
22
23
  value?: number;
23
- deactivationReason?: string;
24
- description?: string;
25
24
  status: MarketingStatus;
25
+ deactivationReason?: string;
26
+ pausedAt?: Date | null;
27
+ createdBy?: Ref<Admin>;
26
28
  }
@@ -13,18 +13,19 @@ exports.ServicePromotion = void 0;
13
13
  const typegoose_1 = require("@typegoose/typegoose");
14
14
  const vendor_model_1 = require("./vendor.model");
15
15
  const enum_1 = require("../../../utilities/enum");
16
- const promotion_duration_model_1 = require("./shared/promotion-duration.model");
17
16
  const service_package_model_1 = require("./service-package.model");
18
17
  const admin_model_1 = require("./admin.model");
18
+ const duration_model_1 = require("./shared/duration.model");
19
+ const service_addon_model_1 = require("./service-addon.model");
19
20
  let ServicePromotion = class ServicePromotion {
20
21
  vendor;
21
- admin;
22
22
  promotionType;
23
23
  duration;
24
24
  isAppliedByCompany;
25
25
  servicePackages;
26
+ addons;
26
27
  isEntireMenu;
27
- slotRange;
28
+ slotRanges;
28
29
  isMaxDiscountPerOrderEnabled;
29
30
  maxDiscountPerOrder;
30
31
  isSpendLimitEnabled;
@@ -32,43 +33,44 @@ let ServicePromotion = class ServicePromotion {
32
33
  spendAmount;
33
34
  valueType;
34
35
  value;
35
- deactivationReason;
36
- description;
37
36
  status;
37
+ deactivationReason;
38
+ pausedAt;
39
+ createdBy;
38
40
  };
39
41
  exports.ServicePromotion = ServicePromotion;
40
42
  __decorate([
41
- (0, typegoose_1.prop)({ ref: () => vendor_model_1.Vendor, required: true }),
43
+ (0, typegoose_1.prop)({ required: true, ref: () => vendor_model_1.Vendor }),
42
44
  __metadata("design:type", Object)
43
45
  ], ServicePromotion.prototype, "vendor", void 0);
44
46
  __decorate([
45
- (0, typegoose_1.prop)({ ref: () => admin_model_1.Admin }),
46
- __metadata("design:type", Object)
47
- ], ServicePromotion.prototype, "admin", void 0);
48
- __decorate([
49
- (0, typegoose_1.prop)({ enum: enum_1.PromotionType, required: true }),
47
+ (0, typegoose_1.prop)({ required: true, type: String, enum: enum_1.PromotionType }),
50
48
  __metadata("design:type", String)
51
49
  ], ServicePromotion.prototype, "promotionType", void 0);
52
50
  __decorate([
53
- (0, typegoose_1.prop)({ required: true, type: promotion_duration_model_1.Duration }),
54
- __metadata("design:type", promotion_duration_model_1.Duration)
51
+ (0, typegoose_1.prop)({ required: true, type: duration_model_1.Duration }),
52
+ __metadata("design:type", duration_model_1.Duration)
55
53
  ], ServicePromotion.prototype, "duration", void 0);
56
54
  __decorate([
57
55
  (0, typegoose_1.prop)({ required: true, type: Boolean }),
58
56
  __metadata("design:type", Boolean)
59
57
  ], ServicePromotion.prototype, "isAppliedByCompany", void 0);
60
58
  __decorate([
61
- (0, typegoose_1.prop)({ ref: () => service_package_model_1.ServicePackage, required: true }),
59
+ (0, typegoose_1.prop)({ ref: () => service_package_model_1.ServicePackage, default: [] }),
62
60
  __metadata("design:type", Array)
63
61
  ], ServicePromotion.prototype, "servicePackages", void 0);
62
+ __decorate([
63
+ (0, typegoose_1.prop)({ ref: () => service_addon_model_1.ServiceAddon, default: [] }),
64
+ __metadata("design:type", Array)
65
+ ], ServicePromotion.prototype, "addons", void 0);
64
66
  __decorate([
65
67
  (0, typegoose_1.prop)({ type: Boolean }),
66
68
  __metadata("design:type", Boolean)
67
69
  ], ServicePromotion.prototype, "isEntireMenu", void 0);
68
70
  __decorate([
69
- (0, typegoose_1.prop)({ type: promotion_duration_model_1.SlotRange }),
71
+ (0, typegoose_1.prop)({ type: duration_model_1.SlotRange, default: [] }),
70
72
  __metadata("design:type", Array)
71
- ], ServicePromotion.prototype, "slotRange", void 0);
73
+ ], ServicePromotion.prototype, "slotRanges", void 0);
72
74
  __decorate([
73
75
  (0, typegoose_1.prop)({ type: Boolean, default: false }),
74
76
  __metadata("design:type", Boolean)
@@ -97,14 +99,6 @@ __decorate([
97
99
  (0, typegoose_1.prop)({ type: Number }),
98
100
  __metadata("design:type", Number)
99
101
  ], ServicePromotion.prototype, "value", void 0);
100
- __decorate([
101
- (0, typegoose_1.prop)({ type: String }),
102
- __metadata("design:type", String)
103
- ], ServicePromotion.prototype, "deactivationReason", void 0);
104
- __decorate([
105
- (0, typegoose_1.prop)({ type: String, trim: true, maxlength: 500 }),
106
- __metadata("design:type", String)
107
- ], ServicePromotion.prototype, "description", void 0);
108
102
  __decorate([
109
103
  (0, typegoose_1.prop)({
110
104
  type: String,
@@ -113,6 +107,18 @@ __decorate([
113
107
  }),
114
108
  __metadata("design:type", String)
115
109
  ], ServicePromotion.prototype, "status", void 0);
110
+ __decorate([
111
+ (0, typegoose_1.prop)({ type: String }),
112
+ __metadata("design:type", String)
113
+ ], ServicePromotion.prototype, "deactivationReason", void 0);
114
+ __decorate([
115
+ (0, typegoose_1.prop)({ type: Date, default: null }),
116
+ __metadata("design:type", Object)
117
+ ], ServicePromotion.prototype, "pausedAt", void 0);
118
+ __decorate([
119
+ (0, typegoose_1.prop)({ ref: () => admin_model_1.Admin }),
120
+ __metadata("design:type", Object)
121
+ ], ServicePromotion.prototype, "createdBy", void 0);
116
122
  exports.ServicePromotion = ServicePromotion = __decorate([
117
123
  (0, typegoose_1.modelOptions)({ schemaOptions: { collection: 'servicePromotions' } })
118
124
  ], ServicePromotion);
@@ -1 +1 @@
1
- {"version":3,"file":"service-promotion.model.js","sourceRoot":"/","sources":["libraries/mongo/models/service-promotion.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA+D;AAC/D,iDAAwC;AACxC,kDAAoF;AACpF,gFAAwE;AACxE,mEAAyD;AACzD,+CAAsC;AAG/B,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAElB,MAAM,CAAe;IAGrB,KAAK,CAAa;IAGlB,aAAa,CAAiB;IAG9B,QAAQ,CAAW;IAGnB,kBAAkB,CAAW;IAG7B,eAAe,CAAwB;IAGvC,YAAY,CAAW;IAGvB,SAAS,CAAc;IAGvB,4BAA4B,CAAW;IAGvC,mBAAmB,CAAU;IAG7B,mBAAmB,CAAW;IAG9B,UAAU,CAAU;IAGpB,WAAW,CAAU;IAGrB,SAAS,CAAa;IAGtB,KAAK,CAAU;IAGf,kBAAkB,CAAU;IAG5B,WAAW,CAAU;IAOrB,MAAM,CAAkB;CAClC,CAAA;AA1DY,4CAAgB;AAElB;IADN,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,qBAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDAChB;AAGrB;IADN,IAAA,gBAAI,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,EAAE,CAAC;;mDACX;AAGtB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;+CACD;AAGf;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;4DACY;AAG5B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC;;qDACvB;AAOrB;IALN,IAAA,gBAAI,EAAC;QACF,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,sBAAe;QACrB,OAAO,EAAE,sBAAe,CAAC,MAAM;KAClC,CAAC;;gDAC6B;2BAzDtB,gBAAgB;IAD5B,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,mBAAmB,EAAE,EAAE,CAAC;GACxD,gBAAgB,CA0D5B","sourcesContent":["import { modelOptions, prop, Ref } from '@typegoose/typegoose';\nimport { Vendor } from './vendor.model';\nimport { MarketingStatus, PromotionType, ValueType } from '../../../utilities/enum';\nimport { Duration, SlotRange } from './shared/promotion-duration.model';\nimport { ServicePackage } from './service-package.model';\nimport { Admin } from './admin.model';\n\n@modelOptions({ schemaOptions: { collection: 'servicePromotions' } })\nexport class ServicePromotion {\n @prop({ ref: () => Vendor, required: true })\n public vendor!: Ref<Vendor>;\n\n @prop({ref: () => Admin})\n public admin?: Ref<Admin>\n\n @prop({ enum: PromotionType, required: true })\n public promotionType!: PromotionType;\n\n @prop({ required: true, type: Duration })\n public duration!: Duration\n\n @prop({ required: true, type: Boolean })\n public isAppliedByCompany!: boolean;\n\n @prop({ ref: () => ServicePackage, required: true })\n public servicePackages?: Ref<ServicePackage>[]\n\n @prop({ type: Boolean })\n public isEntireMenu?: boolean;\n\n @prop({ type: SlotRange })\n public slotRange?: SlotRange[]\n\n @prop({ type: Boolean, default: false })\n public isMaxDiscountPerOrderEnabled?: boolean;\n\n @prop({ type: Number })\n public maxDiscountPerOrder?: number;\n\n @prop({ type: Boolean, default: false })\n public isSpendLimitEnabled?: boolean;\n \n @prop({ type: Number, min: 0 })\n public spendLimit?: number;\n\n @prop({ type: Number, default: 0, min: 0 })\n public spendAmount?: number;\n\n @prop({ type: String, enum: ValueType })\n public valueType?: ValueType;\n\n @prop({ type: Number })\n public value?: number;\n\n @prop({ type: String })\n public deactivationReason?: string;\n\n @prop({ type: String, trim: true, maxlength: 500 })\n public description?: string;\n\n @prop({\n type: String,\n enum: MarketingStatus,\n default: MarketingStatus.ACTIVE,\n })\n public status: MarketingStatus;\n}\n"]}
1
+ {"version":3,"file":"service-promotion.model.js","sourceRoot":"/","sources":["libraries/mongo/models/service-promotion.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA+D;AAC/D,iDAAwC;AACxC,kDAAoF;AACpF,mEAAyD;AACzD,+CAAsC;AACtC,4DAA8D;AAC9D,+DAAqD;AAG9C,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAErB,MAAM,CAAe;IAGrB,aAAa,CAAiB;IAG9B,QAAQ,CAAY;IAGpB,kBAAkB,CAAW;IAG7B,eAAe,CAAyB;IAGxC,MAAM,CAAuB;IAG7B,YAAY,CAAW;IAGvB,UAAU,CAAe;IAGzB,4BAA4B,CAAW;IAGvC,mBAAmB,CAAU;IAG7B,mBAAmB,CAAW;IAG9B,UAAU,CAAU;IAGpB,WAAW,CAAU;IAGrB,SAAS,CAAa;IAGtB,KAAK,CAAU;IAOf,MAAM,CAAkB;IAGxB,kBAAkB,CAAU;IAG5B,QAAQ,CAAe;IAGvB,SAAS,CAAc;CAC9B,CAAA;AA7DY,4CAAgB;AAErB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,qBAAM,EAAE,CAAC;;gDAChB;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,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AAE,gBAAS,EAAE,CAAC;;mDACX;AAGtB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;+CACD;AAOf;IALN,IAAA,gBAAI,EAAC;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,sBAAe;QACrB,OAAO,EAAE,sBAAe,CAAC,MAAM;KAC/B,CAAC;;gDAC6B;AAGxB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;4DACY;AAG5B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;kDACN;AAGvB;IADN,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,mBAAK,EAAE,CAAC;;mDACG;2BA5DlB,gBAAgB;IAD5B,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,mBAAmB,EAAE,EAAE,CAAC;GACxD,gBAAgB,CA6D5B","sourcesContent":["import { modelOptions, prop, Ref } from '@typegoose/typegoose';\nimport { Vendor } from './vendor.model';\nimport { MarketingStatus, PromotionType, ValueType } from '../../../utilities/enum';\nimport { ServicePackage } from './service-package.model';\nimport { Admin } from './admin.model';\nimport { Duration, SlotRange } from './shared/duration.model';\nimport { ServiceAddon } from './service-addon.model';\n\n@modelOptions({ schemaOptions: { collection: 'servicePromotions' } })\nexport class ServicePromotion {\n\t@prop({ required: true, ref: () => Vendor })\n\tpublic vendor!: Ref<Vendor>;\n\n\t@prop({ required: true, type: String, enum: PromotionType })\n\tpublic promotionType!: PromotionType;\n\n\t@prop({ required: true, type: Duration })\n\tpublic duration!: Duration;\n\n\t@prop({ required: true, type: Boolean })\n\tpublic isAppliedByCompany!: boolean;\n\n\t@prop({ ref: () => ServicePackage, default: [] })\n\tpublic servicePackages?: Ref<ServicePackage>[];\n\n\t@prop({ ref: () => ServiceAddon, default: [] })\n\tpublic addons?: Ref<ServiceAddon>[];\n\n\t@prop({ type: Boolean })\n\tpublic isEntireMenu?: boolean;\n\n\t@prop({ type: SlotRange, default: [] })\n\tpublic slotRanges?: SlotRange[];\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isMaxDiscountPerOrderEnabled?: boolean;\n\n\t@prop({ type: Number })\n\tpublic maxDiscountPerOrder?: number;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isSpendLimitEnabled?: boolean;\n\n\t@prop({ type: Number, min: 0 })\n\tpublic spendLimit?: number;\n\n\t@prop({ type: Number, default: 0, min: 0 })\n\tpublic spendAmount?: number;\n\n\t@prop({ type: String, enum: ValueType })\n\tpublic valueType?: ValueType;\n\n\t@prop({ type: Number })\n\tpublic value?: number;\n\n\t@prop({\n\t\ttype: String,\n\t\tenum: MarketingStatus,\n\t\tdefault: MarketingStatus.ACTIVE,\n\t})\n\tpublic status: MarketingStatus;\n\n\t@prop({ type: String })\n\tpublic deactivationReason?: string;\n\n\t@prop({ type: Date, default: null })\n\tpublic pausedAt?: Date | null;\n\n\t@prop({ ref: () => Admin })\n\tpublic createdBy?: Ref<Admin>;\n}\n"]}
@@ -1,4 +1,14 @@
1
+ import { SubServiceType } from '../../../../utilities/enum';
1
2
  export declare class Duration {
2
3
  start: Date;
3
4
  end?: Date;
4
5
  }
6
+ export declare class SlotRange {
7
+ start: string;
8
+ end: string;
9
+ subServiceTypes?: SubServiceType[];
10
+ }
11
+ export declare class OrderSlotRange {
12
+ from: Date;
13
+ to: Date;
14
+ }
@@ -9,19 +9,51 @@ 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.Duration = void 0;
12
+ exports.OrderSlotRange = exports.SlotRange = exports.Duration = void 0;
13
13
  const typegoose_1 = require("@typegoose/typegoose");
14
+ const enum_1 = require("../../../../utilities/enum");
14
15
  class Duration {
15
16
  start;
16
17
  end;
17
18
  }
18
19
  exports.Duration = Duration;
19
20
  __decorate([
20
- (0, typegoose_1.prop)({ required: true, type: Date, default: new Date() }),
21
+ (0, typegoose_1.prop)({ required: true, type: Date }),
21
22
  __metadata("design:type", Date)
22
23
  ], Duration.prototype, "start", void 0);
23
24
  __decorate([
24
25
  (0, typegoose_1.prop)({ type: Date }),
25
26
  __metadata("design:type", Date)
26
27
  ], Duration.prototype, "end", void 0);
28
+ class SlotRange {
29
+ start;
30
+ end;
31
+ subServiceTypes;
32
+ }
33
+ exports.SlotRange = SlotRange;
34
+ __decorate([
35
+ (0, typegoose_1.prop)({ required: true, type: String }),
36
+ __metadata("design:type", String)
37
+ ], SlotRange.prototype, "start", void 0);
38
+ __decorate([
39
+ (0, typegoose_1.prop)({ required: true, type: String }),
40
+ __metadata("design:type", String)
41
+ ], SlotRange.prototype, "end", void 0);
42
+ __decorate([
43
+ (0, typegoose_1.prop)({ type: [String], enum: enum_1.SubServiceType }),
44
+ __metadata("design:type", Array)
45
+ ], SlotRange.prototype, "subServiceTypes", void 0);
46
+ class OrderSlotRange {
47
+ from;
48
+ to;
49
+ }
50
+ exports.OrderSlotRange = OrderSlotRange;
51
+ __decorate([
52
+ (0, typegoose_1.prop)({ required: true, type: Date }),
53
+ __metadata("design:type", Date)
54
+ ], OrderSlotRange.prototype, "from", void 0);
55
+ __decorate([
56
+ (0, typegoose_1.prop)({ required: true, type: Date }),
57
+ __metadata("design:type", Date)
58
+ ], OrderSlotRange.prototype, "to", void 0);
27
59
  //# sourceMappingURL=duration.model.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"duration.model.js","sourceRoot":"/","sources":["libraries/mongo/models/shared/duration.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA4C;AAE5C,MAAa,QAAQ;IAEb,KAAK,CAAQ;IAGb,GAAG,CAAQ;CAClB;AAND,4BAMC;AAJO;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,IAAI,EAAE,EAAE,CAAC;8BAC3C,IAAI;uCAAC;AAGb;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;8BACR,IAAI;qCAAC","sourcesContent":["import { prop } from '@typegoose/typegoose';\n\nexport class Duration {\n\t@prop({ required: true, type: Date, default: new Date() })\n\tpublic start!: Date;\n\n\t@prop({ type: Date })\n\tpublic end?: Date;\n}\n"]}
1
+ {"version":3,"file":"duration.model.js","sourceRoot":"/","sources":["libraries/mongo/models/shared/duration.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA4C;AAC5C,qDAA4D;AAE5D,MAAa,QAAQ;IAEb,KAAK,CAAQ;IAGb,GAAG,CAAQ;CAClB;AAND,4BAMC;AAJO;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;8BACtB,IAAI;uCAAC;AAGb;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;8BACR,IAAI;qCAAC;AAGnB,MAAa,SAAS;IAEd,KAAK,CAAU;IAGf,GAAG,CAAU;IAGb,eAAe,CAAoB;CAC1C;AATD,8BASC;AAPO;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;wCACjB;AAGf;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;sCACnB;AAGb;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,qBAAc,EAAE,CAAC;;kDACL;AAG3C,MAAa,cAAc;IAEnB,IAAI,CAAQ;IAGZ,EAAE,CAAQ;CACjB;AAND,wCAMC;AAJO;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;8BACvB,IAAI;4CAAC;AAGZ;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;8BACzB,IAAI;0CAAC","sourcesContent":["import { prop } from '@typegoose/typegoose';\nimport { SubServiceType } from '../../../../utilities/enum';\n\nexport class Duration {\n\t@prop({ required: true, type: Date })\n\tpublic start!: Date;\n\n\t@prop({ type: Date })\n\tpublic end?: Date;\n}\n\nexport class SlotRange {\n\t@prop({ required: true, type: String }) // hhmm\n\tpublic start!: string;\n\n\t@prop({ required: true, type: String }) // hhmm\n\tpublic end!: string;\n\n\t@prop({ type: [String], enum: SubServiceType })\n\tpublic subServiceTypes?: SubServiceType[];\n}\n\nexport class OrderSlotRange {\n\t@prop({ required: true, type: Date })\n\tpublic from!: Date;\n\n\t@prop({ required: true, type: Date })\n\tpublic to!: Date;\n}\n"]}