@managesome/eposmatic-toolkit 0.2.658 → 0.2.674
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/lib/helpers/types/order-engine.d.ts +3 -0
- package/lib/helpers/utils/halfhalf-setup-helpers.d.ts +8 -5
- package/lib/helpers/utils/halfhalf-setup-helpers.js +65 -27
- package/lib/helpers/utils/order-engine.js +7 -1
- package/lib/helpers/utils/specials-helpers.d.ts +13 -2
- package/lib/helpers/utils/specials-helpers.js +94 -27
- package/lib/schemas/models/halfhalf_setup.d.ts +58 -3
- package/lib/schemas/models/halfhalf_setup.js +24 -4
- package/lib/schemas/models/orders.d.ts +324 -0
- package/lib/schemas/models/orders.js +12 -0
- package/lib/schemas/models/specials.js +2 -0
- package/lib/schemas/types/halfhalf_setup.d.ts +6 -1
- package/lib/schemas/types/orders.d.ts +3 -0
- package/package.json +1 -1
|
@@ -1,12 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HALFHALF_COLLECTION_INDEXES = exports.HALFHALF_COLLECTION_NAME = exports.HalfHalfSetupSchema = void 0;
|
|
3
|
+
exports.HALFHALF_COLLECTION_INDEXES = exports.HALFHALF_COLLECTION_NAME = exports.HalfHalfSetupSchema = exports.HalfHalfSegmentSchema = void 0;
|
|
4
4
|
const mongoose_1 = require("mongoose");
|
|
5
5
|
const categories_1 = require("./categories");
|
|
6
6
|
const common_models_1 = require("./common-models");
|
|
7
7
|
const items_1 = require("./items");
|
|
8
8
|
const specials_1 = require("./specials");
|
|
9
9
|
const tenants_1 = require("./tenants");
|
|
10
|
+
exports.HalfHalfSegmentSchema = new mongoose_1.Schema({
|
|
11
|
+
_id: {
|
|
12
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
13
|
+
required: true,
|
|
14
|
+
immutable: true,
|
|
15
|
+
},
|
|
16
|
+
// `_id` is auto-generated as a BSON ObjectId by mongoose
|
|
17
|
+
name: {
|
|
18
|
+
type: String,
|
|
19
|
+
required: true,
|
|
20
|
+
},
|
|
21
|
+
sort_id: {
|
|
22
|
+
type: Number,
|
|
23
|
+
required: true,
|
|
24
|
+
},
|
|
25
|
+
}, {
|
|
26
|
+
minimize: false,
|
|
27
|
+
});
|
|
10
28
|
exports.HalfHalfSetupSchema = new mongoose_1.Schema({
|
|
11
29
|
_id: {
|
|
12
30
|
type: mongoose_1.Schema.Types.ObjectId,
|
|
@@ -35,10 +53,12 @@ exports.HalfHalfSetupSchema = new mongoose_1.Schema({
|
|
|
35
53
|
min: 1,
|
|
36
54
|
},
|
|
37
55
|
segments: {
|
|
38
|
-
type:
|
|
56
|
+
type: [exports.HalfHalfSegmentSchema],
|
|
39
57
|
required: true,
|
|
40
|
-
|
|
41
|
-
|
|
58
|
+
validate: {
|
|
59
|
+
validator: (value) => Array.isArray(value) && (value.length === 2 || value.length === 4),
|
|
60
|
+
message: 'segments must have a length of 2 or 4',
|
|
61
|
+
},
|
|
42
62
|
},
|
|
43
63
|
image_url: {
|
|
44
64
|
type: String,
|