@lyxa.ai/core 1.1.4 → 1.1.6

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 (22) hide show
  1. package/dist/libraries/mongo/models/embedded/chat-participant.model.d.ts +2 -0
  2. package/dist/libraries/mongo/models/embedded/chat-participant.model.js +6 -0
  3. package/dist/libraries/mongo/models/embedded/chat-participant.model.js.map +1 -1
  4. package/dist/libraries/mongo/models/embedded/{capacity-settings.model.d.ts → cleaning-service-settings.model.d.ts} +5 -5
  5. package/dist/libraries/mongo/models/embedded/{capacity-settings.model.js → cleaning-service-settings.model.js} +18 -21
  6. package/dist/libraries/mongo/models/embedded/cleaning-service-settings.model.js.map +1 -0
  7. package/dist/libraries/mongo/models/shared/entity-ref.model.d.ts +23 -0
  8. package/dist/libraries/mongo/models/shared/entity-ref.model.js +102 -0
  9. package/dist/libraries/mongo/models/shared/entity-ref.model.js.map +1 -0
  10. package/dist/libraries/mongo/models/user.model.d.ts +1 -1
  11. package/dist/libraries/mongo/models/vendor.model.d.ts +2 -2
  12. package/dist/libraries/mongo/models/vendor.model.js +5 -5
  13. package/dist/libraries/mongo/models/vendor.model.js.map +1 -1
  14. package/dist/libraries/trpc/middlewares/createSocketSubscriptionProcedure.d.ts +2 -2
  15. package/dist/types/README.md +1 -1
  16. package/dist/types/package.json +1 -1
  17. package/dist/types/utilities/validation/common-validation.d.ts +78 -2
  18. package/dist/types/utilities/validation/global-validation.d.ts +38 -14
  19. package/dist/utilities/validation/common-validation.d.ts +78 -2
  20. package/dist/utilities/validation/global-validation.d.ts +38 -14
  21. package/package.json +1 -1
  22. package/dist/libraries/mongo/models/embedded/capacity-settings.model.js.map +0 -1
@@ -5,9 +5,11 @@ import { Shop } from '../shop.model';
5
5
  import { Rider } from '../rider.model';
6
6
  import { UserRef } from '../../../../utilities/enum';
7
7
  import { Message } from '../message.model';
