@lyxa.ai/core 1.3.251 → 1.3.253
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 +2 -2
- package/dist/libraries/mongo/models/professional.model.js.map +1 -1
- package/dist/libraries/mongo/models/service-addon.model.d.ts +1 -1
- package/dist/libraries/mongo/models/service-addon.model.js +4 -4
- package/dist/libraries/mongo/models/service-addon.model.js.map +1 -1
- package/dist/libraries/mongo/models/service-category.model.js +1 -1
- package/dist/libraries/mongo/models/service-category.model.js.map +1 -1
- package/dist/libraries/mongo/models/service.model.js +2 -2
- package/dist/libraries/mongo/models/service.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/types/README.md +1 -1
- package/dist/types/package.json +1 -1
- 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,11 +64,11 @@ __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([
|
|
71
|
-
(0, typegoose_1.prop)({ required: true, type: String, enum: enum_1.SubServiceType }),
|
|
71
|
+
(0, typegoose_1.prop)({ required: true, type: [String], enum: enum_1.SubServiceType }),
|
|
72
72
|
__metadata("design:type", Array)
|
|
73
73
|
], Professional.prototype, "worksOn", void 0);
|
|
74
74
|
__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,E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K;QAC/B,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YAChB,IAAI,CAAC,cAAc,GAAG,MAAM,IAAA,yBAAU,EAAC,eAAY,EAAE,kBAAW,CAAC,WAAW,CAAC,CAAC;QAC/E,CAAC;QAED,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;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"]}
|
|
@@ -5,7 +5,7 @@ import { PreparingTime } from './embedded/preparing-time.model';
|
|
|
5
5
|
export declare class ServiceAddon {
|
|
6
6
|
name: string;
|
|
7
7
|
serviceType: ServiceType;
|
|
8
|
-
|
|
8
|
+
subServiceTypes?: SubServiceType[];
|
|
9
9
|
vendor: Ref<Vendor>;
|
|
10
10
|
image: string;
|
|
11
11
|
price: number;
|
|
@@ -21,7 +21,7 @@ const preparing_time_model_1 = require("./embedded/preparing-time.model");
|
|
|
21
21
|
let ServiceAddon = class ServiceAddon {
|
|
22
22
|
name;
|
|
23
23
|
serviceType;
|
|
24
|
-
|
|
24
|
+
subServiceTypes;
|
|
25
25
|
vendor;
|
|
26
26
|
image;
|
|
27
27
|
price;
|
|
@@ -39,9 +39,9 @@ __decorate([
|
|
|
39
39
|
__metadata("design:type", String)
|
|
40
40
|
], ServiceAddon.prototype, "serviceType", void 0);
|
|
41
41
|
__decorate([
|
|
42
|
-
(0, typegoose_1.prop)({ type: String, enum: enum_1.SubServiceType }),
|
|
43
|
-
__metadata("design:type",
|
|
44
|
-
], ServiceAddon.prototype, "
|
|
42
|
+
(0, typegoose_1.prop)({ type: [String], enum: enum_1.SubServiceType }),
|
|
43
|
+
__metadata("design:type", Array)
|
|
44
|
+
], ServiceAddon.prototype, "subServiceTypes", void 0);
|
|
45
45
|
__decorate([
|
|
46
46
|
(0, typegoose_1.prop)({ required: true, type: () => mongoose_1.default.Types.ObjectId, ref: () => index_1.Vendor }),
|
|
47
47
|
__metadata("design:type", Object)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-addon.model.js","sourceRoot":"/","sources":["libraries/mongo/models/service-addon.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,oDAAsE;AACtE,wDAAgC;AAChC,mCAAiC;AACjC,kDAA8E;AAC9E,0EAAgE;AASzD,IAAM,YAAY,GAAlB,MAAM,YAAY;IAEjB,IAAI,CAAU;IAGd,WAAW,CAAe;IAG1B,
|
|
1
|
+
{"version":3,"file":"service-addon.model.js","sourceRoot":"/","sources":["libraries/mongo/models/service-addon.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,oDAAsE;AACtE,wDAAgC;AAChC,mCAAiC;AACjC,kDAA8E;AAC9E,0EAAgE;AASzD,IAAM,YAAY,GAAlB,MAAM,YAAY;IAEjB,IAAI,CAAU;IAGd,WAAW,CAAe;IAG1B,eAAe,CAAoB;IAGnC,MAAM,CAAe;IAGrB,KAAK,CAAU;IAGf,KAAK,CAAU;IAGf,QAAQ,CAAiB;IAGzB,WAAW,CAAU;IAGrB,MAAM,CAAS;CACtB,CAAA;AA3BY,oCAAY;AAEjB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;;0CAChB;AAGd;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAW,EAAE,CAAC;;iDACzB;AAG1B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,qBAAc,EAAE,CAAC;;qDACL;AAGnC;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,kBAAQ,CAAC,KAAK,CAAC,QAAQ,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,cAAM,EAAE,CAAC;;4CACrD;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;;2CAC7B;AAGf;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;;2CACzB;AAGf;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,oCAAa,EAAE,CAAC;8BAC5B,oCAAa;8CAAC;AAGzB;IADN,IAAA,gBAAI,EAAC,EAAE,SAAS,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;;iDACT;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,aAAM,EAAE,OAAO,EAAE,aAAM,CAAC,MAAM,EAAE,CAAC;;4CACvC;uBA1BV,YAAY;IAPxB,IAAA,wBAAY,EAAC;QACb,aAAa,EAAE;YACd,UAAU,EAAE,eAAe;YAC3B,UAAU,EAAE,IAAI;SAChB;KACD,CAAC;IACD,IAAA,iBAAK,EAAC,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;GACrC,YAAY,CA2BxB","sourcesContent":["import { prop, modelOptions, Ref, index } from '@typegoose/typegoose';\nimport mongoose from 'mongoose';\nimport { Vendor } from './index';\nimport { ServiceType, Status, SubServiceType } from '../../../utilities/enum';\nimport { PreparingTime } from './embedded/preparing-time.model';\n\n@modelOptions({\n\tschemaOptions: {\n\t\tcollection: 'serviceAddons',\n\t\ttimestamps: true,\n\t},\n})\n@index({ name: 1, service: 1 }, { unique: false })\nexport class ServiceAddon {\n\t@prop({ required: true, trim: true })\n\tpublic name!: string;\n\n\t@prop({ required: true, type: String, enum: ServiceType })\n\tpublic serviceType!: ServiceType;\n\n\t@prop({ type: [String], enum: SubServiceType })\n\tpublic subServiceTypes?: SubServiceType[];\n\n\t@prop({ required: true, type: () => mongoose.Types.ObjectId, ref: () => Vendor })\n\tpublic vendor!: Ref<Vendor>;\n\n\t@prop({ required: true, type: String, trim: true })\n\tpublic image!: string;\n\n\t@prop({ required: true, type: Number, min: 0 })\n\tpublic price!: number;\n\n\t@prop({ required: true, type: PreparingTime })\n\tpublic duration!: PreparingTime;\n\n\t@prop({ maxlength: 250, trim: true })\n\tpublic description?: string;\n\n\t@prop({ type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status: Status;\n}\n"]}
|
|
@@ -51,7 +51,7 @@ __decorate([
|
|
|
51
51
|
__metadata("design:type", String)
|
|
52
52
|
], ServiceCategory.prototype, "status", void 0);
|
|
53
53
|
__decorate([
|
|
54
|
-
(0, typegoose_1.prop)({ type: Boolean,
|
|
54
|
+
(0, typegoose_1.prop)({ type: Boolean, default: true }),
|
|
55
55
|
__metadata("design:type", Boolean)
|
|
56
56
|
], ServiceCategory.prototype, "isVisible", void 0);
|
|
57
57
|
__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-category.model.js","sourceRoot":"/","sources":["libraries/mongo/models/service-category.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA2E;AAC3E,4EAAqE;AACrE,kDAA8E;AAC9E,iDAAwC;AACxC,wBAAyC;AA0BlC,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,2BAAU;IAEvC,IAAI,CAAU;IAGd,WAAW,CAAe;IAG1B,cAAc,CAAkB;IAGhC,MAAM,CAAe;IAGrB,KAAK,CAAU;IAGf,MAAM,CAAU;IAGhB,SAAS,CAAW;IAGpB,YAAY,CAAU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B,MAAM,EAAE,KAAK,WAAW,IAAI;QAEjD,IAAI,IAAI,CAAC,KAAK,IAAI,OAAO,IAAI,CAAC,YAAY,KAAK,WAAW,EAAE,CAAC;YAC5D,IAAI,CAAC;gBAEJ,MAAM,eAAe,GAAG,MAAM,uBAAoB,CAAC,SAAS,CAA8B;oBACzF;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,EAAE,CAAC;IACR,CAAC,CAAC;GACW,eAAe,CAwB3B","sourcesContent":["import { Index, modelOptions, pre, prop, Ref } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { ServiceType, Status, SubServiceType } from '../../../utilities/enum';\nimport { Vendor } from './vendor.model';\nimport { ServiceCategoryModel } from '.';\n\n@Index({ name: 1, vendor: 1 }, { unique: true, collation: { locale: 'en', strength: 2 } })\n@modelOptions({ schemaOptions: { collection: 'serviceCategories' } })\n@pre<ServiceCategory>('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 ServiceCategoryModel.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\tnext();\n})\nexport class ServiceCategory extends TimeStamps {\n\t@prop({ required: true, type: String, trim: true, maxlength: 20 })\n\tpublic name!: string;\n\n\t@prop({ required: true, type: String, enum: ServiceType })\n\tpublic serviceType!: ServiceType;\n\n\t@prop({ type: String, enum: SubServiceType })\n\tpublic subServiceType?: SubServiceType;\n\n\t@prop({ required: true, ref: () => Vendor })\n\tpublic vendor!: Ref<Vendor>;\n\n\t@prop({ type: String })\n\tpublic image?: string;\n\n\t@prop({ type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status?: Status;\n\n\t@prop({ type: Boolean,
|
|
1
|
+
{"version":3,"file":"service-category.model.js","sourceRoot":"/","sources":["libraries/mongo/models/service-category.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA2E;AAC3E,4EAAqE;AACrE,kDAA8E;AAC9E,iDAAwC;AACxC,wBAAyC;AA0BlC,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,2BAAU;IAEvC,IAAI,CAAU;IAGd,WAAW,CAAe;IAG1B,cAAc,CAAkB;IAGhC,MAAM,CAAe;IAGrB,KAAK,CAAU;IAGf,MAAM,CAAU;IAGhB,SAAS,CAAW;IAGpB,YAAY,CAAU;CAC7B,CAAA;AAxBY,0CAAe;AAEpB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;;6CAC7C;AAGd;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAW,EAAE,CA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E;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,EAAE,CAAC;IACR,CAAC,CAAC;GACW,eAAe,CAwB3B","sourcesContent":["import { Index, modelOptions, pre, prop, Ref } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { ServiceType, Status, SubServiceType } from '../../../utilities/enum';\nimport { Vendor } from './vendor.model';\nimport { ServiceCategoryModel } from '.';\n\n@Index({ name: 1, vendor: 1 }, { unique: true, collation: { locale: 'en', strength: 2 } })\n@modelOptions({ schemaOptions: { collection: 'serviceCategories' } })\n@pre<ServiceCategory>('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 ServiceCategoryModel.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\tnext();\n})\nexport class ServiceCategory extends TimeStamps {\n\t@prop({ required: true, type: String, trim: true, maxlength: 20 })\n\tpublic name!: string;\n\n\t@prop({ required: true, type: String, enum: ServiceType })\n\tpublic serviceType!: ServiceType;\n\n\t@prop({ type: String, enum: SubServiceType })\n\tpublic subServiceType?: SubServiceType;\n\n\t@prop({ required: true, ref: () => Vendor })\n\tpublic vendor!: Ref<Vendor>;\n\n\t@prop({ type: String })\n\tpublic image?: string;\n\n\t@prop({ type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status?: Status;\n\n\t@prop({ type: Boolean, default: true })\n\tpublic isVisible?: boolean;\n\n\t@prop({ type: Number })\n\tpublic sortingOrder?: number;\n}\n"]}
|
|
@@ -37,7 +37,7 @@ __decorate([
|
|
|
37
37
|
__metadata("design:type", String)
|
|
38
38
|
], Service.prototype, "image", void 0);
|
|
39
39
|
exports.Service = Service = __decorate([
|
|
40
|
-
(0, typegoose_1.
|
|
41
|
-
(0, typegoose_1.
|
|
40
|
+
(0, typegoose_1.modelOptions)({ schemaOptions: { collection: 'services' } }),
|
|
41
|
+
(0, typegoose_1.Index)({ serviceType: 1, subServiceType: 1 }, { unique: true, partialFilterExpression: { deletedAt: null } })
|
|
42
42
|
], Service);
|
|
43
43
|
//# sourceMappingURL=service.model.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.model.js","sourceRoot":"/","sources":["libraries/mongo/models/service.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"service.model.js","sourceRoot":"/","sources":["libraries/mongo/models/service.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAiE;AACjE,4EAAqE;AACrE,kDAAsE;AAI/D,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,2BAAU;IAE/B,IAAI,CAAU;IAGd,WAAW,CAAe;IAG1B,cAAc,CAAkB;IAGhC,KAAK,CAAU;CACtB,CAAA;AAZY,0BAAO;AAEZ;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;qCAClB;AAGd;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAW,EAAE,CAAC;;4CACzB;AAG1B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,qBAAc,EAAE,CAAC;;+CACN;AAGhC;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;sCACjB;kBAXV,OAAO;IAFnB,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,UAAU,EAAE,EAAE,CAAC;IAC3D,IAAA,iBAAK,EAAC,EAAE,WAAW,EAAE,CAAC,EAAE,cAAc,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,uBAAuB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC;GAChG,OAAO,CAYnB","sourcesContent":["import { Index, modelOptions, prop } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { ServiceType, SubServiceType } from '../../../utilities/enum';\n\n@modelOptions({ schemaOptions: { collection: 'services' } })\n@Index({ serviceType: 1, subServiceType: 1 }, { unique: true, partialFilterExpression: { deletedAt: null } })\nexport class Service extends TimeStamps {\n\t@prop({ required: true, type: String })\n\tpublic name!: string;\n\n\t@prop({ required: true, type: String, enum: ServiceType })\n\tpublic serviceType!: ServiceType;\n\n\t@prop({ type: String, enum: SubServiceType })\n\tpublic subServiceType?: SubServiceType;\n\n\t@prop({ required: true, type: String })\n\tpublic image!: string;\n}\n"]}
|
|
@@ -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;AAG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E,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"]}
|
package/dist/types/README.md
CHANGED
package/dist/types/package.json
CHANGED