@lyxa.ai/core 1.3.252 → 1.3.254
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.
- package/dist/libraries/mongo/models/professional.model.d.ts +2 -2
- package/dist/libraries/mongo/models/professional.model.js +1 -1
- package/dist/libraries/mongo/models/professional.model.js.map +1 -1
- package/dist/libraries/mongo/models/shared/work-hour.model.d.ts +0 -4
- package/dist/libraries/mongo/models/shared/work-hour.model.js +1 -14
- package/dist/libraries/mongo/models/shared/work-hour.model.js.map +1 -1
- package/dist/libraries/mongo/models/vendor-parent.model.d.ts +1 -1
- package/dist/libraries/mongo/models/vendor-parent.model.js +1 -1
- package/dist/libraries/mongo/models/vendor-parent.model.js.map +1 -1
- package/dist/libraries/mongo/models/vendor.model.d.ts +1 -1
- package/dist/libraries/mongo/models/vendor.model.js +1 -1
- package/dist/libraries/mongo/models/vendor.model.js.map +1 -1
- package/dist/types/README.md +1 -1
- package/dist/types/package.json +1 -1
- package/dist/types/utilities/validation/common-validation.d.ts +12 -12
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Ref } from '@typegoose/typegoose';
|
|
2
2
|
import { Vendor } from './vendor.model';
|
|
3
3
|
import { Status, SubServiceType } from '../../../utilities/enum';
|
|
4
|
-
import {
|
|
4
|
+
import { NormalHour } from './shared/work-hour.model';
|
|
5
5
|
export declare class Professional {
|
|
6
6
|
professionalId: string;
|
|
7
7
|
name: string;
|
|
@@ -11,7 +11,7 @@ export declare class Professional {
|
|
|
11
11
|
password: string;
|
|
12
12
|
nationality?: string;
|
|
13
13
|
vendor: Ref<Vendor>;
|
|
14
|
-
availability:
|
|
14
|
+
availability: NormalHour[];
|
|
15
15
|
worksOn: SubServiceType[];
|
|
16
16
|
status: Status;
|
|
17
17
|
}
|
|
@@ -64,7 +64,7 @@ __decorate([
|
|
|
64
64
|
__metadata("design:type", Object)
|
|
65
65
|
], Professional.prototype, "vendor", void 0);
|
|
66
66
|
__decorate([
|
|
67
|
-
(0, typegoose_1.prop)({ type: () => work_hour_model_1.
|
|
67
|
+
(0, typegoose_1.prop)({ type: () => work_hour_model_1.NormalHour, default: [] }),
|
|
68
68
|
__metadata("design:type", Array)
|
|
69
69
|
], Professional.prototype, "availability", void 0);
|
|
70
70
|
__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"professional.model.js","sourceRoot":"/","sources":["libraries/mongo/models/professional.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA2E;AAC3E,iDAAwC;AACxC,kDAA8E;AAC9E,0DAA2D;AAC3D,
|
|
1
|
+
{"version":3,"file":"professional.model.js","sourceRoot":"/","sources":["libraries/mongo/models/professional.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA2E;AAC3E,iDAAwC;AACxC,kDAA8E;AAC9E,0DAA2D;AAC3D,8DAAsD;AACtD,kEAA6D;AAC7D,wBAAiC;AAc1B,IAAM,YAAY,GAAlB,MAAM,YAAY;IAEjB,cAAc,CAAU;IAGxB,IAAI,CAAU;IAGd,KAAK,CAAU;IAGf,WAAW,CAAU;IAGrB,KAAK,CAAU;IAGf,QAAQ,CAAU;IAGlB,WAAW,CAAU;IAGrB,MAAM,CAAe;IAGrB,YAAY,CAAgB;IAG5B,OAAO,CAAoB;IAG3B,MAAM,CAAU;CACvB,CAAA;AAjCY,oCAAY;AAEjB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;;oDACnB;AAGxB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;;0CAC9B;AAGd;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;2CACjB;AAGf;IADN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C,UAAU,CAAC,EAAE,CAAC;YACjC,IAAI,CAAC,QAAQ,GAAG,MAAM,IAAA,uBAAY,EAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACnD,CAAC;IACF,CAAC,CAAC;IACD,IAAA,iBAAK,EAAC,EAAE,WAAW,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,uBAAuB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC;IACzF,IAAA,iBAAK,EAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,uBAAuB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC;GACvE,YAAY,CAiCxB","sourcesContent":["import { prop, Ref, modelOptions, pre, Index } from '@typegoose/typegoose';\nimport { Vendor } from './vendor.model';\nimport { CounterType, Status, SubServiceType } from '../../../utilities/enum';\nimport { hashPassword } from '../../../utilities/password';\nimport { NormalHour } from './shared/work-hour.model';\nimport { generateId } from '../../../utilities/id-generator';\nimport { CounterModel } from '.';\n\n@modelOptions({ schemaOptions: { collection: 'professionals', timestamps: true } })\n@pre<Professional>('save', async function () {\n\tif (this.isNew) {\n\t\tthis.professionalId = await generateId(CounterModel, CounterType.TEAM_MEMBER);\n\t}\n\n\tif (this.isModified('password')) {\n\t\tthis.password = await hashPassword(this.password);\n\t}\n})\n@Index({ phoneNumber: 1 }, { unique: true, partialFilterExpression: { deletedAt: null } })\n@Index({ email: 1 }, { unique: true, partialFilterExpression: { deletedAt: null } })\nexport class Professional {\n\t@prop({ type: String, unique: true, index: true })\n\tpublic professionalId!: string;\n\n\t@prop({ required: true, type: String, trim: true })\n\tpublic name!: string;\n\n\t@prop({ required: true, type: String })\n\tpublic image!: string;\n\n\t@prop({ required: true, type: String })\n\tpublic phoneNumber!: string;\n\n\t@prop({ required: true, type: String })\n\tpublic email!: string;\n\n\t@prop({ type: String })\n\tpublic password!: string;\n\n\t@prop({ type: String })\n\tpublic nationality?: string;\n\n\t@prop({ required: true, ref: () => Vendor })\n\tpublic vendor!: Ref<Vendor>;\n\n\t@prop({ type: () => NormalHour, default: [] })\n\tpublic availability!: NormalHour[];\n\n\t@prop({ required: true, type: [String], enum: SubServiceType })\n\tpublic worksOn!: SubServiceType[];\n\n\t@prop({ required: true, type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status!: Status;\n}\n"]}
|
|
@@ -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.
|
|
12
|
+
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
15
|
class StartEndTime {
|
|
@@ -78,17 +78,4 @@ __decorate([
|
|
|
78
78
|
(0, typegoose_1.prop)({ type: () => [HolidayHour], default: [] }),
|
|
79
79
|
__metadata("design:type", Array)
|
|
80
80
|
], WorkHourSetting.prototype, "holidayHours", void 0);
|
|
81
|
-
class TeamMemberAvailability {
|
|
82
|
-
day;
|
|
83
|
-
openingHours;
|
|
84
|
-
}
|
|
85
|
-
exports.TeamMemberAvailability = TeamMemberAvailability;
|
|
86
|
-
__decorate([
|
|
87
|
-
(0, typegoose_1.prop)({ required: true, type: Number, enum: enum_1.WeekDay }),
|
|
88
|
-
__metadata("design:type", Number)
|
|
89
|
-
], TeamMemberAvailability.prototype, "day", void 0);
|
|
90
|
-
__decorate([
|
|
91
|
-
(0, typegoose_1.prop)({ required: true, type: () => [StartEndTime] }),
|
|
92
|
-
__metadata("design:type", Array)
|
|
93
|
-
], TeamMemberAvailability.prototype, "openingHours", void 0);
|
|
94
81
|
//# 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,
|
|
1
|
+
{"version":3,"file":"work-hour.model.js","sourceRoot":"/","sources":["libraries/mongo/models/shared/work-hour.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA4C;AAC5C,qDAAoF;AACpF,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,CAAc;IAGpB,YAAY,CAAkB;CACrC;AATD,gCASC;AAPO;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,cAAO,EAAE,CAAC;;uCACjC;AAGd;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,iBAAU,EAAE,CAAC;;0CAC9B;AAGpB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,YAAY,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;gDACb;AAGtC,MAAa,WAAW;IAEhB,IAAI,CAAQ;IAOZ,MAAM,CAAqB;IAG3B,WAAW,CAAgB;CAClC;AAbD,kCAaC;AAXO;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;8BACvB,IAAI;yCAAC;AAOZ;IALN,IAAA,gBAAI,EAAC;QACL,QAAQ,EAAE,IAAI;QACd,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,wBAAiB;KACvB,CAAC;;2CACgC;AAG3B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;8BACR,YAAY;gDAAC;AAGnC,MAAa,eAAe;IAEpB,WAAW,CAAgB;IAG3B,YAAY,CAAiB;CACpC;AAND,0CAMC;AAJO;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,UAAU,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;oDACd;AAG3B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,WAAW,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;qDACb","sourcesContent":["import { prop } from '@typegoose/typegoose';\nimport { HolidayWorkStatus, WeekDay, WorkStatus } from '../../../../utilities/enum';\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"]}
|
|
@@ -7,7 +7,7 @@ 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
|
|
10
|
+
vendorParentId?: string;
|
|
11
11
|
name: string;
|
|
12
12
|
email: string;
|
|
13
13
|
phoneNumber: string;
|
|
@@ -39,7 +39,7 @@ let VendorParent = class VendorParent extends defaultClasses_1.TimeStamps {
|
|
|
39
39
|
};
|
|
40
40
|
exports.VendorParent = VendorParent;
|
|
41
41
|
__decorate([
|
|
42
|
-
(0, typegoose_1.prop)({
|
|
42
|
+
(0, typegoose_1.prop)({ type: String, unique: true, index: true }),
|
|
43
43
|
__metadata("design:type", String)
|
|
44
44
|
], VendorParent.prototype, "vendorParentId", void 0);
|
|
45
45
|
__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vendor-parent.model.js","sourceRoot":"/","sources":["libraries/mongo/models/vendor-parent.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA8E;AAC9E,4EAAqE;AACrE,
|
|
1
|
+
{"version":3,"file":"vendor-parent.model.js","sourceRoot":"/","sources":["libraries/mongo/models/vendor-parent.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA8E;AAC9E,4EAAqE;AACrE,kDAA2E;AAC3E,+CAAsC;AACtC,0DAAiD;AACjD,4EAAkE;AAClE,0DAAiD;AACjD,4DAAmD;AACnD,iDAAwC;AACxC,kEAA6D;AAC7D,wBAAiC;AAa1B,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,2BAAU;IAEpC,cAAc,CAAU;IAGxB,IAAI,CAAU;IAGd,KAAK,CAAU;IAGf,WAAW,CAAU;IAGrB,OAAO,CAAW;IAGlB,MAAM,CAAU;IAGhB,WAAW,CAAe;IAG1B,kBAAkB,CAAY;IAG9B,mBAAmB,CAAW;IAG9B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AAC,mBAAK,EAAE,CAAC;;0DACc;AAGlC;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,aAAM,EAAE,OAAO,EAAE,aAAM,CAAC,MAAM,EAAE,CAAC;;4CACtC;AAGhB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;kDACM;AAGtB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,sCAAc,EAAE,CAAC;8BACb,sCAAc;8CAAC;AAS1B;IAPN,IAAA,gBAAI,EAAC;QACL,GAAG,EAAE,GAAG,EAAE,CAAC,qBAAM;QACjB,YAAY,EAAE,QAAQ;QACtB,UAAU,EAAE,KAAK;QACjB,KAAK,EAAE,IAAI;QACX,KAAK,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE;KAC1B,CAAC;;iDAC0B;uBA/ChB,YAAY;IAXxB,IAAA,wBAAY,EAAC;QACb,aAAa,EAAE,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE;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 { 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({ 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"]}
|
|
@@ -8,7 +8,7 @@ import { Zone } from './zone.model';
|
|
|
8
8
|
import { VendorParent } from '.';
|
|
9
9
|
import { ServiceOrderSettings } from './embedded/service-order-settings.model';
|
|
10
10
|
export declare class Vendor extends TimeStamps {
|
|
11
|
-
vendorId
|
|
11
|
+
vendorId?: string;
|
|
12
12
|
name: string;
|
|
13
13
|
ownerName: string;
|
|
14
14
|
email: string;
|
|
@@ -47,7 +47,7 @@ let Vendor = class Vendor extends defaultClasses_1.TimeStamps {
|
|
|
47
47
|
};
|
|
48
48
|
exports.Vendor = Vendor;
|
|
49
49
|
__decorate([
|
|
50
|
-
(0, typegoose_1.prop)({
|
|
50
|
+
(0, typegoose_1.prop)({ type: String, unique: true, index: true }),
|
|
51
51
|
__metadata("design:type", String)
|
|
52
52
|
], Vendor.prototype, "vendorId", void 0);
|
|
53
53
|
__decorate([
|
|
@@ -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,8DAA2D;AAC3D,6CAAoC;AACpC,wBAA+C;AAC/C,0FAA+E;AAC/E,kEAA6D;AActD,IAAM,MAAM,GAAZ,MAAM,MAAO,SAAQ,2BAAU;IAE9B,QAAQ,CAAU;IAGlB,IAAI,CAAU;IAGd,SAAS,CAAU;IAGnB,KAAK,CAAU;IAGf,MAAM,CAAoB;IAG1B,WAAW,CAAe;IAG1B,MAAM,CAAU;IAGhB,WAAW,CAAU;IAGrB,eAAe,CAAU;IAGzB,sBAAsB,CAAY;IAGlC,OAAO,CAAW;IAGlB,KAAK,CAAe;IAGpB,IAAI,CAAU;IAGd,MAAM,CAAU;IAGhB,QAAQ,CAAgB;IAGxB,SAAS,CAAU;IAGnB,eAAe,CAAW;IAG1B,WAAW,CAAU;IAGrB,cAAc,CAAU;IAGxB,cAAc,CAAU;IAGxB,qBAAqB,CAAU;IAG/B,aAAa,CAAwB;IAGrC,eAAe,CAAmB;CACzC,CAAA;AArEY,wBAAM;AAEX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,SAAS,EAAE,CAAC,EAAE,CAAC;IACjE,IAAA,iBAAK,EAAC,EAAE,WAAW,EAAE,CAAC,EAAE,KAAK,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({ 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"]}
|
package/dist/types/README.md
CHANGED
package/dist/types/package.json
CHANGED
|
@@ -26,8 +26,8 @@ export declare const FilterSchema: z.ZodOptional<z.ZodObject<{
|
|
|
26
26
|
searchFields?: string[] | undefined;
|
|
27
27
|
} | undefined;
|
|
28
28
|
sort?: Record<string, 1 | -1> | undefined;
|
|
29
|
-
select?: Record<string, 0 | 1> | undefined;
|
|
30
29
|
populate?: any;
|
|
30
|
+
select?: Record<string, 0 | 1> | undefined;
|
|
31
31
|
query?: Record<string, any> | undefined;
|
|
32
32
|
}, {
|
|
33
33
|
search?: {
|
|
@@ -36,8 +36,8 @@ export declare const FilterSchema: z.ZodOptional<z.ZodObject<{
|
|
|
36
36
|
} | undefined;
|
|
37
37
|
sort?: Record<string, 1 | -1> | undefined;
|
|
38
38
|
size?: number | undefined;
|
|
39
|
-
select?: Record<string, 0 | 1> | undefined;
|
|
40
39
|
populate?: any;
|
|
40
|
+
select?: Record<string, 0 | 1> | undefined;
|
|
41
41
|
query?: Record<string, any> | undefined;
|
|
42
42
|
page?: number | undefined;
|
|
43
43
|
}>>;
|
|
@@ -733,12 +733,12 @@ export declare const GetByIdInputSchema: z.ZodObject<{
|
|
|
733
733
|
populate: z.ZodOptional<z.ZodUnion<[z.ZodType<any, z.ZodTypeDef, any>, z.ZodArray<z.ZodType<any, z.ZodTypeDef, any>, "many">]>>;
|
|
734
734
|
}, "strip", z.ZodTypeAny, {
|
|
735
735
|
_id: import("mongoose").Types.ObjectId;
|
|
736
|
-
select?: Record<string, 0 | 1> | undefined;
|
|
737
736
|
populate?: any;
|
|
737
|
+
select?: Record<string, 0 | 1> | undefined;
|
|
738
738
|
}, {
|
|
739
739
|
_id: string | import("mongoose").Types.ObjectId;
|
|
740
|
-
select?: Record<string, 0 | 1> | undefined;
|
|
741
740
|
populate?: any;
|
|
741
|
+
select?: Record<string, 0 | 1> | undefined;
|
|
742
742
|
}>;
|
|
743
743
|
export type GetByIdInputDTO = DTO<typeof GetByIdInputSchema>;
|
|
744
744
|
export declare const GetProductByIdInputSchema: z.ZodObject<{
|
|
@@ -751,12 +751,12 @@ export declare const GetProductByIdInputSchema: z.ZodObject<{
|
|
|
751
751
|
_id: import("mongoose").Types.ObjectId;
|
|
752
752
|
withAttributeHiddenItems: boolean;
|
|
753
753
|
withAddonsHiddenItems: boolean;
|
|
754
|
-
select?: Record<string, 0 | 1> | undefined;
|
|
755
754
|
populate?: any;
|
|
755
|
+
select?: Record<string, 0 | 1> | undefined;
|
|
756
756
|
}, {
|
|
757
757
|
_id: string | import("mongoose").Types.ObjectId;
|
|
758
|
-
select?: Record<string, 0 | 1> | undefined;
|
|
759
758
|
populate?: any;
|
|
759
|
+
select?: Record<string, 0 | 1> | undefined;
|
|
760
760
|
withAttributeHiddenItems?: boolean | undefined;
|
|
761
761
|
withAddonsHiddenItems?: boolean | undefined;
|
|
762
762
|
}>;
|
|
@@ -768,13 +768,13 @@ export declare const GetOrderByIdInputSchema: z.ZodObject<{
|
|
|
768
768
|
userOrderCompletionScope: z.ZodOptional<z.ZodNativeEnum<typeof UserOrderCompletionScope>>;
|
|
769
769
|
}, "strip", z.ZodTypeAny, {
|
|
770
770
|
_id: import("mongoose").Types.ObjectId;
|
|
771
|
-
select?: Record<string, 0 | 1> | undefined;
|
|
772
771
|
populate?: any;
|
|
772
|
+
select?: Record<string, 0 | 1> | undefined;
|
|
773
773
|
userOrderCompletionScope?: UserOrderCompletionScope | undefined;
|
|
774
774
|
}, {
|
|
775
775
|
_id: string | import("mongoose").Types.ObjectId;
|
|
776
|
-
select?: Record<string, 0 | 1> | undefined;
|
|
777
776
|
populate?: any;
|
|
777
|
+
select?: Record<string, 0 | 1> | undefined;
|
|
778
778
|
userOrderCompletionScope?: UserOrderCompletionScope | undefined;
|
|
779
779
|
}>;
|
|
780
780
|
export type GetOrderByIdInputDTO = DTO<typeof GetOrderByIdInputSchema>;
|
|
@@ -782,11 +782,11 @@ export declare const GetByTokenInputSchema: z.ZodOptional<z.ZodObject<{
|
|
|
782
782
|
select: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodLiteral<0>, z.ZodLiteral<1>]>>>;
|
|
783
783
|
populate: z.ZodOptional<z.ZodUnion<[z.ZodType<any, z.ZodTypeDef, any>, z.ZodArray<z.ZodType<any, z.ZodTypeDef, any>, "many">]>>;
|
|
784
784
|
}, "strip", z.ZodTypeAny, {
|
|
785
|
-
select?: Record<string, 0 | 1> | undefined;
|
|
786
785
|
populate?: any;
|
|
787
|
-
}, {
|
|
788
786
|
select?: Record<string, 0 | 1> | undefined;
|
|
787
|
+
}, {
|
|
789
788
|
populate?: any;
|
|
789
|
+
select?: Record<string, 0 | 1> | undefined;
|
|
790
790
|
}>>;
|
|
791
791
|
export type GetByTokenInputDTO = DTO<typeof GetByTokenInputSchema>;
|
|
792
792
|
export declare const GetOneQuerySchema: z.ZodObject<{
|
|
@@ -794,12 +794,12 @@ export declare const GetOneQuerySchema: z.ZodObject<{
|
|
|
794
794
|
select: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodLiteral<0>, z.ZodLiteral<1>]>>>;
|
|
795
795
|
populate: z.ZodOptional<z.ZodUnion<[z.ZodType<any, z.ZodTypeDef, any>, z.ZodArray<z.ZodType<any, z.ZodTypeDef, any>, "many">]>>;
|
|
796
796
|
}, "strip", z.ZodTypeAny, {
|
|
797
|
-
select?: Record<string, 0 | 1> | undefined;
|
|
798
797
|
populate?: any;
|
|
798
|
+
select?: Record<string, 0 | 1> | undefined;
|
|
799
799
|
query?: Record<string, any> | undefined;
|
|
800
800
|
}, {
|
|
801
|
-
select?: Record<string, 0 | 1> | undefined;
|
|
802
801
|
populate?: any;
|
|
802
|
+
select?: Record<string, 0 | 1> | undefined;
|
|
803
803
|
query?: Record<string, any> | undefined;
|
|
804
804
|
}>;
|
|
805
805
|
export type GetOneQueryDTO = DTO<typeof GetOneQuerySchema>;
|