8
+ import { EntityRef } from '../shared/entity-ref.model';
8
9
  export declare class ChatParticipant {
9
10
  ref: Ref<User | Admin | Shop | Rider>;
10
11
  type: UserRef;
12
+ entity: EntityRef;
11
13
  joinedAt?: Date;
12
14
  lastReadAt?: Date;
13
15
  isActive?: boolean;
@@ -13,9 +13,11 @@ exports.ChatParticipant = void 0;
13
13
  const typegoose_1 = require("@typegoose/typegoose");
14
14
  const enum_1 = require("../../../../utilities/enum");
15
15
  const message_model_1 = require("../message.model");
16
+ const entity_ref_model_1 = require("../shared/entity-ref.model");
16
17
  class ChatParticipant {
17
18
  ref;
18
19
  type;
20
+ entity;
19
21
  joinedAt;
20
22
  lastReadAt;
21
23
  isActive;
@@ -33,6 +35,10 @@ __decorate([
33
35
  (0, typegoose_1.prop)({ required: true, enum: enum_1.UserRef }),
34
36
  __metadata("design:type", String)
35
37
  ], ChatParticipant.prototype, "type", void 0);
38
+ __decorate([
39
+ (0, typegoose_1.prop)({ required: true, type: () => entity_ref_model_1.EntityRef }),
40
+ __metadata("design:type", entity_ref_model_1.EntityRef)
41
+ ], ChatParticipant.prototype, "entity", void 0);
36
42
  __decorate([
37
43
  (0, typegoose_1.prop)({ type: Date, default: () => new Date() }),
38
44
  __metadata("design:type", Date)
@@ -1 +1 @@
1
- {"version":3,"file":"chat-participant.model.js","sourceRoot":"/","sources":["libraries/mongo/models/embedded/chat-participant.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAiD;AAKjD,qDAAqD;AACrD,oDAA2C;AAE3C,MAAa,eAAe;IAE3B,GAAG,CAAoC;IAGvC,IAAI,CAAW;IAGf,QAAQ,CAAQ;IAGhB,UAAU,CAAQ;IAGlB,QAAQ,CAAW;IAGnB,eAAe,CAAgB;IAG/B,iBAAiB,CAAQ;IAGzB,WAAW,CAAU;IAGrB,MAAM,CAAQ;CACd;AA3BD,0CA2BC;AAzBA;IADC,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;;4CACH;AAGvC;IADC,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,cAAO,EAAE,CAAC;;6CACzB;AAGf;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,EAAE,CAAC;8BACrC,IAAI;iDAAC;AAGhB;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;8BACR,IAAI;mDAAC;AAGlB;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;iDACpB;AAGnB;IADC,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,uBAAO,EAAE,CAAC;;wDACE;AAG/B;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;8BACD,IAAI;0DAAC;AAGzB;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;oDACd;AAGrB;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;8BACZ,IAAI;+CAAC","sourcesContent":["import { prop, Ref } from '@typegoose/typegoose';\nimport { User } from '../user.model';\nimport { Admin } from '../admin.model';\nimport { Shop } from '../shop.model';\nimport { Rider } from '../rider.model';\nimport { UserRef } from '../../../../utilities/enum';\nimport { Message } from '../message.model';\n\nexport class ChatParticipant {\n\t@prop({ required: true, refPath: 'type' })\n\tref!: Ref<User | Admin | Shop | Rider>;\n\n\t@prop({ required: true, enum: UserRef })\n\ttype!: UserRef;\n\n\t@prop({ type: Date, default: () => new Date() })\n\tjoinedAt?: Date;\n\n\t@prop({ type: Date })\n\tlastReadAt?: Date;\n\n\t@prop({ type: Boolean, default: true })\n\tisActive?: boolean;\n\n\t@prop({ ref: () => Message })\n\tlastReadMessage?: Ref<Message>;\n\n\t@prop({ type: Date })\n\tlastReadMessageAt?: Date;\n\n\t@prop({ type: Number, default: 0 })\n\tunreadCount?: number;\n\n\t@prop({ type: Date })\n\tleftAt?: Date;\n}\n"]}
1
+ {"version":3,"file":"chat-participant.model.js","sourceRoot":"/","sources":["libraries/mongo/models/embedded/chat-participant.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAiD;AAKjD,qDAAqD;AACrD,oDAA2C;AAC3C,iEAAuD;AAEvD,MAAa,eAAe;IAE3B,GAAG,CAAoC;IAGvC,IAAI,CAAW;IAGf,MAAM,CAAa;IAGnB,QAAQ,CAAQ;IAGhB,UAAU,CAAQ;IAGlB,QAAQ,CAAW;IAGnB,eAAe,CAAgB;IAG/B,iBAAiB,CAAQ;IAGzB,WAAW,CAAU;IAGrB,MAAM,CAAQ;CACd;AA9BD,0CA8BC;AA5BA;IADC,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;;4CACH;AAGvC;IADC,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,cAAO,EAAE,CAAC;;6CACzB;AAGf;IADC,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,4BAAS,EAAE,CAAC;8BACvC,4BAAS;+CAAC;AAGnB;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,EAAE,CAAC;8BACrC,IAAI;iDAAC;AAGhB;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;8BACR,IAAI;mDAAC;AAGlB;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;iDACpB;AAGnB;IADC,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,uBAAO,EAAE,CAAC;;wDACE;AAG/B;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;8BACD,IAAI;0DAAC;AAGzB;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;oDACd;AAGrB;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;8BACZ,IAAI;+CAAC","sourcesContent":["import { prop, Ref } from '@typegoose/typegoose';\nimport { User } from '../user.model';\nimport { Admin } from '../admin.model';\nimport { Shop } from '../shop.model';\nimport { Rider } from '../rider.model';\nimport { UserRef } from '../../../../utilities/enum';\nimport { Message } from '../message.model';\nimport { EntityRef } from '../shared/entity-ref.model';\n\nexport class ChatParticipant {\n\t@prop({ required: true, refPath: 'type' })\n\tref!: Ref<User | Admin | Shop | Rider>;\n\n\t@prop({ required: true, enum: UserRef })\n\ttype!: UserRef;\n\n\t@prop({ required: true, type: () => EntityRef })\n\tentity!: EntityRef;\n\n\t@prop({ type: Date, default: () => new Date() })\n\tjoinedAt?: Date;\n\n\t@prop({ type: Date })\n\tlastReadAt?: Date;\n\n\t@prop({ type: Boolean, default: true })\n\tisActive?: boolean;\n\n\t@prop({ ref: () => Message })\n\tlastReadMessage?: Ref<Message>;\n\n\t@prop({ type: Date })\n\tlastReadMessageAt?: Date;\n\n\t@prop({ type: Number, default: 0 })\n\tunreadCount?: number;\n\n\t@prop({ type: Date })\n\tleftAt?: Date;\n}\n"]}
@@ -5,18 +5,18 @@ declare class Services {
5
5
  service: Ref<Service>;
6
6
  numberOfProfessionals: number;
7
7
  }
8
- declare class Capacity {
8
+ declare class DailyAllocations {
9
9
  day: WeekDay;
10
10
  services: Services[];
11
11
  }
12
- declare class FurnitureCleaningConfiguration {
12
+ declare class FurnitureCleaningConfig {
13
13
  numberOfPackages: number;
14
14
  numberOfProfessionals: number;
15
15
  }
16
- export declare class CapacitySettings {
16
+ export declare class CleaningServiceSettings {
17
17
  slotBufferTime: number;
18
18
  slotInterval: number;
19
- capacity: Capacity[];
20
- furnitureCleaningConfig?: FurnitureCleaningConfiguration[];
19
+ dailyAllocations: DailyAllocations[];
20
+ furnitureCleaningConfig?: FurnitureCleaningConfig[];
21
21
  }
22
22
  export {};
@@ -9,7 +9,7 @@ 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.CapacitySettings = void 0;
12
+ exports.CleaningServiceSettings = void 0;
13
13
  const typegoose_1 = require("@typegoose/typegoose");
14
14
  const enum_1 = require("../../../../utilities/enum");
15
15
  class Services {
@@ -27,37 +27,37 @@ __decorate([
27
27
  }),
28
28
  __metadata("design:type", Number)
29
29
  ], Services.prototype, "numberOfProfessionals", void 0);
30
- class Capacity {
30
+ class DailyAllocations {
31
31
  day;
32
32
  services;
33
33
  }
34
34
  __decorate([
35
35
  (0, typegoose_1.prop)({ required: true, type: Number, enum: enum_1.WeekDay }),
36
36
  __metadata("design:type", Number)
37
- ], Capacity.prototype, "day", void 0);
37
+ ], DailyAllocations.prototype, "day", void 0);
38
38
  __decorate([
39
39
  (0, typegoose_1.prop)({ type: () => [Services] }),
40
40
  __metadata("design:type", Array)
41
- ], Capacity.prototype, "services", void 0);
42
- class FurnitureCleaningConfiguration {
41
+ ], DailyAllocations.prototype, "services", void 0);
42
+ class FurnitureCleaningConfig {
43
43
  numberOfPackages;
44
44
  numberOfProfessionals;
45
45
  }
46
46
  __decorate([
47
47
  (0, typegoose_1.prop)({ required: true }),
48
48
  __metadata("design:type", Number)
49
- ], FurnitureCleaningConfiguration.prototype, "numberOfPackages", void 0);
49
+ ], FurnitureCleaningConfig.prototype, "numberOfPackages", void 0);
50
50
  __decorate([
51
51
  (0, typegoose_1.prop)({ required: true }),
52
52
  __metadata("design:type", Number)
53
- ], FurnitureCleaningConfiguration.prototype, "numberOfProfessionals", void 0);
54
- let CapacitySettings = class CapacitySettings {
53
+ ], FurnitureCleaningConfig.prototype, "numberOfProfessionals", void 0);
54
+ class CleaningServiceSettings {
55
55
  slotBufferTime;
56
56
  slotInterval;
57
- capacity;
57
+ dailyAllocations;
58
58
  furnitureCleaningConfig;
59
- };
60
- exports.CapacitySettings = CapacitySettings;
59
+ }
60
+ exports.CleaningServiceSettings = CleaningServiceSettings;
61
61
  __decorate([
62
62
  (0, typegoose_1.prop)({
63
63
  min: 5,
@@ -65,7 +65,7 @@ __decorate([
65
65
  default: 5,
66
66
  }),
67
67
  __metadata("design:type", Number)
68
- ], CapacitySettings.prototype, "slotBufferTime", void 0);
68
+ ], CleaningServiceSettings.prototype, "slotBufferTime", void 0);
69
69
  __decorate([
70
70
  (0, typegoose_1.prop)({
71
71
  min: 30,
@@ -73,16 +73,13 @@ __decorate([
73
73
  default: 30,
74
74
  }),
75
75
  __metadata("design:type", Number)
76
- ], CapacitySettings.prototype, "slotInterval", void 0);
76
+ ], CleaningServiceSettings.prototype, "slotInterval", void 0);
77
77
  __decorate([
78
- (0, typegoose_1.prop)({ type: () => [Capacity] }),
78
+ (0, typegoose_1.prop)({ type: () => [DailyAllocations] }),
79
79
  __metadata("design:type", Array)
80
- ], CapacitySettings.prototype, "capacity", void 0);
80
+ ], CleaningServiceSettings.prototype, "dailyAllocations", void 0);
81
81
  __decorate([
82
- (0, typegoose_1.prop)({ type: () => [FurnitureCleaningConfiguration] }),
82
+ (0, typegoose_1.prop)({ type: () => [FurnitureCleaningConfig] }),
83
83
  __metadata("design:type", Array)
84
- ], CapacitySettings.prototype, "furnitureCleaningConfig", void 0);
85
- exports.CapacitySettings = CapacitySettings = __decorate([
86
- (0, typegoose_1.modelOptions)({ schemaOptions: { collection: 'capacitySettings' } })
87
- ], CapacitySettings);
88
- //# sourceMappingURL=capacity-settings.model.js.map
84
+ ], CleaningServiceSettings.prototype, "furnitureCleaningConfig", void 0);
85
+ //# sourceMappingURL=cleaning-service-settings.model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cleaning-service-settings.model.js","sourceRoot":"/","sources":["libraries/mongo/models/embedded/cleaning-service-settings.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA+D;AAC/D,qDAAqD;AAIrD,MAAM,QAAQ;IAEH,OAAO,CAAe;IAMtB,qBAAqB,CAAU;CACzC;AAPU;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yCACI;AAMtB;IAJN,IAAA,gBAAI,EAAC;QACF,QAAQ,EAAE,IAAI;QACd,IAAI,EAAE,MAAM;KACf,CAAC;;uDACoC;AAG1C,MAAM,gBAAgB;IAEX,GAAG,CAAW;IAGd,QAAQ,CAAa;CAC/B;AAJU;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,cAAO,EAAE,CAAC;;6CACjC;AAGd;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC;;kDACL;AAGhC,MAAM,uBAAuB;IAElB,gBAAgB,CAAU;IAG1B,qBAAqB,CAAU;CACzC;AAJU;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iEACQ;AAG1B;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sEACa;AAG1C,MAAa,uBAAuB;IAMzB,cAAc,CAAS;IAOvB,YAAY,CAAS;IAGrB,gBAAgB,CAAoB;IAGpC,uBAAuB,CAA4B;CAC7D;AApBD,0DAoBC;AAdU;IALN,IAAA,gBAAI,EAAC;QACF,GAAG,EAAE,CAAC;QACN,GAAG,EAAE,EAAE;QACP,OAAO,EAAE,CAAC;KACb,CAAC;;+DAC4B;AAOvB;IALN,IAAA,gBAAI,EAAC;QACF,GAAG,EAAE,EAAE;QACP,GAAG,EAAE,GAAG;QACR,OAAO,EAAE,EAAE;KACd,CAAC;;6DAC0B;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,gBAAgB,CAAC,EAAE,CAAC;;iEACE;AAGpC;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,uBAAuB,CAAC,EAAE,CAAC;;wEACU","sourcesContent":["import { modelOptions, prop, Ref } from '@typegoose/typegoose';\nimport { WeekDay } from '../../../../utilities/enum';\nimport { Service } from '../service.model';\n\n\nclass Services {\n @prop({ required: true })\n public service!: Ref<Service>\n\n @prop({\n required: true,\n type: Number,\n })\n public numberOfProfessionals!: number;\n}\n\nclass DailyAllocations {\n @prop({ required: true, type: Number, enum: WeekDay })\n public day!: WeekDay;\n\n @prop({ type: () => [Services] })\n public services!: Services[]\n}\n\nclass FurnitureCleaningConfig {\n @prop({ required: true })\n public numberOfPackages!: number;\n\n @prop({ required: true })\n public numberOfProfessionals!: number;\n}\n\nexport class CleaningServiceSettings {\n @prop({\n min: 5,\n max: 60,\n default: 5,\n })\n public slotBufferTime: number; // minutes\n\n @prop({\n min: 30,\n max: 120,\n default: 30,\n })\n public slotInterval: number; // minutes\n\n @prop({ type: () => [DailyAllocations] })\n public dailyAllocations: DailyAllocations[]\n\n @prop({ type: () => [FurnitureCleaningConfig] })\n public furnitureCleaningConfig?: FurnitureCleaningConfig[]\n}\n"]}
@@ -0,0 +1,23 @@
1
+ import { DocumentType, Ref } from '@typegoose/typegoose';
2
+ import { Admin } from '../admin.model';
3
+ import { Shop } from '../shop.model';
4
+ import { User } from '../user.model';
5
+ import { Rider } from '../rider.model';
6
+ import { UserRef } from '../../../../utilities/enum';
7
+ import { Types } from 'mongoose';
8
+ type RefModel = User | Admin | Shop | Rider;
9
+ export interface EntityData {
10
+ id: Types.ObjectId;
11
+ type: UserRef;
12
+ name: string;
13
+ profilePicture?: string;
14
+ email?: string;
15
+ phone?: string;
16
+ }
17
+ export declare class EntityRef {
18
+ ref: Ref<RefModel>;
19
+ type: UserRef;
20
+ getProfile(this: DocumentType<EntityRef>): Promise<EntityData | null>;
21
+ static mapToProfile(entity: DocumentType<RefModel>, type: UserRef): EntityData;
22
+ }
23
+ export {};
@@ -0,0 +1,102 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.EntityRef = void 0;
13
+ const typegoose_1 = require("@typegoose/typegoose");
14
+ const enum_1 = require("../../../../utilities/enum");
15
+ class EntityRef {
16
+ ref;
17
+ type;
18
+ async getProfile() {
19
+ if (!this.populated('ref')) {
20
+ await this.populate('ref');
21
+ }
22
+ const entity = this.ref;
23
+ if (!entity)
24
+ return null;
25
+ if (this.type === enum_1.UserRef.USER) {
26
+ const user = entity;
27
+ if (user.coreUser && !user.populated('coreUser')) {
28
+ await user.populate('coreUser');
29
+ }
30
+ }
31
+ if (this.type === enum_1.UserRef.ADMIN) {
32
+ const admin = entity;
33
+ if (admin.accessControl && !admin.populated('accessControl')) {
34
+ await admin.populate('accessControl');
35
+ }
36
+ }
37
+ return EntityRef.mapToProfile(entity, this.type);
38
+ }
39
+ static mapToProfile(entity, type) {
40
+ const mappers = {
41
+ [enum_1.UserRef.USER]: (e) => ({
42
+ id: e._id,
43
+ name: e.coreUser?.name || 'Unknown User',
44
+ profilePicture: e.coreUser?.profilePhoto,
45
+ email: e.coreUser?.email,
46
+ phone: e.phoneNumber,
47
+ type: enum_1.UserRef.USER,
48
+ }),
49
+ [enum_1.UserRef.ADMIN]: (e) => ({
50
+ id: e._id,
51
+ name: e.name,
52
+ profilePicture: e.profilePhoto,
53
+ email: e.accessControl.email,
54
+ phone: e.phoneNumber,
55
+ type: enum_1.UserRef.ADMIN,
56
+ }),
57
+ [enum_1.UserRef.SHOP]: (e) => ({
58
+ id: e._id,
59
+ name: e.name,
60
+ profilePicture: e.logo,
61
+ email: e.email,
62
+ phone: e.phoneNumber,
63
+ type: enum_1.UserRef.SHOP,
64
+ }),
65
+ [enum_1.UserRef.RIDER]: (e) => ({
66
+ id: e._id,
67
+ name: e.name,
68
+ profilePicture: e.image,
69
+ email: e.email,
70
+ phone: e.number,
71
+ type: enum_1.UserRef.RIDER,
72
+ }),
73
+ [enum_1.UserRef.VENDOR]: (e) => ({
74
+ id: e._id,
75
+ name: e.name,
76
+ profilePicture: e.logo,
77
+ email: e.email,
78
+ phone: e.phoneNumber,
79
+ type: enum_1.UserRef.VENDOR,
80
+ }),
81
+ [enum_1.UserRef.PROFESSIONAL]: (e) => ({
82
+ id: e._id,
83
+ name: e.name,
84
+ profilePicture: e.image,
85
+ email: e.email,
86
+ phone: e.phoneNumber,
87
+ type: enum_1.UserRef.PROFESSIONAL,
88
+ }),
89
+ };
90
+ return mappers[type](entity);
91
+ }
92
+ }
93
+ exports.EntityRef = EntityRef;
94
+ __decorate([
95
+ (0, typegoose_1.prop)({ required: true, refPath: 'type' }),
96
+ __metadata("design:type", Object)
97
+ ], EntityRef.prototype, "ref", void 0);
98
+ __decorate([
99
+ (0, typegoose_1.prop)({ required: true, enum: enum_1.UserRef }),
100
+ __metadata("design:type", String)
101
+ ], EntityRef.prototype, "type", void 0);
102
+ //# sourceMappingUR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M;gBACf,IAAI,EAAE,cAAO,CAAC,KAAK;aACnB,CAAC;YAEF,CAAC,cAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAuB,EAAE,EAAE,CAAC,CAAC;gBAC/C,EAAE,EAAE,CAAC,CAAC,GAAG;gBACT,IAAI,EAAE,CAAC,CAAC,IAAI;gBACZ,cAAc,EAAE,CAAC,CAAC,IAAI;gBACtB,KAAK,EAAE,CAAC,CAAC,KAAK;gBACd,KAAK,EAAE,CAAC,CAAC,WAAW;gBACpB,IAAI,EAAE,cAAO,CAAC,MAAM;aACpB,CAAC;YAEF,CAAC,cAAO,CAAC,YAAY,CAAC,EAAE,CAAC,CAA6B,EAAE,EAAE,CAAC,CAAC;gBAC3D,EAAE,EAAE,CAAC,CAAC,GAAG;gBACT,IAAI,EAAE,CAAC,CAAC,IAAI;gBACZ,cAAc,EAAE,CAAC,CAAC,KAAK;gBACvB,KAAK,EAAE,CAAC,CAAC,KAAK;gBACd,KAAK,EAAE,CAAC,CAAC,WAAW;gBACpB,IAAI,EAAE,cAAO,CAAC,YAAY;aAC1B,CAAC;SACF,CAAC;QAEF,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,MAAa,CAAC,CAAC;IACrC,CAAC;CACD;AA3FD,8BA2FC;AAzFA;IADC,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;;sCACtB;AAGpB;IADC,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,cAAO,EAAE,CAAC;;uCACzB","sourcesContent":["import { DocumentType, prop, Ref } from '@typegoose/typegoose';\nimport { Admin } from '../admin.model';\nimport { Shop } from '../shop.model';\nimport { User } from '../user.model';\nimport { Rider } from '../rider.model';\nimport { CoreUser } from '../core-user.model';\nimport { UserRef } from '../../../../utilities/enum';\nimport { AdminAccessControl } from '../admin-access-control.model';\nimport { Vendor } from '../vendor.model';\nimport { Professional } from '../professional.model';\nimport { Types } from 'mongoose';\n\ntype RefModel = User | Admin | Shop | Rider;\ntype PopulatedUser = User & { coreUser: DocumentType<CoreUser> };\ntype PopulatedAdmin = Admin & { accessControl: DocumentType<AdminAccessControl> };\n\nexport interface EntityData {\n\tid: Types.ObjectId;\n\ttype: UserRef;\n\tname: string;\n\tprofilePicture?: string;\n\temail?: string;\n\tphone?: string;\n}\n\nexport class EntityRef {\n\t@prop({ required: true, refPath: 'type' })\n\tref!: Ref<RefModel>;\n\n\t@prop({ required: true, enum: UserRef })\n\ttype!: UserRef;\n\n\tasync getProfile(this: DocumentType<EntityRef>): Promise<EntityData | null> {\n\t\tif (!this.populated('ref')) {\n\t\t\tawait this.populate('ref');\n\t\t}\n\n\t\tconst entity = this.ref as DocumentType<RefModel>;\n\t\tif (!entity) return null;\n\n\t\tif (this.type === UserRef.USER) {\n\t\t\tconst user = entity as DocumentType<User>;\n\t\t\tif (user.coreUser && !user.populated('coreUser')) {\n\t\t\t\tawait user.populate('coreUser');\n\t\t\t}\n\t\t}\n\n\t\tif (this.type === UserRef.ADMIN) {\n\t\t\tconst admin = entity as DocumentType<Admin>;\n\t\t\tif (admin.accessControl && !admin.populated('accessControl')) {\n\t\t\t\tawait admin.populate('accessControl');\n\t\t\t}\n\t\t}\n\n\t\treturn EntityRef.mapToProfile(entity, this.type);\n\t}\n\n\tstatic mapToProfile(entity: DocumentType<RefModel>, type: UserRef): EntityData {\n\t\tconst mappers: Record<UserRef, (e: any) => EntityData> = {\n\t\t\t[UserRef.USER]: (e: DocumentType<PopulatedUser>) => ({\n\t\t\t\tid: e._id,\n\t\t\t\tname: e.coreUser?.name || 'Unknown User',\n\t\t\t\tprofilePicture: e.coreUser?.profilePhoto,\n\t\t\t\temail: e.coreUser?.email,\n\t\t\t\tphone: e.phoneNumber,\n\t\t\t\ttype: UserRef.USER,\n\t\t\t}),\n\n\t\t\t[UserRef.ADMIN]: (e: DocumentType<PopulatedAdmin>) => ({\n\t\t\t\tid: e._id,\n\t\t\t\tname: e.name,\n\t\t\t\tprofilePicture: e.profilePhoto,\n\t\t\t\temail: e.accessControl.email,\n\t\t\t\tphone: e.phoneNumber,\n\t\t\t\ttype: UserRef.ADMIN,\n\t\t\t}),\n\n\t\t\t[UserRef.SHOP]: (e: DocumentType<Shop>) => ({\n\t\t\t\tid: e._id,\n\t\t\t\tname: e.name,\n\t\t\t\tprofilePicture: e.logo,\n\t\t\t\temail: e.email,\n\t\t\t\tphone: e.phoneNumber,\n\t\t\t\ttype: UserRef.SHOP,\n\t\t\t}),\n\n\t\t\t[UserRef.RIDER]: (e: DocumentType<Rider>) => ({\n\t\t\t\tid: e._id,\n\t\t\t\tname: e.name,\n\t\t\t\tprofilePicture: e.image,\n\t\t\t\temail: e.email,\n\t\t\t\tphone: e.number,\n\t\t\t\ttype: UserRef.RIDER,\n\t\t\t}),\n\n\t\t\t[UserRef.VENDOR]: (e: DocumentType<Vendor>) => ({\n\t\t\t\tid: e._id,\n\t\t\t\tname: e.name,\n\t\t\t\tprofilePicture: e.logo,\n\t\t\t\temail: e.email,\n\t\t\t\tphone: e.phoneNumber,\n\t\t\t\ttype: UserRef.VENDOR,\n\t\t\t}),\n\n\t\t\t[UserRef.PROFESSIONAL]: (e: DocumentType<Professional>) => ({\n\t\t\t\tid: e._id,\n\t\t\t\tname: e.name,\n\t\t\t\tprofilePicture: e.image,\n\t\t\t\temail: e.email,\n\t\t\t\tphone: e.phoneNumber,\n\t\t\t\ttype: UserRef.PROFESSIONAL,\n\t\t\t}),\n\t\t};\n\n\t\treturn mappers[type](entity as any);\n\t}\n}\n"]}
@@ -31,7 +31,7 @@ export declare class User extends TimeStamps {
31
31
  isPhoneVerified?: boolean;
32
32
  onlineStatus?: OnlineStatus;
33
33
  fcmTokens?: string[];
34
- static updateWallet(this: ReturnModelType<typeof User>, userId: string, amount: number): Promise<(import("mongoose").Document<unknown, import("@typegoose/typegoose/lib/types").BeAnObject, User, import("@typegoose/typegoose/lib/types").BeAnyObject, {}> & Omit<User & {
34
+ static updateWallet(this: ReturnModelType<typeof User>, userId: string, amount: number): Promise<(import("mongoose").Document<unknown, import("@typegoose/typegoose/lib/types").BeAnObject, User, import("@typegoose/typegoose/lib/types").BeAnyObject> & Omit<User & {
35
35
  _id: import("mongoose").Types.ObjectId;
36
36
  } & {
37
37
  __v: number;
@@ -9,7 +9,7 @@ import { Zone } from './zone.model';
9
9
  import { VendorParent } from '.';
10
10
  import { Service } from "./service.model";
11
11
  import { ServiceOrderSettings } from './embedded/service-order-settings.model';
12
- import { CapacitySettings } from './embedded/capacity-settings.model';
12
+ import { CleaningServiceSettings } from './embedded/cleaning-service-settings.model';
13
13
  export declare class Vendor extends TimeStamps {
14
14
  name: string;
15
15
  ownerName: string;
@@ -37,6 +37,6 @@ export declare class Vendor extends TimeStamps {
37
37
  ordersCount?: number;
38
38
  customersCount?: number;
39
39
  orderSettings?: ServiceOrderSettings;
40
- capacitySettings?: CapacitySettings;
40
+ cleaningServiceSettings?: CleaningServiceSettings;
41
41
  workHourSetting?: WorkHourSetting;
42
42
  }
@@ -25,7 +25,7 @@ const _1 = require(".");
25
25
  const slugify_1 = __importDefault(require("slugify"));
26
26
  const service_model_1 = require("./service.model");
27
27
  const service_order_settings_model_1 = require("./embedded/service-order-settings.model");
28
- const capacity_settings_model_1 = require("./embedded/capacity-settings.model");
28
+ const cleaning_service_settings_model_1 = require("./embedded/cleaning-service-settings.model");
29
29
  let Vendor = class Vendor extends defaultClasses_1.TimeStamps {
30
30
  name;
31
31
  ownerName;
@@ -53,7 +53,7 @@ let Vendor = class Vendor extends defaultClasses_1.TimeStamps {
53
53
  ordersCount;
54
54
  customersCount;
55
55
  orderSettings;
56
- capacitySettings;
56
+ cleaningServiceSettings;
57
57
  workHourSetting;
58
58
  };
59
59
  exports.Vendor = Vendor;
@@ -162,9 +162,9 @@ __decorate([
162
162
  __metadata("design:type", service_order_settings_model_1.ServiceOrderSettings)
163
163
  ], Vendor.prototype, "orderSettings", void 0);
164
164
  __decorate([
165
- (0, typegoose_1.prop)({ type: () => capacity_settings_model_1.CapacitySettings }),
166
- __metadata("design:type", capacity_settings_model_1.CapacitySettings)
167
- ], Vendor.prototype, "capacitySettings", void 0);
165
+ (0, typegoose_1.prop)({ type: () => cleaning_service_settings_model_1.CleaningServiceSettings }),
166
+ __metadata("design:type", cleaning_service_settings_model_1.CleaningServiceSettings)
167
+ ], Vendor.prototype, "cleaningServiceSettings", void 0);
168
168
  __decorate([
169
169
  (0, typegoose_1.prop)({ type: work_hour_model_1.WorkHourSetting }),
170
170
  __metadata("design:type", work_hour_model_1.WorkHourSetting)
@@ -1 +1 @@
1
- {"version":3,"file":"vendor.model.js","sourceRoot":"/","sources":["libraries/mongo/models/vendor.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,oDAAqF;AACrF,4EAAqE;AACrE,kDAAiD;AACjD,wEAA8D;AAC9D,0DAAiD;AACjD,8DAAyE;AACzE,2CAAkC;AAClC,6CAAoC;AACpC,wBAA8C;AAC9C,sDAA8B;AAC9B,mDAA0C;AAC1C,0FAA+E;AAC/E,gFAAsE;AA6C/D,IAAM,MAAM,GAAZ,MAAM,MAAO,SAAQ,2BAAU;IAE9B,IAAI,CAAU;IAGd,SAAS,CAAU;IAGnB,KAAK,CAAU;IAGf,IAAI,CAAU;IAGd,MAAM,CAAoB;IAG1B,OAAO,CAAc;IAGrB,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,eAAe,CAAW;IAG1B,YAAY,CAAU;IAGtB,0BAA0B,CAAW;IAGrC,sBAAsB,CAAU;IAGhC,2BAA2B,CAAW;IAGtC,SAAS,CAAU;IAGnB,WAAW,CAAS;IAGpB,cAAc,CAAS;IAGvB,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severity, Index, pre } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { 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 } from '.';\nimport slugify from 'slugify';\nimport { Service } from \"./service.model\";\nimport { ServiceOrderSettings } from './embedded/service-order-settings.model';\nimport { CapacitySettings } from './embedded/capacity-settings.model';\n\n@modelOptions({\n\tschemaOptions: { collection: 'vendors' },\n\toptions: { allowMixed: Severity.ALLOW },\n})\n@Index({ name: 1, itemType: 1 }, { unique: true, partialFilterExpression: { deletedAt: null } })\n@Index({ parent: 1, status: 1, isVisibleToUser: 1, deletedAt: 1 })\n@pre<Vendor>('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 VendorModel.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\ttry {\n\t\tif (this.isNew) {\n\t\t\tconst baseSlug = slugify(this.name, { lower: true, strict: true });\n\t\t\tlet slug = baseSlug;\n\t\t\tlet count = 0;\n\t\t\twhile (await VendorModel.exists({ slug })) {\n\t\t\t\tcount++;\n\t\t\t\tslug = `${baseSlug}-${count}`;\n\t\t\t}\n\t\t\tthis.slug = slug;\n\t\t}\n\t\tnext();\n\t} catch (error) {\n\t\tnext(error as Error);\n\t}\n\tnext();\n})\nexport class Vendor extends TimeStamps {\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: 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({ required: true, type: Boolean })\n\tpublic isVisibleToUser!: boolean;\n\n\t@prop({ type: Number })\n\tpublic sortingOrder?: number;\n\n\t@prop({ required: false, type: () => Boolean })\n\tpublic isFavouriteCategoryVisible?: boolean;\n\n\t@prop({ required: false, type: () => String })\n\tpublic favouriteCategoryTitle?: string;\n\n\t@prop({ required: false, type: () => Boolean })\n\tpublic isBestSellerCategoryVisible?: boolean;\n\n\t@prop({ default: 0, type: () => Number })\n\tpublic avgRating?: number;\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: () => ServiceOrderSettings })\n\tpublic orderSettings?: ServiceOrderSettings\n\n\t@prop({type: ()=> CapacitySettings})\n\tpublic capacitySettings?: CapacitySettings\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":[],"mappings":";;;;;;;;;;;;;;;AAAA,oDAAqF;AACrF,4EAAqE;AACrE,kDAAiD;AACjD,wEAA8D;AAC9D,0DAAiD;AACjD,8DAAyE;AACzE,2CAAkC;AAClC,6CAAoC;AACpC,wBAA8C;AAC9C,sDAA8B;AAC9B,mDAA0C;AAC1C,0FAA+E;AAC/E,gGAAqF;AA6C9E,IAAM,MAAM,GAAZ,MAAM,MAAO,SAAQ,2BAAU;IAE9B,IAAI,CAAU;IAGd,SAAS,CAAU;IAGnB,KAAK,CAAU;IAGf,IAAI,CAAU;IAGd,MAAM,CAAoB;IAG1B,OAAO,CAAc;IAGrB,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,eAAe,CAAW;IAG1B,YAAY,CAAU;IAGtB,0BAA0B,CAAW;IAGrC,sBAAsB,CAAU;IAGhC,2BAA2B,CAAW;IAGtC,SAAS,CAAU;IAGnB,WAAW,CAAS;IAGpB,cAAc,CAAS;IAGvB,aAAa,CAAuB;IAGpC,uBAAuB,CAA0B;IAGjD,eAAe,CAAmB;CACzC,CAAA;AApFY,wBAAM;AAEX;IADN,IAAA,gBAAI,EAAC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MAAM,eAAe,GAAG,MAAM,cAAW,CAAC,SAAS,CAA8B;oBAChF;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,CAAC;YACJ,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;gBAChB,MAAM,QAAQ,GAAG,IAAA,iBAAO,EAAC,IAAI,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;gBACnE,IAAI,IAAI,GAAG,QAAQ,CAAC;gBACpB,IAAI,KAAK,GAAG,CAAC,CAAC;gBACd,OAAO,MAAM,cAAW,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;oBAC3C,KAAK,EAAE,CAAC;oBACR,IAAI,GAAG,GAAG,QAAQ,IAAI,KAAK,EAAE,CAAC;gBAC/B,CAAC;gBACD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;YAClB,CAAC;YACD,IAAI,EAAE,CAAC;QACR,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,IAAI,CAAC,KAAc,CAAC,CAAC;QACtB,CAAC;QACD,IAAI,EAAE,CAAC;IACR,CAAC,CAAC;GACW,MAAM,CAoFlB","sourcesContent":["import { modelOptions, prop, Ref, Severity, Index, pre } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { 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 } from '.';\nimport slugify from 'slugify';\nimport { Service } from \"./service.model\";\nimport { ServiceOrderSettings } from './embedded/service-order-settings.model';\nimport { CleaningServiceSettings } from './embedded/cleaning-service-settings.model';\n\n@modelOptions({\n\tschemaOptions: { collection: 'vendors' },\n\toptions: { allowMixed: Severity.ALLOW },\n})\n@Index({ name: 1, itemType: 1 }, { unique: true, partialFilterExpression: { deletedAt: null } })\n@Index({ parent: 1, status: 1, isVisibleToUser: 1, deletedAt: 1 })\n@pre<Vendor>('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 VendorModel.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\ttry {\n\t\tif (this.isNew) {\n\t\t\tconst baseSlug = slugify(this.name, { lower: true, strict: true });\n\t\t\tlet slug = baseSlug;\n\t\t\tlet count = 0;\n\t\t\twhile (await VendorModel.exists({ slug })) {\n\t\t\t\tcount++;\n\t\t\t\tslug = `${baseSlug}-${count}`;\n\t\t\t}\n\t\t\tthis.slug = slug;\n\t\t}\n\t\tnext();\n\t} catch (error) {\n\t\tnext(error as Error);\n\t}\n\tnext();\n})\nexport class Vendor extends TimeStamps {\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: 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({ required: true, type: Boolean })\n\tpublic isVisibleToUser!: boolean;\n\n\t@prop({ type: Number })\n\tpublic sortingOrder?: number;\n\n\t@prop({ required: false, type: () => Boolean })\n\tpublic isFavouriteCategoryVisible?: boolean;\n\n\t@prop({ required: false, type: () => String })\n\tpublic favouriteCategoryTitle?: string;\n\n\t@prop({ required: false, type: () => Boolean })\n\tpublic isBestSellerCategoryVisible?: boolean;\n\n\t@prop({ default: 0, type: () => Number })\n\tpublic avgRating?: number;\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: () => ServiceOrderSettings })\n\tpublic orderSettings?: ServiceOrderSettings\n\n\t@prop({type: ()=> CleaningServiceSettings})\n\tpublic cleaningServiceSettings?: CleaningServiceSettings\n\n\t@prop({ type: WorkHourSetting })\n\tpublic workHourSetting?: WorkHourSetting;\n}\n"]}
@@ -8,7 +8,7 @@ export declare function createSocketSubscriptionProcedure<I extends ZodTypeAny,
8
8
  outputSchema: O;
9
9
  getId: (out: z.infer<O>) => string;
10
10
  }): import("@trpc/server").TRPCSubscriptionProcedure<{
11
- input: import("@trpc/server/dist/unstable-core-do-not-import.d-C8vB_hCN.cjs").inferParser<I>["in"] extends infer T ? T extends import("@trpc/server/dist/unstable-core-do-not-import.d-C8vB_hCN.cjs").inferParser<I>["in"] ? T extends import("@trpc/server").TRPCUnsetMarker ? void : T : never : never;
12
- output: AsyncIterable<import("@trpc/server/dist/unstable-core-do-not-import.d-C8vB_hCN.cjs").TrackedData<any>, void, unknown>;
11
+ input: import("@trpc/server/dist/unstable-core-do-not-import.d-C6mFWtNG.cjs").inferParser<I>["in"] extends infer T ? T extends import("@trpc/server/dist/unstable-core-do-not-import.d-C6mFWtNG.cjs").inferParser<I>["in"] ? T extends import("@trpc/server").TRPCUnsetMarker ? void : T : never : never;
12
+ output: AsyncIterable<import("@trpc/server/dist/unstable-core-do-not-import.d-C6mFWtNG.cjs").TrackedData<any>, void, unknown>;
13
13
  meta: object;
14
14
  }>;
@@ -22,7 +22,7 @@ Perfect for sharing types between frontend and backend applications.
22
22
 
23
23
  ## Version
24
24
 
25
- Version: 1.1.4
25
+ Version: 1.1.6
26
26
 
27
27
  ## Dependencies
28
28
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lyxa.ai/types",
3
- "version": "1.1.4",
3
+ "version": "1.1.6",
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",
@@ -587,7 +587,7 @@ export declare const createResponseSchema: <T>(schema: z.ZodSchema<T>) => z.ZodO
587
587
  totalPages: number;
588
588
  } | undefined;
589
589
  }>, z.ZodType<T, z.ZodTypeDef, T>]>>;
590
- }>, any> extends infer T_1 ? { [k in keyof T_1]: T_1[k]; } : never, z.baseObjectInputType<{
590
+ }>, any> extends infer T_1 ? { [k in keyof T_1]: z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
591
591
  success: z.ZodBoolean;
592
592
  message: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
593
593
  data: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
@@ -625,7 +625,83 @@ export declare const createResponseSchema: <T>(schema: z.ZodSchema<T>) => z.ZodO
625
625
  totalPages: number;
626
626
  } | undefined;
627
627
  }>, z.ZodType<T, z.ZodTypeDef, T>]>>;
