@lyxa.ai/core 1.2.71 → 1.2.73
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/blocked-time.model.d.ts +13 -0
- package/dist/libraries/mongo/models/blocked-time.model.js +69 -0
- package/dist/libraries/mongo/models/blocked-time.model.js.map +1 -0
- package/dist/libraries/mongo/models/embedded/order-cancel.model.d.ts +0 -8
- package/dist/libraries/mongo/models/embedded/order-cancel.model.js +1 -24
- package/dist/libraries/mongo/models/embedded/order-cancel.model.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/service-order-settings.model.d.ts +3 -1
- package/dist/libraries/mongo/models/embedded/service-order-settings.model.js +22 -6
- package/dist/libraries/mongo/models/embedded/service-order-settings.model.js.map +1 -1
- package/dist/libraries/mongo/models/index.d.ts +3 -0
- package/dist/libraries/mongo/models/index.js +4 -1
- package/dist/libraries/mongo/models/index.js.map +1 -1
- package/dist/libraries/mongo/models/professional-schedule.d.ts +9 -5
- package/dist/libraries/mongo/models/professional-schedule.js +41 -17
- package/dist/libraries/mongo/models/professional-schedule.js.map +1 -1
- package/dist/libraries/mongo/models/professional.model.d.ts +5 -1
- package/dist/libraries/mongo/models/professional.model.js +16 -0
- package/dist/libraries/mongo/models/professional.model.js.map +1 -1
- package/dist/libraries/mongo/models/shared/work-hour.model.d.ts +12 -0
- package/dist/libraries/mongo/models/shared/work-hour.model.js +38 -1
- package/dist/libraries/mongo/models/shared/work-hour.model.js.map +1 -1
- package/dist/libraries/mongo/models/vendor.model.d.ts +0 -2
- package/dist/libraries/mongo/models/vendor.model.js +0 -6
- 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/enum.d.ts +7 -0
- package/dist/types/utilities/enum.js +9 -1
- package/dist/types/utilities/enum.js.map +1 -1
- package/dist/utilities/enum.d.ts +7 -0
- package/dist/utilities/enum.js +9 -1
- package/dist/utilities/enum.js.map +1 -1
- package/dist/utilities/events-common-methods.d.ts +3 -3
- package/dist/utilities/events-common-methods.js +26 -1
- package/dist/utilities/events-common-methods.js.map +1 -1
- package/package.json +1 -1
|
@@ -8,9 +8,6 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
12
|
exports.ProfessionalSchedule = void 0;
|
|
16
13
|
const typegoose_1 = require("@typegoose/typegoose");
|
|
@@ -18,17 +15,21 @@ const professional_model_1 = require("./professional.model");
|
|
|
18
15
|
const enum_1 = require("../../../utilities/enum");
|
|
19
16
|
const service_order_model_1 = require("./service-order.model");
|
|
20
17
|
const service_package_model_1 = require("./service-package.model");
|
|
21
|
-
const mongoose_1 =
|
|
18
|
+
const mongoose_1 = require("mongoose");
|
|
19
|
+
const vendor_model_1 = require("./vendor.model");
|
|
22
20
|
let ProfessionalSchedule = class ProfessionalSchedule {
|
|
23
21
|
professional;
|
|
24
22
|
timeFrom;
|
|
25
23
|
timeTo;
|
|
26
|
-
|
|
24
|
+
type;
|
|
27
25
|
serviceOrder;
|
|
28
|
-
|
|
26
|
+
servicePackages;
|
|
27
|
+
bookingStatus;
|
|
28
|
+
reason;
|
|
29
|
+
blockedProfessionals;
|
|
29
30
|
isRecurring;
|
|
30
31
|
recurrencePattern;
|
|
31
|
-
|
|
32
|
+
vendor;
|
|
32
33
|
};
|
|
33
34
|
exports.ProfessionalSchedule = ProfessionalSchedule;
|
|
34
35
|
__decorate([
|
|
@@ -36,7 +37,7 @@ __decorate([
|
|
|
36
37
|
__metadata("design:type", Object)
|
|
37
38
|
], ProfessionalSchedule.prototype, "professional", void 0);
|
|
38
39
|
__decorate([
|
|
39
|
-
(0, typegoose_1.prop)({ required: true }),
|
|
40
|
+
(0, typegoose_1.prop)({ required: true, index: true }),
|
|
40
41
|
__metadata("design:type", Date)
|
|
41
42
|
], ProfessionalSchedule.prototype, "timeFrom", void 0);
|
|
42
43
|
__decorate([
|
|
@@ -44,29 +45,52 @@ __decorate([
|
|
|
44
45
|
__metadata("design:type", Date)
|
|
45
46
|
], ProfessionalSchedule.prototype, "timeTo", void 0);
|
|
46
47
|
__decorate([
|
|
47
|
-
(0, typegoose_1.prop)({
|
|
48
|
+
(0, typegoose_1.prop)({
|
|
49
|
+
type: String,
|
|
50
|
+
enum: enum_1.ProfessionalScheduleType,
|
|
51
|
+
required: true,
|
|
52
|
+
index: true
|
|
53
|
+
}),
|
|
48
54
|
__metadata("design:type", String)
|
|
49
|
-
], ProfessionalSchedule.prototype, "
|
|
55
|
+
], ProfessionalSchedule.prototype, "type", void 0);
|
|
50
56
|
__decorate([
|
|
51
57
|
(0, typegoose_1.prop)({ ref: () => service_order_model_1.ServiceOrder }),
|
|
52
58
|
__metadata("design:type", Object)
|
|
53
59
|
], ProfessionalSchedule.prototype, "serviceOrder", void 0);
|
|
54
60
|
__decorate([
|
|
55
|
-
(0, typegoose_1.prop)({ ref: () => service_package_model_1.ServicePackage, type: () => [mongoose_1.
|
|
61
|
+
(0, typegoose_1.prop)({ ref: () => service_package_model_1.ServicePackage, type: () => [mongoose_1.Types.ObjectId] }),
|
|
62
|
+
__metadata("design:type", Array)
|
|
63
|
+
], ProfessionalSchedule.prototype, "servicePackages", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
(0, typegoose_1.prop)({
|
|
66
|
+
type: String,
|
|
67
|
+
enum: enum_1.BookingStatus
|
|
68
|
+
}),
|
|
69
|
+
__metadata("design:type", String)
|
|
70
|
+
], ProfessionalSchedule.prototype, "bookingStatus", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, typegoose_1.prop)({ type: String }),
|
|
73
|
+
__metadata("design:type", String)
|
|
74
|
+
], ProfessionalSchedule.prototype, "reason", void 0);
|
|
75
|
+
__decorate([
|
|
76
|
+
(0, typegoose_1.prop)({ ref: () => professional_model_1.Professional, type: () => [mongoose_1.Types.ObjectId] }),
|
|
56
77
|
__metadata("design:type", Array)
|
|
57
|
-
], ProfessionalSchedule.prototype, "
|
|
78
|
+
], ProfessionalSchedule.prototype, "blockedProfessionals", void 0);
|
|
58
79
|
__decorate([
|
|
59
|
-
(0, typegoose_1.prop)({ default: false }),
|
|
80
|
+
(0, typegoose_1.prop)({ type: Boolean, default: false }),
|
|
60
81
|
__metadata("design:type", Boolean)
|
|
61
82
|
], ProfessionalSchedule.prototype, "isRecurring", void 0);
|
|
62
83
|
__decorate([
|
|
63
|
-
(0, typegoose_1.prop)({
|
|
84
|
+
(0, typegoose_1.prop)({
|
|
85
|
+
type: String,
|
|
86
|
+
enum: enum_1.ProfessionalRecurrencePattern
|
|
87
|
+
}),
|
|
64
88
|
__metadata("design:type", String)
|
|
65
89
|
], ProfessionalSchedule.prototype, "recurrencePattern", void 0);
|
|
66
90
|
__decorate([
|
|
67
|
-
(0, typegoose_1.prop)({
|
|
68
|
-
__metadata("design:type",
|
|
69
|
-
], ProfessionalSchedule.prototype, "
|
|
91
|
+
(0, typegoose_1.prop)({ ref: () => vendor_model_1.Vendor, required: true }),
|
|
92
|
+
__metadata("design:type", Object)
|
|
93
|
+
], ProfessionalSchedule.prototype, "vendor", void 0);
|
|
70
94
|
exports.ProfessionalSchedule = ProfessionalSchedule = __decorate([
|
|
71
95
|
(0, typegoose_1.modelOptions)({
|
|
72
96
|
schemaOptions: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"professional-schedule.js","sourceRoot":"/","sources":["libraries/mongo/models/professional-schedule.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"professional-schedule.js","sourceRoot":"/","sources":["libraries/mongo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EAAE,MAAM;QACZ,IAAI,EAAE,oBAAa;KACtB,CAAC;;2DACmC;AAI9B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;oDACA;AAGhB;IADN,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,iCAAY,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,gBAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;;kEACd;AAI3C;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;yDACX;AAMtB;IAJN,IAAA,gBAAI,EAAC;QACF,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,oCAA6B;KACtC,CAAC;;+DACuD;AASlD;IADN,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,qBAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDAChB;+BAvDnB,oBAAoB;IANhC,IAAA,wBAAY,EAAC;QACV,aAAa,EAAE;YACX,UAAU,EAAE,uBAAuB;YACnC,UAAU,EAAE,IAAI;SACnB;KACJ,CAAC;GACW,oBAAoB,CAwDhC","sourcesContent":["import { modelOptions, prop, Ref } from \"@typegoose/typegoose\";\nimport { Professional } from \"./professional.model\";\nimport { BookingStatus, ProfessionalRecurrencePattern, ProfessionalScheduleType, ProfessionalStatus, ServiceOrderStatus, Status } from \"../../../utilities/enum\";\nimport { ServiceOrder } from \"./service-order.model\";\nimport { ServicePackage } from \"./service-package.model\";\nimport mongoose, { Types } from \"mongoose\";\nimport { Vendor } from \"./vendor.model\";\n\n\n@modelOptions({\n schemaOptions: {\n collection: \"professionalSchedules\",\n timestamps: true\n }\n})\nexport class ProfessionalSchedule {\n @prop({ ref: () => Professional, required: true })\n public professional!: Ref<Professional>;\n\n @prop({ required: true, index: true })\n public timeFrom!: Date;\n\n @prop({ required: true })\n public timeTo!: Date;\n\n @prop({\n type: String,\n enum: ProfessionalScheduleType,\n required: true,\n index: true\n })\n public type!: ProfessionalScheduleType;\n\n // For BOOKING type\n @prop({ ref: () => ServiceOrder })\n public serviceOrder?: Ref<ServiceOrder>;\n\n @prop({ ref: () => ServicePackage, type: () => [Types.ObjectId] })\n public servicePackages?: Ref<ServicePackage>[];\n\n @prop({\n type: String,\n enum: BookingStatus\n })\n public bookingStatus?: BookingStatus;\n\n // For BLOCKED type\n @prop({ type: String })\n public reason?: string;\n\n @prop({ ref: () => Professional, type: () => [Types.ObjectId] })\n public blockedProfessionals?: Ref<Professional>[];\n\n // Recurrence settings\n @prop({ type: Boolean, default: false })\n public isRecurring!: boolean;\n\n @prop({\n type: String,\n enum: ProfessionalRecurrencePattern\n })\n public recurrencePattern?: ProfessionalRecurrencePattern;\n\n // @prop()\n // public recurrenceEndDate?: Date;\n\n // @prop({ ref: () => 'ProfessionalSchedule' })\n // public parentSchedule?: Ref<'ProfessionalSchedule'>;\n\n @prop({ ref: () => Vendor, required: true })\n public vendor!: Ref<Vendor>;\n}\n"]}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Ref } from '@typegoose/typegoose';
|
|
2
2
|
import { Vendor } from './vendor.model';
|
|
3
3
|
import { ServicePackage } from './service-package.model';
|
|
4
|
-
import { Status } from '../../../utilities/enum';
|
|
4
|
+
import { ProfessionalStatus, Status } from '../../../utilities/enum';
|
|
5
|
+
import { TeamMemberWorkHourSetting } from './shared/work-hour.model';
|
|
5
6
|
export declare class Professional {
|
|
6
7
|
name: string;
|
|
7
8
|
image: string;
|
|
@@ -10,7 +11,10 @@ export declare class Professional {
|
|
|
10
11
|
password: string;
|
|
11
12
|
nationality?: string;
|
|
12
13
|
vendor: Ref<Vendor>;
|
|
14
|
+
availability: TeamMemberWorkHourSetting[];
|
|
13
15
|
worksOn: Ref<ServicePackage>[];
|
|
14
16
|
avgRating?: number;
|
|
17
|
+
totalReviews: number;
|
|
15
18
|
status: Status;
|
|
19
|
+
currentStatus?: ProfessionalStatus;
|
|
16
20
|
}
|
|
@@ -15,6 +15,7 @@ const vendor_model_1 = require("./vendor.model");
|
|
|
15
15
|
const service_package_model_1 = require("./service-package.model");
|
|
16
16
|
const enum_1 = require("../../../utilities/enum");
|
|
17
17
|
const password_1 = require("../../../utilities/password");
|
|
18
|
+
const work_hour_model_1 = require("./shared/work-hour.model");
|
|
18
19
|
let Professional = class Professional {
|
|
19
20
|
name;
|
|
20
21
|
image;
|
|
@@ -23,9 +24,12 @@ let Professional = class Professional {
|
|
|
23
24
|
password;
|
|
24
25
|
nationality;
|
|
25
26
|
vendor;
|
|
27
|
+
availability;
|
|
26
28
|
worksOn;
|
|
27
29
|
avgRating;
|
|
30
|
+
totalReviews;
|
|
28
31
|
status;
|
|
32
|
+
currentStatus;
|
|
29
33
|
};
|
|
30
34
|
exports.Professional = Professional;
|
|
31
35
|
__decorate([
|
|
@@ -56,6 +60,10 @@ __decorate([
|
|
|
56
60
|
(0, typegoose_1.prop)({ ref: () => vendor_model_1.Vendor, required: true }),
|
|
57
61
|
__metadata("design:type", Object)
|
|
58
62
|
], Professional.prototype, "vendor", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, typegoose_1.prop)({ type: () => work_hour_model_1.TeamMemberWorkHourSetting, default: [] }),
|
|
65
|
+
__metadata("design:type", Array)
|
|
66
|
+
], Professional.prototype, "availability", void 0);
|
|
59
67
|
__decorate([
|
|
60
68
|
(0, typegoose_1.prop)({ ref: () => service_package_model_1.ServicePackage, default: [] }),
|
|
61
69
|
__metadata("design:type", Array)
|
|
@@ -64,10 +72,18 @@ __decorate([
|
|
|
64
72
|
(0, typegoose_1.prop)({ type: Number, default: 0 }),
|
|
65
73
|
__metadata("design:type", Number)
|
|
66
74
|
], Professional.prototype, "avgRating", void 0);
|
|
75
|
+
__decorate([
|
|
76
|
+
(0, typegoose_1.prop)({ type: Number, default: 0 }),
|
|
77
|
+
__metadata("design:type", Number)
|
|
78
|
+
], Professional.prototype, "totalReviews", void 0);
|
|
67
79
|
__decorate([
|
|
68
80
|
(0, typegoose_1.prop)({ required: true, type: String, enum: enum_1.Status, default: enum_1.Status.ACTIVE }),
|
|
69
81
|
__metadata("design:type", String)
|
|
70
82
|
], Professional.prototype, "status", void 0);
|
|
83
|
+
__decorate([
|
|
84
|
+
(0, typegoose_1.prop)({ required: true, type: String, enum: enum_1.ProfessionalStatus, default: enum_1.ProfessionalStatus.AVAILABLE }),
|
|
85
|
+
__metadata("design:type", String)
|
|
86
|
+
], Professional.prototype, "currentStatus", void 0);
|
|
71
87
|
exports.Professional = Professional = __decorate([
|
|
72
88
|
(0, typegoose_1.pre)('save', async function (next) {
|
|
73
89
|
if (this.isModified('password')) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"professional.model.js","sourceRoot":"/","sources":["libraries/mongo/models/professional.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAoE;AACpE,iDAAwC;AACxC,mEAAyD;AACzD,kDAAqE;AACrE,0DAA2D;
|
|
1
|
+
{"version":3,"file":"professional.model.js","sourceRoot":"/","sources":["libraries/mongo/models/professional.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAoE;AACpE,iDAAwC;AACxC,mEAAyD;AACzD,kDAAqE;AACrE,0DAA2D;AAC3D,8DAAqE;AAS9D,IAAM,YAAY,GAAlB,MAAM,YAAY;IAEjB,IAAI,CAAU;IAGd,KAAK,CAAU;IAGf,WAAW,CAAU;IAGrB,KAAK,CAAU;IAGf,QAAQ,CAAU;IAGlB,WAAW,CAAU;IAGrB,MAAM,CAAe;IAGrB,YAAY,CAA8B;IAG1C,OAAO,CAAyB;IAGhC,SAAS,CAAU;IAGnB,YAAY,CAAU;IAGtB,MAAM,CAAU;IAGhB,aAAa,CAAsB;CAC1C,CAAA;AAvCY,oCAAY;AAEjB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAA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O,EAAE,yBAAkB,CAAC,SAAS,EAAE,CAAC;;mDAC9D;uBAtC9B,YAAY;IAPxB,IAAA,eAAG,EAAe,MAAM,EAAE,KAAK,WAAW,IAAI;QAC9C,IAAI,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;YACjC,IAAI,CAAC,QAAQ,GAAG,MAAM,IAAA,uBAAY,EAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACnD,CAAC;QACD,IAAI,EAAE,CAAC;IACR,CAAC,CAAC;IACD,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,eAAe,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,CAAC;GACtE,YAAY,CAuCxB","sourcesContent":["import { prop, Ref, modelOptions, pre } from '@typegoose/typegoose';\nimport { Vendor } from './vendor.model';\nimport { ServicePackage } from './service-package.model';\nimport { ProfessionalStatus, Status } from '../../../utilities/enum';\nimport { hashPassword } from '../../../utilities/password';\nimport { TeamMemberWorkHourSetting } from './shared/work-hour.model';\n\n@pre<Professional>('save', async function (next) {\n\tif (this.isModified('password')) {\n\t\tthis.password = await hashPassword(this.password);\n\t}\n\tnext();\n})\n@modelOptions({ schemaOptions: { collection: 'professionals', timestamps: true } })\nexport class Professional {\n\t@prop({ required: true, trim: true })\n\tpublic name!: string;\n\n\t@prop({ required: true })\n\tpublic image!: string;\n\n\t@prop({ required: true, unique: true })\n\tpublic phoneNumber!: string;\n\n\t@prop({ required: true, unique: true })\n\tpublic email!: string;\n\n\t@prop({ type: String })\n\tpublic password!: string;\n\n\t@prop()\n\tpublic nationality?: string;\n\n\t@prop({ ref: () => Vendor, required: true })\n\tpublic vendor!: Ref<Vendor>;\n\n\t@prop({ type: () => TeamMemberWorkHourSetting, default: [] })\n\tpublic availability!: TeamMemberWorkHourSetting[]\n\n\t@prop({ ref: () => ServicePackage, default: [] })\n\tpublic worksOn!: Ref<ServicePackage>[];\n\n\t@prop({ type: Number, default: 0 })\n\tpublic avgRating?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic totalReviews!: number;\n\n\t@prop({ required: true, type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status!: Status;\n\n\t@prop({ required: true, type: String, enum: ProfessionalStatus, default: ProfessionalStatus.AVAILABLE })\n\tpublic currentStatus?: ProfessionalStatus;\n}\n"]}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { Ref } from '@typegoose/typegoose';
|
|
1
2
|
import { HolidayWorkStatus, WeekDay, WorkStatus } from '../../../../utilities/enum';
|
|
3
|
+
import { Service } from '../service.model';
|
|
2
4
|
export declare class StartEndTime {
|
|
3
5
|
start: string;
|
|
4
6
|
end: string;
|
|
@@ -17,3 +19,13 @@ export declare class WorkHourSetting {
|
|
|
17
19
|
normalHours?: NormalHour[];
|
|
18
20
|
holidayHours?: HolidayHour[];
|
|
19
21
|
}
|
|
22
|
+
export declare class TimeSlot {
|
|
23
|
+
from: string;
|
|
24
|
+
to: string;
|
|
25
|
+
services: Ref<Service>[];
|
|
26
|
+
}
|
|
27
|
+
export declare class TeamMemberWorkHourSetting {
|
|
28
|
+
day: WeekDay;
|
|
29
|
+
isEnabled: boolean;
|
|
30
|
+
timeSlots: TimeSlot[];
|
|
31
|
+
}
|
|
@@ -9,9 +9,10 @@ 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.WorkHourSetting = exports.HolidayHour = exports.NormalHour = exports.StartEndTime = void 0;
|
|
12
|
+
exports.TeamMemberWorkHourSetting = exports.TimeSlot = exports.WorkHourSetting = exports.HolidayHour = exports.NormalHour = exports.StartEndTime = void 0;
|
|
13
13
|
const typegoose_1 = require("@typegoose/typegoose");
|
|
14
14
|
const enum_1 = require("../../../../utilities/enum");
|
|
15
|
+
const service_model_1 = require("../service.model");
|
|
15
16
|
class StartEndTime {
|
|
16
17
|
start;
|
|
17
18
|
end;
|
|
@@ -78,4 +79,40 @@ __decorate([
|
|
|
78
79
|
(0, typegoose_1.prop)({ type: () => [HolidayHour], default: [] }),
|
|
79
80
|
__metadata("design:type", Array)
|
|
80
81
|
], WorkHourSetting.prototype, "holidayHours", void 0);
|
|
82
|
+
class TimeSlot {
|
|
83
|
+
from;
|
|
84
|
+
to;
|
|
85
|
+
services;
|
|
86
|
+
}
|
|
87
|
+
exports.TimeSlot = TimeSlot;
|
|
88
|
+
__decorate([
|
|
89
|
+
(0, typegoose_1.prop)({ required: true }),
|
|
90
|
+
__metadata("design:type", String)
|
|
91
|
+
], TimeSlot.prototype, "from", void 0);
|
|
92
|
+
__decorate([
|
|
93
|
+
(0, typegoose_1.prop)({ required: true }),
|
|
94
|
+
__metadata("design:type", String)
|
|
95
|
+
], TimeSlot.prototype, "to", void 0);
|
|
96
|
+
__decorate([
|
|
97
|
+
(0, typegoose_1.prop)({ ref: () => service_model_1.Service }),
|
|
98
|
+
__metadata("design:type", Array)
|
|
99
|
+
], TimeSlot.prototype, "services", void 0);
|
|
100
|
+
class TeamMemberWorkHourSetting {
|
|
101
|
+
day;
|
|
102
|
+
isEnabled;
|
|
103
|
+
timeSlots;
|
|
104
|
+
}
|
|
105
|
+
exports.TeamMemberWorkHourSetting = TeamMemberWorkHourSetting;
|
|
106
|
+
__decorate([
|
|
107
|
+
(0, typegoose_1.prop)({ required: true, type: Number, enum: enum_1.WeekDay }),
|
|
108
|
+
__metadata("design:type", Number)
|
|
109
|
+
], TeamMemberWorkHourSetting.prototype, "day", void 0);
|
|
110
|
+
__decorate([
|
|
111
|
+
(0, typegoose_1.prop)({ type: Boolean, default: true }),
|
|
112
|
+
__metadata("design:type", Boolean)
|
|
113
|
+
], TeamMemberWorkHourSetting.prototype, "isEnabled", void 0);
|
|
114
|
+
__decorate([
|
|
115
|
+
(0, typegoose_1.prop)({ type: () => [TimeSlot], default: [] }),
|
|
116
|
+
__metadata("design:type", Array)
|
|
117
|
+
], TeamMemberWorkHourSetting.prototype, "timeSlots", void 0);
|
|
81
118
|
//# 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,oDAAiD;AACjD,qDAAoF;AACpF,oDAA2C;AAE3C,MAAa,YAAY;IAEjB,KAAK,CAAU;IAGf,GAAG,CAAU;CACpB;AAND,oCAMC;AAJO;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;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;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AGd;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;4DACZ;AAGpB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;4DAChB","sourcesContent":["import { prop, Ref } from '@typegoose/typegoose';\nimport { HolidayWorkStatus, WeekDay, WorkStatus } from '../../../../utilities/enum';\nimport { Service } from '../service.model';\n\nexport class StartEndTime {\n\t@prop({ required: true, type: String })\n\tpublic start!: string;\n\n\t@prop({ required: true, type: String })\n\tpublic end!: string;\n}\n\nexport class NormalHour {\n\t@prop({ required: true, type: Number, enum: WeekDay })\n\tpublic day!: WeekDay;\n\n\t@prop({ required: true, type: String, enum: WorkStatus })\n\tpublic status!: WorkStatus;\n\n\t@prop({ type: () => [StartEndTime], default: [] })\n\tpublic openingHours?: StartEndTime[];\n}\n\nexport class HolidayHour {\n\t@prop({ required: true, type: Date })\n\tpublic date?: Date;\n\n\t@prop({\n\t\trequired: true,\n\t\ttype: String,\n\t\tenum: HolidayWorkStatus,\n\t})\n\tpublic status!: HolidayWorkStatus;\n\n\t@prop({ type: StartEndTime })\n\tpublic closingHour?: StartEndTime;\n}\n\nexport class WorkHourSetting {\n\t@prop({ type: () => [NormalHour], default: [] })\n\tpublic normalHours?: NormalHour[];\n\n\t@prop({ type: () => [HolidayHour], default: [] })\n\tpublic holidayHours?: HolidayHour[];\n}\n\nexport class TimeSlot {\n\t@prop({ required: true })\n\tpublic from!: string; // Format: \"HH:mm\" (e.g., \"09:00\")\n\n\t@prop({ required: true })\n\tpublic to!: string; // Format: \"HH:mm\" (e.g., \"17:00\")\n\n\t@prop({ ref: () => Service })\n\tpublic services!: Ref<Service>[]\n}\n\n\nexport class TeamMemberWorkHourSetting {\n\t@prop({ required: true, type: Number, enum: WeekDay })\n\tpublic day!: WeekDay;\n\n\t@prop({ type: Boolean, default: true })\n\tpublic isEnabled!: boolean;\n\n\t@prop({ type: () => [TimeSlot], default: [] })\n\tpublic timeSlots!: TimeSlot[];\n}"]}
|
|
@@ -9,7 +9,6 @@ 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 { CleaningServiceSettings } from './embedded/cleaning-service-settings.model';
|
|
13
12
|
export declare class Vendor extends TimeStamps {
|
|
14
13
|
name: string;
|
|
15
14
|
ownerName: string;
|
|
@@ -39,6 +38,5 @@ export declare class Vendor extends TimeStamps {
|
|
|
39
38
|
bobContactName?: string;
|
|
40
39
|
bobContactPhoneNumber?: string;
|
|
41
40
|
orderSettings?: ServiceOrderSettings;
|
|
42
|
-
cleaningServiceSettings?: CleaningServiceSettings;
|
|
43
41
|
workHourSetting?: WorkHourSetting;
|
|
44
42
|
}
|
|
@@ -25,7 +25,6 @@ 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 cleaning_service_settings_model_1 = require("./embedded/cleaning-service-settings.model");
|
|
29
28
|
let Vendor = class Vendor extends defaultClasses_1.TimeStamps {
|
|
30
29
|
name;
|
|
31
30
|
ownerName;
|
|
@@ -55,7 +54,6 @@ let Vendor = class Vendor extends defaultClasses_1.TimeStamps {
|
|
|
55
54
|
bobContactName;
|
|
56
55
|
bobContactPhoneNumber;
|
|
57
56
|
orderSettings;
|
|
58
|
-
cleaningServiceSettings;
|
|
59
57
|
workHourSetting;
|
|
60
58
|
};
|
|
61
59
|
exports.Vendor = Vendor;
|
|
@@ -171,10 +169,6 @@ __decorate([
|
|
|
171
169
|
(0, typegoose_1.prop)({ type: () => service_order_settings_model_1.ServiceOrderSettings }),
|
|
172
170
|
__metadata("design:type", service_order_settings_model_1.ServiceOrderSettings)
|
|
173
171
|
], Vendor.prototype, "orderSettings", void 0);
|
|
174
|
-
__decorate([
|
|
175
|
-
(0, typegoose_1.prop)({ type: () => cleaning_service_settings_model_1.CleaningServiceSettings }),
|
|
176
|
-
__metadata("design:type", cleaning_service_settings_model_1.CleaningServiceSettings)
|
|
177
|
-
], Vendor.prototype, "cleaningServiceSettings", void 0);
|
|
178
172
|
__decorate([
|
|
179
173
|
(0, typegoose_1.prop)({ type: work_hour_model_1.WorkHourSetting }),
|
|
180
174
|
__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,kDAA8D;AAC9D,wEAA8D;AAC9D,0DAAiD;AACjD,8DAAyE;AACzE,2CAAkC;AAClC,6CAAoC;AACpC,wBAA8C;AAC9C,sDAA8B;AAC9B,mDAA0C;AAC1C,0FAA+E;
|
|
1
|
+
{"version":3,"file":"vendor.model.js","sourceRoot":"/","sources":["libraries/mongo/models/vendor.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,oDAAqF;AACrF,4EAAqE;AACrE,kDAA8D;AAC9D,wEAA8D;AAC9D,0DAAiD;AACjD,8DAAyE;AACzE,2CAAkC;AAClC,6CAAoC;AACpC,wBAA8C;AAC9C,sDAA8B;AAC9B,mDAA0C;AAC1C,0FAA+E;AA8CxE,IAAM,MAAM,GAAZ,MAAM,MAAO,SAAQ,2BAAU;IAE9B,IAAI,CAAU;IAGd,SAAS,CAAU;IAGnB,KAAK,CAAU;IAGf,IAAI,CAAU;IAGd,MAAM,CAAoB;IAG1B,OAAO,CAAe;IAGtB,WAAW,CAAc;IAGzB,MAAM,CAAU;IAGhB,WAAW,CAAU;IAGrB,eAAe,CAAU;IAGzB,sBAAsB,CAAY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,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,CAuFlB","sourcesContent":["import { modelOptions, prop, Ref, Severity, Index, pre } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { ServiceType, Status } from '../../../utilities/enum';\nimport { ShopDocument } from './embedded/shop-document.model';\nimport { Address } from './shared/address.model';\nimport { StartEndTime, WorkHourSetting } from './shared/work-hour.model';\nimport { Tag } from './tag.model';\nimport { Zone } from './zone.model';\nimport { VendorParent, VendorModel } 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, serviceType: 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: ServiceType })\n\tpublic serviceType!: ServiceType\n\n\t@prop({ required: true, type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status!: Status;\n\n\t@prop({ required: true, type: String })\n\tpublic phoneNumber!: string;\n\n\t@prop({ required: true, type: String })\n\tpublic userPhoneNumber!: string;\n\n\t@prop({ type: () => [String], default: [] })\n\tpublic additionalPhoneNumbers?: string[];\n\n\t@prop({ required: true, type: Address })\n\tpublic address!: Address;\n\n\t@prop({ required: true, ref: () => Zone, type: () => [String] })\n\tpublic zone!: Ref<Zone>[];\n\n\t@prop({ type: String })\n\tpublic logo?: string;\n\n\t@prop({ type: String })\n\tpublic banner?: string;\n\n\t@prop({ type: ShopDocument })\n\tpublic document?: ShopDocument;\n\n\t@prop({ type: () => [StartEndTime], default: [] })\n\tpublic vendorActiveTimingsOfCurrentDate?: StartEndTime[];\n\n\t@prop({ ref: () => Tag, default: [] })\n\tpublic tags?: Ref<Tag>[];\n\n\t@prop({ type: Number })\n\tpublic sortingOrder?: number;\n\n\t@prop({ default: 0, type: () => Number })\n\tpublic avgRating?: number;\n\n\t@prop({ type: Number, default: 1, min: 1, max: 4 })\n\tpublic priceRange?: number;\n\n\t@prop({ required: true, type: Boolean })\n\tpublic isBeirutAuthentic!: boolean;\n\n\t@prop({ required: true, type: Boolean })\n\tpublic isVisibleToUser!: boolean;\n\n\t@prop({ default: 0, type: () => Number })\n\tpublic ordersCount?: number;\n\n\t@prop({ default: 0, type: () => Number })\n\tpublic customersCount?: number;\n\n\t@prop({ type: String, maxlength: 100 })\n\tpublic bobContactName?: string;\n\n\t@prop({ type: String, maxlength: 15 })\n\tpublic bobContactPhoneNumber?: string;\n\n\t@prop({ type: () => ServiceOrderSettings })\n\tpublic orderSettings?: ServiceOrderSettings;\n\n\t@prop({ type: WorkHourSetting })\n\tpublic workHourSetting?: WorkHourSetting;\n}\n"]}
|
package/dist/types/README.md
CHANGED
package/dist/types/package.json
CHANGED
|
@@ -706,6 +706,13 @@ export declare enum ProfessionalScheduleType {
|
|
|
706
706
|
BLOCK = "block",
|
|
707
707
|
ORDER = "order"
|
|
708
708
|
}
|
|
709
|
+
export declare enum BookingStatus {
|
|
710
|
+
PENDING = "pending",
|
|
711
|
+
CONFIRMED = "confirmed",
|
|
712
|
+
IN_PROGRESS = "in_progress",
|
|
713
|
+
COMPLETED = "completed",
|
|
714
|
+
CANCELLED = "cancelled"
|
|
715
|
+
}
|
|
709
716
|
export declare enum ShopFilterSortByEnum {
|
|
710
717
|
PRICE_LOW_TO_HIGH = "price_low_to_high",
|
|
711
718
|
PRICE_HIGH_TO_LOW = "price_high_to_low",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MarketingType = exports.FavouriteType = exports.CouponExpirationReason = exports.CouponType = exports.BobType = exports.BobChannelType = exports.BobModel = exports.BobSettlementStatus = exports.BobSettlementType = exports.BobAccountType = exports.ZoneStatus = exports.FaqAccountType = exports.CounterType = exports.BannerUserType = exports.BannerLinkType = exports.BannerClickType = exports.VendorRole = exports.ShopRole = exports.OnlineStatus = exports.ShopOnlineStatus = exports.ChargeType = exports.ClickType = exports.NotificationAccountType = exports.DishCategory = exports.ProductDietaryType = exports.ShopDietaryType = exports.PriceOption = exports.ProductType = exports.CoreAuthIdentityType = exports.UserAppSectionItemType = exports.UserAppSectionType = exports.AdminLogsUpdatedFieldsType = exports.UpdatedField = exports.GeoLocationType = exports.RatingAccountType = exports.SubscriptionStatus = exports.SubscriptionPackage = exports.PaidCurrency = exports.PaymentStatus = exports.PaymentMethod = exports.ValueType = exports.HolidayWorkStatus = exports.WorkStatus = exports.WeekDay = exports.GlobalItemType = exports.AdjustmentStatus = exports.ItemType = exports.Status = exports.AccountType = exports.AgentLiveStatus = void 0;
|
|
4
4
|
exports.Service = exports.ServiceCartStatus = exports.ChatroomType = exports.UserRef = exports.TicketStatus = exports.TicketType = exports.RewardedToTypeEnum = exports.ReplacementType = exports.ReplacementReason = exports.OrderCanceledBy = exports.LogUser = exports.PayoutStatus = exports.PayoutType = exports.AddRemoveCreditAccountType = exports.SettingsReasonStatus = exports.CancellationReasonTypeEnum = exports.SupportReasonTypeEnum = exports.PlusSettingsPackageType = exports.AddRemoveCreditSettlementType = exports.SettlementType = exports.MediaType = exports.WorkingHourSettingsType = exports.ZoneGeometryType = exports.RiderAssignmentStatus = exports.CourierServiceType = exports.TripLegStatus = exports.DeliveryStatus = exports.CourierOrderPaymentFrom = exports.ShopCourierOrderStatus = exports.ServiceOrderStatus = exports.CourierOrderStatus = exports.RegularOrderStatus = exports.StatusTimelineType = exports.OrderType = exports.Language = exports.OrderSize = exports.RiderBagSize = exports.RiderType = exports.ShiftType = exports.CreatedBy = exports.LiveStatus = exports.AreebaCardStatus = exports.CardUserType = exports.CardType = exports.PaymentPreference = exports.CartStatus = exports.AdminRole = exports.PunchMarketingStatus = exports.MarketingStatus = exports.ServiceMarketingType = void 0;
|
|
5
|
-
exports.UserOrderCompletionScope = exports.GroupCartNotificationStatus = exports.CurrencyType = exports.RequestFrom = exports.UploadState = exports.ServiceType = exports.ActionType = exports.DeviceType = exports.PushNotificationEventType = exports.SocketEventType = exports.SocketServiceQueue = exports.OtpMethodType = exports.ReviewType = exports.FoodNutritionType = exports.AdjustmentReason = exports.UrgentOrderReasons = exports.FlagReasonType = exports.FlagType = exports.PromotionType = exports.ServiceOrderCanceledBy = exports.TRPCErrorEnum = exports.ShopFilterSortByEnum = exports.ProfessionalScheduleType = exports.ServiceOrderRecurrencePattern = exports.ProfessionalRecurrencePattern = exports.ServiceOrderPriority = exports.ProfessionalStatus = void 0;
|
|
5
|
+
exports.UserOrderCompletionScope = exports.GroupCartNotificationStatus = exports.CurrencyType = exports.RequestFrom = exports.UploadState = exports.ServiceType = exports.ActionType = exports.DeviceType = exports.PushNotificationEventType = exports.SocketEventType = exports.SocketServiceQueue = exports.OtpMethodType = exports.ReviewType = exports.FoodNutritionType = exports.AdjustmentReason = exports.UrgentOrderReasons = exports.FlagReasonType = exports.FlagType = exports.PromotionType = exports.ServiceOrderCanceledBy = exports.TRPCErrorEnum = exports.ShopFilterSortByEnum = exports.BookingStatus = exports.ProfessionalScheduleType = exports.ServiceOrderRecurrencePattern = exports.ProfessionalRecurrencePattern = exports.ServiceOrderPriority = exports.ProfessionalStatus = void 0;
|
|
6
6
|
var AgentLiveStatus;
|
|
7
7
|
(function (AgentLiveStatus) {
|
|
8
8
|
AgentLiveStatus["ONLINE"] = "online";
|
|
@@ -816,6 +816,14 @@ var ProfessionalScheduleType;
|
|
|
816
816
|
ProfessionalScheduleType["BLOCK"] = "block";
|
|
817
817
|
ProfessionalScheduleType["ORDER"] = "order";
|
|
818
818
|
})(ProfessionalScheduleType || (exports.ProfessionalScheduleType = ProfessionalScheduleType = {}));
|
|
819
|
+
var BookingStatus;
|
|
820
|
+
(function (BookingStatus) {
|
|
821
|
+
BookingStatus["PENDING"] = "pending";
|
|
822
|
+
BookingStatus["CONFIRMED"] = "confirmed";
|
|
823
|
+
BookingStatus["IN_PROGRESS"] = "in_progress";
|
|
824
|
+
BookingStatus["COMPLETED"] = "completed";
|
|
825
|
+
BookingStatus["CANCELLED"] = "cancelled";
|
|
826
|
+
})(BookingStatus || (exports.BookingStatus = BookingStatus = {}));
|
|
819
827
|
var ShopFilterSortByEnum;
|
|
820
828
|
(function (ShopFilterSortByEnum) {
|
|
821
829
|
ShopFilterSortByEnum["PRICE_LOW_TO_HIGH"] = "price_low_to_high";
|