@lyxa.ai/core 1.1.4 → 1.1.5
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/embedded/{capacity-settings.model.d.ts → cleaning-service-settings.model.d.ts} +5 -5
- package/dist/libraries/mongo/models/embedded/{capacity-settings.model.js → cleaning-service-settings.model.js} +18 -21
- package/dist/libraries/mongo/models/embedded/cleaning-service-settings.model.js.map +1 -0
- package/dist/libraries/mongo/models/vendor.model.d.ts +2 -2
- package/dist/libraries/mongo/models/vendor.model.js +5 -5
- 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/package.json +1 -1
- package/dist/libraries/mongo/models/embedded/capacity-settings.model.js.map +0 -1
|
@@ -5,18 +5,18 @@ declare class Services {
|
|
|
5
5
|
service: Ref<Service>;
|
|
6
6
|
numberOfProfessionals: number;
|
|
7
7
|
}
|
|
8
|
-
declare class
|
|
8
|
+
declare class DailyAllocations {
|
|
9
9
|
day: WeekDay;
|
|
10
10
|
services: Services[];
|
|
11
11
|
}
|
|
12
|
-
declare class
|
|
12
|
+
declare class FurnitureCleaningConfig {
|
|
13
13
|
numberOfPackages: number;
|
|
14
14
|
numberOfProfessionals: number;
|
|
15
15
|
}
|
|
16
|
-
export declare class
|
|
16
|
+
export declare class CleaningServiceSettings {
|
|
17
17
|
slotBufferTime: number;
|
|
18
18
|
slotInterval: number;
|
|
19
|
-
|
|
20
|
-
furnitureCleaningConfig?:
|
|
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.
|
|
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
|
|
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
|
-
],
|
|
37
|
+
], DailyAllocations.prototype, "day", void 0);
|
|
38
38
|
__decorate([
|
|
39
39
|
(0, typegoose_1.prop)({ type: () => [Services] }),
|
|
40
40
|
__metadata("design:type", Array)
|
|
41
|
-
],
|
|
42
|
-
class
|
|
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
|
-
],
|
|
49
|
+
], FurnitureCleaningConfig.prototype, "numberOfPackages", void 0);
|
|
50
50
|
__decorate([
|
|
51
51
|
(0, typegoose_1.prop)({ required: true }),
|
|
52
52
|
__metadata("design:type", Number)
|
|
53
|
-
],
|
|
54
|
-
|
|
53
|
+
], FurnitureCleaningConfig.prototype, "numberOfProfessionals", void 0);
|
|
54
|
+
class CleaningServiceSettings {
|
|
55
55
|
slotBufferTime;
|
|
56
56
|
slotInterval;
|
|
57
|
-
|
|
57
|
+
dailyAllocations;
|
|
58
58
|
furnitureCleaningConfig;
|
|
59
|
-
}
|
|
60
|
-
exports.
|
|
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
|
-
],
|
|
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
|
-
],
|
|
76
|
+
], CleaningServiceSettings.prototype, "slotInterval", void 0);
|
|
77
77
|
__decorate([
|
|
78
|
-
(0, typegoose_1.prop)({ type: () => [
|
|
78
|
+
(0, typegoose_1.prop)({ type: () => [DailyAllocations] }),
|
|
79
79
|
__metadata("design:type", Array)
|
|
80
|
-
],
|
|
80
|
+
], CleaningServiceSettings.prototype, "dailyAllocations", void 0);
|
|
81
81
|
__decorate([
|
|
82
|
-
(0, typegoose_1.prop)({ type: () => [
|
|
82
|
+
(0, typegoose_1.prop)({ type: () => [FurnitureCleaningConfig] }),
|
|
83
83
|
__metadata("design:type", Array)
|
|
84
|
-
],
|
|
85
|
-
|
|
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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AAG,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"]}
|
|
@@ -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 {
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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: () =>
|
|
166
|
-
__metadata("design:type",
|
|
167
|
-
], Vendor.prototype, "
|
|
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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8B;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"]}
|
package/dist/types/README.md
CHANGED
package/dist/types/package.json
CHANGED
package/package.json
CHANGED
|
@@ -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"]}
|