@lyxa.ai/core 1.2.79 → 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/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 +2 -0
- package/dist/libraries/mongo/models/service-line-item.model.js +6 -0
- package/dist/libraries/mongo/models/service-line-item.model.js.map +1 -1
- package/dist/libraries/mongo/models/service-package.model.d.ts +0 -2
- 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
|
@@ -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,GAAjB,MAAM,WAAY,SAAQ,2BAAU;IAEnC,IAAI,CAAa;IAGjB,MAAM,CAAe;IAGrB,OAAO,CAAgB;IAGvB,eAAe,CAAe;IAG9B,IAAI,CAAO;IAGX,QAAQ,CAAe;IAGvB,iBAAiB,CAAgC;IAQjD,MAAM,CAAqB;IAO3B,gBAAgB,CAAyB;CAChD,CAAA;AApCY,kCAAW;AAEhB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,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O,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"]}
|
|
@@ -5,6 +5,7 @@ import { User } from './user.model';
|
|
|
5
5
|
import { Vendor } from './vendor.model';
|
|
6
6
|
import { ServicePackage } from './service-package.model';
|
|
7
7
|
import { AddOn } from './addon.model';
|
|
8
|
+
import { Status } from '../../../utilities/enum';
|
|
8
9
|
export declare class ServiceLineItem extends TimeStamps {
|
|
9
10
|
cart: Ref<ServiceCart>;
|
|
10
11
|
user: Ref<User>;
|
|
@@ -13,5 +14,6 @@ export declare class ServiceLineItem extends TimeStamps {
|
|
|
13
14
|
addOn?: Ref<AddOn>;
|
|
14
15
|
quantity?: number;
|
|
15
16
|
isAddon: boolean;
|
|
17
|
+
status: Status;
|
|
16
18
|
calculationSnap?: Record<string, unknown>;
|
|
17
19
|
}
|
|
@@ -21,6 +21,7 @@ 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
23
|
const addon_model_1 = require("./addon.model");
|
|
24
|
+
const enum_1 = require("../../../utilities/enum");
|
|
24
25
|
let ServiceLineItem = class ServiceLineItem extends defaultClasses_1.TimeStamps {
|
|
25
26
|
cart;
|
|
26
27
|
user;
|
|
@@ -29,6 +30,7 @@ let ServiceLineItem = class ServiceLineItem extends defaultClasses_1.TimeStamps
|
|
|
29
30
|
addOn;
|
|
30
31
|
quantity;
|
|
31
32
|
isAddon;
|
|
33
|
+
status;
|
|
32
34
|
calculationSnap;
|
|
33
35
|
};
|
|
34
36
|
exports.ServiceLineItem = ServiceLineItem;
|
|
@@ -60,6 +62,10 @@ __decorate([
|
|
|
60
62
|
(0, typegoose_1.prop)({ type: Boolean, default: false }),
|
|
61
63
|
__metadata("design:type", Boolean)
|
|
62
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);
|
|
63
69
|
__decorate([
|
|
64
70
|
(0, typegoose_1.prop)({ type: mongoose_1.default.Schema.Types.Mixed }),
|
|
65
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;AAChC,+CAAsC;
|
|
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,kD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AC,KAAK,EAAE,CAAC;;wDACK;0BA1BrC,eAAe;IAd3B,IAAA,wBAAY,EAAC;QACb,aAAa,EAAE;YACd,UAAU,EAAE,kBAAkB;YAC9B,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,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,7 +16,6 @@ export declare class ServicePackage extends TimeStamps {
|
|
|
17
16
|
description?: string;
|
|
18
17
|
image: string;
|
|
19
18
|
vendorNotes?: string;
|
|
20
|
-
addons?: Ref<AddOn>[];
|
|
21
19
|
status: Status;
|
|
22
20
|
includeMaterials: boolean;
|
|
23
21
|
materialsCost?: 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;AAC3E,4EAAqE;AACrE,kDAAiD;AACjD,iDAAwC;AACxC,qEAA2D;AAC3D,mDAA0C;AAC1C,mCAAqD;AA8B9C,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,2BAAU;IAEnC,IAAI,CAAU;IAGd,MAAM,CAAe;IAGrB,OAAO,CAAc;IAGrB,QAAQ,CAAwB;IAGhC,KAAK,CAAU;IAOf,KAAK,CAAU;IAQf,OAAO,CAAU;IAGjB,qBAAqB,CAAU;IAG/B,WAAW,CAAU;IAGrB,KAAK,CAAU;IAGf,WAAW,CAAU;
|
|
1
|
+
{"version":3,"file":"service-package.model.js","sourceRoot":"/","sources":["libraries/mongo/models/service-package.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA2E;AAC3E,4EAAqE;AACrE,kDAAiD;AACjD,iDAAwC;AACxC,qEAA2D;AAC3D,mDAA0C;AAC1C,mCAAqD;AA8B9C,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,2BAAU;IAEnC,IAAI,CAAU;IAGd,MAAM,CAAe;IAGrB,OAAO,CAAc;IAGrB,QAAQ,CAAwB;IAGhC,KAAK,CAAU;IAOf,KAAK,CAAU;IAQf,OAAO,CAAU;IAGjB,qBAAqB,CAAU;IAG/B,WAAW,CAAU;IAGrB,KAAK,CAAU;IAGf,WAAW,CAAU;IAMrB,MAAM,CAAS;IAGf,gBAAgB,CAAW;IAG3B,aAA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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