@lyxa.ai/core 1.2.78 → 1.2.81
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/addon.model.d.ts +2 -0
- package/dist/libraries/mongo/models/addon.model.js +6 -0
- package/dist/libraries/mongo/models/addon.model.js.map +1 -1
- package/dist/libraries/mongo/models/service-cart.model.d.ts +2 -0
- package/dist/libraries/mongo/models/service-cart.model.js +6 -0
- package/dist/libraries/mongo/models/service-cart.model.js.map +1 -1
- package/dist/libraries/mongo/models/service-line-item.model.d.ts +5 -1
- package/dist/libraries/mongo/models/service-line-item.model.js +13 -1
- package/dist/libraries/mongo/models/service-line-item.model.js.map +1 -1
- package/dist/libraries/mongo/models/service-package.model.d.ts +1 -3
- package/dist/libraries/mongo/models/service-package.model.js +0 -5
- package/dist/libraries/mongo/models/service-package.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,5 +1,6 @@
|
|
|
1
1
|
import { Ref } from "@typegoose/typegoose";
|
|
2
2
|
import { Service, Vendor } from "./index";
|
|
3
|
+
import { Status } from "../../../utilities/enum";
|
|
3
4
|
export declare class AddOn {
|
|
4
5
|
name: string;
|
|
5
6
|
service: Ref<Service>[];
|
|
@@ -9,4 +10,5 @@ export declare class AddOn {
|
|
|
9
10
|
hours: number;
|
|
10
11
|
minutes: number;
|
|
11
12
|
description?: string;
|
|
13
|
+
status: Status;
|
|
12
14
|
}
|
|
@@ -16,6 +16,7 @@ exports.AddOn = void 0;
|
|
|
16
16
|
const typegoose_1 = require("@typegoose/typegoose");
|
|
17
17
|
const mongoose_1 = __importDefault(require("mongoose"));
|
|
18
18
|
const index_1 = require("./index");
|
|
19
|
+
const enum_1 = require("../../../utilities/enum");
|
|
19
20
|
let AddOn = class AddOn {
|
|
20
21
|
name;
|
|
21
22
|
service;
|
|
@@ -25,6 +26,7 @@ let AddOn = class AddOn {
|
|
|
25
26
|
hours;
|
|
26
27
|
minutes;
|
|
27
28
|
description;
|
|
29
|
+
status;
|
|
28
30
|
};
|
|
29
31
|
exports.AddOn = AddOn;
|
|
30
32
|
__decorate([
|
|
@@ -87,6 +89,10 @@ __decorate([
|
|
|
87
89
|
}),
|
|
88
90
|
__metadata("design:type", String)
|
|
89
91
|
], AddOn.prototype, "description", void 0);
|
|
92
|
+
__decorate([
|
|
93
|
+
(0, typegoose_1.prop)({ type: String, enum: enum_1.Status, default: enum_1.Status.ACTIVE }),
|
|
94
|
+
__metadata("design:type", String)
|
|
95
|
+
], AddOn.prototype, "status", void 0);
|
|
90
96
|
exports.AddOn = AddOn = __decorate([
|
|
91
97
|
(0, typegoose_1.modelOptions)({
|
|
92
98
|
schemaOptions: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addon.model.js","sourceRoot":"/","sources":["libraries/mongo/models/addon.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,oDAK8B;AAC9B,wDAAgC;AAChC,mCAA0C;
|
|
1
|
+
{"version":3,"file":"addon.model.js","sourceRoot":"/","sources":["libraries/mongo/models/addon.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,oDAK8B;AAC9B,wDAAgC;AAChC,mCAA0C;AAC1C,kDAAiD;AAU1C,IAAM,KAAK,GAAX,MAAM,KAAK;IAEP,IAAI,CAAU;IAOd,OAAO,CAAkB;IAOzB,MAAM,CAAe;IAOrB,KAAK,CAAU;IAOf,KAAK,CAAU;IAOf,KAAK,CAAU;IAQf,OAAO,CAAU;IAMjB,WAAW,CAAU;IAGrB,MAAM,CAAS;CAEzB,CAAA;AAxDY,sBAAK;AAEP;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;;mCAChB;AAOd;IALN,IAAA,gBAAI,EAAC;QACF,QAAQ,EAAE,IAAI;QACd,IAAI,EAAE,GAAG,EAAE,CAAC,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,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;GACrC,KAAK,CAwDjB","sourcesContent":["import {\n prop,\n modelOptions,\n Ref,\n index,\n} from \"@typegoose/typegoose\";\nimport mongoose from \"mongoose\";\nimport { Service, Vendor } from \"./index\";\nimport { Status } from \"../../../utilities/enum\";\n\n\n@modelOptions({\n schemaOptions: {\n collection: \"addons\",\n timestamps: true,\n },\n})\n@index({ name: 1, service: 1 }, { unique: false })\nexport class AddOn {\n @prop({ required: true, trim: true })\n public name!: string;\n\n @prop({\n required: true,\n type: () => [mongoose.Types.ObjectId],\n ref: () => Service,\n })\n public service!: Ref<Service>[];\n\n @prop({\n required: true,\n type: () => mongoose.Types.ObjectId,\n ref: () => Vendor,\n })\n public vendor!: Ref<Vendor>;\n\n @prop({\n required: true,\n type: String,\n trim: true,\n })\n public image!: string; // store URL or path\n\n @prop({\n required: true,\n type: Number,\n min: 0,\n })\n public price!: number;\n\n @prop({\n required: true,\n type: Number,\n min: 0,\n })\n public hours!: number;\n\n @prop({\n required: true,\n type: Number,\n min: 0,\n max: 59,\n })\n public minutes!: number;\n\n @prop({\n maxlength: 250,\n trim: true,\n })\n public description?: string;\n \n @prop({ type: String, enum: Status, default: Status.ACTIVE })\n public status: Status;\n \n}\n"]}
|
|
@@ -6,9 +6,11 @@ import { ServiceOrderRecurrencePattern, ServiceCartStatus } from '../../../utili
|
|
|
6
6
|
import { ServiceLineItem } from './service-line-item.model';
|
|
7
7
|
import { UserAddress } from './shared/address.model';
|
|
8
8
|
import { StartEndTime } from './shared/work-hour.model';
|
|
9
|
+
import { Service } from './service.model';
|
|
9
10
|
export declare class ServiceCart extends TimeStamps {
|
|
10
11
|
user: Ref<User>;
|
|
11
12
|
vendor: Ref<Vendor>;
|
|
13
|
+
service: Ref<Service>;
|
|
12
14
|
serviceLocation?: UserAddress;
|
|
13
15
|
date: Date;
|
|
14
16
|
timeSlot: StartEndTime;
|
|
@@ -18,9 +18,11 @@ const enum_1 = require("../../../utilities/enum");
|
|
|
18
18
|
const service_line_item_model_1 = require("./service-line-item.model");
|
|
19
19
|
const address_model_1 = require("./shared/address.model");
|
|
20
20
|
const work_hour_model_1 = require("./shared/work-hour.model");
|
|
21
|
+
const service_model_1 = require("./service.model");
|
|
21
22
|
let ServiceCart = class ServiceCart extends defaultClasses_1.TimeStamps {
|
|
22
23
|
user;
|
|
23
24
|
vendor;
|
|
25
|
+
service;
|
|
24
26
|
serviceLocation;
|
|
25
27
|
date;
|
|
26
28
|
timeSlot;
|
|
@@ -37,6 +39,10 @@ __decorate([
|
|
|
37
39
|
(0, typegoose_1.prop)({ required: true, ref: () => vendor_model_1.Vendor }),
|
|
38
40
|
__metadata("design:type", Object)
|
|
39
41
|
], ServiceCart.prototype, "vendor", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, typegoose_1.prop)({ required: true, ref: () => service_model_1.Service }),
|
|
44
|
+
__metadata("design:type", Object)
|
|
45
|
+
], ServiceCart.prototype, "service", void 0);
|
|
40
46
|
__decorate([
|
|
41
47
|
(0, typegoose_1.prop)({ required: false, type: address_model_1.UserAddress }),
|
|
42
48
|
__metadata("design:type", address_model_1.UserAddress)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-cart.model.js","sourceRoot":"/","sources":["libraries/mongo/models/service-cart.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAgF;AAChF,4EAAqE;AACrE,6CAAoC;AACpC,iDAAwC;AACxC,kDAA2F;AAC3F,uEAA4D;AAC5D,0DAAqD;AACrD,8DAAwD;
|
|
1
|
+
{"version":3,"file":"service-cart.model.js","sourceRoot":"/","sources":["libraries/mongo/models/service-cart.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAgF;AAChF,4EAAqE;AACrE,6CAAoC;AACpC,iDAAwC;AACxC,kDAA2F;AAC3F,uEAA4D;AAC5D,0DAAqD;AACrD,8DAAwD;AACxD,mDAA0C;AAyBnC,IAAM,WAAW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E,CAAC,yCAAe;QAC1B,YAAY,EAAE,MAAM;QACpB,UAAU,EAAE,KAAK;KACjB,CAAC;;qDAC8C;sBAnCpC,WAAW;IAvBvB,IAAA,wBAAY,EAAC;QACb,aAAa,EAAE;YACd,UAAU,EAAE,cAAc;YAC1B,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;YAC1B,QAAQ,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;SAC5B;QACD,OAAO,EAAE;YACR,UAAU,EAAE,oBAAQ,CAAC,KAAK;SAC1B;KACD,CAAC;IACD,IAAA,iBAAK,EAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;IAClB,IAAA,iBAAK,EAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;IACpB,IAAA,iBAAK,EAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;IACpB,IAAA,iBAAK,EACL,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EACtB;QACC,MAAM,EAAE,IAAI;QACZ,uBAAuB,EAAE;YACxB,MAAM,EAAE,EAAE,GAAG,EAAE,CAAC,wBAAiB,CAAC,MAAM,EAAE,wBAAiB,CAAC,MAAM,CAAC,EAAE;YACrE,SAAS,EAAE,IAAI;SACf;KACD,CACD;GACY,WAAW,CAoCvB","sourcesContent":["import { Index, modelOptions, prop, Ref, Severity } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { User } from './user.model';\nimport { Vendor } from './vendor.model';\nimport { ServiceOrderRecurrencePattern, ServiceCartStatus } from '../../../utilities/enum';\nimport { ServiceLineItem } from './service-line-item.model';\nimport { UserAddress } from './shared/address.model';\nimport { StartEndTime } from './shared/work-hour.model';\nimport { Service } from './service.model';\n\n@modelOptions({\n\tschemaOptions: {\n\t\tcollection: 'serviceCarts',\n\t\ttoJSON: { virtuals: true },\n\t\ttoObject: { virtuals: true },\n\t},\n\toptions: {\n\t\tallowMixed: Severity.ALLOW,\n\t},\n})\n@Index({ user: 1 })\n@Index({ vendor: 1 })\n@Index({ status: 1 })\n@Index(\n\t{ user: 1, vendor: 1 },\n\t{\n\t\tunique: true,\n\t\tpartialFilterExpression: {\n\t\t\tstatus: { $in: [ServiceCartStatus.ACTIVE, ServiceCartStatus.LOCKED] },\n\t\t\tdeletedAt: null,\n\t\t},\n\t}\n)\nexport class ServiceCart extends TimeStamps {\n\t@prop({ required: true, ref: () => User })\n\tpublic user!: Ref<User>;\n\n\t@prop({ required: true, ref: () => Vendor })\n\tpublic vendor!: Ref<Vendor>;\n\n\t@prop({ required: true, ref: () => Service })\n\tpublic service!: Ref<Service>;\n\n\t@prop({ required: false, type: UserAddress })\n\tpublic serviceLocation?: UserAddress;\n\n\t@prop({ required: true })\n\tpublic date!: Date\n\n\t@prop({ required: true })\n\tpublic timeSlot!: StartEndTime\n\n\t@prop({ enum: ServiceOrderRecurrencePattern, default: ServiceOrderRecurrencePattern.ONETIME })\n\tpublic recurrencePattern?: ServiceOrderRecurrencePattern\n\n\t@prop({\n\t\tenum: ServiceCartStatus,\n\t\ttype: String,\n\t\tdefault: ServiceCartStatus.ACTIVE,\n\t\trequired: true,\n\t})\n\tpublic status!: ServiceCartStatus;\n\n\t@prop({\n\t\tref: () => ServiceLineItem,\n\t\tforeignField: 'cart',\n\t\tlocalField: '_id',\n\t})\n\tpublic serviceLineItems: Ref<ServiceLineItem>[];\n}\n"]}
|
|
@@ -4,12 +4,16 @@ import { ServiceCart } from './service-cart.model';
|
|
|
4
4
|
import { User } from './user.model';
|
|
5
5
|
import { Vendor } from './vendor.model';
|
|
6
6
|
import { ServicePackage } from './service-package.model';
|
|
7
|
+
import { AddOn } from './addon.model';
|
|
8
|
+
import { Status } from '../../../utilities/enum';
|
|
7
9
|
export declare class ServiceLineItem extends TimeStamps {
|
|
8
10
|
cart: Ref<ServiceCart>;
|
|
9
11
|
user: Ref<User>;
|
|
10
12
|
vendor: Ref<Vendor>;
|
|
11
|
-
servicePackage
|
|
13
|
+
servicePackage?: Ref<ServicePackage>;
|
|
14
|
+
addOn?: Ref<AddOn>;
|
|
12
15
|
quantity?: number;
|
|
13
16
|
isAddon: boolean;
|
|
17
|
+
status: Status;
|
|
14
18
|
calculationSnap?: Record<string, unknown>;
|
|
15
19
|
}
|
|
@@ -20,13 +20,17 @@ const user_model_1 = require("./user.model");
|
|
|
20
20
|
const vendor_model_1 = require("./vendor.model");
|
|
21
21
|
const service_package_model_1 = require("./service-package.model");
|
|
22
22
|
const mongoose_1 = __importDefault(require("mongoose"));
|
|
23
|
+
const addon_model_1 = require("./addon.model");
|
|
24
|
+
const enum_1 = require("../../../utilities/enum");
|
|
23
25
|
let ServiceLineItem = class ServiceLineItem extends defaultClasses_1.TimeStamps {
|
|
24
26
|
cart;
|
|
25
27
|
user;
|
|
26
28
|
vendor;
|
|
27
29
|
servicePackage;
|
|
30
|
+
addOn;
|
|
28
31
|
quantity;
|
|
29
32
|
isAddon;
|
|
33
|
+
status;
|
|
30
34
|
calculationSnap;
|
|
31
35
|
};
|
|
32
36
|
exports.ServiceLineItem = ServiceLineItem;
|
|
@@ -43,9 +47,13 @@ __decorate([
|
|
|
43
47
|
__metadata("design:type", Object)
|
|
44
48
|
], ServiceLineItem.prototype, "vendor", void 0);
|
|
45
49
|
__decorate([
|
|
46
|
-
(0, typegoose_1.prop)({
|
|
50
|
+
(0, typegoose_1.prop)({ ref: () => service_package_model_1.ServicePackage }),
|
|
47
51
|
__metadata("design:type", Object)
|
|
48
52
|
], ServiceLineItem.prototype, "servicePackage", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, typegoose_1.prop)({ ref: () => addon_model_1.AddOn }),
|
|
55
|
+
__metadata("design:type", Object)
|
|
56
|
+
], ServiceLineItem.prototype, "addOn", void 0);
|
|
49
57
|
__decorate([
|
|
50
58
|
(0, typegoose_1.prop)({ min: 1, default: 1 }),
|
|
51
59
|
__metadata("design:type", Number)
|
|
@@ -54,6 +62,10 @@ __decorate([
|
|
|
54
62
|
(0, typegoose_1.prop)({ type: Boolean, default: false }),
|
|
55
63
|
__metadata("design:type", Boolean)
|
|
56
64
|
], ServiceLineItem.prototype, "isAddon", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, typegoose_1.prop)({ type: String, enum: enum_1.Status, default: enum_1.Status.ACTIVE }),
|
|
67
|
+
__metadata("design:type", String)
|
|
68
|
+
], ServiceLineItem.prototype, "status", void 0);
|
|
57
69
|
__decorate([
|
|
58
70
|
(0, typegoose_1.prop)({ type: mongoose_1.default.Schema.Types.Mixed }),
|
|
59
71
|
__metadata("design:type", Object)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-line-item.model.js","sourceRoot":"/","sources":["libraries/mongo/models/service-line-item.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,oDAAgF;AAChF,4EAAqE;AACrE,6DAAmD;AACnD,6CAAoC;AACpC,iDAAwC;AACxC,mEAAyD;AACzD,wDAAgC;
|
|
1
|
+
{"version":3,"file":"service-line-item.model.js","sourceRoot":"/","sources":["libraries/mongo/models/service-line-item.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,oDAAgF;AAChF,4EAAqE;AACrE,6DAAmD;AACnD,6CAAoC;AACpC,iDAAwC;AACxC,mEAAyD;AACzD,wDAAgC;AAChC,+CAAsC;AACtC,kDAAiD;AAoB1C,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,2BAAU;IAEvC,IAAI,CAAoB;IAGxB,IAAI,CAAa;IAGjB,MAAM,CAAe;IAGrB,cAAc,CAAuB;IAGrC,KAAK,CAAc;IAGnB,QAAQ,CAAU;IAGlB,OAAO,CAAU;IAGjB,MAAM,CAAQ;IAGd,eAAe,CAA2B;CACjD,CAAA;AA3BY,0CAAe;AAEpB;IADN,IAAA,gBAAI,EAAC,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,gCAAW,EAAE,CAAC;;6CAC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EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;IAC3B,IAAA,iBAAK,EAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;IACrB,IAAA,iBAAK,EAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;GACR,eAAe,CA2B3B","sourcesContent":["import { Index, modelOptions, prop, Ref, Severity } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { ServiceCart } from './service-cart.model';\nimport { User } from './user.model';\nimport { Vendor } from './vendor.model';\nimport { ServicePackage } from './service-package.model';\nimport mongoose from 'mongoose';\nimport { AddOn } from './addon.model';\nimport { Status } from '../../../utilities/enum';\n\n/**\n * ServiceLineItem model - Represents individual items in a cart\n */\n\n@modelOptions({\n\tschemaOptions: {\n\t\tcollection: 'serviceLineItems',\n\t\ttoJSON: { virtuals: true },\n\t\ttoObject: { virtuals: true },\n\t},\n\toptions: {\n\t\tallowMixed: Severity.ALLOW,\n\t},\n})\n@Index({ cart: 1 })\n@Index({ cart: 1, user: 1 })\n@Index({ package: 1 })\n@Index({ vendor: 1 })\nexport class ServiceLineItem extends TimeStamps {\n\t@prop({ require: true, ref: () => ServiceCart })\n\tpublic cart!: Ref<ServiceCart>;\n\n\t@prop({ required: true, ref: () => User })\n\tpublic user!: Ref<User>;\n\n\t@prop({ required: true, ref: () => Vendor })\n\tpublic vendor!: Ref<Vendor>;\n\n\t@prop({ ref: () => ServicePackage })\n\tpublic servicePackage?: Ref<ServicePackage>;\n\n\t@prop({ ref: () => AddOn })\n\tpublic addOn?: Ref<AddOn>;\n\n\t@prop({ min: 1, default: 1 })\n\tpublic quantity?: number;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isAddon: boolean;\n\n\t@prop({ type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status: Status\n\n\t@prop({ type: mongoose.Schema.Types.Mixed })\n\tpublic calculationSnap?: Record<string, unknown>;\n}\n"]}
|
|
@@ -4,7 +4,6 @@ import { Status } from '../../../utilities/enum';
|
|
|
4
4
|
import { Vendor } from './vendor.model';
|
|
5
5
|
import { ServiceCategory } from './service-category.model';
|
|
6
6
|
import { Service } from "./service.model";
|
|
7
|
-
import { AddOn } from './index';
|
|
8
7
|
export declare class ServicePackage extends TimeStamps {
|
|
9
8
|
name: string;
|
|
10
9
|
vendor: Ref<Vendor>;
|
|
@@ -17,8 +16,7 @@ export declare class ServicePackage extends TimeStamps {
|
|
|
17
16
|
description?: string;
|
|
18
17
|
image: string;
|
|
19
18
|
vendorNotes?: string;
|
|
20
|
-
|
|
21
|
-
status?: Status;
|
|
19
|
+
status: Status;
|
|
22
20
|
includeMaterials: boolean;
|
|
23
21
|
materialsCost?: number;
|
|
24
22
|
sortingOrder?: number;
|
|
@@ -29,7 +29,6 @@ let ServicePackage = class ServicePackage extends defaultClasses_1.TimeStamps {
|
|
|
29
29
|
description;
|
|
30
30
|
image;
|
|
31
31
|
vendorNotes;
|
|
32
|
-
addons;
|
|
33
32
|
status;
|
|
34
33
|
includeMaterials;
|
|
35
34
|
materialsCost;
|
|
@@ -89,10 +88,6 @@ __decorate([
|
|
|
89
88
|
(0, typegoose_1.prop)({ type: String, maxlength: 250 }),
|
|
90
89
|
__metadata("design:type", String)
|
|
91
90
|
], ServicePackage.prototype, "vendorNotes", void 0);
|
|
92
|
-
__decorate([
|
|
93
|
-
(0, typegoose_1.prop)({ ref: () => index_1.AddOn, default: [], type: [String] }),
|
|
94
|
-
__metadata("design:type", Array)
|
|
95
|
-
], ServicePackage.prototype, "addons", void 0);
|
|
96
91
|
__decorate([
|
|
97
92
|
(0, typegoose_1.prop)({ type: String, enum: enum_1.Status, default: enum_1.Status.ACTIVE }),
|
|
98
93
|
__metadata("design:type", String)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-package.model.js","sourceRoot":"/","sources":["libraries/mongo/models/service-package.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA2E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;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;;qDACb;AAGvB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;oDACM;yBAxDpB,cAAc;IA3B1B,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,iBAAiB,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,CAAC;IACpF,IAAA,iBAAK,EACF,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EACtB,EAAE,MAAM,EAAE,IAAI,EAAE,uBAAuB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,CACjE;IACA,IAAA,eAAG,EAAiB,MAAM,EAAE,KAAK,WAAW,IAAI;QAE7C,IAAI,IAAI,CAAC,KAAK,IAAI,OAAO,IAAI,CAAC,YAAY,KAAK,WAAW,EAAE,CAAC;YACzD,IAAI,CAAC;gBAED,MAAM,eAAe,GAAG,MAAM,2BAAmB,CAAC,SAAS,CAA8B;oBACrF;wBACI,MAAM,EAAE;4BACJ,GAAG,EAAE,IAAI;4BACT,eAAe,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE;yBAC7C;qBACJ;iBACJ,CAAC,CAAC,IAAI,EAAE,CAAC;gBAGV,IAAI,CAAC,YAAY,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,eAAe,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;YACxE,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACb,OAAO,IAAI,CAAC,KAAc,CAAC,CAAC;YAChC,CAAC;QACL,CAAC;QACD,IAAI,EAAE,CAAC;IACX,CAAC,CAAC;GACW,cAAc,CAyD1B","sourcesContent":["import { Index, modelOptions, pre, prop, Ref } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { Status } from '../../../utilities/enum';\nimport { Vendor } from './vendor.model';\nimport { ServiceCategory } from './service-category.model';\nimport { Service } from \"./service.model\";\nimport { AddOn, ServicePackageModel } from './index';\n\n\n@modelOptions({ schemaOptions: { collection: 'servicePackages', timestamps: true } })\n@Index(\n { name: 1, vendor: 1 },\n { unique: true, partialFilterExpression: { deletedAt: null } }\n)\n@pre<ServicePackage>('save', async function (next) {\n // Only set sortingOrder if it's a new document or sortingOrder is not set\n if (this.isNew || typeof this.sortingOrder === 'undefined') {\n try {\n // Find the maximum sortingOrder for shops with the same itemType that aren't deleted\n const maxSortingOrder = await ServicePackageModel.aggregate<{ maxSortingOrder: number }>([\n {\n $group: {\n _id: null,\n maxSortingOrder: { $max: '$sortingOrder' },\n },\n },\n ]).exec();\n\n // Set the new sortingOrder to max + 1 (or 0 if no items found)\n this.sortingOrder = (maxSortingOrder[0]?.maxSortingOrder ?? -1) + 1;\n } catch (error) {\n return next(error as Error);\n }\n }\n next();\n})\nexport class ServicePackage extends TimeStamps {\n @prop({ required: true, type: String, trim: true, maxlength: 20 })\n public name!: string;\n\n @prop({ required: true, ref: () => Vendor })\n public vendor!: Ref<Vendor>;\n\n @prop({ required: true, ref: () => Service })\n public service: Ref<Service>\n \n @prop({ required: true, ref: () => ServiceCategory })\n public category!: Ref<ServiceCategory>;\n\n @prop({ required: true, type: Number, min: 0 })\n public price!: number;\n\n @prop({\n required: true,\n type: Number,\n min: 0,\n })\n public hours!: number;\n\n @prop({\n required: true,\n type: Number,\n min: 0,\n max: 59,\n })\n public minutes!: number;\n\n @prop({ required: true, type: Number, min: 1 })\n public numberOfProfessionals?: number; // no need for furniture cleaning\n\n @prop({ type: String, trim: true })\n public description?: string;\n\n @prop({ type: String })\n public image!: string;\n\n @prop({ type: String, maxlength: 250 })\n public vendorNotes?: string;\n\n // @prop({ ref: () => AddOn, default: [], type: [String] })\n // public addons?: Ref<AddOn>[];\n\n @prop({ type: String, enum: Status, default: Status.ACTIVE })\n public status: Status;\n \n @prop({ type: Boolean, default: false })\n public includeMaterials!: boolean;\n\n @prop({ type: Number, default: 0, min: 0 })\n public materialsCost?: number;\n\n @prop({ type: Number })\n public sortingOrder?: number;\n}\n\n"]}
|
package/dist/types/README.md
CHANGED
package/dist/types/package.json
CHANGED