628
- }> extends infer T_2 ? { [k_1 in keyof T_2]: T_2[k_1]; } : never>;
628
+ }>, any>[k]; } : never, z.baseObjectInputType<{
629
+ success: z.ZodBoolean;
630
+ message: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
631
+ data: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
632
+ metadata: z.ZodOptional<z.ZodObject<{
633
+ page: z.ZodNumber;
634
+ size: z.ZodNumber;
635
+ totalElements: z.ZodNumber;
636
+ totalPages: z.ZodNumber;
637
+ }, "strip", z.ZodTypeAny, {
638
+ size: number;
639
+ page: number;
640
+ totalElements: number;
641
+ totalPages: number;
642
+ }, {
643
+ size: number;
644
+ page: number;
645
+ totalElements: number;
646
+ totalPages: number;
647
+ }>>;
648
+ documents: z.ZodArray<z.ZodType<T, z.ZodTypeDef, T>, "many">;
649
+ }, "strip", z.ZodTypeAny, {
650
+ documents: T[];
651
+ metadata?: {
652
+ size: number;
653
+ page: number;
654
+ totalElements: number;
655
+ totalPages: number;
656
+ } | undefined;
657
+ }, {
658
+ documents: T[];
659
+ metadata?: {
660
+ size: number;
661
+ page: number;
662
+ totalElements: number;
663
+ totalPages: number;
664
+ } | undefined;
665
+ }>, z.ZodType<T, z.ZodTypeDef, T>]>>;
666
+ }> extends infer T_2 ? { [k_1 in keyof T_2]: z.baseObjectInputType<{
667
+ success: z.ZodBoolean;
668
+ message: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
669
+ data: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
670
+ metadata: z.ZodOptional<z.ZodObject<{
671
+ page: z.ZodNumber;
672
+ size: z.ZodNumber;
673
+ totalElements: z.ZodNumber;
674
+ totalPages: z.ZodNumber;
675
+ }, "strip", z.ZodTypeAny, {
676
+ size: number;
677
+ page: number;
678
+ totalElements: number;
679
+ totalPages: number;
680
+ }, {
681
+ size: number;
682
+ page: number;
683
+ totalElements: number;
684
+ totalPages: number;
685
+ }>>;
686
+ documents: z.ZodArray<z.ZodType<T, z.ZodTypeDef, T>, "many">;
687
+ }, "strip", z.ZodTypeAny, {
688
+ documents: T[];
689
+ metadata?: {
690
+ size: number;
691
+ page: number;
692
+ totalElements: number;
693
+ totalPages: number;
694
+ } | undefined;
695
+ }, {
696
+ documents: T[];
697
+ metadata?: {
698
+ size: number;
699
+ page: number;
700
+ totalElements: number;
701
+ totalPages: number;
702
+ } | undefined;
703
+ }>, z.ZodType<T, z.ZodTypeDef, T>]>>;
704
+ }>[k_1]; } : never>;
629
705
  export type PaginatedDTO<T> = {
630
706
  metadata: DTO<typeof metadataSchema>;
631
707
  documents: T[];
@@ -76,22 +76,34 @@ export declare class SchemaBuilder<T extends z.ZodRawShape> {
76
76
  private baseSchema;
77
77
  constructor(baseFields: T, includeTimestamps?: boolean, includeTracking?: boolean);
78
78
  private createBaseSchema;
79
- getBaseSchema(): z.ZodObject<T, "strict", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<T>, any> extends infer T_1 ? { [k in keyof T_1]: T_1[k]; } : never, z.baseObjectInputType<T> extends infer T_2 ? { [k_1 in keyof T_2]: T_2[k_1]; } : never>;
79
+ getBaseSchema(): z.ZodObject<T, "strict", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<T>, any> extends infer T_1 ? { [k in keyof T_1]: z.objectUtil.addQuestionMarks<z.baseObjectOutputType<T>, any>[k]; } : never, z.baseObjectInputType<T> extends infer T_2 ? { [k_1 in keyof T_2]: z.baseObjectInputType<T>[k_1]; } : never>;
80
80
  getEntitySchema(): z.ZodObject<z.objectUtil.extendShape<T, {
81
81
  _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
82
- }> extends infer T_1 extends z.ZodRawShape ? { [k in keyof T_1]: z.ZodOptional<T_1[k]>; } : never, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<T, {
82
+ }> extends infer T_1 extends z.ZodRawShape ? { [k in keyof T_1]: z.ZodOptional<z.objectUtil.extendShape<T, {
83
83
  _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
84
- }> extends infer T_2 extends z.ZodRawShape ? { [k in keyof T_2]: z.ZodOptional<T_2[k]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
84
+ }>[k]>; } : never, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<T, {
85
85
  _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
86
- }> extends infer T_3 extends z.ZodRawShape ? { [k in keyof T_3]: z.ZodOptional<T_3[k]>; } : never, z.ZodTypeAny, "passthrough">>;
86
+ }> extends infer T_2 extends z.ZodRawShape ? { [k in keyof T_2]: z.ZodOptional<z.objectUtil.extendShape<T, {
87
+ _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
88
+ }>[k]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
89
+ _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
90
+ }> extends infer T_3 extends z.ZodRawShape ? { [k in keyof T_3]: z.ZodOptional<z.objectUtil.extendShape<T, {
91
+ _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
92
+ }>[k]>; } : never, z.ZodTypeAny, "passthrough">>;
87
93
  getIdSchema(): z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
88
94
  getUpdateSchema(excludeFields?: ExcludeFromUpdate): z.ZodObject<z.objectUtil.extendShape<T, {
89
95
  _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
90
- }> extends infer T_1 extends z.ZodRawShape ? { [k in keyof T_1]: z.ZodOptional<T_1[k]>; } : never, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<T, {
96
+ }> extends infer T_1 extends z.ZodRawShape ? { [k in keyof T_1]: z.ZodOptional<z.objectUtil.extendShape<T, {
97
+ _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
98
+ }>[k]>; } : never, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<T, {
99
+ _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
100
+ }> extends infer T_2 extends z.ZodRawShape ? { [k in keyof T_2]: z.ZodOptional<z.objectUtil.extendShape<T, {
101
+ _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
102
+ }>[k]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
91
103
  _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
92
- }> extends infer T_2 extends z.ZodRawShape ? { [k in keyof T_2]: z.ZodOptional<T_2[k]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
104
+ }> extends infer T_3 extends z.ZodRawShape ? { [k in keyof T_3]: z.ZodOptional<z.objectUtil.extendShape<T, {
93
105
  _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
94
- }> extends infer T_3 extends z.ZodRawShape ? { [k in keyof T_3]: z.ZodOptional<T_3[k]>; } : never, z.ZodTypeAny, "passthrough">> | z.ZodObject<{
106
+ }>[k]>; } : never, z.ZodTypeAny, "passthrough">> | z.ZodObject<{
95
107
  [x: string]: z.ZodOptional<z.ZodTypeAny>;
96
108
  }, "strict", z.ZodTypeAny, {
97
109
  [x: string]: any;
@@ -114,22 +126,34 @@ export declare class SchemaBuilder<T extends z.ZodRawShape> {
114
126
  [x: string]: any;
115
127
  }>;
116
128
  getAllSchemas(excludeFromUpdate?: ExcludeFromUpdate): {
117
- BaseSchema: z.ZodObject<T, "strict", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<T>, any> extends infer T_1 ? { [k in keyof T_1]: T_1[k]; } : never, z.baseObjectInputType<T> extends infer T_2 ? { [k_1 in keyof T_2]: T_2[k_1]; } : never>;
129
+ BaseSchema: z.ZodObject<T, "strict", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<T>, any> extends infer T_1 ? { [k in keyof T_1]: z.objectUtil.addQuestionMarks<z.baseObjectOutputType<T>, any>[k]; } : never, z.baseObjectInputType<T> extends infer T_2 ? { [k_1 in keyof T_2]: z.baseObjectInputType<T>[k_1]; } : never>;
118
130
  EntitySchema: z.ZodObject<z.objectUtil.extendShape<T, {
119
131
  _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
120
- }> extends infer T_3 extends z.ZodRawShape ? { [k_2 in keyof T_3]: z.ZodOptional<T_3[k_2]>; } : never, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<T, {
132
+ }> extends infer T_3 extends z.ZodRawShape ? { [k_2 in keyof T_3]: z.ZodOptional<z.objectUtil.extendShape<T, {
121
133
  _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
122
- }> extends infer T_4 extends z.ZodRawShape ? { [k_2 in keyof T_4]: z.ZodOptional<T_4[k_2]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
134
+ }>[k_2]>; } : never, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<T, {
123
135
  _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
124
- }> extends infer T_5 extends z.ZodRawShape ? { [k_2 in keyof T_5]: z.ZodOptional<T_5[k_2]>; } : never, z.ZodTypeAny, "passthrough">>;
136
+ }> extends infer T_4 extends z.ZodRawShape ? { [k_2 in keyof T_4]: z.ZodOptional<z.objectUtil.extendShape<T, {
137
+ _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
138
+ }>[k_2]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
139
+ _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
140
+ }> extends infer T_5 extends z.ZodRawShape ? { [k_2 in keyof T_5]: z.ZodOptional<z.objectUtil.extendShape<T, {
141
+ _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
142
+ }>[k_2]>; } : never, z.ZodTypeAny, "passthrough">>;
125
143
  IdSchema: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
126
144
  UpdateSchema: z.ZodObject<z.objectUtil.extendShape<T, {
127
145
  _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
128
- }> extends infer T_6 extends z.ZodRawShape ? { [k_2 in keyof T_6]: z.ZodOptional<T_6[k_2]>; } : never, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<T, {
146
+ }> extends infer T_6 extends z.ZodRawShape ? { [k_2 in keyof T_6]: z.ZodOptional<z.objectUtil.extendShape<T, {
147
+ _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
148
+ }>[k_2]>; } : never, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<T, {
149
+ _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
150
+ }> extends infer T_7 extends z.ZodRawShape ? { [k_2 in keyof T_7]: z.ZodOptional<z.objectUtil.extendShape<T, {
151
+ _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
152
+ }>[k_2]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
129
153
  _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
130
- }> extends infer T_7 extends z.ZodRawShape ? { [k_2 in keyof T_7]: z.ZodOptional<T_7[k_2]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
154
+ }> extends infer T_8 extends z.ZodRawShape ? { [k_2 in keyof T_8]: z.ZodOptional<z.objectUtil.extendShape<T, {
131
155
  _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
132
- }> extends infer T_8 extends z.ZodRawShape ? { [k_2 in keyof T_8]: z.ZodOptional<T_8[k_2]>; } : never, z.ZodTypeAny, "passthrough">> | z.ZodObject<{
156
+ }>[k_2]>; } : never, z.ZodTypeAny, "passthrough">> | z.ZodObject<{
133
157
  [x: string]: z.ZodOptional<z.ZodTypeAny>;
134
158
  }, "strict", z.ZodTypeAny, {
135
159
  [x: string]: any;
@@ -587,7 +587,7 @@ export declare const createResponseSchema: <T>(schema: z.ZodSchema<T>) => z.ZodO
587
587
  totalPages: number;
588
588
  } | undefined;
589
589
  }>, z.ZodType<T, z.ZodTypeDef, T>]>>;
