@lyxa.ai/core 1.3.231 → 1.3.252

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 (62) hide show
  1. package/dist/libraries/mongo/models/embedded/cleaning-material.model.d.ts +4 -0
  2. package/dist/libraries/mongo/models/embedded/cleaning-material.model.js +27 -0
  3. package/dist/libraries/mongo/models/embedded/cleaning-material.model.js.map +1 -0
  4. package/dist/libraries/mongo/models/embedded/service-order-settings.model.d.ts +5 -5
  5. package/dist/libraries/mongo/models/embedded/service-order-settings.model.js +14 -23
  6. package/dist/libraries/mongo/models/embedded/service-order-settings.model.js.map +1 -1
  7. package/dist/libraries/mongo/models/index.d.ts +6 -9
  8. package/dist/libraries/mongo/models/index.js +7 -11
  9. package/dist/libraries/mongo/models/index.js.map +1 -1
  10. package/dist/libraries/mongo/models/professional-blocked-time.model.d.ts +10 -0
  11. package/dist/libraries/mongo/models/{blocked-time.model.js → professional-blocked-time.model.js} +13 -23
  12. package/dist/libraries/mongo/models/professional-blocked-time.model.js.map +1 -0
  13. package/dist/libraries/mongo/models/professional.model.d.ts +4 -8
  14. package/dist/libraries/mongo/models/professional.model.js +11 -25
  15. package/dist/libraries/mongo/models/professional.model.js.map +1 -1
  16. package/dist/libraries/mongo/models/service-addon.model.d.ts +15 -0
  17. package/dist/libraries/mongo/models/{addon.model.js → service-addon.model.js} +30 -62
  18. package/dist/libraries/mongo/models/service-addon.model.js.map +1 -0
  19. package/dist/libraries/mongo/models/service-category.model.d.ts +5 -5
  20. package/dist/libraries/mongo/models/service-category.model.js +10 -6
  21. package/dist/libraries/mongo/models/service-category.model.js.map +1 -1
  22. package/dist/libraries/mongo/models/service-line-item.model.d.ts +2 -2
  23. package/dist/libraries/mongo/models/service-line-item.model.js +2 -2
  24. package/dist/libraries/mongo/models/service-line-item.model.js.map +1 -1
  25. package/dist/libraries/mongo/models/service-package.model.d.ts +11 -12
  26. package/dist/libraries/mongo/models/service-package.model.js +25 -43
  27. package/dist/libraries/mongo/models/service-package.model.js.map +1 -1
  28. package/dist/libraries/mongo/models/service.model.d.ts +4 -5
  29. package/dist/libraries/mongo/models/service.model.js +7 -7
  30. package/dist/libraries/mongo/models/service.model.js.map +1 -1
  31. package/dist/libraries/mongo/models/shared/work-hour.model.d.ts +2 -10
  32. package/dist/libraries/mongo/models/shared/work-hour.model.js +7 -31
  33. package/dist/libraries/mongo/models/shared/work-hour.model.js.map +1 -1
  34. package/dist/libraries/mongo/models/vendor-parent.model.d.ts +3 -2
  35. package/dist/libraries/mongo/models/vendor-parent.model.js +26 -7
  36. package/dist/libraries/mongo/models/vendor-parent.model.js.map +1 -1
  37. package/dist/libraries/mongo/models/vendor.model.d.ts +3 -12
  38. package/dist/libraries/mongo/models/vendor.model.js +6 -58
  39. package/dist/libraries/mongo/models/vendor.model.js.map +1 -1
  40. package/dist/libraries/trpc/middlewares/auth.d.ts +1 -1
  41. package/dist/libraries/trpc/middlewares/createRoleProtectedProcedure.d.ts +1 -1
  42. package/dist/libraries/trpc/middlewares/phone-verified.d.ts +1 -1
  43. package/dist/libraries/trpc/middlewares/publicUserDecoder.d.ts +1 -1
  44. package/dist/types/README.md +1 -1
  45. package/dist/types/package.json +1 -1
  46. package/dist/types/utilities/enum.d.ts +7 -8
  47. package/dist/types/utilities/enum.js +8 -8
  48. package/dist/types/utilities/enum.js.map +1 -1
  49. package/dist/types/utilities/validation/common-validation.d.ts +12 -12
  50. package/dist/utilities/enum.d.ts +7 -8
  51. package/dist/utilities/enum.js +8 -8
  52. package/dist/utilities/enum.js.map +1 -1
  53. package/dist/utilities/id-generator.js +1 -0
  54. package/dist/utilities/id-generator.js.map +1 -1
  55. package/package.json +1 -1
  56. package/dist/libraries/mongo/models/addon.model.d.ts +0 -15
  57. package/dist/libraries/mongo/models/addon.model.js.map +0 -1
  58. package/dist/libraries/mongo/models/blocked-time.model.d.ts +0 -11
  59. package/dist/libraries/mongo/models/blocked-time.model.js.map +0 -1
  60. package/dist/libraries/mongo/models/professional-schedule.d.ts +0 -20
  61. package/dist/libraries/mongo/models/professional-schedule.js +0 -102
  62. package/dist/libraries/mongo/models/professional-schedule.js.map +0 -1
@@ -16,7 +16,7 @@ const enum_1 = require("../../../utilities/enum");
16
16
  let Service = class Service extends defaultClasses_1.TimeStamps {
17
17
  name;
18
18
  serviceType;
19
- parentService;
19
+ subServiceType;
20
20
  image;
21
21
  };
22
22
  exports.Service = Service;
@@ -29,15 +29,15 @@ __decorate([
29
29
  __metadata("design:type", String)
30
30
  ], Service.prototype, "serviceType", void 0);
31
31
  __decorate([
32
- (0, typegoose_1.prop)({ ref: () => Service }),
33
- __metadata("design:type", Object)
34
- ], Service.prototype, "parentService", void 0);
32
+ (0, typegoose_1.prop)({ type: String, enum: enum_1.SubServiceType }),
33
+ __metadata("design:type", String)
34
+ ], Service.prototype, "subServiceType", void 0);
35
35
  __decorate([
36
- (0, typegoose_1.prop)({ type: String }),
36
+ (0, typegoose_1.prop)({ required: true, type: String }),
37
37
  __metadata("design:type", String)
38
38
  ], Service.prototype, "image", void 0);
39
39
  exports.Service = Service = __decorate([
40
- (0, typegoose_1.Index)({ name: 1 }, { unique: true, partialFilterExpression: { deletedAt: null } }),
41
- (0, typegoose_1.modelOptions)({ schemaOptions: { collection: 'services' } })
40
+ (0, typegoose_1.modelOptions)({ schemaOptions: { collection: 'services' } }),
41
+ (0, typegoose_1.Index)({ serviceType: 1, subServiceType: 1 }, { unique: true, partialFilterExpression: { deletedAt: null } })
42
42
  ], Service);
