@lyxa.ai/core 1.4.189 → 1.4.191
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.
|
@@ -68,7 +68,14 @@ __decorate([
|
|
|
68
68
|
__metadata("design:type", Object)
|
|
69
69
|
], ServicePackage.prototype, "category", void 0);
|
|
70
70
|
__decorate([
|
|
71
|
-
(0, typegoose_1.prop)({
|
|
71
|
+
(0, typegoose_1.prop)({
|
|
72
|
+
required: true,
|
|
73
|
+
type: Number,
|
|
74
|
+
validate: {
|
|
75
|
+
validator: (value) => value > 0,
|
|
76
|
+
message: 'Price must be greater than 0',
|
|
77
|
+
},
|
|
78
|
+
}),
|
|
72
79
|
__metadata("design:type", Number)
|
|
73
80
|
], ServicePackage.prototype, "price", void 0);
|
|
74
81
|
__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-package.model.js","sourceRoot":"/","sources":["libraries/mongo/models/service-package.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAmF;AACnF,4EAAqE;AACrE,kDAA8E;AAC9E,iDAAwC;AACxC,qEAA2D;AAC3D,mCAA4D;AAC5D,0EAAgE;AAChE,gFAAsE;AACtE,8EAAyE;AA4BlE,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,2BAAU;IAEtC,IAAI,CAAU;IAGd,cAAc,CAAU;IAGxB,MAAM,CAAe;IAGrB,WAAW,CAAe;IAG1B,cAAc,CAAkB;IAGhC,WAAW,CAAU;IAGrB,QAAQ,CAAwB;
|
|
1
|
+
{"version":3,"file":"service-package.model.js","sourceRoot":"/","sources":["libraries/mongo/models/service-package.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAmF;AACnF,4EAAqE;AACrE,kDAA8E;AAC9E,iDAAwC;AACxC,qEAA2D;AAC3D,mCAA4D;AAC5D,0EAAgE;AAChE,gFAAsE;AACtE,8EAAyE;AA4BlE,IAAM,cAAc,GAApB,MAAM,cAA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/defaultClasses';\nimport { ServiceType, Status, SubServiceType } from '../../../utilities/enum';\nimport { Vendor } from './vendor.model';\nimport { ServiceCategory } from './service-category.model';\nimport { ServiceAddon, ServicePackageModel } from './index';\nimport { PreparingTime } from './embedded/preparing-time.model';\nimport { CleaningMaterial } from './embedded/cleaning-material.model';\nimport { normalizeFieldPlugin } from '../plugins/normalize-field.plugin';\n\n@modelOptions({ schemaOptions: { collection: 'servicePackages', timestamps: true } })\n@index({ nameNormalized: 1, vendor: 1 }, { unique: true, partialFilterExpression: { deletedAt: null } })\n@index({ nameNormalized: 1 }, { partialFilterExpression: { deletedAt: null } })\n@pre<ServicePackage>('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 ServicePackageModel.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})\n@plugin(normalizeFieldPlugin, { field: 'name' })\nexport class ServicePackage extends TimeStamps {\n\t@prop({ required: true, type: String, trim: true, maxlength: 20 })\n\tpublic name!: string;\n\n\t@prop({ type: String, trim: true, lowercase: true, select: false })\n\tpublic nameNormalized?: string;\n\n\t@prop({ required: true, ref: () => Vendor })\n\tpublic vendor!: Ref<Vendor>;\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({ type: String, trim: true })\n\tpublic description?: string;\n\n\t@prop({ required: true, ref: () => ServiceCategory })\n\tpublic category!: Ref<ServiceCategory>;\n\n\t@prop({\n\t\trequired: true,\n\t\ttype: Number,\n\t\tvalidate: {\n\t\t\tvalidator: (value: number) => value > 0,\n\t\t\tmessage: 'Price must be greater than 0',\n\t\t},\n\t})\n\tpublic price!: number;\n\n\t@prop({ required: true, type: PreparingTime })\n\tpublic duration!: PreparingTime;\n\n\t@prop({ required: true, type: Number, min: 1 })\n\tpublic numberOfProfessionals!: number;\n\n\t@prop({ required: true, type: String })\n\tpublic image!: string;\n\n\t@prop({ type: String, maxlength: 250 })\n\tpublic vendorNotes?: string;\n\n\t@prop({ ref: () => ServiceAddon, default: [] })\n\tpublic addons?: Ref<ServiceAddon>[];\n\n\t@prop({ type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status: Status;\n\n\t@prop({ required: true, type: CleaningMaterial })\n\tpublic cleaningMaterial!: CleaningMaterial;\n\n\t@prop({ type: Number })\n\tpublic sortingOrder?: number;\n\n\t@prop({ default: 0, type: () => Number })\n\tpublic avgRating?: number;\n}\n"]}
|
package/dist/types/README.md
CHANGED
package/dist/types/package.json
CHANGED