@lyxa.ai/core 1.2.62 → 1.2.63
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.
|
@@ -29,11 +29,15 @@ export declare class Vendor extends TimeStamps {
|
|
|
29
29
|
document?: ShopDocument;
|
|
30
30
|
vendorActiveTimingsOfCurrentDate?: StartEndTime[];
|
|
31
31
|
tags?: Ref<Tag>[];
|
|
32
|
-
isVisibleToUser: boolean;
|
|
33
32
|
sortingOrder?: number;
|
|
34
33
|
avgRating?: number;
|
|
34
|
+
priceRange?: number;
|
|
35
|
+
isBeirutAuthentic: boolean;
|
|
36
|
+
isVisibleToUser: boolean;
|
|
35
37
|
ordersCount?: number;
|
|
36
38
|
customersCount?: number;
|
|
39
|
+
bobContactName?: string;
|
|
40
|
+
bobContactPhoneNumber?: string;
|
|
37
41
|
orderSettings?: ServiceOrderSettings;
|
|
38
42
|
cleaningServiceSettings?: CleaningServiceSettings;
|
|
39
43
|
workHourSetting?: WorkHourSetting;
|
|
@@ -45,11 +45,15 @@ let Vendor = class Vendor extends defaultClasses_1.TimeStamps {
|
|
|
45
45
|
document;
|
|
46
46
|
vendorActiveTimingsOfCurrentDate;
|
|
47
47
|
tags;
|
|
48
|
-
isVisibleToUser;
|
|
49
48
|
sortingOrder;
|
|
50
49
|
avgRating;
|
|
50
|
+
priceRange;
|
|
51
|
+
isBeirutAuthentic;
|
|
52
|
+
isVisibleToUser;
|
|
51
53
|
ordersCount;
|
|
52
54
|
customersCount;
|
|
55
|
+
bobContactName;
|
|
56
|
+
bobContactPhoneNumber;
|
|
53
57
|
orderSettings;
|
|
54
58
|
cleaningServiceSettings;
|
|
55
59
|
workHourSetting;
|
|
@@ -127,10 +131,6 @@ __decorate([
|
|
|
127
131
|
(0, typegoose_1.prop)({ ref: () => tag_model_1.Tag, default: [] }),
|
|
128
132
|
__metadata("design:type", Array)
|
|
129
133
|
], Vendor.prototype, "tags", void 0);
|
|
130
|
-
__decorate([
|
|
131
|
-
(0, typegoose_1.prop)({ required: true, type: Boolean }),
|
|
132
|
-
__metadata("design:type", Boolean)
|
|
133
|
-
], Vendor.prototype, "isVisibleToUser", void 0);
|
|
134
134
|
__decorate([
|
|
135
135
|
(0, typegoose_1.prop)({ type: Number }),
|
|
136
136
|
__metadata("design:type", Number)
|
|
@@ -139,6 +139,18 @@ __decorate([
|
|
|
139
139
|
(0, typegoose_1.prop)({ default: 0, type: () => Number }),
|
|
140
140
|
__metadata("design:type", Number)
|
|
141
141
|
], Vendor.prototype, "avgRating", void 0);
|
|
142
|
+
__decorate([
|
|
143
|
+
(0, typegoose_1.prop)({ type: Number, default: 1, min: 1, max: 4 }),
|
|
144
|
+
__metadata("design:type", Number)
|
|
145
|
+
], Vendor.prototype, "priceRange", void 0);
|
|
146
|
+
__decorate([
|
|
147
|
+
(0, typegoose_1.prop)({ required: true, type: Boolean }),
|
|
148
|
+
__metadata("design:type", Boolean)
|
|
149
|
+
], Vendor.prototype, "isBeirutAuthentic", void 0);
|
|
150
|
+
__decorate([
|
|
151
|
+
(0, typegoose_1.prop)({ required: true, type: Boolean }),
|
|
152
|
+
__metadata("design:type", Boolean)
|
|
153
|
+
], Vendor.prototype, "isVisibleToUser", void 0);
|
|
142
154
|
__decorate([
|
|
143
155
|
(0, typegoose_1.prop)({ default: 0, type: () => Number }),
|
|
144
156
|
__metadata("design:type", Number)
|
|
@@ -147,6 +159,14 @@ __decorate([
|
|
|
147
159
|
(0, typegoose_1.prop)({ default: 0, type: () => Number }),
|
|
148
160
|
__metadata("design:type", Number)
|
|
149
161
|
], Vendor.prototype, "customersCount", void 0);
|
|
162
|
+
__decorate([
|
|
163
|
+
(0, typegoose_1.prop)({ type: String, maxlength: 100 }),
|
|
164
|
+
__metadata("design:type", String)
|
|
165
|
+
], Vendor.prototype, "bobContactName", void 0);
|
|
166
|
+
__decorate([
|
|
167
|
+
(0, typegoose_1.prop)({ type: String, maxlength: 15 }),
|
|
168
|
+
__metadata("design:type", String)
|
|
169
|
+
], Vendor.prototype, "bobContactPhoneNumber", void 0);
|
|
150
170
|
__decorate([
|
|
151
171
|
(0, typegoose_1.prop)({ type: () => service_order_settings_model_1.ServiceOrderSettings }),
|
|
152
172
|
__metadata("design:type", service_order_settings_model_1.ServiceOrderSettings)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vendor.model.js","sourceRoot":"/","sources":["libraries/mongo/models/vendor.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,oDAAqF;AACrF,4EAAqE;AACrE,kDAA8D;AAC9D,wEAA8D;AAC9D,0DAAiD;AACjD,8DAAyE;AACzE,2CAAkC;AAClC,6CAAoC;AACpC,wBAA8C;AAC9C,sDAA8B;AAC9B,mDAA0C;AAC1C,0FAA+E;AAC/E,gGAAqF;AA6C9E,IAAM,MAAM,GAAZ,MAAM,MAAO,SAAQ,2BAAU;IAE9B,IAAI,CAAU;IAGd,SAAS,CAAU;IAGnB,KAAK,CAAU;IAGf,IAAI,CAAU;IAGd,MAAM,CAAoB;IAG1B,OAAO,CAAe;IAGtB,WAAW,CAAc;IAGzB,MAAM,CAAU;IAGhB,WAAW,CAAU;IAGrB,eAAe,CAAU;IAGzB,sBAAsB,CAAY;IAGlC,OAAO,CAAW;IAGlB,IAAI,CAAe;IAGnB,IAAI,CAAU;IAGd,MAAM,CAAU;IAGhB,QAAQ,CAAgB;IAGxB,gCAAgC,CAAkB;IAGlD,IAAI,CAAc;IAGlB,
|
|
1
|
+
{"version":3,"file":"vendor.model.js","sourceRoot":"/","sources":["libraries/mongo/models/vendor.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,oDAAqF;AACrF,4EAAqE;AACrE,kDAA8D;AAC9D,wEAA8D;AAC9D,0DAAiD;AACjD,8DAAyE;AACzE,2CAAkC;AAClC,6CAAoC;AACpC,wBAA8C;AAC9C,sDAA8B;AAC9B,mDAA0C;AAC1C,0FAA+E;AAC/E,gGAAqF;AA6C9E,IAAM,MAAM,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AO,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,CA0FlB","sourcesContent":["import { modelOptions, prop, Ref, Severity, Index, pre } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { ServiceType, 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, serviceType: 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: ServiceType })\n\tpublic serviceType!: ServiceType\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({ type: Number })\n\tpublic sortingOrder?: number;\n\n\t@prop({ default: 0, type: () => Number })\n\tpublic avgRating?: number;\n\n\t@prop({ type: Number, default: 1, min: 1, max: 4 })\n\tpublic priceRange?: number;\n\n\t@prop({ required: true, type: Boolean })\n\tpublic isBeirutAuthentic!: boolean;\n\n\t@prop({ required: true, type: Boolean })\n\tpublic isVisibleToUser!: boolean;\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: String, maxlength: 100 })\n\tpublic bobContactName?: string;\n\n\t@prop({ type: String, maxlength: 15 })\n\tpublic bobContactPhoneNumber?: string;\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