43
43
  //# sourceMappingURL=service.model.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"service.model.js","sourceRoot":"/","sources":["libraries/mongo/models/service.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAsE;AACtE,4EAAqE;AACrE,kDAAsD;AAK/C,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,2BAAU;IAE5B,IAAI,CAAU;IAGd,WAAW,CAAc;IAGzB,aAAa,CAAe;IAG5B,KAAK,CAAU;CACzB,CAAA;AAZY,0BAAO;AAET;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;qCAClB;AAGd;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAW,EAAE,CAAC;;4CAC1B;AAGzB;IADN,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC;;8CACM;AAG5B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;sCACD;kBAXb,OAAO;IAFnB,IAAA,iBAAK,EAAC,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,uBAAuB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC;IAClF,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,UAAU,EAAE,EAAE,CAAC;GAC/C,OAAO,CAYnB","sourcesContent":["import { Index, modelOptions, prop, Ref } from \"@typegoose/typegoose\";\nimport { TimeStamps } from \"@typegoose/typegoose/lib/defaultClasses\";\nimport { ServiceType } from \"../../../utilities/enum\";\n\n\n@Index({ name: 1 }, { unique: true, partialFilterExpression: { deletedAt: null } })\n@modelOptions({ schemaOptions: { collection: 'services' } })\nexport class Service extends TimeStamps {\n @prop({ required: true, type: String })\n public name!: string;\n\n @prop({ required: true, type: String, enum: ServiceType })\n public serviceType!: ServiceType\n\n @prop({ ref: () => Service })\n public parentService?: Ref<Service>\n\n @prop({ type: String })\n public image?: string;\n}"]}