590
- }>, any> extends infer T_1 ? { [k in keyof T_1]: T_1[k]; } : never, z.baseObjectInputType<{
590
+ }>, any> extends infer T_1 ? { [k in keyof T_1]: z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
591
591
  success: z.ZodBoolean;
592
592
  message: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
593
593
  data: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
@@ -625,7 +625,83 @@ export declare const createResponseSchema: <T>(schema: z.ZodSchema<T>) => z.ZodO
625
625
  totalPages: number;
626
626
  } | undefined;
627
627
  }>, z.ZodType<T, z.ZodTypeDef, T>]>>;
628
- }> extends infer T_2 ? { [k_1 in keyof T_2]: T_2[k_1]; } : never>;
628
+ }>, any>[k]; } : never, z.baseObjectInputType<{
629
+ success: z.ZodBoolean;
630
+ message: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
631
+ data: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
632
+ metadata: z.ZodOptional<z.ZodObject<{
633
+ page: z.ZodNumber;
634
+ size: z.ZodNumber;
635
+ totalElements: z.ZodNumber;
636
+ totalPages: z.ZodNumber;
637
+ }, "strip", z.ZodTypeAny, {
638
+ page: number;
639
+ size: number;
640
+ totalElements: number;
641
+ totalPages: number;
642
+ }, {
643
+ page: number;
644
+ size: number;
645
+ totalElements: number;
646
+ totalPages: number;
647
+ }>>;
648
+ documents: z.ZodArray<z.ZodType<T, z.ZodTypeDef, T>, "many">;
649
+ }, "strip", z.ZodTypeAny, {
650
+ documents: T[];
651
+ metadata?: {
652
+ page: number;
653
+ size: number;
654
+ totalElements: number;
655
+ totalPages: number;
656
+ } | undefined;
657
+ }, {
658
+ documents: T[];
659
+ metadata?: {
660
+ page: number;
661
+ size: number;
662
+ totalElements: number;
663
+ totalPages: number;
664
+ } | undefined;
665
+ }>, z.ZodType<T, z.ZodTypeDef, T>]>>;
666
+ }> extends infer T_2 ? { [k_1 in keyof T_2]: z.baseObjectInputType<{
667
+ success: z.ZodBoolean;
668
+ message: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
669
+ data: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
670
+ metadata: z.ZodOptional<z.ZodObject<{
671
+ page: z.ZodNumber;
672
+ size: z.ZodNumber;
673
+ totalElements: z.ZodNumber;
674
+ totalPages: z.ZodNumber;
675
+ }, "strip", z.ZodTypeAny, {
676
+ page: number;
677
+ size: number;
678
+ totalElements: number;
679
+ totalPages: number;
680
+ }, {
681
+ page: number;
682
+ size: number;
683
+ totalElements: number;
684
+ totalPages: number;
685
+ }>>;
686
+ documents: z.ZodArray<z.ZodType<T, z.ZodTypeDef, T>, "many">;
687
+ }, "strip", z.ZodTypeAny, {
688
+ documents: T[];
689
+ metadata?: {
690
+ page: number;
691
+ size: number;
692
+ totalElements: number;
693
+ totalPages: number;
694
+ } | undefined;
695
+ }, {
696
+ documents: T[];
697
+ metadata?: {
698
+ page: number;
699
+ size: number;
700
+ totalElements: number;
701
+ totalPages: number;
702
+ } | undefined;
703
+ }>, z.ZodType<T, z.ZodTypeDef, T>]>>;
704
+ }>[k_1]; } : never>;
629
705
  export type PaginatedDTO<T> = {
630
706
  metadata: DTO<typeof metadataSchema>;
631
707
  documents: T[];
@@ -76,22 +76,34 @@ export declare class SchemaBuilder<T extends z.ZodRawShape> {
76
76
  private baseSchema;
77
77
  constructor(baseFields: T, includeTimestamps?: boolean, includeTracking?: boolean);
78
78
  private createBaseSchema;
79
- getBaseSchema(): z.ZodObject<T, "strict", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<T>, any> extends infer T_1 ? { [k in keyof T_1]: T_1[k]; } : never, z.baseObjectInputType<T> extends infer T_2 ? { [k_1 in keyof T_2]: T_2[k_1]; } : never>;
79
+ getBaseSchema(): z.ZodObject<T, "strict", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<T>, any> extends infer T_1 ? { [k in keyof T_1]: z.objectUtil.addQuestionMarks<z.baseObjectOutputType<T>, any>[k]; } : never, z.baseObjectInputType<T> extends infer T_2 ? { [k_1 in keyof T_2]: z.baseObjectInputType<T>[k_1]; } : never>;
80
80
  getEntitySchema(): z.ZodObject<z.objectUtil.extendShape<T, {
81
81
  _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
82
- }> extends infer T_1 extends z.ZodRawShape ? { [k in keyof T_1]: z.ZodOptional<T_1[k]>; } : never, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<T, {
82
+ }> extends infer T_1 extends z.ZodRawShape ? { [k in keyof T_1]: z.ZodOptional<z.objectUtil.extendShape<T, {
83
83
  _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
84
- }> extends infer T_2 extends z.ZodRawShape ? { [k in keyof T_2]: z.ZodOptional<T_2[k]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
84
+ }>[k]>; } : never, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<T, {
85
85
  _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
86
- }> extends infer T_3 extends z.ZodRawShape ? { [k in keyof T_3]: z.ZodOptional<T_3[k]>; } : never, z.ZodTypeAny, "passthrough">>;
86
+ }> extends infer T_2 extends z.ZodRawShape ? { [k in keyof T_2]: z.ZodOptional<z.objectUtil.extendShape<T, {
87
+ _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
88
+ }>[k]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
89
+ _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
90
+ }> extends infer T_3 extends z.ZodRawShape ? { [k in keyof T_3]: z.ZodOptional<z.objectUtil.extendShape<T, {
91
+ _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
92
+ }>[k]>; } : never, z.ZodTypeAny, "passthrough">>;
87
93
  getIdSchema(): z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
88
94
  getUpdateSchema(excludeFields?: ExcludeFromUpdate): z.ZodObject<z.objectUtil.extendShape<T, {
89
95
  _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
90
- }> extends infer T_1 extends z.ZodRawShape ? { [k in keyof T_1]: z.ZodOptional<T_1[k]>; } : never, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<T, {
96
+ }> extends infer T_1 extends z.ZodRawShape ? { [k in keyof T_1]: z.ZodOptional<z.objectUtil.extendShape<T, {
97
+ _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
98
+ }>[k]>; } : never, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<T, {
99
+ _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
100
+ }> extends infer T_2 extends z.ZodRawShape ? { [k in keyof T_2]: z.ZodOptional<z.objectUtil.extendShape<T, {
101
+ _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
102
+ }>[k]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
91
103
  _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
92
- }> extends infer T_2 extends z.ZodRawShape ? { [k in keyof T_2]: z.ZodOptional<T_2[k]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
104
+ }> extends infer T_3 extends z.ZodRawShape ? { [k in keyof T_3]: z.ZodOptional<z.objectUtil.extendShape<T, {
93
105
  _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
94
- }> extends infer T_3 extends z.ZodRawShape ? { [k in keyof T_3]: z.ZodOptional<T_3[k]>; } : never, z.ZodTypeAny, "passthrough">> | z.ZodObject<{
106
+ }>[k]>; } : never, z.ZodTypeAny, "passthrough">> | z.ZodObject<{
95
107
  [x: string]: z.ZodOptional<z.ZodTypeAny>;
96
108
  }, "strict", z.ZodTypeAny, {
97
109
  [x: string]: any;
@@ -114,22 +126,34 @@ export declare class SchemaBuilder<T extends z.ZodRawShape> {
114
126
  [x: string]: any;
115
127
  }>;
116
128
  getAllSchemas(excludeFromUpdate?: ExcludeFromUpdate): {
117
- BaseSchema: z.ZodObject<T, "strict", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<T>, any> extends infer T_1 ? { [k in keyof T_1]: T_1[k]; } : never, z.baseObjectInputType<T> extends infer T_2 ? { [k_1 in keyof T_2]: T_2[k_1]; } : never>;
129
+ BaseSchema: z.ZodObject<T, "strict", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<T>, any> extends infer T_1 ? { [k in keyof T_1]: z.objectUtil.addQuestionMarks<z.baseObjectOutputType<T>, any>[k]; } : never, z.baseObjectInputType<T> extends infer T_2 ? { [k_1 in keyof T_2]: z.baseObjectInputType<T>[k_1]; } : never>;
118
130
  EntitySchema: z.ZodObject<z.objectUtil.extendShape<T, {
119
131
  _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
120
- }> extends infer T_3 extends z.ZodRawShape ? { [k_2 in keyof T_3]: z.ZodOptional<T_3[k_2]>; } : never, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<T, {
132
+ }> extends infer T_3 extends z.ZodRawShape ? { [k_2 in keyof T_3]: z.ZodOptional<z.objectUtil.extendShape<T, {
121
133
  _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
122
- }> extends infer T_4 extends z.ZodRawShape ? { [k_2 in keyof T_4]: z.ZodOptional<T_4[k_2]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
134
+ }>[k_2]>; } : never, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<T, {
123
135
  _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
124
- }> extends infer T_5 extends z.ZodRawShape ? { [k_2 in keyof T_5]: z.ZodOptional<T_5[k_2]>; } : never, z.ZodTypeAny, "passthrough">>;
136
+ }> extends infer T_4 extends z.ZodRawShape ? { [k_2 in keyof T_4]: z.ZodOptional<z.objectUtil.extendShape<T, {
137
+ _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
138
+ }>[k_2]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
139
+ _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
140
+ }> extends infer T_5 extends z.ZodRawShape ? { [k_2 in keyof T_5]: z.ZodOptional<z.objectUtil.extendShape<T, {
141
+ _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
142
+ }>[k_2]>; } : never, z.ZodTypeAny, "passthrough">>;
125
143
  IdSchema: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
126
144
  UpdateSchema: z.ZodObject<z.objectUtil.extendShape<T, {
127
145
  _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
128
- }> extends infer T_6 extends z.ZodRawShape ? { [k_2 in keyof T_6]: z.ZodOptional<T_6[k_2]>; } : never, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<T, {
146
+ }> extends infer T_6 extends z.ZodRawShape ? { [k_2 in keyof T_6]: z.ZodOptional<z.objectUtil.extendShape<T, {
147
+ _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
148
+ }>[k_2]>; } : never, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<T, {
149
+ _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
150
+ }> extends infer T_7 extends z.ZodRawShape ? { [k_2 in keyof T_7]: z.ZodOptional<z.objectUtil.extendShape<T, {
151
+ _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
152
+ }>[k_2]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
129
153
  _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
130
- }> extends infer T_7 extends z.ZodRawShape ? { [k_2 in keyof T_7]: z.ZodOptional<T_7[k_2]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
154
+ }> extends infer T_8 extends z.ZodRawShape ? { [k_2 in keyof T_8]: z.ZodOptional<z.objectUtil.extendShape<T, {
131
155
  _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
132
- }> extends infer T_8 extends z.ZodRawShape ? { [k_2 in keyof T_8]: z.ZodOptional<T_8[k_2]>; } : never, z.ZodTypeAny, "passthrough">> | z.ZodObject<{
156
+ }>[k_2]>; } : never, z.ZodTypeAny, "passthrough">> | z.ZodObject<{
133
157
  [x: string]: z.ZodOptional<z.ZodTypeAny>;
134
158
  }, "strict", z.ZodTypeAny, {
135
159
  [x: string]: any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lyxa.ai/core",
3
- "version": "1.1.4",
3
+ "version": "1.1.6",
4
4
  "description": "The Core system of the Lyxa services.",
5
5
  "author": "elie <42282499+Internalizable@users.noreply.github.com>",
6
6
  "license": "MIT",
@@ -1 +0,0 @@
1
- {"version":3,"file":"capacity-settings.model.js","sourceRoot":"/","sources":["libraries/mongo/models/embedded/capacity-settings.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA+D;AAC/D,qDAAqD;AAIrD,MAAM,QAAQ;IAEH,OAAO,CAAe;IAMtB,qBAAqB,CAAU;CACzC;AAPU;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yCACI;AAMtB;IAJN,IAAA,gBAAI,EAAC;QACF,QAAQ,EAAE,IAAI;QACd,IAAI,EAAE,MAAM;KACf,CAAC;;uDACoC;AAG1C,MAAM,QAAQ;IAEH,GAAG,CAAW;IAGd,QAAQ,CAAa;CAC/B;AAJU;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,cAAO,EAAE,CAAC;;qCACjC;AAGd;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC;;0CACL;AAGhC,MAAM,8BAA8B;IAEzB,gBAAgB,CAAU;IAG1B,qBAAqB,CAAU;CACzC;AAJU;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wEACQ;AAG1B;IADN,IAAA,gBAAI,EAAC,EAAC,QAAQ,EAAE,IAAI,EAAE,CAAC;;6EACc;AAInC,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAMlB,cAAc,CAAS;IAOvB,YAAY,CAAS;IAGrB,QAAQ,CAAY;IAGpB,uBAAuB,CAAmC;CACpE,CAAA;AApBY,4CAAgB;AAMlB;IALN,IAAA,gBAAI,EAAC;QACF,GAAG,EAAE,CAAC;QACN,GAAG,EAAE,EAAE;QACP,OAAO,EAAE,CAAC;KACb,CAAC;;wDAC4B;AAOvB;IALN,IAAA,gBAAI,EAAC;QACF,GAAG,EAAE,EAAE;QACP,GAAG,EAAE,GAAG;QACR,OAAO,EAAE,EAAE;KACd,CAAC;;sDAC0B;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,QAAQ,CAAC,EAAC,CAAC;;kDACL;AAGpB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,8BAA8B,CAAC,EAAE,CAAC;;iEACU;2BAnBxD,gBAAgB;IAD5B,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,kBAAkB,EAAE,EAAE,CAAC;GACvD,gBAAgB,CAoB5B","sourcesContent":["import { modelOptions, prop, Ref } from '@typegoose/typegoose';\nimport { WeekDay } from '../../../../utilities/enum';\nimport { Service } from '../service.model';\n\n\nclass Services {\n @prop({ required: true })\n public service!: Ref<Service>\n\n @prop({\n required: true,\n type: Number,\n })\n public numberOfProfessionals!: number;\n}\n\nclass Capacity {\n @prop({ required: true, type: Number, enum: WeekDay })\n public day!: WeekDay;\n\n @prop({ type: () => [Services] })\n public services!: Services[]\n}\n\nclass FurnitureCleaningConfiguration {\n @prop({ required: true })\n public numberOfPackages!: number;\n\n @prop({required: true })\n public numberOfProfessionals!: number;\n}\n\n@modelOptions({ schemaOptions: { collection: 'capacitySettings' } })\nexport class CapacitySettings {\n @prop({\n min: 5,\n max: 60,\n default: 5,\n })\n public slotBufferTime: number; // minutes\n\n @prop({\n min: 30,\n max: 120,\n default: 30,\n })\n public slotInterval: number; // minutes\n\n @prop({ type: () => [Capacity]})\n public capacity: Capacity[]\n\n @prop({ type: () => [FurnitureCleaningConfiguration] })\n public furnitureCleaningConfig?: FurnitureCleaningConfiguration[]\n}\n"]}