@lyxa.ai/core 1.0.381-alpha.0 → 1.0.381
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/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/libraries/event/decorators/subscribe.js.map +1 -1
- package/dist/libraries/event/index.d.ts +4 -0
- package/dist/libraries/event/index.js +49 -0
- package/dist/libraries/event/index.js.map +1 -1
- package/dist/libraries/index.d.ts +2 -1
- package/dist/libraries/index.js +3 -0
- package/dist/libraries/index.js.map +1 -1
- package/dist/libraries/mongo/models/admin-access-control.model.js +2 -1
- package/dist/libraries/mongo/models/admin-access-control.model.js.map +1 -1
- package/dist/libraries/mongo/models/category.model.d.ts +1 -0
- package/dist/libraries/mongo/models/category.model.js +32 -1
- package/dist/libraries/mongo/models/category.model.js.map +1 -1
- package/dist/libraries/mongo/models/counter.model.d.ts +1 -0
- package/dist/libraries/mongo/models/counter.model.js +5 -0
- package/dist/libraries/mongo/models/counter.model.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/shop-document.model.d.ts +1 -0
- package/dist/libraries/mongo/models/embedded/shop-document.model.js +5 -0
- package/dist/libraries/mongo/models/embedded/shop-document.model.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/shop-search-fields.model.d.ts +7 -0
- package/dist/libraries/mongo/models/embedded/shop-search-fields.model.js +42 -0
- package/dist/libraries/mongo/models/embedded/shop-search-fields.model.js.map +1 -0
- package/dist/libraries/mongo/models/finance-settlement.model.d.ts +1 -0
- package/dist/libraries/mongo/models/finance-settlement.model.js +12 -1
- package/dist/libraries/mongo/models/finance-settlement.model.js.map +1 -1
- package/dist/libraries/mongo/models/gallery.model.js +1 -1
- package/dist/libraries/mongo/models/gallery.model.js.map +1 -1
- package/dist/libraries/mongo/models/index.d.ts +0 -3
- package/dist/libraries/mongo/models/index.js +2 -5
- package/dist/libraries/mongo/models/index.js.map +1 -1
- package/dist/libraries/mongo/models/line-item.model.d.ts +2 -0
- package/dist/libraries/mongo/models/line-item.model.js +12 -0
- package/dist/libraries/mongo/models/line-item.model.js.map +1 -1
- package/dist/libraries/mongo/models/order.model.d.ts +11 -5
- package/dist/libraries/mongo/models/order.model.js +70 -30
- package/dist/libraries/mongo/models/order.model.js.map +1 -1
- package/dist/libraries/mongo/models/providers/core-google-auth-identity.model.d.ts +1 -0
- package/dist/libraries/mongo/models/providers/core-google-auth-identity.model.js +5 -0
- package/dist/libraries/mongo/models/providers/core-google-auth-identity.model.js.map +1 -1
- package/dist/libraries/mongo/models/punch-marketing-history.model.d.ts +5 -2
- package/dist/libraries/mongo/models/punch-marketing-history.model.js +16 -9
- package/dist/libraries/mongo/models/punch-marketing-history.model.js.map +1 -1
- package/dist/libraries/mongo/models/service-cart.model.d.ts +3 -2
- package/dist/libraries/mongo/models/service-cart.model.js +6 -5
- package/dist/libraries/mongo/models/service-cart.model.js.map +1 -1
- package/dist/libraries/mongo/models/service-order.model.d.ts +3 -2
- package/dist/libraries/mongo/models/service-order.model.js +6 -5
- package/dist/libraries/mongo/models/service-order.model.js.map +1 -1
- package/dist/libraries/mongo/models/service-promotion.model.d.ts +1 -0
- package/dist/libraries/mongo/models/service-promotion.model.js +5 -0
- package/dist/libraries/mongo/models/service-promotion.model.js.map +1 -1
- package/dist/libraries/mongo/models/service.model.d.ts +2 -0
- package/dist/libraries/mongo/models/service.model.js +6 -0
- package/dist/libraries/mongo/models/service.model.js.map +1 -1
- package/dist/libraries/mongo/models/shop.model.d.ts +3 -0
- package/dist/libraries/mongo/models/shop.model.js +11 -0
- package/dist/libraries/mongo/models/shop.model.js.map +1 -1
- package/dist/libraries/mongo/models/ticket.model.d.ts +2 -0
- package/dist/libraries/mongo/models/ticket.model.js +10 -0
- package/dist/libraries/mongo/models/ticket.model.js.map +1 -1
- package/dist/libraries/mongo/models/user-app-section-setting.model.js +1 -1
- package/dist/libraries/mongo/models/user-app-section-setting.model.js.map +1 -1
- package/dist/libraries/mongo/models/user.model.d.ts +1 -1
- package/dist/libraries/mongo/utilities/uniqueIdHooks.d.ts +1 -1
- package/dist/libraries/mongo/utilities/uniqueIdHooks.js +2 -2
- package/dist/libraries/mongo/utilities/uniqueIdHooks.js.map +1 -1
- package/dist/libraries/redis/index.d.ts +4 -0
- package/dist/libraries/redis/index.js +14 -0
- package/dist/libraries/redis/index.js.map +1 -1
- package/dist/libraries/socket/adapters/index.d.ts +2 -0
- package/dist/libraries/socket/adapters/index.js +19 -0
- package/dist/libraries/socket/adapters/index.js.map +1 -0
- package/dist/libraries/socket/adapters/socket-context.d.ts +9 -0
- package/dist/libraries/socket/adapters/socket-context.js +29 -0
- package/dist/libraries/socket/adapters/socket-context.js.map +1 -0
- package/dist/libraries/socket/adapters/socket-trpc.d.ts +71 -0
- package/dist/libraries/socket/adapters/socket-trpc.js +22 -0
- package/dist/libraries/socket/adapters/socket-trpc.js.map +1 -0
- package/dist/libraries/socket/core/BaseSocketEvent.d.ts +15 -0
- package/dist/libraries/socket/core/BaseSocketEvent.js +23 -0
- package/dist/libraries/socket/core/BaseSocketEvent.js.map +1 -0
- package/dist/libraries/socket/core/LocalSubscriptionRegistry.d.ts +19 -0
- package/dist/libraries/socket/core/LocalSubscriptionRegistry.js +58 -0
- package/dist/libraries/socket/core/LocalSubscriptionRegistry.js.map +1 -0
- package/dist/libraries/socket/core/index.d.ts +5 -0
- package/dist/libraries/socket/core/index.js +22 -0
- package/dist/libraries/socket/core/index.js.map +1 -0
- package/dist/libraries/socket/core/socket-event-registry.d.ts +42 -0
- package/dist/libraries/socket/core/socket-event-registry.js +25 -0
- package/dist/libraries/socket/core/socket-event-registry.js.map +1 -0
- package/dist/libraries/socket/core/socket-redis-connections.d.ts +12 -0
- package/dist/libraries/socket/core/socket-redis-connections.js +65 -0
- package/dist/libraries/socket/core/socket-redis-connections.js.map +1 -0
- package/dist/libraries/socket/core/zAsyncIterable.d.ts +7 -0
- package/dist/libraries/socket/core/zAsyncIterable.js +35 -0
- package/dist/libraries/socket/core/zAsyncIterable.js.map +1 -0
- package/dist/libraries/socket/events/chatlist-message-send.socket.event.d.ts +67 -0
- package/dist/libraries/socket/events/chatlist-message-send.socket.event.js +30 -0
- package/dist/libraries/socket/events/chatlist-message-send.socket.event.js.map +1 -0
- package/dist/libraries/socket/events/chatroom-message-send.socket.event.d.ts +56 -0
- package/dist/libraries/socket/events/chatroom-message-send.socket.event.js +32 -0
- package/dist/libraries/socket/events/chatroom-message-send.socket.event.js.map +1 -0
- package/dist/libraries/socket/events/index.d.ts +1 -0
- package/dist/libraries/socket/events/index.js +18 -0
- package/dist/libraries/socket/events/index.js.map +1 -0
- package/dist/libraries/socket/index.d.ts +3 -2
- package/dist/libraries/socket/index.js +3 -2
- package/dist/libraries/socket/index.js.map +1 -1
- package/dist/types/README.md +1 -1
- package/dist/types/package.json +1 -1
- package/dist/types/utilities/enum.d.ts +42 -16
- package/dist/types/utilities/enum.js +49 -20
- package/dist/types/utilities/enum.js.map +1 -1
- package/dist/types/utilities/validation/common-validation.d.ts +103 -3
- package/dist/types/utilities/validation/common-validation.js +7 -2
- package/dist/types/utilities/validation/common-validation.js.map +1 -1
- package/dist/types/utilities/validation/global-validation.d.ts +38 -14
- package/dist/utilities/enum.d.ts +42 -16
- package/dist/utilities/enum.js +49 -20
- package/dist/utilities/enum.js.map +1 -1
- package/dist/utilities/validation/common-validation.d.ts +103 -3
- package/dist/utilities/validation/common-validation.js +7 -2
- package/dist/utilities/validation/common-validation.js.map +1 -1
- package/dist/utilities/validation/global-validation.d.ts +38 -14
- package/package.json +3 -3
- package/dist/libraries/mongo/models/order-delivery.model.d.ts +0 -19
- package/dist/libraries/mongo/models/order-delivery.model.js +0 -87
- package/dist/libraries/mongo/models/order-delivery.model.js.map +0 -1
- package/dist/libraries/mongo/repositories/index.d.ts +0 -0
- package/dist/libraries/mongo/repositories/index.js +0 -2
- package/dist/libraries/mongo/repositories/index.js.map +0 -1
- package/dist/libraries/mongo/repositories/optimized-product.repository.d.ts +0 -0
- package/dist/libraries/mongo/repositories/optimized-product.repository.js +0 -2
- package/dist/libraries/mongo/repositories/optimized-product.repository.js.map +0 -1
- package/dist/libraries/mongo/repositories/optimized-product.service.d.ts +0 -0
- package/dist/libraries/mongo/repositories/optimized-product.service.js +0 -2
- package/dist/libraries/mongo/repositories/optimized-product.service.js.map +0 -1
- package/dist/libraries/mongo/repositories/product-benchmark.d.ts +0 -0
- package/dist/libraries/mongo/repositories/product-benchmark.js +0 -2
- package/dist/libraries/mongo/repositories/product-benchmark.js.map +0 -1
- package/dist/libraries/mongo/repositories/product-query-optimizer.d.ts +0 -0
- package/dist/libraries/mongo/repositories/product-query-optimizer.js +0 -2
- package/dist/libraries/mongo/repositories/product-query-optimizer.js.map +0 -1
- package/dist/libraries/mongo/repositories/product.repository.d.ts +0 -0
- package/dist/libraries/mongo/repositories/product.repository.js +0 -2
- package/dist/libraries/mongo/repositories/product.repository.js.map +0 -1
- package/dist/libraries/mongo/repositories/test-optimized-product.d.ts +0 -0
- package/dist/libraries/mongo/repositories/test-optimized-product.js +0 -2
- package/dist/libraries/mongo/repositories/test-optimized-product.js.map +0 -1
- package/dist/libraries/socket/SocketEmitEvent.d.ts +0 -9
- package/dist/libraries/socket/SocketEmitEvent.js +0 -29
- package/dist/libraries/socket/SocketEmitEvent.js.map +0 -1
- package/dist/libraries/socket/socket-publisher.d.ts +0 -11
- package/dist/libraries/socket/socket-publisher.js +0 -36
- package/dist/libraries/socket/socket-publisher.js.map +0 -1
|
@@ -15,16 +15,19 @@ const defaultClasses_1 = require("@typegoose/typegoose/lib/defaultClasses");
|
|
|
15
15
|
const punch_marketing_model_1 = require("./providers/punch-marketing.model");
|
|
16
16
|
const shop_model_1 = require("./shop.model");
|
|
17
17
|
const user_model_1 = require("./user.model");
|
|
18
|
+
const coupon_model_1 = require("./coupon.model");
|
|
19
|
+
const enum_1 = require("../../../utilities/enum");
|
|
18
20
|
let PunchMarketingHistory = class PunchMarketingHistory extends defaultClasses_1.TimeStamps {
|
|
19
21
|
user;
|
|
20
22
|
marketing;
|
|
21
23
|
shop;
|
|
22
24
|
completedOrders;
|
|
25
|
+
startDate;
|
|
23
26
|
expiryDate;
|
|
24
27
|
completedAt;
|
|
28
|
+
status;
|
|
25
29
|
couponExpiryDate;
|
|
26
|
-
|
|
27
|
-
marketingSnapshot;
|
|
30
|
+
coupon;
|
|
28
31
|
};
|
|
29
32
|
exports.PunchMarketingHistory = PunchMarketingHistory;
|
|
30
33
|
__decorate([
|
|
@@ -43,6 +46,10 @@ __decorate([
|
|
|
43
46
|
(0, typegoose_1.prop)({ type: Number, default: 1 }),
|
|
44
47
|
__metadata("design:type", Number)
|
|
45
48
|
], PunchMarketingHistory.prototype, "completedOrders", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, typegoose_1.prop)({ type: Date }),
|
|
51
|
+
__metadata("design:type", Date)
|
|
52
|
+
], PunchMarketingHistory.prototype, "startDate", void 0);
|
|
46
53
|
__decorate([
|
|
47
54
|
(0, typegoose_1.prop)({ type: Date }),
|
|
48
55
|
__metadata("design:type", Date)
|
|
@@ -51,18 +58,18 @@ __decorate([
|
|
|
51
58
|
(0, typegoose_1.prop)({ type: Date, default: null }),
|
|
52
59
|
__metadata("design:type", Date)
|
|
53
60
|
], PunchMarketingHistory.prototype, "completedAt", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, typegoose_1.prop)({ type: String, enum: enum_1.PunchMarketingStatus, default: enum_1.PunchMarketingStatus.ACTIVE }),
|
|
63
|
+
__metadata("design:type", String)
|
|
64
|
+
], PunchMarketingHistory.prototype, "status", void 0);
|
|
54
65
|
__decorate([
|
|
55
66
|
(0, typegoose_1.prop)({ type: Date, default: null }),
|
|
56
67
|
__metadata("design:type", Date)
|
|
57
68
|
], PunchMarketingHistory.prototype, "couponExpiryDate", void 0);
|
|
58
69
|
__decorate([
|
|
59
|
-
(0, typegoose_1.prop)({
|
|
60
|
-
__metadata("design:type",
|
|
61
|
-
], PunchMarketingHistory.prototype, "
|
|
62
|
-
__decorate([
|
|
63
|
-
(0, typegoose_1.prop)({ required: true, type: punch_marketing_model_1.PunchMarketing }),
|
|
64
|
-
__metadata("design:type", punch_marketing_model_1.PunchMarketing)
|
|
65
|
-
], PunchMarketingHistory.prototype, "marketingSnapshot", void 0);
|
|
70
|
+
(0, typegoose_1.prop)({ ref: () => coupon_model_1.Coupon }),
|
|
71
|
+
__metadata("design:type", Object)
|
|
72
|
+
], PunchMarketingHistory.prototype, "coupon", void 0);
|
|
66
73
|
exports.PunchMarketingHistory = PunchMarketingHistory = __decorate([
|
|
67
74
|
(0, typegoose_1.modelOptions)({ schemaOptions: { collection: 'punchMarketingHistories' } })
|
|
68
75
|
], PunchMarketingHistory);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"punch-marketing-history.model.js","sourceRoot":"/","sources":["libraries/mongo/models/punch-marketing-history.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA+D;AAC/D,4EAAqE;AACrE,6EAAmE;AACnE,6CAAoC;AACpC,6CAAoC;
|
|
1
|
+
{"version":3,"file":"punch-marketing-history.model.js","sourceRoot":"/","sources":["libraries/mongo/models/punch-marketing-history.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA+D;AAC/D,4EAAqE;AACrE,6EAAmE;AACnE,6CAAoC;AACpC,6CAAoC;AACpC,iDAAwC;AACxC,kDAA+D;AAGxD,IAAM,qBAAqB,GAA3B,MAAM,qBAAsB,SAAQ,2BAAU;IAE7C,IAAI,CAAa;IAGjB,SAAS,CAAuB;IAGhC,IAAI,CAAa;IAGjB,eAAe,CAAU;IAGzB,SAAS,CAAQ;IAGjB,UAAU,CAAQ;IAGlB,WAAW,CAAQ;IAGnB,MAAM,CAAuB;IAG7B,gBAAgB,CAAO;IAGvB,MAAM,CAAe;CAC5B,CAAA;AA9BY,sDAAqB;AAE1B;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,iBAAI,EAAE,CAAC;;mDAClB;AAGjB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,sCAAc,EAAE,CAAC;;wDACb;AAGhC;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,iBAAI,EAAE,CAAC;;mDAClB;AAGjB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;8DACH;AAGzB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;8BACF,IAAI;wDAAC;AAGjB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;8BACD,IAAI;yDAAC;AAGlB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;8BACf,IAAI;0DAAC;AAGnB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,2BAAoB,EAAE,OAAO,EAAE,2BAAoB,CAAC,MAAM,EAAE,CAAC;;qDACrD;AAG7B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;8BACX,IAAI;+DAAC;AAGvB;IADN,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,qBAAM,EAAE,CAAC;;qDACA;gCA7BhB,qBAAqB;IADjC,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,yBAAyB,EAAE,EAAE,CAAC;GAC9D,qBAAqB,CA8BjC","sourcesContent":["import { modelOptions, prop, Ref } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { PunchMarketing } from './providers/punch-marketing.model';\nimport { Shop } from './shop.model';\nimport { User } from './user.model';\nimport { Coupon } from './coupon.model';\nimport { PunchMarketingStatus } from '../../../utilities/enum';\n\n@modelOptions({ schemaOptions: { collection: 'punchMarketingHistories' } })\nexport class PunchMarketingHistory extends TimeStamps {\n\t@prop({ required: true, ref: () => User })\n\tpublic user!: Ref<User>;\n\n\t@prop({ required: true, ref: () => PunchMarketing })\n\tpublic marketing!: Ref<PunchMarketing>;\n\n\t@prop({ required: true, ref: () => Shop })\n\tpublic shop!: Ref<Shop>;\n\n\t@prop({ type: Number, default: 1 })\n\tpublic completedOrders!: number;\n\n\t@prop({ type: Date })\n\tpublic startDate!: Date;\n\n\t@prop({ type: Date })\n\tpublic expiryDate!: Date;\n\n\t@prop({ type: Date, default: null })\n\tpublic completedAt?: Date;\n\n\t@prop({ type: String, enum: PunchMarketingStatus, default: PunchMarketingStatus.ACTIVE })\n\tpublic status: PunchMarketingStatus;\n\n\t@prop({ type: Date, default: null })\n\tpublic couponExpiryDate: Date;\n\n\t@prop({ ref: () => Coupon })\n\tpublic coupon?: Ref<Coupon>;\n}\n"]}
|
|
@@ -5,12 +5,13 @@ import { Vendor } from './vendor.model';
|
|
|
5
5
|
import { ServiceOrderRecurrencePattern, ServiceCartStatus } from '../../../utilities/enum';
|
|
6
6
|
import { ServiceLineItem } from './service-line-item.model';
|
|
7
7
|
import { UserAddress } from './shared/address.model';
|
|
8
|
+
import { StartEndTime } from './shared/work-hour.model';
|
|
8
9
|
export declare class ServiceCart extends TimeStamps {
|
|
9
10
|
user: Ref<User>;
|
|
10
11
|
vendor: Ref<Vendor>;
|
|
11
12
|
serviceLocation?: UserAddress;
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
date: Date;
|
|
14
|
+
timeSlot: StartEndTime;
|
|
14
15
|
recurrencePattern?: ServiceOrderRecurrencePattern;
|
|
15
16
|
status: ServiceCartStatus;
|
|
16
17
|
serviceLineItems: Ref<ServiceLineItem>[];
|
|
@@ -17,12 +17,13 @@ const vendor_model_1 = require("./vendor.model");
|
|
|
17
17
|
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
|
+
const work_hour_model_1 = require("./shared/work-hour.model");
|
|
20
21
|
let ServiceCart = class ServiceCart extends defaultClasses_1.TimeStamps {
|
|
21
22
|
user;
|
|
22
23
|
vendor;
|
|
23
24
|
serviceLocation;
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
date;
|
|
26
|
+
timeSlot;
|
|
26
27
|
recurrencePattern;
|
|
27
28
|
status;
|
|
28
29
|
serviceLineItems;
|
|
@@ -43,11 +44,11 @@ __decorate([
|
|
|
43
44
|
__decorate([
|
|
44
45
|
(0, typegoose_1.prop)({ required: true }),
|
|
45
46
|
__metadata("design:type", Date)
|
|
46
|
-
], ServiceCart.prototype, "
|
|
47
|
+
], ServiceCart.prototype, "date", void 0);
|
|
47
48
|
__decorate([
|
|
48
49
|
(0, typegoose_1.prop)({ required: true }),
|
|
49
|
-
__metadata("design:type",
|
|
50
|
-
], ServiceCart.prototype, "
|
|
50
|
+
__metadata("design:type", work_hour_model_1.StartEndTime)
|
|
51
|
+
], ServiceCart.prototype, "timeSlot", void 0);
|
|
51
52
|
__decorate([
|
|
52
53
|
(0, typegoose_1.prop)({ enum: enum_1.ServiceOrderRecurrencePattern, default: enum_1.ServiceOrderRecurrencePattern.ONETIME }),
|
|
53
54
|
__metadata("design:type", String)
|
|
@@ -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;
|
|
1
|
+
{"version":3,"file":"service-cart.model.js","sourceRoot":"/","sources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B;IALN,IAAA,gBAAI,EAAC;QACL,GAAG,EAAE,GAAG,EAAE,CAAC,yCAAe;QAC1B,YAAY,EAAE,MAAM;QACpB,UAAU,EAAE,KAAK;KACjB,CAAC;;qDAC8C;sBAhCpC,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,CAiCvB","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';\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: 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"]}
|
|
@@ -11,6 +11,7 @@ import { ServiceOrderFinance } from "./embedded/service-order-finance.model";
|
|
|
11
11
|
import { ServiceOrderCancel } from "./embedded/service-order-cance.model";
|
|
12
12
|
import { ServiceOrderStatusTimeline } from "./embedded/status-timeline.model";
|
|
13
13
|
import { Service } from "./service.model";
|
|
14
|
+
import { StartEndTime } from "./shared/work-hour.model";
|
|
14
15
|
export declare class ServiceOrder {
|
|
15
16
|
orderId: string;
|
|
16
17
|
service: Ref<Service>;
|
|
@@ -19,8 +20,8 @@ export declare class ServiceOrder {
|
|
|
19
20
|
cart: Ref<ServiceCart>;
|
|
20
21
|
status: ServiceOrderStatus;
|
|
21
22
|
priority: ServiceOrderPriority;
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
date: Date;
|
|
24
|
+
timeSlot: StartEndTime;
|
|
24
25
|
hoursRequired?: number;
|
|
25
26
|
userNotes?: string;
|
|
26
27
|
vendorNotes?: string;
|
|
@@ -23,6 +23,7 @@ const service_order_finance_model_1 = require("./embedded/service-order-finance.
|
|
|
23
23
|
const service_order_cance_model_1 = require("./embedded/service-order-cance.model");
|
|
24
24
|
const status_timeline_model_1 = require("./embedded/status-timeline.model");
|
|
25
25
|
const service_model_1 = require("./service.model");
|
|
26
|
+
const work_hour_model_1 = require("./shared/work-hour.model");
|
|
26
27
|
let ServiceOrder = class ServiceOrder {
|
|
27
28
|
orderId;
|
|
28
29
|
service;
|
|
@@ -31,8 +32,8 @@ let ServiceOrder = class ServiceOrder {
|
|
|
31
32
|
cart;
|
|
32
33
|
status;
|
|
33
34
|
priority;
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
date;
|
|
36
|
+
timeSlot;
|
|
36
37
|
hoursRequired;
|
|
37
38
|
userNotes;
|
|
38
39
|
vendorNotes;
|
|
@@ -85,11 +86,11 @@ __decorate([
|
|
|
85
86
|
__decorate([
|
|
86
87
|
(0, typegoose_1.prop)({ required: true }),
|
|
87
88
|
__metadata("design:type", Date)
|
|
88
|
-
], ServiceOrder.prototype, "
|
|
89
|
+
], ServiceOrder.prototype, "date", void 0);
|
|
89
90
|
__decorate([
|
|
90
91
|
(0, typegoose_1.prop)({ required: true }),
|
|
91
|
-
__metadata("design:type",
|
|
92
|
-
], ServiceOrder.prototype, "
|
|
92
|
+
__metadata("design:type", work_hour_model_1.StartEndTime)
|
|
93
|
+
], ServiceOrder.prototype, "timeSlot", void 0);
|
|
93
94
|
__decorate([
|
|
94
95
|
(0, typegoose_1.prop)({ type: Number }),
|
|
95
96
|
__metadata("design:type", Number)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-order.model.js","sourceRoot":"/","sources":["libraries/mongo/models/service-order.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA+D;AAC/D,6CAAoC;AACpC,iDAAwC;AAExC,kDAAiI;AACjI,6DAAoD;AACpD,wEAA8D;AAC9D,kFAAuE;AACvE,6DAAmD;AACnD,oFAA0E;AAC1E,wFAA6E;AAC7E,oFAA0E;AAC1E,4EAA8E;AAC9E,mDAA0C;
|
|
1
|
+
{"version":3,"file":"service-order.model.js","sourceRoot":"/","sources":["libraries/mongo/models/service-order.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA+D;AAC/D,6CAAoC;AACpC,iDAAwC;AAExC,kDAAiI;AACjI,6DAAoD;AACpD,wEAA8D;AAC9D,kFAAuE;AACvE,6DAAmD;AACnD,oFAA0E;AAC1E,wFAA6E;AAC7E,oFAA0E;AAC1E,4EAA8E;AAC9E,mDAA0C;AAC1C,8DAAwD;AAOjD,IAAM,YAAY,GAAlB,MAAM,YAAY;IAEd,OAAO,CAAS;IAGhB,OAAO,CAAe;IAGtB,IAAI,CAAY;IAGhB,MAAM,CAAc;IAGpB,IAAI,CAAmB;IAG9B,MAAM,CAAqB;IAGpB,QAAQ,CAAuB;IAG/B,IAAI,CAAO;IAGX,QAAQ,CAAe;IAGvB,aAAa,CAAU;IAGvB,SAAS,CAAU;IAGnB,WAAW,CAAU;IAGrB,YAAY,CAAoB;IAGhC,YAAY,CAAe;IAG3B,IAAI,CAAmB;IAGvB,WAAW,CAAQ;IAGnB,eAAe,CAAQ;IAGvB,QAAQ,CAAW;IAGnB,QAAQ,CAAQ;IAGhB,SAAS,CAAW;IAGpB,SAAS,CAAQ;IAGjB,OAAO,CAAqB;IAG5B,iBAAiB,CAAgC;IAGjD,MAAM,CAAW;IAGjB,aAAa,CAAiB;IAG9B,kBAAkB,CAAsB;IAGxC,WAAW,CAAsB;IAGjC,cAAc,CAA+B;CACvD,CAAA;AApFY,o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E,IAAI,EAAE,GAAG,EAAE,CAAC,8CAAkB,EAAE,CAAC;8BACpB,8CAAkB;iDAAC;AAGjC;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,kDAA0B,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;oDACZ;uBAnF3C,YAAY;IALxB,IAAA,wBAAY,EAAC;QACV,aAAa,EAAE;YACX,UAAU,EAAE,cAAc;SAC7B;KACJ,CAAC;GACW,YAAY,CAoFxB","sourcesContent":["import { modelOptions, prop, Ref } from \"@typegoose/typegoose\";\nimport { User } from \"./user.model\";\nimport { Vendor } from \"./vendor.model\";\nimport { ServicePackage } from \"./service-package.model\";\nimport { ServiceOrderRecurrencePattern, PaymentMethod, ServiceOrderPriority, ServiceOrderStatus } from \"../../../utilities/enum\";\nimport { Professional } from \"./professional.model\";\nimport { ServiceTimer } from \"./embedded/service-timer.model\";\nimport { ServiceOrderFlag } from \"./embedded/service-order-flag.model\";\nimport { ServiceCart } from \"./service-cart.model\";\nimport { PaymentInformation } from \"./embedded/payment-infromation.model\";\nimport { ServiceOrderFinance } from \"./embedded/service-order-finance.model\";\nimport { ServiceOrderCancel } from \"./embedded/service-order-cance.model\";\nimport { ServiceOrderStatusTimeline } from \"./embedded/status-timeline.model\";\nimport { Service } from \"./service.model\";\nimport { StartEndTime } from \"./shared/work-hour.model\";\n\n@modelOptions({\n schemaOptions: {\n collection: \"serviceOrder\"\n }\n})\nexport class ServiceOrder {\n @prop({ type: String, required: true, unique: true })\n public orderId!: string\n\n @prop({ ref: () => Service, required: true })\n public service!: Ref<Service>\n\n @prop({ ref: () => User, required: true })\n public user!: Ref<User>\n\n @prop({ ref: () => Vendor, required: true })\n public vendor!: Ref<Vendor>\n\n @prop({ ref: () => ServiceCart, required: true })\n public cart!: Ref<ServiceCart>\n\n @prop({ enum: ServiceOrderStatus, default: ServiceOrderStatus.PENDING })\n status!: ServiceOrderStatus\n\n @prop({ enum: ServiceOrderPriority, default: ServiceOrderPriority.NORMAL })\n public priority!: ServiceOrderPriority\n\n @prop({ required: true })\n public date!: Date\n\n @prop({ required: true })\n public timeSlot!: StartEndTime\n\n @prop({ type: Number })\n public hoursRequired?: number;\n\n @prop({ type: String })\n public userNotes?: string;\n\n @prop({ type: String })\n public vendorNotes?: string;\n\n @prop({ ref: () => Professional })\n public professional?: Ref<Professional>\n\n @prop({ type: () => ServiceTimer })\n public serviceTimer?: ServiceTimer\n\n @prop({ type: () => ServiceOrderFlag })\n public flag?: ServiceOrderFlag\n\n @prop()\n public confirmedAt?: Date;\n\n @prop()\n public autoConfirmedAt?: Date;\n\n @prop({ default: false })\n public isUrgent!: boolean;\n\n @prop()\n public urgentAt?: Date;\n\n @prop({ default: false })\n public isOverdue!: boolean;\n\n @prop()\n public overdueAt?: Date;\n\n @prop({ required: true, type: ServiceOrderFinance })\n public finance: ServiceOrderFinance\n\n @prop({ enum: ServiceOrderRecurrencePattern, default: ServiceOrderRecurrencePattern.ONETIME })\n public recurrencePattern?: ServiceOrderRecurrencePattern\n\n @prop({ default: false })\n public isPaid!: boolean;\n\n @prop({ enum: PaymentMethod, type: String })\n public paymentMethod?: PaymentMethod;\n\n @prop({ type: () => PaymentInformation })\n public paymentInformation?: PaymentInformation;\n\n @prop({ type: () => ServiceOrderCancel })\n public orderCancel?: ServiceOrderCancel;\n\n @prop({ type: () => [ServiceOrderStatusTimeline], default: [] })\n public statusTimeline: ServiceOrderStatusTimeline[];\n}"]}
|
|
@@ -25,6 +25,7 @@ let ServicePromotion = class ServicePromotion {
|
|
|
25
25
|
slotRanges;
|
|
26
26
|
spendLimit;
|
|
27
27
|
spendAmount;
|
|
28
|
+
maxDiscountPerOrder;
|
|
28
29
|
valueType;
|
|
29
30
|
value;
|
|
30
31
|
deactivationReason;
|
|
@@ -67,6 +68,10 @@ __decorate([
|
|
|
67
68
|
(0, typegoose_1.prop)({ type: Number, default: 0, min: 0 }),
|
|
68
69
|
__metadata("design:type", Number)
|
|
69
70
|
], ServicePromotion.prototype, "spendAmount", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, typegoose_1.prop)({ type: Number }),
|
|
73
|
+
__metadata("design:type", Number)
|
|
74
|
+
], ServicePromotion.prototype, "maxDiscountPerOrder", void 0);
|
|
70
75
|
__decorate([
|
|
71
76
|
(0, typegoose_1.prop)({ type: String, enum: enum_1.ValueType }),
|
|
72
77
|
__metadata("design:type", String)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-promotion.model.js","sourceRoot":"/","sources":["libraries/mongo/models/service-promotion.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA+D;AAC/D,iDAAwC;AACxC,kDAAoF;AACpF,gFAAsE;AACtE,mEAAyD;AACzD,8DAAwD;AAGjD,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAElB,MAAM,CAAe;IAGrB,aAAa,CAAiB;IAO9B,MAAM,CAAmB;IAGzB,QAAQ,CAAoB;IAG5B,eAAe,CAAwB;IAGvC,UAAU,CAAkB;IAG5B,UAAU,CAAU;IAGpB,WAAW,CAAU;IAGrB,SAAS,CAAa;IAGtB,KAAK,CAAU;IAGf,kBAAkB,CAAU;IAG5B,WAAW,CAAU;CAC/B,CAAA;
|
|
1
|
+
{"version":3,"file":"service-promotion.model.js","sourceRoot":"/","sources":["libraries/mongo/models/service-promotion.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA+D;AAC/D,iDAAwC;AACxC,kDAAoF;AACpF,gFAAsE;AACtE,mEAAyD;AACzD,8DAAwD;AAGjD,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAElB,MAAM,CAAe;IAGrB,aAAa,CAAiB;IAO9B,MAAM,CAAmB;IAGzB,QAAQ,CAAoB;IAG5B,eAAe,CAAwB;IAGvC,UAAU,CAAkB;IAG5B,UAAU,CAAU;IAGpB,WAAW,CAAU;IAGrB,mBAAmB,CAAU;IAG7B,SAAS,CAAa;IAGtB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AM,EAAE,CAAC;;+CACD;AAGf;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;4DACY;AAG5B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC;;qDACvB;2BA1CnB,gBAAgB;IAD5B,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,mBAAmB,EAAE,EAAE,CAAC;GACxD,gBAAgB,CA2C5B","sourcesContent":["import { modelOptions, prop, Ref } from '@typegoose/typegoose';\nimport { Vendor } from './vendor.model';\nimport { MarketingStatus, PromotionType, ValueType } from '../../../utilities/enum';\nimport { PromotionDuration } from './shared/promotion-duration.model';\nimport { ServicePackage } from './service-package.model';\nimport { StartEndTime } from './shared/work-hour.model';\n\n@modelOptions({ schemaOptions: { collection: 'servicePromotions' } })\nexport class ServicePromotion {\n @prop({ ref: () => Vendor, required: true })\n public vendor!: Ref<Vendor>;\n\n @prop({ enum: PromotionType, required: true })\n public promotionType!: PromotionType;\n\n @prop({\n type: String,\n enum: MarketingStatus,\n default: MarketingStatus.ACTIVE,\n })\n public status?: MarketingStatus;\n\n @prop({ required: true, type: PromotionDuration })\n public duration!: PromotionDuration\n\n @prop({ ref: () => ServicePackage, required: true })\n public servicePackages?: Ref<ServicePackage>[]\n\n @prop({ type: () => [StartEndTime] })\n public slotRanges?: StartEndTime[];\n\n @prop({ type: Number, min: 0 })\n public spendLimit?: number;\n\n @prop({ type: Number, default: 0, min: 0 })\n public spendAmount?: number;\n\n @prop({ type: Number })\n public maxDiscountPerOrder?: number;\n\n @prop({ type: String, enum: ValueType })\n public valueType?: ValueType;\n\n @prop({ type: Number })\n public value?: number;\n\n @prop({ type: String })\n public deactivationReason?: string;\n\n @prop({ type: String, trim: true, maxlength: 500 })\n public description?: string;\n}\n"]}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { Ref } from "@typegoose/typegoose";
|
|
2
2
|
import { TimeStamps } from "@typegoose/typegoose/lib/defaultClasses";
|
|
3
|
+
import { ServiceType } from "../../../utilities/enum";
|
|
3
4
|
export declare class Service extends TimeStamps {
|
|
4
5
|
name: string;
|
|
6
|
+
serviceType: ServiceType;
|
|
5
7
|
parentService?: Ref<Service>;
|
|
6
8
|
image?: string;
|
|
7
9
|
}
|
|
@@ -12,8 +12,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.Service = void 0;
|
|
13
13
|
const typegoose_1 = require("@typegoose/typegoose");
|
|
14
14
|
const defaultClasses_1 = require("@typegoose/typegoose/lib/defaultClasses");
|
|
15
|
+
const enum_1 = require("../../../utilities/enum");
|
|
15
16
|
let Service = class Service extends defaultClasses_1.TimeStamps {
|
|
16
17
|
name;
|
|
18
|
+
serviceType;
|
|
17
19
|
parentService;
|
|
18
20
|
image;
|
|
19
21
|
};
|
|
@@ -22,6 +24,10 @@ __decorate([
|
|
|
22
24
|
(0, typegoose_1.prop)({ required: true, type: String }),
|
|
23
25
|
__metadata("design:type", String)
|
|
24
26
|
], Service.prototype, "name", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, typegoose_1.prop)({ required: true, type: String, enum: enum_1.ServiceType }),
|
|
29
|
+
__metadata("design:type", String)
|
|
30
|
+
], Service.prototype, "serviceType", void 0);
|
|
25
31
|
__decorate([
|
|
26
32
|
(0, typegoose_1.prop)({ ref: () => Service }),
|
|
27
33
|
__metadata("design:type", Object)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.model.js","sourceRoot":"/","sources":["libraries/mongo/models/service.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAsE;AACtE,4EAAqE;
|
|
1
|
+
{"version":3,"file":"service.model.js","sourceRoot":"/","sources":["libraries/mongo/models/service.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAsE;AACtE,4EAAqE;AACrE,kDAAsD;AAK/C,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,2BAAU;IAE5B,IAAI,CAAU;IAGd,WAAW,CAAc;IAGzB,aAAa,CAAe;IAG5B,KAAK,CAAU;CACzB,CAAA;AAZY,0BAAO;AAET;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;;4CAC1B;AAGzB;IADN,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC;;8CACM;AAG5B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;sCACD;kBAXb,OAAO;IAFnB,IAAA,iBAAK,EAAC,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,uBAAuB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC;IAClF,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,UAAU,EAAE,EAAE,CAAC;GAC/C,OAAO,CAYnB","sourcesContent":["import { Index, modelOptions, prop, Ref } from \"@typegoose/typegoose\";\nimport { TimeStamps } from \"@typegoose/typegoose/lib/defaultClasses\";\nimport { ServiceType } from \"../../../utilities/enum\";\n\n\n@Index({ name: 1 }, { unique: true, partialFilterExpression: { deletedAt: null } })\n@modelOptions({ schemaOptions: { collection: 'services' } })\nexport class Service extends TimeStamps {\n @prop({ required: true, type: String })\n public name!: string;\n\n @prop({ required: true, type: String, enum: ServiceType })\n public serviceType!: ServiceType\n\n @prop({ ref: () => Service })\n public parentService?: Ref<Service>\n\n @prop({ type: String })\n public image?: string;\n}"]}
|
|
@@ -8,6 +8,7 @@ import { Address } from './shared/address.model';
|
|
|
8
8
|
import { StartEndTime, WorkHourSetting } from './shared/work-hour.model';
|
|
9
9
|
import { Tag } from './tag.model';
|
|
10
10
|
import { DeliveryInfo } from './embedded/delivery-info.model';
|
|
11
|
+
import { ShopSearchFields } from './embedded/shop-search-fields.model';
|
|
11
12
|
export declare class Shop extends TimeStamps {
|
|
12
13
|
shopId: string;
|
|
13
14
|
name: string;
|
|
@@ -52,4 +53,6 @@ export declare class Shop extends TimeStamps {
|
|
|
52
53
|
ordersCount?: number;
|
|
53
54
|
customersCount?: number;
|
|
54
55
|
vat_reg_number?: number;
|
|
56
|
+
fcmTokens?: string[];
|
|
57
|
+
searchFields?: ShopSearchFields;
|
|
55
58
|
}
|
|
@@ -21,6 +21,7 @@ const work_hour_model_1 = require("./shared/work-hour.model");
|
|
|
21
21
|
const tag_model_1 = require("./tag.model");
|
|
22
22
|
const delivery_info_model_1 = require("./embedded/delivery-info.model");
|
|
23
23
|
const shopHooks_1 = require("../utilities/shopHooks");
|
|
24
|
+
const shop_search_fields_model_1 = require("./embedded/shop-search-fields.model");
|
|
24
25
|
let Shop = class Shop extends defaultClasses_1.TimeStamps {
|
|
25
26
|
shopId;
|
|
26
27
|
name;
|
|
@@ -65,6 +66,8 @@ let Shop = class Shop extends defaultClasses_1.TimeStamps {
|
|
|
65
66
|
ordersCount;
|
|
66
67
|
customersCount;
|
|
67
68
|
vat_reg_number;
|
|
69
|
+
fcmTokens;
|
|
70
|
+
searchFields;
|
|
68
71
|
};
|
|
69
72
|
exports.Shop = Shop;
|
|
70
73
|
__decorate([
|
|
@@ -243,6 +246,14 @@ __decorate([
|
|
|
243
246
|
(0, typegoose_1.prop)({ default: 0, type: () => Number }),
|
|
244
247
|
__metadata("design:type", Number)
|
|
245
248
|
], Shop.prototype, "vat_reg_number", void 0);
|
|
249
|
+
__decorate([
|
|
250
|
+
(0, typegoose_1.prop)({ type: () => [String], default: [] }),
|
|
251
|
+
__metadata("design:type", Array)
|
|
252
|
+
], Shop.prototype, "fcmTokens", void 0);
|
|
253
|
+
__decorate([
|
|
254
|
+
(0, typegoose_1.prop)({ type: shop_search_fields_model_1.ShopSearchFields }),
|
|
255
|
+
__metadata("design:type", shop_search_fields_model_1.ShopSearchFields)
|
|
256
|
+
], Shop.prototype, "searchFields", void 0);
|
|
246
257
|
exports.Shop = Shop = __decorate([
|
|
247
258
|
(0, typegoose_1.modelOptions)({
|
|
248
259
|
schemaOptions: { collection: 'shops' },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shop.model.js","sourceRoot":"/","sources":["libraries/mongo/models/shop.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAqF;AACrF,4EAAqE;AACrE,kDAA6E;AAC7E,+CAAsC;AACtC,wEAA8D;AAC9D,iDAAwC;AACxC,0DAAiD;AACjD,8DAAyE;AACzE,2CAAkC;AAClC,wEAA8D;AAC9D,sDAA2D;AAcpD,IAAM,IAAI,GAAV,MAAM,IAAK,SAAQ,2BAAU;IAE5B,MAAM,CAAS;IAGf,IAAI,CAAU;IAGd,SAAS,CAAU;IAGnB,KAAK,CAAU;IAGf,MAAM,CAAc;IAGpB,QAAQ,CAAY;IAGpB,MAAM,CAAU;IAGhB,KAAK,CAAa;IAGlB,UAAU,CAAU;IAGpB,WAAW,CAAU;IAGrB,eAAe,CAAU;IAGzB,sBAAsB,CAAY;IAGlC,OAAO,CAAW;IAGlB,IAAI,CAAU;IAGd,MAAM,CAAU;IAGhB,QAAQ,CAAgB;IAOxB,YAAY,CAAoB;IAGhC,eAAe,CAAmB;IAGlC,SAAS,CAAY;IAGrB,IAAI,CAAc;IAGlB,iBAAiB,CAAW;IAG5B,eAAe,CAAW;IAG1B,cAAc,CAAW;IAGzB,WAAW,CAAU;IAGrB,kBAAkB,CAAU;IAG5B,aAAa,CAAU;IAGvB,8BAA8B,CAAkB;IAGhD,YAAY,CAAgB;IAG5B,YAAY,CAAU;IAItB,wBAAwB,CAAW;IAGnC,kBAAkB,CAAW;IAG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AZhB,IAAA,wBAAY,EAAC;QACb,aAAa,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE;QACtC,OAAO,EAAE,EAAE,UAAU,EAAE,oBAAQ,CAAC,KAAK,EAAE;KACvC,CAAC;IACD,IAAA,iBAAK,EAAC,EAAE,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,uBAAuB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC;IAC/F,IAAA,iBAAK,EAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,eAAe,EAAE,CAAC,EAAE,EAAE,EAAE,uBAAuB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC;IACrG,IAAA,iBAAK,EAAC,EAAE,MAAM,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,uBAAuB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC;IACrF,IAAA,eAAG,EAAO,MAAM,EAAE,KAAK,WAAW,IAAI;QACtC,MAAM,6BAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEnC,IAAI,EAAE,CAAC;IACR,CAAC,CAAC;GACW,IAAI,CAsIhB","sourcesContent":["import { modelOptions, prop, Ref, Severity, index, pre } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { ItemType, ShopOnlineStatus, Status } from '../../../utilities/enum';\nimport { Brand } from './brand.model';\nimport { ShopDocument } from './embedded/shop-document.model';\nimport { Parent } from './parent.model';\nimport { Address } from './shared/address.model';\nimport { StartEndTime, WorkHourSetting } from './shared/work-hour.model';\nimport { Tag } from './tag.model';\nimport { DeliveryInfo } from './embedded/delivery-info.model';\nimport { handleShopPreSave } from '../utilities/shopHooks';\n\n@modelOptions({\n\tschemaOptions: { collection: 'shops' },\n\toptions: { allowMixed: Severity.ALLOW },\n})\n@index({ name: 1, itemType: 1 }, { unique: true, partialFilterExpression: { deletedAt: null } })\n@index({ parent: 1, status: 1, isVisibleToUser: 1 }, { partialFilterExpression: { deletedAt: null } })\n@index({ status: 1, createdAt: -1 }, { partialFilterExpression: { deletedAt: null } })\n@pre<Shop>('save', async function (next) {\n\tawait handleShopPreSave.call(this);\n\n\tnext();\n})\nexport class Shop extends TimeStamps {\n\t@prop({ type: String, unique: true, index: true })\n\tpublic shopId: string;\n\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({ required: true, ref: () => Parent })\n\tpublic parent: Ref<Parent>;\n\n\t@prop({ required: true, type: String, enum: ItemType })\n\tpublic itemType!: ItemType;\n\n\t@prop({ required: true, type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status!: Status;\n\n\t@prop({ required: true, ref: () => Brand })\n\tpublic brand: Ref<Brand>;\n\n\t@prop({ type: Number, default: 1, min: 1, max: 4 })\n\tpublic priceRange?: number;\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({ 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({\n\t\ttype: String,\n\t\tenum: ShopOnlineStatus,\n\t\tdefault: ShopOnlineStatus.OFFLINE,\n\t})\n\tpublic onlineStatus?: ShopOnlineStatus;\n\n\t@prop({ type: WorkHourSetting })\n\tpublic workHourSetting?: WorkHourSetting;\n\n\t@prop({ type: () => [String], default: [] })\n\tpublic dietaries?: string[];\n\n\t@prop({ ref: () => Tag, default: [] })\n\tpublic tags?: Ref<Tag>[];\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({ type: Boolean, default: false })\n\tpublic isShopDelivery?: boolean;\n\n\t@prop({ type: Number })\n\tpublic deliveryFee?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic minimumOrderAmount?: number;\n\n\t@prop({ type: Number, default: Infinity })\n\tpublic orderCapacity?: number;\n\n\t@prop({ type: () => [StartEndTime], default: [] })\n\tpublic shopActiveTimingsOfCurrentDate?: StartEndTime[];\n\n\t@prop({ type: DeliveryInfo })\n\tpublic deliveryInfo?: DeliveryInfo;\n\n\t@prop({ type: Number })\n\tpublic sortingOrder?: number;\n\n\t// Setting\n\t@prop({ type: Boolean, default: false })\n\tpublic allowSpecialInstructions?: boolean;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isRiderNoteVisible?: boolean;\n\n\t@prop({ type: String })\n\tpublic riderNote?: string;\n\n\t@prop({ type: Number, default: 10 })\n\tpublic defaultPreparationTime?: number;\n\n\t@prop({ type: Number, default: null })\n\texchangeRate?: number;\n\n\t@prop({ required: false, type: () => Boolean })\n\tpublic isFavouriteCategoryVisible?: boolean;\n\n\t@prop({ required: false, type: () => String })\n\tpublic favouriteCategoryTitle?: string;\n\n\t@prop({ required: false, type: () => Boolean })\n\tpublic isBestSellerCategoryVisible?: boolean;\n\n\t@prop({ required: false, type: () => String })\n\tpublic bestSellerCategoryTitle?: string;\n\n\t@prop({ required: true, type: () => Boolean })\n\tpublic orderCapacityEnabled!: boolean;\n\n\t@prop({ default: 0, type: () => Number })\n\tpublic avgRating?: number;\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({ default: 0, type: () => Number })\n\tpublic vat_reg_number?: number;\n}\n"]}
|
|
1
|
+
{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AE,EAAE,UAAU,EAAE,OAAO,EAAE;QACtC,OAAO,EAAE,EAAE,UAAU,EAAE,oBAAQ,CAAC,KAAK,EAAE;KACvC,CAAC;IACD,IAAA,iBAAK,EAAC,EAAE,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,uBAAuB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC;IAC/F,IAAA,iBAAK,EAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,eAAe,EAAE,CAAC,EAAE,EAAE,EAAE,uBAAuB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC;IACrG,IAAA,iBAAK,EAAC,EAAE,MAAM,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,uBAAuB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC;IACrF,IAAA,eAAG,EAAO,MAAM,EAAE,KAAK,WAAW,IAAI;QACtC,MAAM,6BAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEnC,IAAI,EAAE,CAAC;IACR,CAAC,CAAC;GACW,IAAI,CA4IhB","sourcesContent":["import { modelOptions, prop, Ref, Severity, index, pre } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { ItemType, ShopOnlineStatus, Status } from '../../../utilities/enum';\nimport { Brand } from './brand.model';\nimport { ShopDocument } from './embedded/shop-document.model';\nimport { Parent } from './parent.model';\nimport { Address } from './shared/address.model';\nimport { StartEndTime, WorkHourSetting } from './shared/work-hour.model';\nimport { Tag } from './tag.model';\nimport { DeliveryInfo } from './embedded/delivery-info.model';\nimport { handleShopPreSave } from '../utilities/shopHooks';\nimport { ShopSearchFields } from './embedded/shop-search-fields.model';\n\n@modelOptions({\n\tschemaOptions: { collection: 'shops' },\n\toptions: { allowMixed: Severity.ALLOW },\n})\n@index({ name: 1, itemType: 1 }, { unique: true, partialFilterExpression: { deletedAt: null } })\n@index({ parent: 1, status: 1, isVisibleToUser: 1 }, { partialFilterExpression: { deletedAt: null } })\n@index({ status: 1, createdAt: -1 }, { partialFilterExpression: { deletedAt: null } })\n@pre<Shop>('save', async function (next) {\n\tawait handleShopPreSave.call(this);\n\n\tnext();\n})\nexport class Shop extends TimeStamps {\n\t@prop({ type: String, unique: true, index: true })\n\tpublic shopId: string;\n\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({ required: true, ref: () => Parent })\n\tpublic parent: Ref<Parent>;\n\n\t@prop({ required: true, type: String, enum: ItemType })\n\tpublic itemType!: ItemType;\n\n\t@prop({ required: true, type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status!: Status;\n\n\t@prop({ required: true, ref: () => Brand })\n\tpublic brand: Ref<Brand>;\n\n\t@prop({ type: Number, default: 1, min: 1, max: 4 })\n\tpublic priceRange?: number;\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({ 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({\n\t\ttype: String,\n\t\tenum: ShopOnlineStatus,\n\t\tdefault: ShopOnlineStatus.OFFLINE,\n\t})\n\tpublic onlineStatus?: ShopOnlineStatus;\n\n\t@prop({ type: WorkHourSetting })\n\tpublic workHourSetting?: WorkHourSetting;\n\n\t@prop({ type: () => [String], default: [] })\n\tpublic dietaries?: string[];\n\n\t@prop({ ref: () => Tag, default: [] })\n\tpublic tags?: Ref<Tag>[];\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({ type: Boolean, default: false })\n\tpublic isShopDelivery?: boolean;\n\n\t@prop({ type: Number })\n\tpublic deliveryFee?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic minimumOrderAmount?: number;\n\n\t@prop({ type: Number, default: Infinity })\n\tpublic orderCapacity?: number;\n\n\t@prop({ type: () => [StartEndTime], default: [] })\n\tpublic shopActiveTimingsOfCurrentDate?: StartEndTime[];\n\n\t@prop({ type: DeliveryInfo })\n\tpublic deliveryInfo?: DeliveryInfo;\n\n\t@prop({ type: Number })\n\tpublic sortingOrder?: number;\n\n\t// Setting\n\t@prop({ type: Boolean, default: false })\n\tpublic allowSpecialInstructions?: boolean;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isRiderNoteVisible?: boolean;\n\n\t@prop({ type: String })\n\tpublic riderNote?: string;\n\n\t@prop({ type: Number, default: 10 })\n\tpublic defaultPreparationTime?: number;\n\n\t@prop({ type: Number, default: null })\n\texchangeRate?: number;\n\n\t@prop({ required: false, type: () => Boolean })\n\tpublic isFavouriteCategoryVisible?: boolean;\n\n\t@prop({ required: false, type: () => String })\n\tpublic favouriteCategoryTitle?: string;\n\n\t@prop({ required: false, type: () => Boolean })\n\tpublic isBestSellerCategoryVisible?: boolean;\n\n\t@prop({ required: false, type: () => String })\n\tpublic bestSellerCategoryTitle?: string;\n\n\t@prop({ required: true, type: () => Boolean })\n\tpublic orderCapacityEnabled!: boolean;\n\n\t@prop({ default: 0, type: () => Number })\n\tpublic avgRating?: number;\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({ default: 0, type: () => Number })\n\tpublic vat_reg_number?: number;\n\n\t@prop({ type: () => [String], default: [] })\n\tpublic fcmTokens?: string[];\n\n\t@prop({ type: ShopSearchFields })\n\tpublic searchFields?: ShopSearchFields\n}\n"]}
|
|
@@ -16,6 +16,8 @@ export declare class Ticket extends TimeStamps {
|
|
|
16
16
|
supportReason?: Ref<SupportReason>;
|
|
17
17
|
client: Ref<User | Shop>;
|
|
18
18
|
clientType: UserRef;
|
|
19
|
+
clientName: string;
|
|
20
|
+
clientPhoto: string;
|
|
19
21
|
order?: Ref<Order>;
|
|
20
22
|
assignedAgent?: Ref<Admin>;
|
|
21
23
|
assignedAt?: Date;
|
|
@@ -26,6 +26,8 @@ let Ticket = class Ticket extends defaultClasses_1.TimeStamps {
|
|
|
26
26
|
supportReason;
|
|
27
27
|
client;
|
|
28
28
|
clientType;
|
|
29
|
+
clientName;
|
|
30
|
+
clientPhoto;
|
|
29
31
|
order;
|
|
30
32
|
assignedAgent;
|
|
31
33
|
assignedAt;
|
|
@@ -67,6 +69,14 @@ __decorate([
|
|
|
67
69
|
(0, typegoose_1.prop)({ required: true, type: String, enum: enum_1.UserRef }),
|
|
68
70
|
__metadata("design:type", String)
|
|
69
71
|
], Ticket.prototype, "clientType", void 0);
|
|
72
|
+
__decorate([
|
|
73
|
+
(0, typegoose_1.prop)({ required: true, type: String }),
|
|
74
|
+
__metadata("design:type", String)
|
|
75
|
+
], Ticket.prototype, "clientName", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
(0, typegoose_1.prop)({ required: true, type: String }),
|
|
78
|
+
__metadata("design:type", String)
|
|
79
|
+
], Ticket.prototype, "clientPhoto", void 0);
|
|
70
80
|
__decorate([
|
|
71
81
|
(0, typegoose_1.prop)({ ref: () => order_model_1.Order }),
|
|
72
82
|
__metadata("design:type", Object)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ticket.model.js","sourceRoot":"/","sources":["libraries/mongo/models/ticket.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAsE;AACtE,4EAAqE;AAGrE,+CAAsC;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E,UAAU,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;IAC9C,IAAA,iBAAK,EAAC,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC;IACxB,IAAA,iBAAK,EAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC;GACV,MAAM,CA4DlB","sourcesContent":["import { prop, Ref, index, modelOptions } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { User } from './user.model';\nimport { Shop } from './shop.model';\nimport { Order } from './order.model';\nimport { Admin } from './admin.model';\nimport { TicketType, TicketStatus, UserRef } from '../../../utilities/enum';\nimport { Chatroom } from './chat-room.model';\nimport { DefaultChat } from './default-chat.model';\nimport { TicketAction } from './ticket-action.model';\nimport { SupportReason } from './support-reason.model';\n\n@modelOptions({\n\tschemaOptions: {\n\t\tcollection: 'tickets',\n\t\ttimestamps: true,\n\t},\n})\n@index({ assignedAgent: 1, status: 1 })\n@index({ type: 1, status: 1, priority: 1 })\n@index({ client: 1, clientType: 1, status: 1 })\n@index({ createdAt: -1 })\n@index({ chatroom: 1 })\nexport class Ticket extends TimeStamps {\n\t@prop({ required: true, type: String, unique: true })\n\tpublic ticketId!: string;\n\n\t@prop({ required: true, type: String, enum: TicketType })\n\tpublic type!: TicketType;\n\n\t@prop({ required: true, type: String, enum: TicketStatus, default: TicketStatus.PENDING })\n\tpublic status!: TicketStatus;\n\n\t@prop({ type: String, required: true })\n\tpublic title!: string;\n\n\t@prop({ ref: () => SupportReason, required: false })\n\tpublic supportReason?: Ref<SupportReason>;\n\n\t@prop({ refPath: 'clientType', required: true })\n\tpublic client!: Ref<User | Shop>;\n\n\t@prop({ required: true, type: String, enum: UserRef })\n\tpublic clientType!: UserRef;\n\n\t@prop({ required: true, type: String })\n\tpublic clientName!: string;\n\n\t@prop({ required: true, type: String })\n\tpublic clientPhoto!: string;\n\n\t@prop({ ref: () => Order })\n\tpublic order?: Ref<Order>;\n\n\t@prop({ ref: () => Admin })\n\tpublic assignedAgent?: Ref<Admin>;\n\n\t@prop({ type: Date })\n\tpublic assignedAt?: Date;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic assignmentAttempts?: number;\n\n\t@prop({ ref: () => Chatroom, required: true })\n\tpublic chatroom!: Ref<Chatroom>;\n\n\t@prop({ type: Date })\n\tpublic resolvedAt?: Date;\n\n\t@prop({ type: Date })\n\tpublic closedAt?: Date;\n\n\t@prop({ type: Number })\n\tpublic resolutionTimeMinutes?: number;\n\n\t@prop({ type: Number, min: 1, max: 5 })\n\tpublic customerRating?: number;\n\n\t@prop({ type: Number })\n\tpublic agentScore?: number;\n\n\t@prop({ ref: () => TicketAction, required: false })\n\tpublic action?: Ref<TicketAction>;\n}\n"]}
|
|
@@ -45,7 +45,7 @@ __decorate([
|
|
|
45
45
|
], UserAppSectionSetting.prototype, "sortingOrder", void 0);
|
|
46
46
|
exports.UserAppSectionSetting = UserAppSectionSetting = __decorate([
|
|
47
47
|
(0, typegoose_1.modelOptions)({ schemaOptions: { collection: 'userAppSectionSetting' } }),
|
|
48
|
-
(0, typegoose_1.Index)({ itemType: 1, section: 1 }, { unique: true }),
|
|
48
|
+
(0, typegoose_1.Index)({ itemType: 1, section: 1 }, { unique: true, partialFilterExpression: { deletedAt: null } }),
|
|
49
49
|
(0, typegoose_1.pre)('save', async function (next) {
|
|
50
50
|
await sortingOrderHooks_1.handlePreSaveForSortingWithStatus.call(this, _1.UserAppSectionSettingModel, { itemType: this.itemType });
|
|
51
51
|
next();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-app-section-setting.model.js","sourceRoot":"/","sources":["libraries/mongo/models/user-app-section-setting.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAsE;AACtE,4EAAqE;AACrE,kDAA6F;AAC7F,wBAA+C;AAE/C,sEAGwC;AAiBjC,IAAM,qBAAqB,GAA3B,MAAM,qBAAsB,SAAQ,2BAAU;IAE7C,QAAQ,CAA0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,CAAC,UAAU,CAAC,CAAC,CAAC;QAE/F,IAAI,EAAE,CAAC;IACR,CAAC,CACD;GACY,qBAAqB,CAejC","sourcesContent":["import { Index, modelOptions, pre, prop } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { Status, UserAppSectionItemType, UserAppSectionType } from '../../../utilities/enum';\nimport { UserAppSectionSettingModel } from '.';\nimport { Query } from 'mongoose';\nimport {\n\thandlePreSaveForSortingWithStatus,\n\thandlePreUpdateForSortingWithStatus,\n} from '../utilities/sortingOrderHooks';\n\n@modelOptions({ schemaOptions: { collection: 'userAppSectionSetting' } })\n@Index({ itemType: 1, section: 1 }, { unique: true, partialFilterExpression: { deletedAt: null } })\n@pre<UserAppSectionSetting>('save', async function (next) {\n\tawait handlePreSaveForSortingWithStatus.call(this, UserAppSectionSettingModel, { itemType: this.itemType });\n\n\tnext();\n})\n@pre<UserAppSectionSetting>(\n\t'findOneAndUpdate',\n\tasync function (this: Query<any, UserAppSectionSetting>, next) {\n\t\tawait handlePreUpdateForSortingWithStatus.call(this, UserAppSectionSettingModel, ['itemType']);\n\n\t\tnext();\n\t}\n)\nexport class UserAppSectionSetting extends TimeStamps {\n\t@prop({ required: true, type: String, enum: UserAppSectionItemType })\n\tpublic itemType!: UserAppSectionItemType;\n\n\t@prop({ required: true, type: String, enum: UserAppSectionType })\n\tpublic section!: UserAppSectionType;\n\n\t@prop({ required: true, type: String })\n\tpublic alias!: string;\n\n\t@prop({ type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status?: Status;\n\n\t@prop({ type: Number })\n\tpublic sortingOrder?: number;\n}\n"]}
|
|
@@ -31,7 +31,7 @@ export declare class User extends TimeStamps {
|
|
|
31
31
|
isPhoneVerified?: boolean;
|
|
32
32
|
onlineStatus?: OnlineStatus;
|
|
33
33
|
fcmTokens?: string[];
|
|
34
|
-
static updateWallet(this: ReturnModelType<typeof User>, userId: string, amount: number): Promise<(import("mongoose").Document<unknown, import("@typegoose/typegoose/lib/types").BeAnObject, User, import("@typegoose/typegoose/lib/types").BeAnyObject
|
|
34
|
+
static updateWallet(this: ReturnModelType<typeof User>, userId: string, amount: number): Promise<(import("mongoose").Document<unknown, import("@typegoose/typegoose/lib/types").BeAnObject, User, import("@typegoose/typegoose/lib/types").BeAnyObject> & Omit<User & {
|
|
35
35
|
_id: import("mongoose").Types.ObjectId;
|
|
36
36
|
} & {
|
|
37
37
|
__v: number;
|
|
@@ -2,5 +2,5 @@ import { Document } from 'mongoose';
|
|
|
2
2
|
interface BaseDoc extends Document {
|
|
3
3
|
[field: string]: any;
|
|
4
4
|
}
|
|
5
|
-
export declare function handlePreSaveForUniqueId<T extends BaseDoc>(this: T, Model: any, field: string): Promise<void>;
|
|
5
|
+
export declare function handlePreSaveForUniqueId<T extends BaseDoc>(this: T, Model: any, field: string, length?: number): Promise<void>;
|
|
6
6
|
export {};
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.handlePreSaveForUniqueId = handlePreSaveForUniqueId;
|
|
4
4
|
const nanoid_1 = require("nanoid");
|
|
5
|
-
|
|
6
|
-
async function handlePreSaveForUniqueId(Model, field) {
|
|
5
|
+
async function handlePreSaveForUniqueId(Model, field, length = 6) {
|
|
7
6
|
if (this[field])
|
|
8
7
|
return;
|
|
8
|
+
const nanoid = (0, nanoid_1.customAlphabet)('0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', length);
|
|
9
9
|
let uniqueId = null;
|
|
10
10
|
let exists = true;
|
|
11
11
|
while (exists) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uniqueIdHooks.js","sourceRoot":"/","sources":["libraries/mongo/utilities/uniqueIdHooks.ts"],"names":[],"mappings":";;AAiBA,
|
|
1
|
+
{"version":3,"file":"uniqueIdHooks.js","sourceRoot":"/","sources":["libraries/mongo/utilities/uniqueIdHooks.ts"],"names":[],"mappings":";;AAiBA,4DAuBC;AAxCD,mCAAwC;AAiBjC,KAAK,UAAU,wBAAwB,CAE7C,KAAU,EACV,KAAa,EACb,MAAM,GAAG,CAAC;IAGV,IAAI,IAAI,CAAC,KAAK,CAAC;QAAE,OAAO;IAGxB,MAAM,MAAM,GAAG,IAAA,uBAAc,EAAC,gEAAgE,EAAE,MAAM,CAAC,CAAC;IAExG,IAAI,QAAQ,GAAkB,IAAI,CAAC;IACnC,IAAI,MAAM,GAAG,IAAI,CAAC;IAGlB,OAAO,MAAM,EAAE,CAAC;QACf,QAAQ,GAAG,MAAM,EAAE,CAAC;QACpB,MAAM,GAAG,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,QAAQ,EAAoB,CAAC,CAAC,CAAC;IAC1E,CAAC;IAGD,IAAI,CAAC,GAAG,CAAC,KAAe,EAAE,QAAQ,CAAC,CAAC;AACrC,CAAC","sourcesContent":["import { customAlphabet } from 'nanoid';\nimport { Document, FilterQuery } from 'mongoose';\n\n// Nanoid generator: 6-character alphanumeric\n// const nanoid = customAlphabet('0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', 6);\n\ninterface BaseDoc extends Document {\n\t[field: string]: any; // allow dynamic field access\n}\n\n/**\n * Pre-save hook handler to ensure a unique ID for a given field\n *\n * @param this Current document being saved\n * @param Model The Mongoose model\n * @param field The field that should have a unique ID\n */\nexport async function handlePreSaveForUniqueId<T extends BaseDoc>(\n\tthis: T,\n\tModel: any,\n\tfield: string,\n\tlength = 6\n): Promise<void> {\n\t// Skip if already has a value\n\tif (this[field]) return;\n\n\t// Prepare generator dynamically\n\tconst nanoid = customAlphabet('0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', length);\n\n\tlet uniqueId: string | null = null;\n\tlet exists = true;\n\n\t// Keep generating until unique\n\twhile (exists) {\n\t\tuniqueId = nanoid();\n\t\texists = !!(await Model.exists({ [field]: uniqueId } as FilterQuery<T>));\n\t}\n\n\t// Assign the unique ID to the field\n\tthis.set(field as string, uniqueId);\n}\n"]}
|
|
@@ -10,4 +10,8 @@ export declare class RedisService {
|
|
|
10
10
|
setCachedObjectByGroup<T>(group: string, key: string, object: T): Promise<boolean>;
|
|
11
11
|
deleteCachedObjectByGroup<T>(group: string, key: string): Promise<boolean>;
|
|
12
12
|
sanitizeKey(key: string): string;
|
|
13
|
+
addToSet(group: string, member: string): Promise<boolean>;
|
|
14
|
+
removeFromSet(group: string, member: string): Promise<boolean>;
|
|
15
|
+
isMemberOfSet(group: string, member: string): Promise<boolean>;
|
|
16
|
+
getSetMembers(group: string): Promise<string[]>;
|
|
13
17
|
}
|
|
@@ -68,6 +68,20 @@ let RedisService = class RedisService {
|
|
|
68
68
|
.replace(/\s+/g, '-')
|
|
69
69
|
.toLowerCase();
|
|
70
70
|
}
|
|
71
|
+
async addToSet(group, member) {
|
|
72
|
+
await this._redisClient.sadd(group, member);
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
async removeFromSet(group, member) {
|
|
76
|
+
await this._redisClient.srem(group, member);
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
79
|
+
async isMemberOfSet(group, member) {
|
|
80
|
+
return (await this._redisClient.sismember(group, member)) === 1;
|
|
81
|
+
}
|
|
82
|
+
async getSetMembers(group) {
|
|
83
|
+
return await this._redisClient.smembers(group);
|
|
84
|
+
}
|
|
71
85
|
};
|
|
72
86
|
exports.RedisService = RedisService;
|
|
73
87
|
exports.RedisService = RedisService = __decorate([
|