1
+ {"version":3,"file":"service.model.js","sourceRoot":"/","sources":["libraries/mongo/models/service.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAiE;AACjE,4EAAqE;AACrE,kDAAsE;AAI/D,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,2BAAU;IAE/B,IAAI,CAAU;IAGd,WAAW,CAAe;IAG1B,cAAc,CAAkB;IAGhC,KAAK,CAAU;CACtB,CAAA;AAZY,0BAAO;AAEZ;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;qCAClB;AAGd;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAW,EAAE,CAAC;;4CACzB;AAG1B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,qBAAc,EAAE,CAAC;;+CACN;AAGhC;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;sCACjB;kBAXV,OAAO;IAFnB,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,UAAU,EAAE,EAAE,CAAC;IAC3D,IAAA,iBAAK,EAAC,EAAE,WAAW,EAAE,CAAC,EAAE,cAAc,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,uBAAuB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC;GAChG,OAAO,CAYnB","sourcesContent":["import { Index, modelOptions, prop } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { ServiceType, SubServiceType } from '../../../utilities/enum';\n\n@modelOptions({ schemaOptions: { collection: 'services' } })\n@Index({ serviceType: 1, subServiceType: 1 }, { unique: true, partialFilterExpression: { deletedAt: null } })\nexport class Service extends TimeStamps {\n\t@prop({ required: true, type: String })\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: String })\n\tpublic image!: string;\n}\n"]}
@@ -1,6 +1,4 @@
1
- import { Ref } from '@typegoose/typegoose';
2
1
  import { HolidayWorkStatus, WeekDay, WorkStatus } from '../../../../utilities/enum';
3
- import { Service } from '../service.model';
4
2
  export declare class StartEndTime {
5
3
  start: string;
6
4
  end: string;
@@ -19,13 +17,7 @@ export declare class WorkHourSetting {
19
17
  normalHours?: NormalHour[];
20
18
  holidayHours?: HolidayHour[];
21
19
  }
22
- export declare class TimeSlot {
23
- timeFrom: string;
24
- timeTo: string;
25
- services: Ref<Service>[];
26
- }
27
- export declare class TeamMemberWorkHourSetting {
20
+ export declare class TeamMemberAvailability {
28
21
  day: WeekDay;
29
- isEnabled: boolean;
30
- timeSlots: TimeSlot[];
22
+ openingHours: StartEndTime[];
31
23
  }
@@ -9,10 +9,9 @@ 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.TeamMemberWorkHourSetting = exports.TimeSlot = exports.WorkHourSetting = exports.HolidayHour = exports.NormalHour = exports.StartEndTime = void 0;
12
+ exports.TeamMemberAvailability = exports.WorkHourSetting = exports.HolidayHour = exports.NormalHour = exports.StartEndTime = void 0;
13
13
  const typegoose_1 = require("@typegoose/typegoose");
14
14
  const enum_1 = require("../../../../utilities/enum");
15
- const service_model_1 = require("../service.model");
16
15
  class StartEndTime {
17
16
  start;
18
17
  end;
@@ -79,40 +78,17 @@ __decorate([
79
78
  (0, typegoose_1.prop)({ type: () => [HolidayHour], default: [] }),
80
79
  __metadata("design:type", Array)
81
80
  ], WorkHourSetting.prototype, "holidayHours", void 0);
82
- class TimeSlot {
83
- timeFrom;
84
- timeTo;
85
- services;
86
- }
87
- exports.TimeSlot = TimeSlot;
88
- __decorate([
89
- (0, typegoose_1.prop)({ required: true }),
90
- __metadata("design:type", String)
91
- ], TimeSlot.prototype, "timeFrom", void 0);
92
- __decorate([
93
- (0, typegoose_1.prop)({ required: true }),
94
- __metadata("design:type", String)
95
- ], TimeSlot.prototype, "timeTo", void 0);
96
- __decorate([
97
- (0, typegoose_1.prop)({ ref: () => service_model_1.Service }),
98
- __metadata("design:type", Array)
99
- ], TimeSlot.prototype, "services", void 0);
100
- class TeamMemberWorkHourSetting {
81
+ class TeamMemberAvailability {
101
82
  day;
102
- isEnabled;
103
- timeSlots;
83
+ openingHours;
104
84
  }
105
- exports.TeamMemberWorkHourSetting = TeamMemberWorkHourSetting;
85
+ exports.TeamMemberAvailability = TeamMemberAvailability;
106
86
  __decorate([
107
87
  (0, typegoose_1.prop)({ required: true, type: Number, enum: enum_1.WeekDay }),
108
88
  __metadata("design:type", Number)
109
- ], TeamMemberWorkHourSetting.prototype, "day", void 0);
110
- __decorate([
111
- (0, typegoose_1.prop)({ type: Boolean, default: true }),
112
- __metadata("design:type", Boolean)
113
- ], TeamMemberWorkHourSetting.prototype, "isEnabled", void 0);
89
+ ], TeamMemberAvailability.prototype, "day", void 0);
114
90
  __decorate([
115
- (0, typegoose_1.prop)({ type: () => [TimeSlot], default: [] }),
91
+ (0, typegoose_1.prop)({ required: true, type: () => [StartEndTime] }),
116
92
  __metadata("design:type", Array)
117
- ], TeamMemberWorkHourSetting.prototype, "timeSlots", void 0);
93
+ ], TeamMemberAvailability.prototype, "openingHours", void 0);
118
94
  //# sourceMappingURL=work-hour.model.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"work-hour.model.js","sourceRoot":"/","sources":["libraries/mongo/models/shared/work-hour.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAiD;AACjD,qDAAoF;AACpF,oDAA2C;AAE3C,MAAa,YAAY;IAEjB,KAAK,CAAU;IAGf,GAAG,CAAU;CACpB;AAND,oCAMC;AAJO;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;2C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AAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,WAAW,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;qDACb;AAGrC,MAAa,QAAQ;IAEb,QAAQ,CAAU;IAGlB,MAAM,CAAU;IAGhB,QAAQ,CAAiB;CAChC;AATD,4BASC;AAPO;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0CACA;AAGlB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wCACF;AAGhB;IADN,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,uBAAO,EAAE,CAAC;;0CACG;AAIjC,MAAa,yBAAyB;IAE9B,GAAG,CAAW;IAGd,SAAS,CAAW;IAGpB,SAAS,CAAc;CAC9B;AATD,8DASC;AAPO;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,cAAO,EAAE,CAAC;;sDACjC;AAGd;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;4DACZ;AAGpB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;4DAChB","sourcesContent":["import { prop, Ref } from '@typegoose/typegoose';\nimport { HolidayWorkStatus, WeekDay, WorkStatus } from '../../../../utilities/enum';\nimport { Service } from '../service.model';\n\nexport class StartEndTime {\n\t@prop({ required: true, type: String })\n\tpublic start!: string;\n\n\t@prop({ required: true, type: String })\n\tpublic end!: string;\n}\n\nexport class NormalHour {\n\t@prop({ required: true, type: Number, enum: WeekDay })\n\tpublic day!: WeekDay;\n\n\t@prop({ required: true, type: String, enum: WorkStatus })\n\tpublic status!: WorkStatus;\n\n\t@prop({ type: () => [StartEndTime], default: [] })\n\tpublic openingHours?: StartEndTime[];\n}\n\nexport class HolidayHour {\n\t@prop({ required: true, type: Date })\n\tpublic date?: Date;\n\n\t@prop({\n\t\trequired: true,\n\t\ttype: String,\n\t\tenum: HolidayWorkStatus,\n\t})\n\tpublic status!: HolidayWorkStatus;\n\n\t@prop({ type: StartEndTime })\n\tpublic closingHour?: StartEndTime;\n}\n\nexport class WorkHourSetting {\n\t@prop({ type: () => [NormalHour], default: [] })\n\tpublic normalHours?: NormalHour[];\n\n\t@prop({ type: () => [HolidayHour], default: [] })\n\tpublic holidayHours?: HolidayHour[];\n}\n\nexport class TimeSlot {\n\t@prop({ required: true })\n\tpublic timeFrom!: string; // Format: \"HH:mm\" (e.g., \"09:00\")\n\n\t@prop({ required: true })\n\tpublic timeTo!: string; // Format: \"HH:mm\" (e.g., \"17:00\")\n\n\t@prop({ ref: () => Service })\n\tpublic services!: Ref<Service>[]\n}\n\n\nexport class TeamMemberWorkHourSetting {\n\t@prop({ required: true, type: Number, enum: WeekDay })\n\tpublic day!: WeekDay;\n\n\t@prop({ type: Boolean, default: true })\n\tpublic isEnabled!: boolean;\n\n\t@prop({ type: () => [TimeSlot], default: [] })\n\tpublic timeSlots!: TimeSlot[];\n}"]}
1
+ {"version":3,"file":"work-hour.model.js","sourceRoot":"/","sources":["libraries/mongo/models/shared/work-hour.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAiD;AACjD,qDAAoF;AAGpF,MAAa,YAAY;IAEjB,KAAK,CAAU;IAGf,GAAG,CAAU;CACpB;AAND,oCAMC;AAJO;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;;yCACnB;AAGrB,MAAa,UAAU;IAEf,GAAG,CAAW;IAGd,MAAM,CAA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AkB;CACrC;AAND,wDAMC;AAJO;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,cAAO,EAAE,CAAC;;mDACjC;AAGd;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC;;4DAChB","sourcesContent":["import { prop, Ref } from '@typegoose/typegoose';\nimport { HolidayWorkStatus, WeekDay, WorkStatus } from '../../../../utilities/enum';\nimport { Service } from '../service.model';\n\nexport class StartEndTime {\n\t@prop({ required: true, type: String })\n\tpublic start!: string;\n\n\t@prop({ required: true, type: String })\n\tpublic end!: string;\n}\n\nexport class NormalHour {\n\t@prop({ required: true, type: Number, enum: WeekDay })\n\tpublic day!: WeekDay;\n\n\t@prop({ required: true, type: String, enum: WorkStatus })\n\tpublic status!: WorkStatus;\n\n\t@prop({ type: () => [StartEndTime], default: [] })\n\tpublic openingHours?: StartEndTime[];\n}\n\nexport class HolidayHour {\n\t@prop({ required: true, type: Date })\n\tpublic date?: Date;\n\n\t@prop({\n\t\trequired: true,\n\t\ttype: String,\n\t\tenum: HolidayWorkStatus,\n\t})\n\tpublic status!: HolidayWorkStatus;\n\n\t@prop({ type: StartEndTime })\n\tpublic closingHour?: StartEndTime;\n}\n\nexport class WorkHourSetting {\n\t@prop({ type: () => [NormalHour], default: [] })\n\tpublic normalHours?: NormalHour[];\n\n\t@prop({ type: () => [HolidayHour], default: [] })\n\tpublic holidayHours?: HolidayHour[];\n}\n\nexport class TeamMemberAvailability {\n\t@prop({ required: true, type: Number, enum: WeekDay })\n\tpublic day!: WeekDay;\n\n\t@prop({ required: true, type: () => [StartEndTime] })\n\tpublic openingHours!: StartEndTime[];\n}\n"]}
@@ -1,17 +1,17 @@
1
1
  import { Ref } from '@typegoose/typegoose';
2
2
  import { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';
3
- import { ChargeType, ServiceType, Status } from '../../../utilities/enum';
3
+ import { ServiceType, Status } from '../../../utilities/enum';
4
4
  import { Admin } from './admin.model';
5
5
  import { Charge } from './embedded/charge.model';
6
6
  import { ParentDocument } from './embedded/parent-document.model';
7
7
  import { Address } from './shared/address.model';
8
8
  import { Duration } from './shared/duration.model';
9
9
  export declare class VendorParent extends TimeStamps {
10
+ vendorParentId: string;
10
11
  name: string;
11
12
  email: string;
12
13
  phoneNumber: string;
13
14
  address: Address;
14
- chargeType: ChargeType;
15
15
  charge: Charge;
16
16
  serviceType: ServiceType;
17
17
  commissionDuration: Duration;
@@ -20,4 +20,5 @@ export declare class VendorParent extends TimeStamps {
20
20
  status?: Status;
21
21
  profilePhoto?: string;
22
22
  document?: ParentDocument;
23
+ vendorCount?: number;
23
24
  }
@@ -18,12 +18,15 @@ const charge_model_1 = require("./embedded/charge.model");
18
18
  const parent_document_model_1 = require("./embedded/parent-document.model");
19
19
  const address_model_1 = require("./shared/address.model");
20
20
  const duration_model_1 = require("./shared/duration.model");
21
+ const vendor_model_1 = require("./vendor.model");
22
+ const id_generator_1 = require("../../../utilities/id-generator");
23
+ const _1 = require(".");
21
24
  let VendorParent = class VendorParent extends defaultClasses_1.TimeStamps {
25
+ vendorParentId;
22
26
  name;
23
27
  email;
24
28
  phoneNumber;
25
29
  address;
26
- chargeType;
27
30
  charge;
28
31
  serviceType;
29
32
  commissionDuration;
@@ -32,28 +35,29 @@ let VendorParent = class VendorParent extends defaultClasses_1.TimeStamps {
32
35
  status;
33
36
  profilePhoto;
34
37
  document;
38
+ vendorCount;
35
39
  };
36
40
  exports.VendorParent = VendorParent;
41
+ __decorate([
42
+ (0, typegoose_1.prop)({ required: true, type: String, unique: true, index: true }),
43
+ __metadata("design:type", String)
44
+ ], VendorParent.prototype, "vendorParentId", void 0);
37
45
  __decorate([
38
46
  (0, typegoose_1.prop)({ required: true, type: String, maxlength: 50 }),
39
47
  __metadata("design:type", String)
40
48
  ], VendorParent.prototype, "name", void 0);
41
49
  __decorate([
42
- (0, typegoose_1.prop)({ required: true, unique: true, type: String }),
50
+ (0, typegoose_1.prop)({ required: true, type: String }),
43
51
  __metadata("design:type", String)
44
52
  ], VendorParent.prototype, "email", void 0);
45
53
  __decorate([
46
- (0, typegoose_1.prop)({ required: true, unique: true, type: String }),
54
+ (0, typegoose_1.prop)({ required: true, type: String }),
47
55
  __metadata("design:type", String)
48
56
  ], VendorParent.prototype, "phoneNumber", void 0);
49
57
  __decorate([
50
58
  (0, typegoose_1.prop)({ required: true, type: address_model_1.Address }),
51
59
  __metadata("design:type", address_model_1.Address)
52
60
  ], VendorParent.prototype, "address", void 0);
53
- __decorate([
54
- (0, typegoose_1.prop)({ required: true, type: String, enum: enum_1.ChargeType, default: enum_1.ChargeType.CUSTOM }),
55
- __metadata("design:type", String)
56
- ], VendorParent.prototype, "chargeType", void 0);
57
61
  __decorate([
58
62
  (0, typegoose_1.prop)({ required: true, type: charge_model_1.Charge }),
59
63
  __metadata("design:type", charge_model_1.Charge)
@@ -86,12 +90,27 @@ __decorate([
86
90
  (0, typegoose_1.prop)({ type: parent_document_model_1.ParentDocument }),
87
91
  __metadata("design:type", parent_document_model_1.ParentDocument)
88
92
  ], VendorParent.prototype, "document", void 0);
93
+ __decorate([
94
+ (0, typegoose_1.prop)({
95
+ ref: () => vendor_model_1.Vendor,
96
+ foreignField: 'parent',
97
+ localField: '_id',
98
+ count: true,
99
+ match: { deletedAt: null },
100
+ }),
101
+ __metadata("design:type", Number)
102
+ ], VendorParent.prototype, "vendorCount", void 0);
89
103
  exports.VendorParent = VendorParent = __decorate([
90
104
  (0, typegoose_1.modelOptions)({
91
105
  schemaOptions: { collection: 'vendorParents', toJSON: { virtuals: true }, toObject: { virtuals: true } },
92
106
  options: {
93
107
  allowMixed: typegoose_1.Severity.ALLOW,
94
108
  },
109
+ }),
110
+ (0, typegoose_1.pre)('save', async function () {
111
+ if (this.isNew) {
112
+ this.vendorParentId = await (0, id_generator_1.generateId)(_1.CounterModel, enum_1.CounterType.VENDOR_PARENT);
113
+ }
95
114
  })
96
115
  ], VendorParent);
97
116
  //# sourceMappingURL=vendor-parent.model.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"vendor-parent.model.js","sourceRoot":"/","sources":["libraries/mongo/models/vendor-parent.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAyE;AACzE,4EAAqE;AACrE,kDAA0E;AAC1E,+CAAsC;AACtC,0DAAiD;AACjD,4EAAkE;AAClE,0DAAiD;AACjD,4DAAmD;AAQ5C,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,2BAAU;IAEpC,IAAI,CAAU;IAGd,KAAK,CAAU;IAGf,WAAW,CAAU;IAGrB,OAAO,CAAW;IAGlB,UAAU,CAAc;IAGxB,MAAM,CAAU;IAGhB,WAAW,CAAc;IAGzB,kBAAkB,CAAY;IAG9B,mBAAmB,CAAW;IAG9B,oBAAoB,CAAc;IAGlC,MAAM,CAAU;IAGhB,YAAY,CAAU;IAGtB,QAAQ,CAAkB;CAUjC,CAAA;AAhDY,oCAAY;AAEjB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;;0CACjC;AAGd;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;2CAC/B;AAGf;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;iDACzB;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,uBAAO,EAAE,CAAC;8BACvB,uBAAO;6CAAC;AAGlB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IA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CAAC;GACW,YAAY,CAgDxB","sourcesContent":["import { modelOptions, prop, Ref, Severity } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { ChargeType, ServiceType, Status } from '../../../utilities/enum';\nimport { Admin } from './admin.model';\nimport { Charge } from './embedded/charge.model';\nimport { ParentDocument } from './embedded/parent-document.model';\nimport { Address } from './shared/address.model';\nimport { Duration } from './shared/duration.model';\n\n@modelOptions({\n\tschemaOptions: { collection: 'vendorParents', toJSON: { virtuals: true }, toObject: { virtuals: true } },\n\toptions: {\n\t\tallowMixed: Severity.ALLOW,\n\t},\n})\nexport class VendorParent extends TimeStamps {\n\t@prop({ required: true, type: String, maxlength: 50 })\n\tpublic name!: string;\n\n\t@prop({ required: true, unique: true, type: String })\n\tpublic email!: string;\n\n\t@prop({ required: true, unique: true, type: String })\n\tpublic phoneNumber!: string;\n\n\t@prop({ required: true, type: Address })\n\tpublic address!: Address;\n\n\t@prop({ required: true, type: String, enum: ChargeType, default: ChargeType.CUSTOM })\n\tpublic chargeType!: ChargeType;\n\n\t@prop({ required: true, type: Charge })\n\tpublic charge!: Charge;\n\n\t@prop({ required: true, type: String, enum: ServiceType })\n\tpublic serviceType!: ServiceType\n\n\t@prop({ required: true, type: Duration })\n\tpublic commissionDuration!: Duration;\n\n\t@prop({ required: true, type: Boolean, default: true })\n\tpublic isServiceFeeCharged!: boolean;\n\n\t@prop({ ref: () => Admin })\n\tpublic businessDevExecutive?: Ref<Admin>;\n\n\t@prop({ type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status?: Status;\n\n\t@prop({ type: String })\n\tpublic profilePhoto?: string;\n\n\t@prop({ type: ParentDocument })\n\tpublic document?: ParentDocument;\n\n\t// @prop({\n\t// \tref: () => Shop,\n\t// \tforeignField: 'parent',\n\t// \tlocalField: '_id',\n\t// \tcount: true,\n\t// \tmatch: { deletedAt: null },\n\t// })\n\t// public shopCount?: number;\n}\n"]}
1
+ {"version":3,"file":"vendor-par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AAE;QACxG,OAAO,EAAE;YACR,UAAU,EAAE,oBAAQ,CAAC,KAAK;SAC1B;KACD,CAAC;IACD,IAAA,eAAG,EAAe,MAAM,EAAE,KAAK;QAC/B,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YAChB,IAAI,CAAC,cAAc,GAAG,MAAM,IAAA,yBAAU,EAAC,eAAY,EAAE,kBAAW,CAAC,aAAa,CAAC,CAAC;QACjF,CAAC;IACF,CAAC,CAAC;GACW,YAAY,CAgDxB","sourcesContent":["import { modelOptions, pre, prop, Ref, Severity } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { ChargeType, CounterType, ServiceType, Status } from '../../../utilities/enum';\nimport { Admin } from './admin.model';\nimport { Charge } from './embedded/charge.model';\nimport { ParentDocument } from './embedded/parent-document.model';\nimport { Address } from './shared/address.model';\nimport { Duration } from './shared/duration.model';\nimport { Vendor } from './vendor.model';\nimport { generateId } from '../../../utilities/id-generator';\nimport { CounterModel } from '.';\n\n@modelOptions({\n\tschemaOptions: { collection: 'vendorParents', toJSON: { virtuals: true }, toObject: { virtuals: true } },\n\toptions: {\n\t\tallowMixed: Severity.ALLOW,\n\t},\n})\n@pre<VendorParent>('save', async function () {\n\tif (this.isNew) {\n\t\tthis.vendorParentId = await generateId(CounterModel, CounterType.VENDOR_PARENT);\n\t}\n})\nexport class VendorParent extends TimeStamps {\n\t@prop({ required: true, type: String, unique: true, index: true })\n\tpublic vendorParentId!: string;\n\n\t@prop({ required: true, type: String, maxlength: 50 })\n\tpublic name!: string;\n\n\t@prop({ required: true, type: String})\n\tpublic email!: string;\n\n\t@prop({ required: true, type: String})\n\tpublic phoneNumber!: string;\n\n\t@prop({ required: true, type: Address })\n\tpublic address!: Address;\n\n\t@prop({ required: true, type: Charge })\n\tpublic charge!: Charge;\n\n\t@prop({ required: true, type: String, enum: ServiceType })\n\tpublic serviceType!: ServiceType;\n\n\t@prop({ required: true, type: Duration })\n\tpublic commissionDuration!: Duration;\n\n\t@prop({ required: true, type: Boolean, default: true })\n\tpublic isServiceFeeCharged!: boolean;\n\n\t@prop({ ref: () => Admin })\n\tpublic businessDevExecutive?: Ref<Admin>;\n\n\t@prop({ type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status?: Status;\n\n\t@prop({ type: String })\n\tpublic profilePhoto?: string;\n\n\t@prop({ type: ParentDocument })\n\tpublic document?: ParentDocument;\n\n\t@prop({\n\t\tref: () => Vendor,\n\t\tforeignField: 'parent',\n\t\tlocalField: '_id',\n\t\tcount: true,\n\t\tmatch: { deletedAt: null },\n\t})\n\tpublic vendorCount?: number;\n}\n"]}
@@ -3,36 +3,27 @@ import { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';
3
3
  import { ServiceType, Status } from '../../../utilities/enum';
4
4
  import { ShopDocument } from './embedded/shop-document.model';
5
5
  import { Address } from './shared/address.model';
6
- import { StartEndTime, WorkHourSetting } from './shared/work-hour.model';
7
- import { Tag } from './tag.model';
6
+ import { WorkHourSetting } from './shared/work-hour.model';
8
7
  import { Zone } from './zone.model';
9
8
  import { VendorParent } from '.';
10
- import { Service } from './service.model';
11
9
  import { ServiceOrderSettings } from './embedded/service-order-settings.model';
12
10
  export declare class Vendor extends TimeStamps {
13
11
  vendorId: string;
14
12
  name: string;
15
13
  ownerName: string;
16
14
  email: string;
17
- slug?: string;
18
15
  parent: Ref<VendorParent>;
19
- service: Ref<Service>;
20
- serviceType: ServiceType;
16
+ serviceType?: ServiceType;
21
17
  status: Status;
22
18
  phoneNumber: string;
23
19
  userPhoneNumber: string;
24
20
  additionalPhoneNumbers?: string[];
25
21
  address: Address;
26
- zone: Ref<Zone>[];
22
+ zones: Ref<Zone>[];
27
23
  logo?: string;
28
24
  banner?: string;
29
25
  document?: ShopDocument;
30
- vendorActiveTimingsOfCurrentDate?: StartEndTime[];
31
- tags?: Ref<Tag>[];
32
- sortingOrder?: number;
33
26
  avgRating?: number;
34
- priceRange?: number;
35
- isBeirutAuthentic: boolean;
36
27
  isVisibleToUser: boolean;
37
28
  ordersCount?: number;
38
29
  customersCount?: number;
@@ -8,9 +8,6 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
8
8
  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
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
11
  Object.defineProperty(exports, "__esModule", { value: true });
15
12
  exports.Vendor = void 0;
16
13
  const typegoose_1 = require("@typegoose/typegoose");
@@ -19,11 +16,8 @@ const enum_1 = require("../../../utilities/enum");
19
16
  const shop_document_model_1 = require("./embedded/shop-document.model");
20
17
  const address_model_1 = require("./shared/address.model");
21
18
  const work_hour_model_1 = require("./shared/work-hour.model");
22
- const tag_model_1 = require("./tag.model");
23
19
  const zone_model_1 = require("./zone.model");
24
20
  const _1 = require(".");
25
- const slugify_1 = __importDefault(require("slugify"));
26
- const service_model_1 = require("./service.model");
27
21
  const service_order_settings_model_1 = require("./embedded/service-order-settings.model");
28
22
  const id_generator_1 = require("../../../utilities/id-generator");
29
23
  let Vendor = class Vendor extends defaultClasses_1.TimeStamps {
@@ -31,25 +25,18 @@ let Vendor = class Vendor extends defaultClasses_1.TimeStamps {
31
25
  name;
32
26
  ownerName;
33
27
  email;
34
- slug;
35
28
  parent;
36
- service;
37
29
  serviceType;
38
30
  status;
39
31
  phoneNumber;
40
32
  userPhoneNumber;
41
33
  additionalPhoneNumbers;
42
34
  address;
43
- zone;
35
+ zones;
44
36
  logo;
45
37
  banner;
46
38
  document;
47
- vendorActiveTimingsOfCurrentDate;
48
- tags;
49
- sortingOrder;
50
39
  avgRating;
51
- priceRange;
52
- isBeirutAuthentic;
53
40
  isVisibleToUser;
54
41
  ordersCount;
55
42
  customersCount;
@@ -60,7 +47,7 @@ let Vendor = class Vendor extends defaultClasses_1.TimeStamps {
60
47
  };
61
48
  exports.Vendor = Vendor;
62
49
  __decorate([
63
- (0, typegoose_1.prop)({ type: String, unique: true, index: true }),
50
+ (0, typegoose_1.prop)({ required: true, type: String, unique: true, index: true }),
64
51
  __metadata("design:type", String)
65
52
  ], Vendor.prototype, "vendorId", void 0);
66
53
  __decorate([
@@ -75,20 +62,12 @@ __decorate([
75
62
  (0, typegoose_1.prop)({ required: true, type: String }),
76
63
  __metadata("design:type", String)
77
64
  ], Vendor.prototype, "email", void 0);
78
- __decorate([
79
- (0, typegoose_1.prop)({ unique: true, type: String }),
80
- __metadata("design:type", String)
81
- ], Vendor.prototype, "slug", void 0);
82
65
  __decorate([
83
66
  (0, typegoose_1.prop)({ required: true, ref: () => _1.VendorParent }),
84
67
  __metadata("design:type", Object)
85
68
  ], Vendor.prototype, "parent", void 0);
86
69
  __decorate([
87
- (0, typegoose_1.prop)({ required: true, ref: () => service_model_1.Service }),
88
- __metadata("design:type", Object)
89
- ], Vendor.prototype, "service", void 0);
90
- __decorate([
91
- (0, typegoose_1.prop)({ required: true, type: String, enum: enum_1.ServiceType }),
70
+ (0, typegoose_1.prop)({ type: String, enum: enum_1.ServiceType }),
92
71
  __metadata("design:type", String)
93
72
  ], Vendor.prototype, "serviceType", void 0);
94
73
  __decorate([
@@ -112,9 +91,9 @@ __decorate([
112
91
  __metadata("design:type", address_model_1.Address)
113
92
  ], Vendor.prototype, "address", void 0);
114
93
  __decorate([
115
- (0, typegoose_1.prop)({ required: true, ref: () => zone_model_1.Zone, type: () => [String] }),
94
+ (0, typegoose_1.prop)({ required: true, ref: () => zone_model_1.Zone }),
116
95
  __metadata("design:type", Array)
117
- ], Vendor.prototype, "zone", void 0);
96
+ ], Vendor.prototype, "zones", void 0);
118
97
  __decorate([
119
98
  (0, typegoose_1.prop)({ type: String }),
120
99
  __metadata("design:type", String)
@@ -127,30 +106,10 @@ __decorate([
127
106
  (0, typegoose_1.prop)({ type: shop_document_model_1.ShopDocument }),
128
107
  __metadata("design:type", shop_document_model_1.ShopDocument)
129
108
  ], Vendor.prototype, "document", void 0);
130
- __decorate([
131
- (0, typegoose_1.prop)({ type: () => [work_hour_model_1.StartEndTime], default: [] }),
132
- __metadata("design:type", Array)
133
- ], Vendor.prototype, "vendorActiveTimingsOfCurrentDate", void 0);
134
- __decorate([
135
- (0, typegoose_1.prop)({ ref: () => tag_model_1.Tag, default: [] }),
136
- __metadata("design:type", Array)
137
- ], Vendor.prototype, "tags", void 0);
138
- __decorate([
139
- (0, typegoose_1.prop)({ type: Number }),
140
- __metadata("design:type", Number)
141
- ], Vendor.prototype, "sortingOrder", void 0);
142
109
  __decorate([
143
110
  (0, typegoose_1.prop)({ default: 0, type: () => Number }),
144
111
  __metadata("design:type", Number)
145
112
  ], Vendor.prototype, "avgRating", void 0);
146
- __decorate([
147
- (0, typegoose_1.prop)({ type: Number, default: 1, min: 1, max: 4 }),
148
- __metadata("design:type", Number)
149
- ], Vendor.prototype, "priceRange", void 0);
150
- __decorate([
151
- (0, typegoose_1.prop)({ required: true, type: Boolean }),
152
- __metadata("design:type", Boolean)
153
- ], Vendor.prototype, "isBeirutAuthentic", void 0);
154
113
  __decorate([
155
114
  (0, typegoose_1.prop)({ required: true, type: Boolean }),
156
115
  __metadata("design:type", Boolean)
@@ -186,21 +145,10 @@ exports.Vendor = Vendor = __decorate([
186
145
  }),
187
146
  (0, typegoose_1.Index)({ name: 1, serviceType: 1 }, { unique: true, partialFilterExpression: { deletedAt: null } }),
188
147
  (0, typegoose_1.Index)({ parent: 1, status: 1, isVisibleToUser: 1, deletedAt: 1 }),
148
+ (0, typegoose_1.Index)({ serviceType: 1, zones: 1 }, { unique: true, partialFilterExpression: { deletedAt: null } }),
189
149
  (0, typegoose_1.pre)('save', async function () {
190
150
  if (this.isNew) {
191
151
  this.vendorId = await (0, id_generator_1.generateId)(_1.CounterModel, enum_1.CounterType.VENDOR);
192
- const baseSlug = (0, slugify_1.default)(this.name, { lower: true, strict: true });
193
- let slug = baseSlug;
194
- let count = 0;
195
- while (await _1.VendorModel.exists({ slug })) {
196
- count++;
197
- slug = `${baseSlug}-${count}`;
198
- }
199
- this.slug = slug;
200
- const maxSortingOrder = await _1.VendorModel.aggregate([
201
- { $group: { _id: null, maxSortingOrder: { $max: '$sortingOrder' } } }
202
- ]);
203
- this.sortingOrder = (maxSortingOrder[0]?.maxSortingOrder ?? -1) + 1;
204
152
  }
205
153
  })
206
154
  ], Vendor);
@@ -1 +1 @@
1
- {"version":3,"file":"vendor.model.js","sourceRoot":"/","sources":["libraries/mongo/models/vendor.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,oDAAqF;AACrF,4EAAqE;AACrE,kDAA2E;AAC3E,wEAA8D;AAC9D,0DAAiD;AACjD,8DAAyE;AACzE,2CAAkC;AAClC,6CAAoC;AACpC,wBAA4D;AAC5D,sDAA8B;AAC9B,mDAA0C;AAC1C,0FAA+E;AAC/E,kEAA6D;AA+BtD,IAAM,MAAM,GAAZ,MAAM,MAAO,SAAQ,2BAAU;IAE9B,QAAQ,CAAU;IAGlB,IAAI,CAAU;IAGd,SAAS,CAAU;IAGnB,KAAK,CAAU;IAGf,IAAI,CAAU;IAGd,MAAM,CAAoB;IAG1B,OAAO,CAAe;IAGtB,WAAW,CAAc;IAGzB,MAAM,CAAU;IAGhB,WAAW,CAAU;IAGrB,eAAe,CAAU;IAGzB,sBAAsB,CAAY;IAGlC,OAAO,CAAW;IAGlB,IAAI,CAAe;IAGnB,IAAI,CAAU;IAGd,MAAM,CAAU;IAGhB,QAAQ,CAAgB;IAGxB,gCAAgC,CAAkB;IAGlD,IAAI,CAAc;IAGlB,YAAY,CAAU;IAGtB,SAAS,CAAU;IAGnB,UAAU,CAAU;IAGpB,iBAAiB,CAAW;IAG5B,eAAe,CAAW;IAG1B,WAAW,CAAU;IAGrB,cAAc,CAAU;IAGxB,cAAc,CAAU;IAGxB,qBAAqB,CAAU;IAG/B,aAAa,CAAwB;IAGrC,eAAe,CAAmB;CACzC,CAAA;AA1FY,wBAAM;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AE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,eAAe,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC;IACjE,IAAA,eAAG,EAAS,MAAM,EAAE,KAAK;QACzB,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YAEhB,IAAI,CAAC,QAAQ,GAAG,MAAM,IAAA,yBAAU,EAAC,eAAY,EAAE,kBAAW,CAAC,MAAM,CAAC,CAAC;YAGnE,MAAM,QAAQ,GAAG,IAAA,iBAAO,EAAC,IAAI,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;YACnE,IAAI,IAAI,GAAG,QAAQ,CAAC;YACpB,IAAI,KAAK,GAAG,CAAC,CAAC;YACd,OAAO,MAAM,cAAW,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;gBAC3C,KAAK,EAAE,CAAC;gBACR,IAAI,GAAG,GAAG,QAAQ,IAAI,KAAK,EAAE,CAAC;YAC/B,CAAC;YACD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;YAGjB,MAAM,eAAe,GAAG,MAAM,cAAW,CAAC,SAAS,CAA8B;gBAChF,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,eAAe,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,EAAE,EAAE;aACrE,CAAC,CAAC;YACH,IAAI,CAAC,YAAY,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,eAAe,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QACrE,CAAC;IACF,CAAC,CAAC;GACW,MAAM,CA0FlB","sourcesContent":["import { modelOptions, prop, Ref, Severity, Index, pre } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { CounterType, ServiceType, Status } from '../../../utilities/enum';\nimport { ShopDocument } from './embedded/shop-document.model';\nimport { Address } from './shared/address.model';\nimport { StartEndTime, WorkHourSetting } from './shared/work-hour.model';\nimport { Tag } from './tag.model';\nimport { Zone } from './zone.model';\nimport { VendorParent, VendorModel, CounterModel } from '.';\nimport slugify from 'slugify';\nimport { Service } from './service.model';\nimport { ServiceOrderSettings } from './embedded/service-order-settings.model';\nimport { generateId } from '../../../utilities/id-generator';\n\n\n@modelOptions({\n\tschemaOptions: { collection: 'vendors' },\n\toptions: { allowMixed: Severity.ALLOW },\n})\n@Index({ name: 1, serviceType: 1 }, { unique: true, partialFilterExpression: { deletedAt: null } })\n@Index({ parent: 1, status: 1, isVisibleToUser: 1, deletedAt: 1 })\n@pre<Vendor>('save', async function () {\n\tif (this.isNew) {\n\t\t// Generate vendorId\n\t\tthis.vendorId = await generateId(CounterModel, CounterType.VENDOR);\n\n\t\t// Generate slug\n\t\tconst baseSlug = slugify(this.name, { lower: true, strict: true });\n\t\tlet slug = baseSlug;\n\t\tlet count = 0;\n\t\twhile (await VendorModel.exists({ slug })) {\n\t\t\tcount++;\n\t\t\tslug = `${baseSlug}-${count}`;\n\t\t}\n\t\tthis.slug = slug;\n\n\t\t// Set sortingOrder\n\t\tconst maxSortingOrder = await VendorModel.aggregate<{ maxSortingOrder: number }>([\n\t\t\t{ $group: { _id: null, maxSortingOrder: { $max: '$sortingOrder' } } }\n\t\t]);\n\t\tthis.sortingOrder = (maxSortingOrder[0]?.maxSortingOrder ?? -1) + 1;\n\t}\n})\nexport class Vendor extends TimeStamps {\n\t@prop({ type: String, unique: true, index: true })\n\tpublic vendorId!: string;\n\n\t@prop({ required: true, type: String })\n\tpublic name!: string;\n\n\t@prop({ required: true, type: String })\n\tpublic ownerName!: string;\n\n\t@prop({ required: true, type: String })\n\tpublic email!: string;\n\n\t@prop({ unique: true, type: String })\n\tpublic slug?: string;\n\n\t@prop({ required: true, ref: () => VendorParent })\n\tpublic parent: Ref<VendorParent>;\n\n\t@prop({ required: true, ref: () => Service })\n\tpublic service: Ref<Service>;\n\n\t@prop({ required: true, type: String, enum: ServiceType })\n\tpublic serviceType!: ServiceType\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 })\n\tpublic phoneNumber!: string;\n\n\t@prop({ required: true, type: String })\n\tpublic userPhoneNumber!: string;\n\n\t@prop({ type: () => [String], default: [] })\n\tpublic additionalPhoneNumbers?: string[];\n\n\t@prop({ required: true, type: Address })\n\tpublic address!: Address;\n\n\t@prop({ required: true, ref: () => Zone, type: () => [String] })\n\tpublic zone!: Ref<Zone>[];\n\n\t@prop({ type: String })\n\tpublic logo?: string;\n\n\t@prop({ type: String })\n\tpublic banner?: string;\n\n\t@prop({ type: ShopDocument })\n\tpublic document?: ShopDocument;\n\n\t@prop({ type: () => [StartEndTime], default: [] })\n\tpublic vendorActiveTimingsOfCurrentDate?: StartEndTime[];\n\n\t@prop({ ref: () => Tag, default: [] })\n\tpublic tags?: Ref<Tag>[];\n\n\t@prop({ type: Number })\n\tpublic sortingOrder?: number;\n\n\t@prop({ default: 0, type: () => Number })\n\tpublic avgRating?: number;\n\n\t@prop({ type: Number, default: 1, min: 1, max: 4 })\n\tpublic priceRange?: number;\n\n\t@prop({ required: true, type: Boolean })\n\tpublic isBeirutAuthentic!: boolean;\n\n\t@prop({ required: true, type: Boolean })\n\tpublic isVisibleToUser!: boolean;\n\n\t@prop({ default: 0, type: () => Number })\n\tpublic ordersCount?: number;\n\n\t@prop({ default: 0, type: () => Number })\n\tpublic customersCount?: number;\n\n\t@prop({ type: String, maxlength: 100 })\n\tpublic bobContactName?: string;\n\n\t@prop({ type: String, maxlength: 15 })\n\tpublic bobContactPhoneNumber?: string;\n\n\t@prop({ type: () => ServiceOrderSettings })\n\tpublic orderSettings?: ServiceOrderSettings;\n\n\t@prop({ type: WorkHourSetting })\n\tpublic workHourSetting?: WorkHourSetting;\n}\n"]}
1
+ {"version":3,"file":"vendor.model.js","sourceRoot":"/","sources":["libraries/mongo/models/vendor.model.ts"],"names":[],"mapp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,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,uBAAuB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC;IACnG,IAAA,eAAG,EAAS,MAAM,EAAE,KAAK;QACzB,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YAChB,IAAI,CAAC,QAAQ,GAAG,MAAM,IAAA,yBAAU,EAAC,eAAY,EAAE,kBAAW,CAAC,MAAM,CAAC,CAAC;QACpE,CAAC;IACF,CAAC,CAAC;GACW,MAAM,CAqElB","sourcesContent":["import { modelOptions, prop, Ref, Severity, Index, pre } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { CounterType, ServiceType, Status } from '../../../utilities/enum';\nimport { ShopDocument } from './embedded/shop-document.model';\nimport { Address } from './shared/address.model';\nimport { WorkHourSetting } from './shared/work-hour.model';\nimport { Zone } from './zone.model';\nimport { VendorParent, CounterModel } from '.';\nimport { ServiceOrderSettings } from './embedded/service-order-settings.model';\nimport { generateId } from '../../../utilities/id-generator';\n\n@modelOptions({\n\tschemaOptions: { collection: 'vendors' },\n\toptions: { allowMixed: Severity.ALLOW },\n})\n@Index({ name: 1, serviceType: 1 }, { unique: true, partialFilterExpression: { deletedAt: null } })\n@Index({ parent: 1, status: 1, isVisibleToUser: 1, deletedAt: 1 })\n@Index({ serviceType: 1, zones: 1 }, { unique: true, partialFilterExpression: { deletedAt: null } })\n@pre<Vendor>('save', async function () {\n\tif (this.isNew) {\n\t\tthis.vendorId = await generateId(CounterModel, CounterType.VENDOR);\n\t}\n})\nexport class Vendor extends TimeStamps {\n\t@prop({ required: true, type: String, unique: true, index: true })\n\tpublic vendorId!: string;\n\n\t@prop({ required: true, type: String })\n\tpublic name!: string;\n\n\t@prop({ required: true, type: String })\n\tpublic ownerName!: string;\n\n\t@prop({ required: true, type: String })\n\tpublic email!: string;\n\n\t@prop({ required: true, ref: () => VendorParent })\n\tpublic parent: Ref<VendorParent>;\n\n\t@prop({ type: String, enum: ServiceType })\n\tpublic serviceType?: ServiceType;\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 })\n\tpublic phoneNumber!: string;\n\n\t@prop({ required: true, type: String })\n\tpublic userPhoneNumber!: string;\n\n\t@prop({ type: () => [String], default: [] })\n\tpublic additionalPhoneNumbers?: string[];\n\n\t@prop({ required: true, type: Address })\n\tpublic address!: Address;\n\n\t@prop({ required: true, ref: () => Zone })\n\tpublic zones!: Ref<Zone>[];\n\n\t@prop({ type: String })\n\tpublic logo?: string;\n\n\t@prop({ type: String })\n\tpublic banner?: string;\n\n\t@prop({ type: ShopDocument })\n\tpublic document?: ShopDocument;\n\n\t@prop({ default: 0, type: () => Number })\n\tpublic avgRating?: number;\n\n\t@prop({ required: true, type: Boolean })\n\tpublic isVisibleToUser!: boolean;\n\n\t@prop({ default: 0, type: () => Number })\n\tpublic ordersCount?: number;\n\n\t@prop({ default: 0, type: () => Number })\n\tpublic customersCount?: number;\n\n\t@prop({ type: String, maxlength: 100 })\n\tpublic bobContactName?: string;\n\n\t@prop({ type: String, maxlength: 15 })\n\tpublic bobContactPhoneNumber?: string;\n\n\t@prop({ type: () => ServiceOrderSettings })\n\tpublic orderSettings?: ServiceOrderSettings;\n\n\t@prop({ type: WorkHourSetting })\n\tpublic workHourSetting?: WorkHourSetting;\n}\n"]}
@@ -5,10 +5,10 @@ interface AuthOptions {
5
5
  autoRefresh?: boolean;
6
6
  }
7
7
  export declare function createAuthenticatedProcedure(options: AuthOptions): import("@trpc/server").TRPCProcedureBuilder<import("../context").LyxaHTTPContext, object, {
8
- req: import("http").IncomingMessage;
9
8
  res: import("http").ServerResponse<import("http").IncomingMessage>;
10
9
  tokenType: TokenType | undefined;
11
10
  entity: import("../context").EntityContext | undefined;
11
+ req: import("http").IncomingMessage;
12
12
  requestId: string | undefined;
13
13
  usedRefreshToken: boolean | undefined;
14
14
  tokenRenewed: boolean | undefined;
@@ -4,10 +4,10 @@ interface RoleProtectedOptions {
4
4
  allowedRoles: string[];
5
5
  }
6
6
  export declare function createRoleProtectedProcedure(options: RoleProtectedOptions): import("@trpc/server").TRPCProcedureBuilder<import("../context").LyxaHTTPContext, object, {
7
- req: import("http").IncomingMessage;
8
7
  res: import("http").ServerResponse<import("http").IncomingMessage>;
9
8
  tokenType: import("../../auth").TokenType | undefined;
10
9
  entity: import("../context").EntityContext | undefined;
10
+ req: import("http").IncomingMessage;
11
11
  requestId: string | undefined;
12
12
  usedRefreshToken: boolean | undefined;
13
13
  tokenRenewed: boolean | undefined;
@@ -3,10 +3,10 @@ interface PhoneVerifiedOptions {
3
3
  entityTypes: AuthEntityType[];
4
4
  }
5
5
  export declare function createPhoneVerifiedProcedure(options: PhoneVerifiedOptions): import("@trpc/server").TRPCProcedureBuilder<import("../context").LyxaHTTPContext, object, {
6
- req: import("http").IncomingMessage;
7
6
  res: import("http").ServerResponse<import("http").IncomingMessage>;
8
7
  tokenType: import("../../auth").TokenType | undefined;
9
8
  entity: import("../context").EntityContext | undefined;
9
+ req: import("http").IncomingMessage;
10
10
  requestId: string | undefined;
11
11
  usedRefreshToken: boolean | undefined;
12
12
  tokenRenewed: boolean | undefined;
@@ -5,10 +5,10 @@ interface AuthOptions {
5
5
  autoRefresh?: boolean;
6
6
  }
7
7
  export declare function publicUserDecoder(options: AuthOptions): import("@trpc/server").TRPCProcedureBuilder<import("../context").LyxaHTTPContext, object, {
8
- req: import("http").IncomingMessage;
9
8
  res: import("http").ServerResponse<import("http").IncomingMessage>;
10
9
  tokenType: TokenType | undefined;
11
10
  entity: import("../context").EntityContext | undefined;
11
+ req: import("http").IncomingMessage;
12
12
  requestId: string | undefined;
13
13
  usedRefreshToken: boolean | undefined;
14
14
  tokenRenewed: boolean | undefined;
@@ -22,7 +22,7 @@ Perfect for sharing types between frontend and backend applications.
22
22
 
23
23
  ## Version
24
24
 
25
- Version: 1.3.231
25
+ Version: 1.3.252
26
26
 
27
27
  ## Dependencies
28
28
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lyxa.ai/types",
3
- "version": "1.3.231",
3
+ "version": "1.3.252",
4
4
  "description": "Lyxa type definitions and validation schemas for both frontend and backend",
5
5
  "author": "elie <42282499+Internalizable@users.noreply.github.com>",
6
6
  "license": "MIT",
@@ -395,7 +395,8 @@ export declare enum CounterType {
395
395
  TICKET = "ticket",
396
396
  VENDOR = "vendor",
397
397
  BOOKING = "booking",
398
- TEAM_MEMBER = "team_member"
398
+ TEAM_MEMBER = "team_member",
399
+ VENDOR_PARENT = "vendor_parent"
399
400
  }
400
401
  export declare enum FaqAccountType {
401
402
  USER = "user",
@@ -890,16 +891,14 @@ export declare enum ActionType {
890
891
  }
891
892
  export declare enum ServiceType {
892
893
  CLEANING = "cleaning",
893
- FURNITURE_CLEANING = "furniture_cleaning",
894
- HOME_CLEANING = "home_cleaning",
895
- DEEP_CLEANING = "deep_cleaning",
896
- PEST_CONTROL = "pest_control",
897
894
  LAUNDRY = "laundry",
898
- REGULAR_WASH = "regular_wash",
899
- DRY_CLEANING = "dry_cleaning",
900
- IRONING = "ironing",
901
895
  SALOON = "saloon"
902
896
  }
897
+ export declare enum SubServiceType {
898
+ FURNITURE_CLEANING = "furniture_cleaning",
899
+ HOME_CLEANING = "home_cleaning",
900
+ DEEP_CLEANING = "deep_cleaning"
901
+ }
903
902
  export declare enum UploadState {
904
903
  ACTIVE = "active",
905
904
  COMPLETED = "completed",