@lyxa.ai/core 1.4.151-alpha.0 → 1.4.151
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-addon.model.d.ts +1 -0
- package/dist/libraries/mongo/models/service-addon.model.js +8 -1
- package/dist/libraries/mongo/models/service-addon.model.js.map +1 -1
- package/dist/libraries/mongo/models/service-category.model.d.ts +1 -0
- package/dist/libraries/mongo/models/service-category.model.js +10 -2
- package/dist/libraries/mongo/models/service-category.model.js.map +1 -1
- package/dist/libraries/mongo/models/service-package.model.d.ts +1 -0
- package/dist/libraries/mongo/models/service-package.model.js +10 -2
- package/dist/libraries/mongo/models/service-package.model.js.map +1 -1
- package/dist/libraries/mongo/models/tournament.model.d.ts +0 -1
- package/dist/libraries/mongo/models/tournament.model.js +0 -5
- package/dist/libraries/mongo/models/tournament.model.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 +3 -16
- package/dist/types/utilities/enum.js +2 -17
- package/dist/types/utilities/enum.js.map +1 -1
- package/dist/utilities/enum.d.ts +3 -16
- package/dist/utilities/enum.js +2 -17
- package/dist/utilities/enum.js.map +1 -1
- package/package.json +1 -1
|
@@ -4,6 +4,7 @@ import { ServiceType, Status, SubServiceType } from '../../../utilities/enum';
|
|
|
4
4
|
import { PreparingTime } from './embedded/preparing-time.model';
|
|
5
5
|
export declare class ServiceAddon {
|
|
6
6
|
name: string;
|
|
7
|
+
nameNormalized?: string;
|
|
7
8
|
serviceType: ServiceType;
|
|
8
9
|
subServiceTypes?: SubServiceType[];
|
|
9
10
|
vendor: Ref<Vendor>;
|
|
@@ -18,8 +18,10 @@ const mongoose_1 = __importDefault(require("mongoose"));
|
|
|
18
18
|
const index_1 = require("./index");
|
|
19
19
|
const enum_1 = require("../../../utilities/enum");
|
|
20
20
|
const preparing_time_model_1 = require("./embedded/preparing-time.model");
|
|
21
|
+
const normalize_field_plugin_1 = require("../plugins/normalize-field.plugin");
|
|
21
22
|
let ServiceAddon = class ServiceAddon {
|
|
22
23
|
name;
|
|
24
|
+
nameNormalized;
|
|
23
25
|
serviceType;
|
|
24
26
|
subServiceTypes;
|
|
25
27
|
vendor;
|
|
@@ -34,6 +36,10 @@ __decorate([
|
|
|
34
36
|
(0, typegoose_1.prop)({ required: true, type: String, trim: true }),
|
|
35
37
|
__metadata("design:type", String)
|
|
36
38
|
], ServiceAddon.prototype, "name", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, typegoose_1.prop)({ type: String, trim: true, lowercase: true, select: false }),
|
|
41
|
+
__metadata("design:type", String)
|
|
42
|
+
], ServiceAddon.prototype, "nameNormalized", void 0);
|
|
37
43
|
__decorate([
|
|
38
44
|
(0, typegoose_1.prop)({ required: true, type: String, enum: enum_1.ServiceType }),
|
|
39
45
|
__metadata("design:type", String)
|
|
@@ -73,6 +79,7 @@ exports.ServiceAddon = ServiceAddon = __decorate([
|
|
|
73
79
|
timestamps: true,
|
|
74
80
|
},
|
|
75
81
|
}),
|
|
76
|
-
(0, typegoose_1.index)({
|
|
82
|
+
(0, typegoose_1.index)({ nameNormalized: 1 }, { partialFilterExpression: { deletedAt: null } }),
|
|
83
|
+
(0, typegoose_1.plugin)(normalize_field_plugin_1.normalizeFieldPlugin, { field: 'name' })
|
|
77
84
|
], ServiceAddon);
|
|
78
85
|
//# sourceMappingURL=service-addon.model.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-addon.model.js","sourceRoot":"/","sources":["libraries/mongo/models/service-addon.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"service-addon.model.js","sourceRoot":"/","sources":["libraries/mongo/models/service-addon.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,oDAA8E;AAC9E,wDAAgC;AAChC,mCAAiC;AACjC,kDAA8E;AAC9E,0EAAgE;AAChE,8EAAyE;A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AAI,EAAE,IAAI,EAAE,oCAAa,EAAE,CAAC;8BAC5B,oCAAa;8CAAC;AAGzB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC;;iDACX;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,aAAM,EAAE,OAAO,EAAE,aAAM,CAAC,MAAM,EAAE,CAAC;;4CACvC;uBA7BV,YAAY;IARxB,IAAA,wBAAY,EAAC;QACb,aAAa,EAAE;YACd,UAAU,EAAE,eAAe;YAC3B,UAAU,EAAE,IAAI;SAChB;KACD,CAAC;IACD,IAAA,iBAAK,EAAC,EAAE,cAAc,EAAE,CAAC,EAAE,EAAE,EAAE,uBAAuB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC;IAC9E,IAAA,kBAAM,EAAC,6CAAoB,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;GACnC,YAAY,CA8BxB","sourcesContent":["import { prop, modelOptions, Ref, index, plugin } from '@typegoose/typegoose';\nimport mongoose from 'mongoose';\nimport { Vendor } from './index';\nimport { ServiceType, Status, SubServiceType } from '../../../utilities/enum';\nimport { PreparingTime } from './embedded/preparing-time.model';\nimport { normalizeFieldPlugin } from '../plugins/normalize-field.plugin';\n\n@modelOptions({\n\tschemaOptions: {\n\t\tcollection: 'serviceAddons',\n\t\ttimestamps: true,\n\t},\n})\n@index({ nameNormalized: 1 }, { partialFilterExpression: { deletedAt: null } })\n@plugin(normalizeFieldPlugin, { field: 'name' })\nexport class ServiceAddon {\n\t@prop({ required: true, type: String, trim: true })\n\tpublic name!: string;\n\n\t@prop({ type: String, trim: true, lowercase: true, select: false })\n\tpublic nameNormalized?: string;\n\n\t@prop({ required: true, type: String, enum: ServiceType })\n\tpublic serviceType!: ServiceType;\n\n\t@prop({ type: [String], enum: SubServiceType })\n\tpublic subServiceTypes?: SubServiceType[];\n\n\t@prop({ required: true, type: () => mongoose.Types.ObjectId, ref: () => Vendor })\n\tpublic vendor!: Ref<Vendor>;\n\n\t@prop({ required: true, type: String })\n\tpublic image!: string;\n\n\t@prop({ required: true, type: Number, min: 0 })\n\tpublic price!: number;\n\n\t@prop({ required: true, type: PreparingTime })\n\tpublic duration!: PreparingTime;\n\n\t@prop({ type: String, maxlength: 250 })\n\tpublic description?: string;\n\n\t@prop({ type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status: Status;\n}\n"]}
|
|
@@ -4,6 +4,7 @@ import { ServiceType, Status, SubServiceType } from '../../../utilities/enum';
|
|
|
4
4
|
import { Vendor } from './vendor.model';
|
|
5
5
|
export declare class ServiceCategory extends TimeStamps {
|
|
6
6
|
name: string;
|
|
7
|
+
nameNormalized?: string;
|
|
7
8
|
serviceType: ServiceType;
|
|
8
9
|
subServiceType?: SubServiceType;
|
|
9
10
|
vendor: Ref<Vendor>;
|
|
@@ -15,8 +15,10 @@ const defaultClasses_1 = require("@typegoose/typegoose/lib/defaultClasses");
|
|
|
15
15
|
const enum_1 = require("../../../utilities/enum");
|
|
16
16
|
const vendor_model_1 = require("./vendor.model");
|
|
17
17
|
const _1 = require(".");
|
|
18
|
+
const normalize_field_plugin_1 = require("../plugins/normalize-field.plugin");
|
|
18
19
|
let ServiceCategory = class ServiceCategory extends defaultClasses_1.TimeStamps {
|
|
19
20
|
name;
|
|
21
|
+
nameNormalized;
|
|
20
22
|
serviceType;
|
|
21
23
|
subServiceType;
|
|
22
24
|
vendor;
|
|
@@ -29,6 +31,10 @@ __decorate([
|
|
|
29
31
|
(0, typegoose_1.prop)({ required: true, type: String, trim: true, maxlength: 20 }),
|
|
30
32
|
__metadata("design:type", String)
|
|
31
33
|
], ServiceCategory.prototype, "name", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, typegoose_1.prop)({ type: String, trim: true, lowercase: true, select: false }),
|
|
36
|
+
__metadata("design:type", String)
|
|
37
|
+
], ServiceCategory.prototype, "nameNormalized", void 0);
|
|
32
38
|
__decorate([
|
|
33
39
|
(0, typegoose_1.prop)({ required: true, type: String, enum: enum_1.ServiceType }),
|
|
34
40
|
__metadata("design:type", String)
|
|
@@ -54,8 +60,9 @@ __decorate([
|
|
|
54
60
|
__metadata("design:type", Number)
|
|
55
61
|
], ServiceCategory.prototype, "sortingOrder", void 0);
|
|
56
62
|
exports.ServiceCategory = ServiceCategory = __decorate([
|
|
57
|
-
(0, typegoose_1.Index)({ name: 1, vendor: 1 }, { unique: true, collation: { locale: 'en', strength: 2 } }),
|
|
58
63
|
(0, typegoose_1.modelOptions)({ schemaOptions: { collection: 'serviceCategories' } }),
|
|
64
|
+
(0, typegoose_1.index)({ nameNormalized: 1, vendor: 1 }, { unique: true, partialFilterExpression: { deletedAt: null } }),
|
|
65
|
+
(0, typegoose_1.index)({ nameNormalized: 1 }, { partialFilterExpression: { deletedAt: null } }),
|
|
59
66
|
(0, typegoose_1.pre)('save', async function (next) {
|
|
60
67
|
if (this.isNew || typeof this.sortingOrder === 'undefined') {
|
|
61
68
|
try {
|
|
@@ -74,6 +81,7 @@ exports.ServiceCategory = ServiceCategory = __decorate([
|
|
|
74
81
|
}
|
|
75
82
|
}
|
|
76
83
|
next();
|
|
77
|
-
})
|
|
84
|
+
}),
|
|
85
|
+
(0, typegoose_1.plugin)(normalize_field_plugin_1.normalizeFieldPlugin, { field: 'name' })
|
|
78
86
|
], ServiceCategory);
|
|
79
87
|
//# sourceMappingURL=service-category.model.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-category.model.js","sourceRoot":"/","sources":["libraries/mongo/models/service-category.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"service-category.model.js","sourceRoot":"/","sources":["libraries/mongo/models/service-category.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAmF;AACnF,4EAAqE;AACrE,kDAA8E;AAC9E,iDAAwC;AACxC,wBAAyC;AACzC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,EAAE,UAAU,EAAE,mBAAmB,EAAE,EAAE,CAAC;IACpE,IAAA,iBAAK,EAAC,EAAE,cAAc,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,uBAAuB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC;IACvG,IAAA,iBAAK,EAAC,EAAE,cAAc,EAAE,CAAC,EAAE,EAAE,EAAE,uBAAuB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC;IAC9E,IAAA,eAAG,EAAkB,MAAM,EAAE,KAAK,WAAW,IAAI;QAEjD,IAAI,IAAI,CAAC,KAAK,IAAI,OAAO,IAAI,CAAC,YAAY,KAAK,WAAW,EAAE,CAAC;YAC5D,IAAI,CAAC;gBAEJ,MAAM,eAAe,GAAG,MAAM,uBAAoB,CAAC,SAAS,CAA8B;oBACzF;wBACC,MAAM,EAAE;4BACP,GAAG,EAAE,IAAI;4BACT,eAAe,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE;yBAC1C;qBACD;iBACD,CAAC,CAAC,IAAI,EAAE,CAAC;gBAGV,IAAI,CAAC,YAAY,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,eAAe,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;YACrE,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,OAAO,IAAI,CAAC,KAAc,CAAC,CAAC;YAC7B,CAAC;QACF,CAAC;QACD,IAAI,EAAE,CAAC;IACR,CAAC,CAAC;IACD,IAAA,kBAAM,EAAC,6CAAoB,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;GACnC,eAAe,CAwB3B","sourcesContent":["import { index, modelOptions, plugin, pre, prop, Ref } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { ServiceType, Status, SubServiceType } from '../../../utilities/enum';\nimport { Vendor } from './vendor.model';\nimport { ServiceCategoryModel } from '.';\nimport { normalizeFieldPlugin } from '../plugins/normalize-field.plugin';\n\n@modelOptions({ schemaOptions: { collection: 'serviceCategories' } })\n@index({ nameNormalized: 1, vendor: 1 }, { unique: true, partialFilterExpression: { deletedAt: null } })\n@index({ nameNormalized: 1 }, { partialFilterExpression: { deletedAt: null } })\n@pre<ServiceCategory>('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 ServiceCategoryModel.aggregate<{ maxSortingOrder: number }>([\n\t\t\t\t{\n\t\t\t\t\t$group: {\n\t\t\t\t\t\t_id: null,\n\t\t\t\t\t\tmaxSortingOrder: { $max: '$sortingOrder' },\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t]).exec();\n\n\t\t\t// Set the new sortingOrder to max + 1 (or 0 if no items found)\n\t\t\tthis.sortingOrder = (maxSortingOrder[0]?.maxSortingOrder ?? -1) + 1;\n\t\t} catch (error) {\n\t\t\treturn next(error as Error);\n\t\t}\n\t}\n\tnext();\n})\n@plugin(normalizeFieldPlugin, { field: 'name' })\nexport class ServiceCategory extends TimeStamps {\n\t@prop({ required: true, type: String, trim: true, maxlength: 20 })\n\tpublic name!: string;\n\n\t@prop({ type: String, trim: true, lowercase: true, select: false })\n\tpublic nameNormalized?: string;\n\n\t@prop({ required: true, type: String, enum: ServiceType })\n\tpublic serviceType!: ServiceType;\n\n\t@prop({ type: String, enum: SubServiceType })\n\tpublic subServiceType?: SubServiceType;\n\n\t@prop({ required: true, ref: () => Vendor })\n\tpublic vendor!: Ref<Vendor>;\n\n\t@prop({ type: String })\n\tpublic image?: 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"]}
|
|
@@ -8,6 +8,7 @@ import { PreparingTime } from './embedded/preparing-time.model';
|
|
|
8
8
|
import { CleaningMaterial } from './embedded/cleaning-material.model';
|
|
9
9
|
export declare class ServicePackage extends TimeStamps {
|
|
10
10
|
name: string;
|
|
11
|
+
nameNormalized?: string;
|
|
11
12
|
vendor: Ref<Vendor>;
|
|
12
13
|
serviceType: ServiceType;
|
|
13
14
|
subServiceType?: SubServiceType;
|
|
@@ -18,8 +18,10 @@ const service_category_model_1 = require("./service-category.model");
|
|
|
18
18
|
const index_1 = require("./index");
|
|
19
19
|
const preparing_time_model_1 = require("./embedded/preparing-time.model");
|
|
20
20
|
const cleaning_material_model_1 = require("./embedded/cleaning-material.model");
|
|
21
|
+
const normalize_field_plugin_1 = require("../plugins/normalize-field.plugin");
|
|
21
22
|
let ServicePackage = class ServicePackage extends defaultClasses_1.TimeStamps {
|
|
22
23
|
name;
|
|
24
|
+
nameNormalized;
|
|
23
25
|
vendor;
|
|
24
26
|
serviceType;
|
|
25
27
|
subServiceType;
|
|
@@ -41,6 +43,10 @@ __decorate([
|
|
|
41
43
|
(0, typegoose_1.prop)({ required: true, type: String, trim: true, maxlength: 20 }),
|
|
42
44
|
__metadata("design:type", String)
|
|
43
45
|
], ServicePackage.prototype, "name", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, typegoose_1.prop)({ type: String, trim: true, lowercase: true, select: false }),
|
|
48
|
+
__metadata("design:type", String)
|
|
49
|
+
], ServicePackage.prototype, "nameNormalized", void 0);
|
|
44
50
|
__decorate([
|
|
45
51
|
(0, typegoose_1.prop)({ required: true, ref: () => vendor_model_1.Vendor }),
|
|
46
52
|
__metadata("design:type", Object)
|
|
@@ -103,7 +109,8 @@ __decorate([
|
|
|
103
109
|
], ServicePackage.prototype, "avgRating", void 0);
|
|
104
110
|
exports.ServicePackage = ServicePackage = __decorate([
|
|
105
111
|
(0, typegoose_1.modelOptions)({ schemaOptions: { collection: 'servicePackages', timestamps: true } }),
|
|
106
|
-
(0, typegoose_1.
|
|
112
|
+
(0, typegoose_1.index)({ nameNormalized: 1, vendor: 1 }, { unique: true, partialFilterExpression: { deletedAt: null } }),
|
|
113
|
+
(0, typegoose_1.index)({ nameNormalized: 1 }, { partialFilterExpression: { deletedAt: null } }),
|
|
107
114
|
(0, typegoose_1.pre)('save', async function (next) {
|
|
108
115
|
if (this.isNew || typeof this.sortingOrder === 'undefined') {
|
|
109
116
|
try {
|
|
@@ -122,6 +129,7 @@ exports.ServicePackage = ServicePackage = __decorate([
|
|
|
122
129
|
}
|
|
123
130
|
}
|
|
124
131
|
next();
|
|
125
|
-
})
|
|
132
|
+
}),
|
|
133
|
+
(0, typegoose_1.plugin)(normalize_field_plugin_1.normalizeFieldPlugin, { field: 'name' })
|
|
126
134
|
], ServicePackage);
|
|
127
135
|
//# sourceMappingURL=service-package.model.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-package.model.js","sourceRoot":"/","sources":["libraries/mongo/models/service-package.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"service-package.model.js","sourceRoot":"/","sources":["libraries/mongo/models/service-package.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAmF;AACnF,4EAAqE;AACrE,kDAA8E;AAC9E,iDAAwC;AACxC,qEAA2D;AAC3D,mCAA4D;AAC5D,0EAAgE;AAChE,gFAAsE;AACtE,8EAAyE;AA4BlE,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,2BAAU;IAEtC,IAAI,CAAU;IAGd,cAAc,CAAU;IAGxB,MAAM,CAAe;IAGrB,WAAW,CAAe;IAG1B,cAAc,CAAkB;IAGhC,WAAW,CAAU;IAGrB,QAAQ,CAAwB;IAGhC,KAAK,CAAU;IAGf,QAAQ,CAAiB;IAGzB,qBAAqB,CAAU;IAG/B,KAAK,CAAU;IAGf,WAAW,CAAU;IAGrB,MAAM,CAAuB;IAG7B,MAAM,CAAS;IAGf,gBAAgB,CAAoB;IAGpC,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,EAAE,IAAI,EAAE,EAAE,CAAC;IAC9E,IAAA,eAAG,EAAiB,MAAM,EAAE,KAAK,WAAW,IAAI;QAEhD,IAAI,IAAI,CAAC,KAAK,IAAI,OAAO,IAAI,CAAC,YAAY,KAAK,WAAW,EAAE,CAAC;YAC5D,IAAI,CAAC;gBAEJ,MAAM,eAAe,GAAG,MAAM,2BAAmB,CAAC,SAAS,CAA8B;oBACxF;wBACC,MAAM,EAAE;4BACP,GAAG,EAAE,IAAI;4BACT,eAAe,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE;yBAC1C;qBACD;iBACD,CAAC,CAAC,IAAI,EAAE,CAAC;gBAGV,IAAI,CAAC,YAAY,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,eAAe,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;YACrE,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,OAAO,IAAI,CAAC,KAAc,CAAC,CAAC;YAC7B,CAAC;QACF,CAAC;QACD,IAAI,EAAE,CAAC;IACR,CAAC,CAAC;IACD,IAAA,kBAAM,EAAC,6CAAoB,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;GACnC,cAAc,CAmD1B","sourcesContent":["import { index, modelOptions, plugin, pre, prop, Ref } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { ServiceType, Status, SubServiceType } from '../../../utilities/enum';\nimport { Vendor } from './vendor.model';\nimport { ServiceCategory } from './service-category.model';\nimport { ServiceAddon, ServicePackageModel } from './index';\nimport { PreparingTime } from './embedded/preparing-time.model';\nimport { CleaningMaterial } from './embedded/cleaning-material.model';\nimport { normalizeFieldPlugin } from '../plugins/normalize-field.plugin';\n\n@modelOptions({ schemaOptions: { collection: 'servicePackages', timestamps: true } })\n@index({ nameNormalized: 1, vendor: 1 }, { unique: true, partialFilterExpression: { deletedAt: null } })\n@index({ nameNormalized: 1 }, { partialFilterExpression: { deletedAt: null } })\n@pre<ServicePackage>('save', async function (next) {\n\t// Only set sortingOrder if it's a new document or sortingOrder is not set\n\tif (this.isNew || typeof this.sortingOrder === 'undefined') {\n\t\ttry {\n\t\t\t// Find the maximum sortingOrder for shops with the same itemType that aren't deleted\n\t\t\tconst maxSortingOrder = await ServicePackageModel.aggregate<{ maxSortingOrder: number }>([\n\t\t\t\t{\n\t\t\t\t\t$group: {\n\t\t\t\t\t\t_id: null,\n\t\t\t\t\t\tmaxSortingOrder: { $max: '$sortingOrder' },\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t]).exec();\n\n\t\t\t// Set the new sortingOrder to max + 1 (or 0 if no items found)\n\t\t\tthis.sortingOrder = (maxSortingOrder[0]?.maxSortingOrder ?? -1) + 1;\n\t\t} catch (error) {\n\t\t\treturn next(error as Error);\n\t\t}\n\t}\n\tnext();\n})\n@plugin(normalizeFieldPlugin, { field: 'name' })\nexport class ServicePackage extends TimeStamps {\n\t@prop({ required: true, type: String, trim: true, maxlength: 20 })\n\tpublic name!: string;\n\n\t@prop({ type: String, trim: true, lowercase: true, select: false })\n\tpublic nameNormalized?: string;\n\n\t@prop({ required: true, ref: () => Vendor })\n\tpublic vendor!: Ref<Vendor>;\n\n\t@prop({ required: true, type: String, enum: ServiceType })\n\tpublic serviceType!: ServiceType;\n\n\t@prop({ type: String, enum: SubServiceType })\n\tpublic subServiceType?: SubServiceType;\n\n\t@prop({ type: String, trim: true, maxlength: 250 })\n\tpublic description?: string;\n\n\t@prop({ required: true, ref: () => ServiceCategory })\n\tpublic category!: Ref<ServiceCategory>;\n\n\t@prop({ required: true, type: Number, min: 0 })\n\tpublic price!: number;\n\n\t@prop({ required: true, type: PreparingTime })\n\tpublic duration!: PreparingTime;\n\n\t@prop({ required: true, type: Number, min: 1 })\n\tpublic numberOfProfessionals!: number;\n\n\t@prop({ required: true, type: String })\n\tpublic image!: string;\n\n\t@prop({ type: String, maxlength: 250 })\n\tpublic vendorNotes?: string;\n\n\t@prop({ ref: () => ServiceAddon, default: [] })\n\tpublic addons?: Ref<ServiceAddon>[];\n\n\t@prop({ type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status: Status;\n\n\t@prop({ required: true, type: CleaningMaterial })\n\tpublic cleaningMaterial!: CleaningMaterial;\n\n\t@prop({ type: Number })\n\tpublic sortingOrder?: number;\n\n\t@prop({ default: 0, type: () => Number })\n\tpublic avgRating?: number;\n}\n"]}
|
|
@@ -204,7 +204,6 @@ let Tournament = class Tournament extends defaultClasses_1.TimeStamps {
|
|
|
204
204
|
reward;
|
|
205
205
|
notificationTemplates;
|
|
206
206
|
scheduledNotifications;
|
|
207
|
-
notificationFlags;
|
|
208
207
|
};
|
|
209
208
|
exports.Tournament = Tournament;
|
|
210
209
|
__decorate([
|
|
@@ -258,10 +257,6 @@ __decorate([
|
|
|
258
257
|
(0, typegoose_1.prop)({ type: () => [ScheduledNotificationConfig], default: [], _id: false }),
|
|
259
258
|
__metadata("design:type", Array)
|
|
260
259
|
], Tournament.prototype, "scheduledNotifications", void 0);
|
|
261
|
-
__decorate([
|
|
262
|
-
(0, typegoose_1.prop)({ type: () => Boolean }),
|
|
263
|
-
__metadata("design:type", Map)
|
|
264
|
-
], Tournament.prototype, "notificationFlags", void 0);
|
|
265
260
|
exports.Tournament = Tournament = __decorate([
|
|
266
261
|
(0, typegoose_1.modelOptions)({ schemaOptions: { collection: 'tournaments', timestamps: true } })
|
|
267
262
|
], Tournament);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tournament.model.js","sourceRoot":"/","sources":["libraries/mongo/models/tournament.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA0D;AAC1D,4EAAqE;AACrE,uCAAiC;AACjC,kDAAuE;AAEvE,MAAa,UAAU;IAEf,KAAK,CAAiB;IAGtB,KAAK,CAAiB;CAC7B;AAND,gCAMC;AAJO;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE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A8B;AAGzD;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,2BAA2B,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;;0DACf;AAGvD;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC;8BACH,GAAG;qDAAkB;qBAzCpC,UAAU;IADtB,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,aAAa,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,CAAC;GACpE,UAAU,CA0CtB","sourcesContent":["import { modelOptions, prop } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { Types } from 'mongoose';\nimport { Status, TournamentRewardType } from '../../../utilities/enum';\n\nexport class MatchScore {\n\t@prop({ type: Number, default: null })\n\tpublic team1!: number | null;\n\n\t@prop({ type: Number, default: null })\n\tpublic team2!: number | null;\n}\n\nexport class TournamentTeam {\n\t@prop({ type: Types.ObjectId, default: () => new Types.ObjectId() })\n\tpublic _id!: Types.ObjectId;\n\n\t@prop({ type: String, default: null })\n\tpublic externalId?: string;\n\n\t@prop({ required: true, type: String, trim: true })\n\tpublic name!: string;\n\n\t@prop({ type: String })\n\tpublic picture?: string;\n}\n\nexport class TournamentMatchTeam {\n\t@prop({ required: true, type: Types.ObjectId })\n\tpublic teamId!: Types.ObjectId;\n\n\t@prop({ required: true, type: String, trim: true })\n\tpublic name!: string;\n}\n\nexport class TournamentMatch {\n\t@prop({ type: Types.ObjectId, default: () => new Types.ObjectId() })\n\tpublic _id!: Types.ObjectId;\n\n\t@prop({ type: String, default: null })\n\tpublic externalId?: string;\n\n\t@prop({ type: String, trim: true })\n\tpublic additionalTag?: string;\n\n\t@prop({ required: true, type: String, trim: true })\n\tpublic stage!: string;\n\n\t@prop({ required: true, type: () => TournamentMatchTeam, _id: false })\n\tpublic team1!: TournamentMatchTeam;\n\n\t@prop({ required: true, type: () => TournamentMatchTeam, _id: false })\n\tpublic team2!: TournamentMatchTeam;\n\n\t@prop({ type: () => MatchScore, _id: false, default: () => ({}) })\n\tpublic score!: MatchScore;\n\n\t@prop({ type: Types.ObjectId, default: null })\n\tpublic winnerId!: Types.ObjectId | null;\n\n\t@prop({ required: true, type: Date })\n\tpublic startingDate!: Date;\n\n\t@prop({ type: Date })\n\tpublic endDate?: Date;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic matchEnded!: boolean;\n\n\t@prop({ type: String })\n\tpublic matchStatus?: string;\n\n\t@prop({ type: () => Boolean })\n\tpublic notificationFlags!: Map<string, boolean>;\n}\n\nexport class ScheduledNotificationConfig {\n\t@prop({ required: true, type: String })\n\tpublic type!: string;\n\n\t@prop({ required: true, type: Number })\n\tpublic durationMins!: number;\n\n\t@prop({ required: true, type: String })\n\tpublic target!: string;\n}\n\n@modelOptions({ schemaOptions: { discriminatorKey: 'type', _id: false } })\nexport class TournamentReward {\n\t@prop({ required: true, type: String, enum: TournamentRewardType })\n\tpublic type!: TournamentRewardType;\n}\n\nexport class TournamentCouponReward extends TournamentReward {\n\t@prop({ required: true, type: String, trim: true })\n\tpublic couponNamePrefix!: string;\n\n\t@prop({ required: true, type: Number })\n\tpublic percentage!: number;\n\n\t@prop({ type: Number, default: null })\n\tpublic maxDiscountPerOrder!: number | null;\n}\n\nexport class NotificationMessage {\n\t@prop({ required: true, type: String })\n\tpublic title!: string;\n\n\t@prop({ required: true, type: String })\n\tpublic body!: string;\n}\n\n@modelOptions({ schemaOptions: { collection: 'tournaments', timestamps: true } })\nexport class Tournament extends TimeStamps {\n\t@prop({ required: true, type: String })\n\tpublic name!: string;\n\n\t@prop({ required: true, type: String, trim: true })\n\tpublic tag!: string;\n\n\t@prop({ required: true, type: Date })\n\tpublic startDate!: Date;\n\n\t@prop({ required: true, type: Date })\n\tpublic endDate!: Date;\n\n\t@prop({ type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status!: Status;\n\n\t@prop({ required: false, type: String })\n\tpublic externalApi?: string;\n\n\t@prop({ required: false, type: String })\n\tpublic externalApiKey?: string;\n\n\t@prop({ type: () => [TournamentTeam], default: [] })\n\tpublic teams!: TournamentTeam[];\n\n\t@prop({ type: () => [TournamentMatch], default: [] })\n\tpublic matches!: TournamentMatch[];\n\n\t@prop({\n\t\ttype: () => TournamentReward,\n\t\tdiscriminators: () => [{ type: TournamentCouponReward, value: TournamentRewardType.COUPON }],\n\t})\n\tpublic reward?: TournamentReward;\n\n\t@prop({ type: () => NotificationMessage })\n\tpublic notificationTemplates!: Map<string, NotificationMessage>;\n\n\t@prop({ type: () => [ScheduledNotificationConfig], default: [], _id: false })\n\tpublic scheduledNotifications!: ScheduledNotificationConfig[];\n\n\t@prop({ type: () => Boolean })\n\tpublic notificationFlags!: Map<string, boolean>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"tournament.model.js","sourceRoot":"/","sources":["libraries/mongo/models/tournament.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA0D;AAC1D,4EAAqE;AACrE,uCAAiC;AACjC,kDAAuE;AAEvE,MAAa,UAAU;IAEf,KAAK,CAAiB;IAGtB,KAAK,CAAiB;CAC7B;AAND,gCAMC;AAJO;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;yCACT;AAGtB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;yCACT;AAG9B,MAAa,cAAc;IAEnB,GAAG,CAAkB;IAGrB,UAAU,CAAU;IAGpB,IAAI,CAAU;IAGd,OAAO,CAAU;CACxB;AAZD,wCAYC;AAVO;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,gBAAK,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,gBAAK,CAAC,Q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/defaultClasses';\nimport { Types } from 'mongoose';\nimport { Status, TournamentRewardType } from '../../../utilities/enum';\n\nexport class MatchScore {\n\t@prop({ type: Number, default: null })\n\tpublic team1!: number | null;\n\n\t@prop({ type: Number, default: null })\n\tpublic team2!: number | null;\n}\n\nexport class TournamentTeam {\n\t@prop({ type: Types.ObjectId, default: () => new Types.ObjectId() })\n\tpublic _id!: Types.ObjectId;\n\n\t@prop({ type: String, default: null })\n\tpublic externalId?: string;\n\n\t@prop({ required: true, type: String, trim: true })\n\tpublic name!: string;\n\n\t@prop({ type: String })\n\tpublic picture?: string;\n}\n\nexport class TournamentMatchTeam {\n\t@prop({ required: true, type: Types.ObjectId })\n\tpublic teamId!: Types.ObjectId;\n\n\t@prop({ required: true, type: String, trim: true })\n\tpublic name!: string;\n}\n\nexport class TournamentMatch {\n\t@prop({ type: Types.ObjectId, default: () => new Types.ObjectId() })\n\tpublic _id!: Types.ObjectId;\n\n\t@prop({ type: String, default: null })\n\tpublic externalId?: string;\n\n\t@prop({ type: String, trim: true })\n\tpublic additionalTag?: string;\n\n\t@prop({ required: true, type: String, trim: true })\n\tpublic stage!: string;\n\n\t@prop({ required: true, type: () => TournamentMatchTeam, _id: false })\n\tpublic team1!: TournamentMatchTeam;\n\n\t@prop({ required: true, type: () => TournamentMatchTeam, _id: false })\n\tpublic team2!: TournamentMatchTeam;\n\n\t@prop({ type: () => MatchScore, _id: false, default: () => ({}) })\n\tpublic score!: MatchScore;\n\n\t@prop({ type: Types.ObjectId, default: null })\n\tpublic winnerId!: Types.ObjectId | null;\n\n\t@prop({ required: true, type: Date })\n\tpublic startingDate!: Date;\n\n\t@prop({ type: Date })\n\tpublic endDate?: Date;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic matchEnded!: boolean;\n\n\t@prop({ type: String })\n\tpublic matchStatus?: string;\n\n\t@prop({ type: () => Boolean })\n\tpublic notificationFlags!: Map<string, boolean>;\n}\n\nexport class ScheduledNotificationConfig {\n\t@prop({ required: true, type: String })\n\tpublic type!: string;\n\n\t@prop({ required: true, type: Number })\n\tpublic durationMins!: number;\n\n\t@prop({ required: true, type: String })\n\tpublic target!: string;\n}\n\n@modelOptions({ schemaOptions: { discriminatorKey: 'type', _id: false } })\nexport class TournamentReward {\n\t@prop({ required: true, type: String, enum: TournamentRewardType })\n\tpublic type!: TournamentRewardType;\n}\n\nexport class TournamentCouponReward extends TournamentReward {\n\t@prop({ required: true, type: String, trim: true })\n\tpublic couponNamePrefix!: string;\n\n\t@prop({ required: true, type: Number })\n\tpublic percentage!: number;\n\n\t@prop({ type: Number, default: null })\n\tpublic maxDiscountPerOrder!: number | null;\n}\n\nexport class NotificationMessage {\n\t@prop({ required: true, type: String })\n\tpublic title!: string;\n\n\t@prop({ required: true, type: String })\n\tpublic body!: string;\n}\n\n@modelOptions({ schemaOptions: { collection: 'tournaments', timestamps: true } })\nexport class Tournament extends TimeStamps {\n\t@prop({ required: true, type: String })\n\tpublic name!: string;\n\n\t@prop({ required: true, type: String, trim: true })\n\tpublic tag!: string;\n\n\t@prop({ required: true, type: Date })\n\tpublic startDate!: Date;\n\n\t@prop({ required: true, type: Date })\n\tpublic endDate!: Date;\n\n\t@prop({ type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status!: Status;\n\n\t@prop({ required: false, type: String })\n\tpublic externalApi?: string;\n\n\t@prop({ required: false, type: String })\n\tpublic externalApiKey?: string;\n\n\t@prop({ type: () => [TournamentTeam], default: [] })\n\tpublic teams!: TournamentTeam[];\n\n\t@prop({ type: () => [TournamentMatch], default: [] })\n\tpublic matches!: TournamentMatch[];\n\n\t@prop({\n\t\ttype: () => TournamentReward,\n\t\tdiscriminators: () => [{ type: TournamentCouponReward, value: TournamentRewardType.COUPON }],\n\t})\n\tpublic reward?: TournamentReward;\n\n\t@prop({ type: () => NotificationMessage })\n\tpublic notificationTemplates!: Map<string, NotificationMessage>;\n\n\t@prop({ type: () => [ScheduledNotificationConfig], default: [], _id: false })\n\tpublic scheduledNotifications!: ScheduledNotificationConfig[];\n}\n"]}
|
package/dist/types/README.md
CHANGED
package/dist/types/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lyxa.ai/types",
|
|
3
|
-
"version": "1.4.151
|
|
3
|
+
"version": "1.4.151",
|
|
4
4
|
"description": "Lyxa type definitions and validation schemas for both frontend and backend",
|
|
5
5
|
"author": "elie <42282499+Internalizable@users.noreply.github.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -356,8 +356,7 @@ export declare enum ClickType {
|
|
|
356
356
|
CLICKABLE_WALLET = "clickable_wallet",
|
|
357
357
|
CLICKABLE_SETTING = "clickable_setting",
|
|
358
358
|
CLICKABLE_FALLBACK = "clickable_fallback",
|
|
359
|
-
CLICKABLE_BOOKING = "clickable_booking"
|
|
360
|
-
CLICKABLE_TOURNAMENT = "clickable_tournament"
|
|
359
|
+
CLICKABLE_BOOKING = "clickable_booking"
|
|
361
360
|
}
|
|
362
361
|
export declare enum ChargeType {
|
|
363
362
|
CUSTOM = "custom"
|
|
@@ -711,7 +710,8 @@ export declare enum SupportReasonTypeEnum {
|
|
|
711
710
|
ORDER = "order",
|
|
712
711
|
ACCOUNT = "account",
|
|
713
712
|
SHOP = "shop",
|
|
714
|
-
FAQ = "faq"
|
|
713
|
+
FAQ = "faq",
|
|
714
|
+
BOOKING = "booking"
|
|
715
715
|
}
|
|
716
716
|
export declare enum CancellationReasonTypeEnum {
|
|
717
717
|
USER = "user",
|
|
@@ -1249,16 +1249,3 @@ export declare enum TournamentRewardType {
|
|
|
1249
1249
|
COUPON = "coupon",
|
|
1250
1250
|
FREE_DELIVERY = "free_delivery"
|
|
1251
1251
|
}
|
|
1252
|
-
export declare enum TournamentNotificationTag {
|
|
1253
|
-
TOURNAMENT_ACTIVATION = "tournament-activation",
|
|
1254
|
-
MATCH_RESULT_WINNER = "match-result-winner",
|
|
1255
|
-
MATCH_RESULT_LOSER = "match-result-loser",
|
|
1256
|
-
TEAM_SELECTION_REMINDER_1_DAY = "team-selection-reminder-1-day",
|
|
1257
|
-
PREDICTION_REMINDER_3_HOURS = "prediction-reminder-3-hours",
|
|
1258
|
-
PREDICTION_REMINDER_15_MINUTES = "prediction-reminder-15-minutes"
|
|
1259
|
-
}
|
|
1260
|
-
export declare enum TournamentScheduledNotificationTarget {
|
|
1261
|
-
GLOBAL = "global",
|
|
1262
|
-
UNPREDICTED_PARTICIPANTS = "unpredicted-participants",
|
|
1263
|
-
NO_TEAM_SELECTED_PARTICIPANTS = "no-team-selected-participants"
|
|
1264
|
-
}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.BobType = exports.BobChannelType = exports.BobModel = exports.BobSettlementStatus = exports.BobSettlementType = exports.BobAccountType = exports.ZoneStatus = exports.FaqAccountType = exports.CounterType = exports.BannerUserType = exports.BannerLinkType = exports.BannerClickType = exports.VendorRole = exports.ShopRole = exports.OnlineStatus = exports.ShopOnlineStatus = exports.ChargeType = exports.ClickType = exports.NotificationAccountType = exports.DishCategory = exports.ProductDietaryType = exports.ShopDietaryType = exports.PriceOption = exports.ProductType = exports.CoreAuthIdentityType = exports.UserAppSectionItemType = exports.UserAppSectionType = exports.AdminLogsUpdatedFieldsType = exports.UpdatedField = exports.GeoLocationType = exports.RatingAccountType = exports.SubscriptionStatus = exports.SubscriptionPackage = exports.PaidCurrency = exports.PaymentStatus = exports.ChangeReturnMethod = exports.PaymentMethod = exports.ValueType = exports.HolidayWorkStatus = exports.WorkStatus = exports.WeekDay = exports.GlobalItemType = exports.AdjustmentStatus = exports.ServiceItemType = exports.ItemType = exports.Status = exports.AppPlatform = exports.AccountType = exports.AgentLiveStatus = exports.AuthEntityType = void 0;
|
|
4
4
|
exports.PayoutStatus = exports.PayoutType = exports.AddRemoveCreditAccountType = exports.SettingsReasonStatus = exports.CancellationReasonTypeEnum = exports.SupportReasonTypeEnum = exports.PlusSettingsPackageType = exports.AddRemoveCreditSettlementType = exports.SettlementType = exports.MediaType = exports.WorkingHourSettingsType = exports.ZoneGeometryType = exports.RiderAssignmentStatus = exports.CourierServiceType = exports.TripLegStatus = exports.DeliveryStatus = exports.CourierOrderPaymentFrom = exports.UserActionReason = exports.UserActionType = exports.ShopCourierOrderStatus = exports.ServiceBookingStatus = exports.CourierOrderStatus = exports.RegularOrderStatus = exports.AdjustmentType = exports.ServiceBookingStatusTimelineType = exports.StatusTimelineType = exports.OrderType = exports.Language = exports.OrderSize = exports.RiderBagSize = exports.RiderType = exports.ShiftType = exports.CreatedBy = exports.LiveStatus = exports.PaymentIntentStatus = exports.CardStatus = exports.CardUserType = exports.PaymentProvider = exports.CardType = exports.PaymentPreference = exports.CartStatus = exports.LimitedTimeOfferCampaignStatus = exports.AdminRole = exports.PunchMarketingStatus = exports.MarketingStatus = exports.ServiceMarketingType = exports.MarketingType = exports.FavouriteType = exports.CouponExpirationReason = exports.CouponType = void 0;
|
|
5
5
|
exports.SyncCacheEnumType = exports.DateFormatType = exports.AppAppearanceType = exports.GraphType = exports.CalendarEventType = exports.CalendarViewType = exports.LyxaTimeZoneEnum = exports.UserOrderCompletionScope = exports.GroupCartNotificationStatus = exports.Currency = exports.RequestFrom = exports.UploadState = exports.SubServiceType = exports.ServiceType = exports.ActionType = exports.DeviceType = exports.PushNotificationEventType = exports.SocketEventType = exports.SocketServiceQueue = exports.OtpMethodType = exports.ReviewType = exports.FoodNutritionType = exports.AdjustmentReason = exports.UrgentOrderReasons = exports.ServiceFlagReasonType = exports.ServiceFlagType = exports.FlagReasonType = exports.FlagType = exports.PromotionType = exports.ServiceBookingCanceledBy = exports.TRPCErrorEnum = exports.ShopFilterSortByEnum = exports.BookingStatus = exports.ProfessionalScheduleType = exports.ServiceBookingRecurrencePattern = exports.ProfessionalRecurrencePattern = exports.ServiceBookingPriority = exports.ProfessionalStatus = exports.Service = exports.ServiceLineItemType = exports.ServiceCartStatus = exports.ChatroomType = exports.UserRef = exports.TicketStatus = exports.TicketType = exports.RewardedToTypeEnum = exports.ReplacementType = exports.ReplacementReason = exports.OrderCanceledBy = exports.LogUser = void 0;
|
|
6
|
-
exports.
|
|
6
|
+
exports.TournamentRewardType = exports.OnlinePaymentStatus = exports.BarcodeTypes = exports.RiderScoreEventTag = exports.AreebaPaymentType = exports.HttpStatus = exports.LogTag = exports.LogLevel = void 0;
|
|
7
7
|
var AuthEntityType;
|
|
8
8
|
(function (AuthEntityType) {
|
|
9
9
|
AuthEntityType["USER"] = "USER";
|
|
@@ -396,7 +396,6 @@ var ClickType;
|
|
|
396
396
|
ClickType["CLICKABLE_SETTING"] = "clickable_setting";
|
|
397
397
|
ClickType["CLICKABLE_FALLBACK"] = "clickable_fallback";
|
|
398
398
|
ClickType["CLICKABLE_BOOKING"] = "clickable_booking";
|
|
399
|
-
ClickType["CLICKABLE_TOURNAMENT"] = "clickable_tournament";
|
|
400
399
|
})(ClickType || (exports.ClickType = ClickType = {}));
|
|
401
400
|
var ChargeType;
|
|
402
401
|
(function (ChargeType) {
|
|
@@ -813,6 +812,7 @@ var SupportReasonTypeEnum;
|
|
|
813
812
|
SupportReasonTypeEnum["ACCOUNT"] = "account";
|
|
814
813
|
SupportReasonTypeEnum["SHOP"] = "shop";
|
|
815
814
|
SupportReasonTypeEnum["FAQ"] = "faq";
|
|
815
|
+
SupportReasonTypeEnum["BOOKING"] = "booking";
|
|
816
816
|
})(SupportReasonTypeEnum || (exports.SupportReasonTypeEnum = SupportReasonTypeEnum = {}));
|
|
817
817
|
var CancellationReasonTypeEnum;
|
|
818
818
|
(function (CancellationReasonTypeEnum) {
|
|
@@ -1413,19 +1413,4 @@ var TournamentRewardType;
|
|
|
1413
1413
|
TournamentRewardType["COUPON"] = "coupon";
|
|
1414
1414
|
TournamentRewardType["FREE_DELIVERY"] = "free_delivery";
|
|
1415
1415
|
})(TournamentRewardType || (exports.TournamentRewardType = TournamentRewardType = {}));
|
|
1416
|
-
var TournamentNotificationTag;
|
|
1417
|
-
(function (TournamentNotificationTag) {
|
|
1418
|
-
TournamentNotificationTag["TOURNAMENT_ACTIVATION"] = "tournament-activation";
|
|
1419
|
-
TournamentNotificationTag["MATCH_RESULT_WINNER"] = "match-result-winner";
|
|
1420
|
-
TournamentNotificationTag["MATCH_RESULT_LOSER"] = "match-result-loser";
|
|
1421
|
-
TournamentNotificationTag["TEAM_SELECTION_REMINDER_1_DAY"] = "team-selection-reminder-1-day";
|
|
1422
|
-
TournamentNotificationTag["PREDICTION_REMINDER_3_HOURS"] = "prediction-reminder-3-hours";
|
|
1423
|
-
TournamentNotificationTag["PREDICTION_REMINDER_15_MINUTES"] = "prediction-reminder-15-minutes";
|
|
1424
|
-
})(TournamentNotificationTag || (exports.TournamentNotificationTag = TournamentNotificationTag = {}));
|
|
1425
|
-
var TournamentScheduledNotificationTarget;
|
|
1426
|
-
(function (TournamentScheduledNotificationTarget) {
|
|
1427
|
-
TournamentScheduledNotificationTarget["GLOBAL"] = "global";
|
|
1428
|
-
TournamentScheduledNotificationTarget["UNPREDICTED_PARTICIPANTS"] = "unpredicted-participants";
|
|
1429
|
-
TournamentScheduledNotificationTarget["NO_TEAM_SELECTED_PARTICIPANTS"] = "no-team-selected-participants";
|
|
1430
|
-
})(TournamentScheduledNotificationTarget || (exports.TournamentScheduledNotificationTarget = TournamentScheduledNotificationTarget = {}));
|
|
1431
1416
|
//# sourceMappingURL=enum.js.map
|