@freedom_sky/feige-lib 5.20.0 → 5.22.0

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/AGENTS.md ADDED
@@ -0,0 +1,75 @@
1
+ # AGENTS.md — feige-lib
2
+
3
+ Shared business library consumed by every repo in the order-multi workspace
4
+ (server, app, admin-server, admin-fe, client, etc.). Anything here is, by
5
+ definition, **shared** — changes ripple across the whole system.
6
+
7
+ ## Local-dev distribution
8
+
9
+ This package is published to npm. During cross-repo development you can iterate
10
+ without bumping the version by rebuilding (`npx tsc`) and copying `dist/` into
11
+ each consumer's `node_modules/@freedom_sky/feige-lib/dist/`. Only bump the
12
+ version (`package.json` + `CHANGE.md`) and `npm publish` when you're ready to
13
+ release — and only with explicit user approval.
14
+
15
+ ---
16
+
17
+ ## `CONST.UPPER_LIMIT` — naming and authoring rules
18
+
19
+ `Const.UPPER_LIMIT` (see `src/const/const.ts`) holds every validation upper
20
+ bound used by DTOs / schemas / UI in the workspace. The prefix on each key
21
+ encodes **which domain owns the concept** — and any feature in any repo may
22
+ reuse that constant when they're referencing the same concept.
23
+
24
+ | Prefix | Meaning | Examples |
25
+ |---|---|---|
26
+ | `<DOMAIN>_` (e.g. `DISH_`, `MEMBER_`, `STORE_`, `TABLE_`, `TAKEOUT_`, `SPECIFICATION_`, `RESERVATION_`) | The constant belongs to that domain. Any feature that references the same concept reuses this key as-is. | `DISH_NAME_MAX_LENGTH`, `DISH_COUNT_MAX`, `MEMBER_NOTE_MAX_LENGTH`, `RESERVATION_NOTE_MAX_LENGTH` |
27
+ | `COMMON_` | Generic limit with no single domain owner — applies across many features. | `COMMON_HEADCOUNT_MAX`, `COMMON_CONTACT_NAME_MAX_LENGTH`, `COMMON_CONTACT_PHONE_MAX_LENGTH` |
28
+
29
+ **Decision flow for a new entry:**
30
+
31
+ 1. **Does an existing domain already own this concept?** Scan
32
+ `UPPER_LIMIT` for a `<DOMAIN>_` prefix that matches semantically. If yes,
33
+ reuse the existing key — even if your current feature is something else.
34
+ Example: reservation needs a max "dish count" → use `DISH_COUNT_MAX`, **not**
35
+ `RESERVATION_DISH_COUNT_MAX` and **not** `COMMON_DISH_COUNT_MAX`. The
36
+ concept is owned by the dish domain; reservation is just referencing dish.
37
+ 2. **No existing domain prefix, but the concept spans multiple unrelated
38
+ features?** Use `COMMON_`. Example: `COMMON_HEADCOUNT_MAX` —
39
+ dine-in / takeout / reservation can all hold a headcount; no single domain
40
+ owns it.
41
+ 3. **No existing prefix and only one feature will ever care?** Use that
42
+ feature's prefix. Example: `RESERVATION_NOTE_MAX_LENGTH` — the reservation
43
+ note is reservation-specific.
44
+
45
+ **Forbidden combinations:**
46
+
47
+ - `COMMON_<DOMAIN>_*` (e.g. `COMMON_DISH_*`) — self-contradicting; the
48
+ presence of `DISH_` already says "this lives in the dish domain". Drop
49
+ the `COMMON_`.
50
+ - `<FEATURE>_<OTHER_DOMAIN>_*` (e.g. `RESERVATION_DISH_*`) — don't graft
51
+ your feature's prefix onto a concept that already has a domain. Reuse the
52
+ domain key directly.
53
+
54
+ **Authoring rules:**
55
+
56
+ 1. **Look for an existing hardcoded value before inventing one.** A lot of
57
+ limits in this codebase started life as magic numbers in DTOs (`@Max(1000)`,
58
+ `@Length(1, 50)`, …). When extracting, **copy the existing value**, don't
59
+ pick a new one. That way a future "unify all usages" pass is a no-op for
60
+ behavior. Document where the value came from in the PR description /
61
+ commit, e.g.:
62
+
63
+ > `DISH_COUNT_MAX = 1000` — copied from
64
+ > `order-multi-server/src/orders/dto/create-order/create-order-base.dto.ts:83`
65
+ > `@Max(1000)`.
66
+
67
+ 2. **If no precedent exists, ask the user** for the value — do not guess.
68
+ 3. **Do not retro-edit old code** in the same change. Add the constant and
69
+ point new code at it. Sweeping the old hardcodes is a separate, dedicated
70
+ task to keep diffs reviewable.
71
+ 4. **Names use SCREAMING_SNAKE_CASE.** Suffix conventions:
72
+ - String fields → `..._MAX_LENGTH`
73
+ - Numeric counts/amounts → `..._MAX` (or no suffix when the name is already
74
+ unambiguous, matching the existing entries like `DISH_PRICE`,
75
+ `WAITER_NUM`).
package/CHANGE.md CHANGED
@@ -1,3 +1,13 @@
1
+ # 5.22.0
2
+ - add Reservation and ReservationDish interfaces for cross-repo reservation feature (ReservationDish.type uses DishType enum; Reservation.status uses ReservationStatusEnum; Reservation.addTime accepts Date | string for BSON/wire compatibility)
3
+ # 5.21.0
4
+ - add ReservationStatusEnum (WAITING / CANCELLED / COMPLETED) for cross-repo reservation feature
5
+ - add UPPER_LIMIT constants: COMMON_HEADCOUNT_MAX, COMMON_CONTACT_NAME_MAX_LENGTH, COMMON_CONTACT_PHONE_MAX_LENGTH, DISH_COUNT_MAX, DISH_NOTE_MAX_LENGTH, RESERVATION_NOTE_MAX_LENGTH
6
+ - add AGENTS.md documenting UPPER_LIMIT naming rules (COMMON_ vs domain prefix)
7
+ # 5.20.0
8
+ - add ADDRESS_DETAIL_MAX_LENGTH constant
9
+ # 5.19.0
10
+ - add Store.location field for map-location feature
1
11
  # 4.45.0
2
12
  - add store auditedNames
3
13
  # 4.44.0
@@ -145,6 +145,12 @@ declare class Const {
145
145
  MEMBER_NOTE_MAX_LENGTH: number;
146
146
  MEMBER_TRANSACTION_NOTE_MAX_LENGTH: number;
147
147
  ADDRESS_DETAIL_MAX_LENGTH: number;
148
+ COMMON_HEADCOUNT_MAX: number;
149
+ COMMON_CONTACT_NAME_MAX_LENGTH: number;
150
+ COMMON_CONTACT_PHONE_MAX_LENGTH: number;
151
+ DISH_COUNT_MAX: number;
152
+ DISH_NOTE_MAX_LENGTH: number;
153
+ RESERVATION_NOTE_MAX_LENGTH: number;
148
154
  };
149
155
  BUSINESS: {
150
156
  BASE: {
@@ -149,6 +149,12 @@ var Const = /** @class */ (function () {
149
149
  MEMBER_NOTE_MAX_LENGTH: 200,
150
150
  MEMBER_TRANSACTION_NOTE_MAX_LENGTH: 200,
151
151
  ADDRESS_DETAIL_MAX_LENGTH: 100,
152
+ COMMON_HEADCOUNT_MAX: 100,
153
+ COMMON_CONTACT_NAME_MAX_LENGTH: 50,
154
+ COMMON_CONTACT_PHONE_MAX_LENGTH: 30,
155
+ DISH_COUNT_MAX: 1000,
156
+ DISH_NOTE_MAX_LENGTH: 100,
157
+ RESERVATION_NOTE_MAX_LENGTH: 1000,
152
158
  };
153
159
  this.BUSINESS = {
154
160
  BASE: {
@@ -0,0 +1,5 @@
1
+ export declare enum ReservationStatusEnum {
2
+ WAITING = "WAITING",
3
+ CANCELLED = "CANCELLED",
4
+ COMPLETED = "COMPLETED"
5
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var ReservationStatusEnum;
4
+ (function (ReservationStatusEnum) {
5
+ ReservationStatusEnum["WAITING"] = "WAITING";
6
+ ReservationStatusEnum["CANCELLED"] = "CANCELLED";
7
+ ReservationStatusEnum["COMPLETED"] = "COMPLETED";
8
+ })(ReservationStatusEnum = exports.ReservationStatusEnum || (exports.ReservationStatusEnum = {}));
package/dist/index.d.ts CHANGED
@@ -24,6 +24,7 @@ export * from './enum/receptionist.enum';
24
24
  export * from './enum/from.enum';
25
25
  export * from './enum/role.enum';
26
26
  export * from './enum/continent.enum';
27
+ export * from './enum/reservation.enum';
27
28
  export * from './announcement/enum/announcement.enum';
28
29
  export * from './interfaces/member/member.interface';
29
30
  export * from './interfaces/member/member-transaction.interface';
@@ -36,6 +37,7 @@ export * from './interfaces/store/specification.interface';
36
37
  export * from './interfaces/store/menu-export.interface';
37
38
  export { MenuImportModeEnum } from './enum/menu-io.enum';
38
39
  export * from './interfaces/order';
40
+ export * from './interfaces/reservation/reservation.interface';
39
41
  export { PayCompanyEnum } from './enum/pay-company.enum';
40
42
  import * as moment from 'moment';
41
43
  import Big from 'big.js';
package/dist/index.js CHANGED
@@ -28,6 +28,7 @@ __export(require("./enum/receptionist.enum"));
28
28
  __export(require("./enum/from.enum"));
29
29
  __export(require("./enum/role.enum"));
30
30
  __export(require("./enum/continent.enum"));
31
+ __export(require("./enum/reservation.enum"));
31
32
  __export(require("./announcement/enum/announcement.enum"));
32
33
  var menu_io_enum_1 = require("./enum/menu-io.enum");
33
34
  exports.MenuImportModeEnum = menu_io_enum_1.MenuImportModeEnum;
@@ -0,0 +1,46 @@
1
+ import { ReservationStatusEnum } from '../../enum/reservation.enum';
2
+ import { DishType } from '../../enum/dish.enum';
3
+ export interface ReservationDish {
4
+ readonly dishId: string;
5
+ readonly count: number;
6
+ /** Used to flag weight-priced dishes. */
7
+ readonly type: DishType;
8
+ /** For dishes priced by weight. Only meaningful when type === DishType.Weigh. */
9
+ readonly weight?: number;
10
+ readonly specifications?: Array<{
11
+ readonly _id: string;
12
+ readonly selectedItems: string[];
13
+ }>;
14
+ readonly note?: string;
15
+ }
16
+ export interface Reservation {
17
+ readonly _id: string;
18
+ readonly storeId: string;
19
+ /** ISO local string "YYYY-MM-DDTHH:mm" — no seconds, no timezone. */
20
+ readonly reservationTime: string;
21
+ readonly headcount: number;
22
+ readonly contactName: string;
23
+ readonly contactPhone?: string;
24
+ readonly contactEmail?: string;
25
+ readonly tableNum?: string;
26
+ readonly reservationNote?: string;
27
+ readonly dishes: ReservationDish[];
28
+ readonly status: ReservationStatusEnum;
29
+ /**
30
+ * `Date` inside the server process (mongoose returns a Date instance);
31
+ * ISO `string` once the document has crossed JSON.stringify (HTTP wire,
32
+ * app side). Same dual-shape convention as `BaseOrder.date`. Normalize
33
+ * with `new Date(addTime)` if you need to do math — that constructor
34
+ * accepts either form.
35
+ */
36
+ readonly addTime: Date | string;
37
+ readonly operatorId?: string;
38
+ /**
39
+ * Set when this reservation has been bound to a real order via
40
+ * POST /orders. Optional: a reservation can also be marked COMPLETED
41
+ * without a backing order (e.g. manual no-show close-out).
42
+ */
43
+ readonly boundOrderId?: string;
44
+ /** Mongoose default version key — present on every document. */
45
+ readonly __v?: number;
46
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@freedom_sky/feige-lib",
3
- "version": "5.20.0",
3
+ "version": "5.22.0",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -148,6 +148,12 @@ class Const {
148
148
  MEMBER_NOTE_MAX_LENGTH: 200,
149
149
  MEMBER_TRANSACTION_NOTE_MAX_LENGTH: 200,
150
150
  ADDRESS_DETAIL_MAX_LENGTH: 100,
151
+ COMMON_HEADCOUNT_MAX: 100,
152
+ COMMON_CONTACT_NAME_MAX_LENGTH: 50,
153
+ COMMON_CONTACT_PHONE_MAX_LENGTH: 30,
154
+ DISH_COUNT_MAX: 1000,
155
+ DISH_NOTE_MAX_LENGTH: 100,
156
+ RESERVATION_NOTE_MAX_LENGTH: 1000,
151
157
  };
152
158
  BUSINESS = {
153
159
  BASE: {
@@ -0,0 +1,5 @@
1
+ export enum ReservationStatusEnum {
2
+ WAITING = 'WAITING',
3
+ CANCELLED = 'CANCELLED',
4
+ COMPLETED = 'COMPLETED',
5
+ }
package/src/index.ts CHANGED
@@ -25,6 +25,7 @@ export * from './enum/receptionist.enum';
25
25
  export * from './enum/from.enum';
26
26
  export * from './enum/role.enum';
27
27
  export * from './enum/continent.enum';
28
+ export * from './enum/reservation.enum';
28
29
  export * from './announcement/enum/announcement.enum';
29
30
  export * from './interfaces/member/member.interface';
30
31
  export * from './interfaces/member/member-transaction.interface';
@@ -37,6 +38,7 @@ export * from './interfaces/store/specification.interface';
37
38
  export * from './interfaces/store/menu-export.interface';
38
39
  export { MenuImportModeEnum } from './enum/menu-io.enum';
39
40
  export * from './interfaces/order';
41
+ export * from './interfaces/reservation/reservation.interface';
40
42
  export { PayCompanyEnum } from './enum/pay-company.enum';
41
43
  import * as moment from 'moment';
42
44
  import Big from 'big.js';
@@ -0,0 +1,48 @@
1
+ import { ReservationStatusEnum } from '../../enum/reservation.enum';
2
+ import { DishType } from '../../enum/dish.enum';
3
+
4
+ export interface ReservationDish {
5
+ readonly dishId: string;
6
+ readonly count: number;
7
+ /** Used to flag weight-priced dishes. */
8
+ readonly type: DishType;
9
+ /** For dishes priced by weight. Only meaningful when type === DishType.Weigh. */
10
+ readonly weight?: number;
11
+ readonly specifications?: Array<{
12
+ readonly _id: string;
13
+ readonly selectedItems: string[];
14
+ }>;
15
+ readonly note?: string;
16
+ }
17
+
18
+ export interface Reservation {
19
+ readonly _id: string;
20
+ readonly storeId: string;
21
+ /** ISO local string "YYYY-MM-DDTHH:mm" — no seconds, no timezone. */
22
+ readonly reservationTime: string;
23
+ readonly headcount: number;
24
+ readonly contactName: string;
25
+ readonly contactPhone?: string;
26
+ readonly contactEmail?: string;
27
+ readonly tableNum?: string;
28
+ readonly reservationNote?: string;
29
+ readonly dishes: ReservationDish[];
30
+ readonly status: ReservationStatusEnum;
31
+ /**
32
+ * `Date` inside the server process (mongoose returns a Date instance);
33
+ * ISO `string` once the document has crossed JSON.stringify (HTTP wire,
34
+ * app side). Same dual-shape convention as `BaseOrder.date`. Normalize
35
+ * with `new Date(addTime)` if you need to do math — that constructor
36
+ * accepts either form.
37
+ */
38
+ readonly addTime: Date | string;
39
+ readonly operatorId?: string;
40
+ /**
41
+ * Set when this reservation has been bound to a real order via
42
+ * POST /orders. Optional: a reservation can also be marked COMPLETED
43
+ * without a backing order (e.g. manual no-show close-out).
44
+ */
45
+ readonly boundOrderId?: string;
46
+ /** Mongoose default version key — present on every document. */
47
+ readonly __v?: number;
48
+ }
@@ -1,316 +1,316 @@
1
- import { Dish } from './dish.interface';
2
- import { Classification } from './classification.interface';
3
- import { Specification } from './specification.interface';
4
- import { Subscription } from './subscription.interface';
5
- import { MemberSavingRule } from './member.interface';
6
- import { TaxTypeEnum } from '../../enum/tax.enum';
7
- import {
8
- PrinterDeviceTypeEnum,
9
- PrinterWidthEnum,
10
- TagPrinterDeviceTypeEnum,
11
- EncodeTypeEnum,
12
- MultiLangDirectionEnum,
13
- } from '../../enum/printer.enum';
14
- import { TimeMenuLoopMode } from '../../enum/time-menu.enum';
15
- import { WeekEnum } from '../../enum/common.enum';
16
- import { AnnouncementTargetEnum, AnnouncementTypeEnum } from '../../index';
17
-
18
- export interface LangList {
19
- [key: string]: string;
20
- }
21
- export interface BuffetDishItem {
22
- readonly dishId: string;
23
- upperLimit: {
24
- enable: boolean;
25
- adult: number;
26
- child: number;
27
- };
28
- }
29
-
30
- export interface BuffetCombosItems {
31
- readonly _id: string;
32
- names: object;
33
- price: {
34
- adult: number;
35
- child: number;
36
- };
37
- dishes: BuffetDishItem[];
38
- orderingByTurns: {
39
- enable: boolean;
40
- interval: number;
41
- maxOrdersPerRoundPerPerson: number;
42
- maxRounds: number;
43
- };
44
- }
45
-
46
- export interface AllergenItem {
47
- readonly _id: string;
48
- names: object;
49
- img: string;
50
- dishIds: string[];
51
- }
52
-
53
- export interface AnnouncementItem {
54
- readonly _id: string;
55
- enable: boolean;
56
- titles: LangList;
57
- type: AnnouncementTypeEnum;
58
- targets: AnnouncementTargetEnum[];
59
- textContents: LangList;
60
- imageContents: LangList;
61
- }
62
-
63
- export interface Store {
64
- readonly _id: string;
65
- name: string;
66
- readonly names?: object;
67
- readonly auditedNames?: Record<string, string>; //审核后的店铺名, 暂时用于发短信
68
- readonly needAuditNames: boolean; //如果店铺的名字有变化, 这里就要设置为需要重新审核
69
- readonly img: string;
70
- readonly phone?: string;
71
- /**
72
- * Geographic location for the store. Optional — old stores may not have it.
73
- * Set via the manager's map-location picker flow on the App; consumed by
74
- * delivery distance / static-map thumbnails / future routing features.
75
- * Mirrors the server-side Mongoose subdoc shape in
76
- * order-multi-server/src/stores/schemas/store.schema.ts.
77
- */
78
- readonly location?: {
79
- lat: number;
80
- lng: number;
81
- formattedAddress?: string;
82
- placeId?: string;
83
- };
84
- description: string;
85
- readonly descriptions?: object;
86
- readonly type: string;
87
- readonly currency: string;
88
- readonly defaultLang: string;
89
- readonly timeZoneNum: number;
90
- readonly autoClean: boolean;
91
- readonly forceClean: boolean;
92
- readonly userId: string;
93
- readonly close: boolean;
94
- readonly multiLanguage: boolean;
95
- readonly dishes: Dish[];
96
- readonly classifications: Classification[];
97
- readonly specifications: Specification[];
98
- readonly subscription: Subscription;
99
- readonly date: string | Date;
100
- readonly setting: {
101
- autoConfirm: boolean;
102
- clientPay: boolean;
103
- waiterCheckout: boolean;
104
- cashBox: boolean;
105
- openCashBoxWhenPay: boolean;
106
- closeTime: number;
107
- enableTaxes: boolean;
108
- enableBuffet: boolean;
109
- enableAllergens: boolean;
110
- checkoutFirst: boolean;
111
- defalutNoTax: boolean;
112
- taxType?: TaxTypeEnum;
113
- orderReminderInterval: number;
114
- disableAppendInterval: number;
115
- canDeleteOrder: boolean;
116
- tableOrderAutoCheckout: boolean;
117
- tableOrderAutoCleanTime: number;
118
- serialOrderAutoCleanTime: number;
119
- disableSerialOrder: boolean;
120
- mustPayVersion: boolean;
121
- freeVersion: boolean;
122
- proclamationPopUp: boolean;
123
- };
124
- readonly takeoutSetting: {
125
- startingPrice: number;
126
- deliveryFee: number;
127
- payType: string[];
128
- startTime: number;
129
- endTime: number;
130
- open: boolean;
131
- autoConfirm: boolean;
132
- selfPickUp: boolean;
133
- selfPickUpUseDeliveryMenu?: boolean; //自取使用外卖价格, false表示使用堂食价格
134
- enableDelivery: boolean;
135
- autoCheckout?: boolean;
136
- autoCleanTime?: number;
137
- reserveSwitch: boolean;
138
- reserveTimeLow: number;
139
- reserveTimeHigh: number;
140
- nonPaymentSmsVerification: boolean;
141
- smsVerificationAreaCode: string[];
142
- };
143
- readonly buffetSetting: {
144
- enable: boolean;
145
- showDishesOutOfBuffetInClient: boolean;
146
- allowDishNumberExceedSetLimitInClient: boolean;
147
- childStandard: string;
148
- buffetCombos: BuffetCombosItems[];
149
- };
150
- readonly allergenSetting: {
151
- enable: boolean;
152
- allergens: AllergenItem[];
153
- };
154
- readonly announcementSetting: {
155
- announcements: AnnouncementItem[];
156
- };
157
- readonly memberSetting: {
158
- savingRules: MemberSavingRule[];
159
- security: {
160
- paymentVerification: boolean;
161
- paymentVerificationLimit: number;
162
- };
163
- };
164
- readonly smsNum: number;
165
- readonly resource: {
166
- aiToken: number;
167
- };
168
- readonly smsNotificationSetting: {
169
- becomeMember: boolean;
170
- memberSave: boolean;
171
- memberPayout: boolean;
172
- takeoutConfirm: boolean;
173
- takeoutCancel: boolean;
174
- takeoutComplete: boolean;
175
- };
176
- readonly taxes: {
177
- name: string;
178
- rate: number;
179
- dishIds: string[];
180
- }[];
181
- readonly priceHaveTaxBindOrderTaxes: {
182
- name: string;
183
- rate: number;
184
- }[];
185
- readonly receptionPrinters: ReceptionPrinter[];
186
- readonly chefPrinters: ChefPrinter[];
187
- readonly labelPrinters: LabelPrinter[];
188
- readonly timeMenu: {
189
- enable: boolean;
190
- hideDisabledProductions: boolean;
191
- loopMode: TimeMenuLoopMode;
192
- dayLoop: DayLoopItem[];
193
- weekLoop: {
194
- Mon: {
195
- sameAs: WeekEnum;
196
- dayLoop: DayLoopItem[];
197
- };
198
- Tue: {
199
- sameAs: WeekEnum;
200
- dayLoop: DayLoopItem[];
201
- };
202
- Wed: {
203
- sameAs: WeekEnum;
204
- dayLoop: DayLoopItem[];
205
- };
206
- Thu: {
207
- sameAs: WeekEnum;
208
- dayLoop: DayLoopItem[];
209
- };
210
- Fri: {
211
- sameAs: WeekEnum;
212
- dayLoop: DayLoopItem[];
213
- };
214
- Sat: {
215
- sameAs: WeekEnum;
216
- dayLoop: DayLoopItem[];
217
- };
218
- Sun: {
219
- sameAs: WeekEnum;
220
- dayLoop: DayLoopItem[];
221
- };
222
- };
223
- };
224
- readonly customPayment: {
225
- name: string;
226
- enabled: boolean;
227
- }[];
228
- readonly areas: Area[];
229
- readonly cashDenominations: number[];
230
- }
231
-
232
- export interface ReceptionPrinter {
233
- _id: string;
234
- name: string;
235
- type: PrinterDeviceTypeEnum;
236
- address: string;
237
- bluetoothName: string;
238
- printerWidth: PrinterWidthEnum;
239
- printerNum: number;
240
- disabled: boolean;
241
- mergeDishes: boolean;
242
- bigFont: boolean;
243
- isPrepayOrderPrinteWithTotalPrice: boolean;
244
- isAutoPrinteAfterConfirm: boolean;
245
- isAutoPrinteAfterCheckout: boolean;
246
- preferLang?: string;
247
- printChineseAndEnglishAsImg?: boolean;
248
- largeLineHeight?: boolean;
249
- lineBetweenDishes?: boolean;
250
- specificationInNewLine?: boolean;
251
- customInformationAtStart?: string;
252
- customInformationAtEnd?: string;
253
- showWaiterName?: boolean;
254
- showSalesmanName?: boolean;
255
- showUnitPrice?: boolean;
256
- encodeType?: EncodeTypeEnum;
257
- extendedPrintingLangs?: string[];
258
- multiLangDirection?: MultiLangDirectionEnum;
259
- }
260
-
261
- export interface ChefPrinter {
262
- name: string;
263
- type: PrinterDeviceTypeEnum;
264
- address: string;
265
- bluetoothName: string;
266
- printerWidth: PrinterWidthEnum;
267
- printerNum: number;
268
- disabled: boolean;
269
- bigFont: boolean;
270
- dishIds: string[];
271
- mergeDishes: boolean;
272
- isSeparateDishes: boolean;
273
- isSeparateDishesWithTotal: boolean;
274
- preferLang?: string;
275
- printChineseAndEnglishAsImg?: boolean;
276
- largeLineHeight?: boolean;
277
- lineBetweenDishes?: boolean;
278
- specificationInNewLine?: boolean;
279
- countFront?: boolean;
280
- showWaiterName?: boolean;
281
- showSalesmanName?: boolean;
282
- addTableNumBeforeDishName?: boolean;
283
- encodeType?: EncodeTypeEnum;
284
- extendedPrintingLangs?: string[];
285
- multiLangDirection?: MultiLangDirectionEnum;
286
- }
287
-
288
- export interface LabelPrinter {
289
- name: string;
290
- type: TagPrinterDeviceTypeEnum;
291
- address: string;
292
- printerNum: number;
293
- disabled: boolean;
294
- dishIds: string[];
295
- preferLang?: string;
296
- rotate?: boolean;
297
- }
298
-
299
- interface DayLoopItem {
300
- startMinute: number;
301
- endMinute: number;
302
- removeMode: boolean;
303
- dishId: string[];
304
- }
305
-
306
- export interface Area {
307
- readonly _id?: string;
308
- readonly name: string;
309
- readonly tables: Table[];
310
- }
311
-
312
- export interface Table {
313
- readonly _id?: string;
314
- readonly name: string;
315
- readonly seatNum: number;
316
- }
1
+ import { Dish } from './dish.interface';
2
+ import { Classification } from './classification.interface';
3
+ import { Specification } from './specification.interface';
4
+ import { Subscription } from './subscription.interface';
5
+ import { MemberSavingRule } from './member.interface';
6
+ import { TaxTypeEnum } from '../../enum/tax.enum';
7
+ import {
8
+ PrinterDeviceTypeEnum,
9
+ PrinterWidthEnum,
10
+ TagPrinterDeviceTypeEnum,
11
+ EncodeTypeEnum,
12
+ MultiLangDirectionEnum,
13
+ } from '../../enum/printer.enum';
14
+ import { TimeMenuLoopMode } from '../../enum/time-menu.enum';
15
+ import { WeekEnum } from '../../enum/common.enum';
16
+ import { AnnouncementTargetEnum, AnnouncementTypeEnum } from '../../index';
17
+
18
+ export interface LangList {
19
+ [key: string]: string;
20
+ }
21
+ export interface BuffetDishItem {
22
+ readonly dishId: string;
23
+ upperLimit: {
24
+ enable: boolean;
25
+ adult: number;
26
+ child: number;
27
+ };
28
+ }
29
+
30
+ export interface BuffetCombosItems {
31
+ readonly _id: string;
32
+ names: object;
33
+ price: {
34
+ adult: number;
35
+ child: number;
36
+ };
37
+ dishes: BuffetDishItem[];
38
+ orderingByTurns: {
39
+ enable: boolean;
40
+ interval: number;
41
+ maxOrdersPerRoundPerPerson: number;
42
+ maxRounds: number;
43
+ };
44
+ }
45
+
46
+ export interface AllergenItem {
47
+ readonly _id: string;
48
+ names: object;
49
+ img: string;
50
+ dishIds: string[];
51
+ }
52
+
53
+ export interface AnnouncementItem {
54
+ readonly _id: string;
55
+ enable: boolean;
56
+ titles: LangList;
57
+ type: AnnouncementTypeEnum;
58
+ targets: AnnouncementTargetEnum[];
59
+ textContents: LangList;
60
+ imageContents: LangList;
61
+ }
62
+
63
+ export interface Store {
64
+ readonly _id: string;
65
+ name: string;
66
+ readonly names?: object;
67
+ readonly auditedNames?: Record<string, string>; //审核后的店铺名, 暂时用于发短信
68
+ readonly needAuditNames: boolean; //如果店铺的名字有变化, 这里就要设置为需要重新审核
69
+ readonly img: string;
70
+ readonly phone?: string;
71
+ /**
72
+ * Geographic location for the store. Optional — old stores may not have it.
73
+ * Set via the manager's map-location picker flow on the App; consumed by
74
+ * delivery distance / static-map thumbnails / future routing features.
75
+ * Mirrors the server-side Mongoose subdoc shape in
76
+ * order-multi-server/src/stores/schemas/store.schema.ts.
77
+ */
78
+ readonly location?: {
79
+ lat: number;
80
+ lng: number;
81
+ formattedAddress?: string;
82
+ placeId?: string;
83
+ };
84
+ description: string;
85
+ readonly descriptions?: object;
86
+ readonly type: string;
87
+ readonly currency: string;
88
+ readonly defaultLang: string;
89
+ readonly timeZoneNum: number;
90
+ readonly autoClean: boolean;
91
+ readonly forceClean: boolean;
92
+ readonly userId: string;
93
+ readonly close: boolean;
94
+ readonly multiLanguage: boolean;
95
+ readonly dishes: Dish[];
96
+ readonly classifications: Classification[];
97
+ readonly specifications: Specification[];
98
+ readonly subscription: Subscription;
99
+ readonly date: string | Date;
100
+ readonly setting: {
101
+ autoConfirm: boolean;
102
+ clientPay: boolean;
103
+ waiterCheckout: boolean;
104
+ cashBox: boolean;
105
+ openCashBoxWhenPay: boolean;
106
+ closeTime: number;
107
+ enableTaxes: boolean;
108
+ enableBuffet: boolean;
109
+ enableAllergens: boolean;
110
+ checkoutFirst: boolean;
111
+ defalutNoTax: boolean;
112
+ taxType?: TaxTypeEnum;
113
+ orderReminderInterval: number;
114
+ disableAppendInterval: number;
115
+ canDeleteOrder: boolean;
116
+ tableOrderAutoCheckout: boolean;
117
+ tableOrderAutoCleanTime: number;
118
+ serialOrderAutoCleanTime: number;
119
+ disableSerialOrder: boolean;
120
+ mustPayVersion: boolean;
121
+ freeVersion: boolean;
122
+ proclamationPopUp: boolean;
123
+ };
124
+ readonly takeoutSetting: {
125
+ startingPrice: number;
126
+ deliveryFee: number;
127
+ payType: string[];
128
+ startTime: number;
129
+ endTime: number;
130
+ open: boolean;
131
+ autoConfirm: boolean;
132
+ selfPickUp: boolean;
133
+ selfPickUpUseDeliveryMenu?: boolean; //自取使用外卖价格, false表示使用堂食价格
134
+ enableDelivery: boolean;
135
+ autoCheckout?: boolean;
136
+ autoCleanTime?: number;
137
+ reserveSwitch: boolean;
138
+ reserveTimeLow: number;
139
+ reserveTimeHigh: number;
140
+ nonPaymentSmsVerification: boolean;
141
+ smsVerificationAreaCode: string[];
142
+ };
143
+ readonly buffetSetting: {
144
+ enable: boolean;
145
+ showDishesOutOfBuffetInClient: boolean;
146
+ allowDishNumberExceedSetLimitInClient: boolean;
147
+ childStandard: string;
148
+ buffetCombos: BuffetCombosItems[];
149
+ };
150
+ readonly allergenSetting: {
151
+ enable: boolean;
152
+ allergens: AllergenItem[];
153
+ };
154
+ readonly announcementSetting: {
155
+ announcements: AnnouncementItem[];
156
+ };
157
+ readonly memberSetting: {
158
+ savingRules: MemberSavingRule[];
159
+ security: {
160
+ paymentVerification: boolean;
161
+ paymentVerificationLimit: number;
162
+ };
163
+ };
164
+ readonly smsNum: number;
165
+ readonly resource: {
166
+ aiToken: number;
167
+ };
168
+ readonly smsNotificationSetting: {
169
+ becomeMember: boolean;
170
+ memberSave: boolean;
171
+ memberPayout: boolean;
172
+ takeoutConfirm: boolean;
173
+ takeoutCancel: boolean;
174
+ takeoutComplete: boolean;
175
+ };
176
+ readonly taxes: {
177
+ name: string;
178
+ rate: number;
179
+ dishIds: string[];
180
+ }[];
181
+ readonly priceHaveTaxBindOrderTaxes: {
182
+ name: string;
183
+ rate: number;
184
+ }[];
185
+ readonly receptionPrinters: ReceptionPrinter[];
186
+ readonly chefPrinters: ChefPrinter[];
187
+ readonly labelPrinters: LabelPrinter[];
188
+ readonly timeMenu: {
189
+ enable: boolean;
190
+ hideDisabledProductions: boolean;
191
+ loopMode: TimeMenuLoopMode;
192
+ dayLoop: DayLoopItem[];
193
+ weekLoop: {
194
+ Mon: {
195
+ sameAs: WeekEnum;
196
+ dayLoop: DayLoopItem[];
197
+ };
198
+ Tue: {
199
+ sameAs: WeekEnum;
200
+ dayLoop: DayLoopItem[];
201
+ };
202
+ Wed: {
203
+ sameAs: WeekEnum;
204
+ dayLoop: DayLoopItem[];
205
+ };
206
+ Thu: {
207
+ sameAs: WeekEnum;
208
+ dayLoop: DayLoopItem[];
209
+ };
210
+ Fri: {
211
+ sameAs: WeekEnum;
212
+ dayLoop: DayLoopItem[];
213
+ };
214
+ Sat: {
215
+ sameAs: WeekEnum;
216
+ dayLoop: DayLoopItem[];
217
+ };
218
+ Sun: {
219
+ sameAs: WeekEnum;
220
+ dayLoop: DayLoopItem[];
221
+ };
222
+ };
223
+ };
224
+ readonly customPayment: {
225
+ name: string;
226
+ enabled: boolean;
227
+ }[];
228
+ readonly areas: Area[];
229
+ readonly cashDenominations: number[];
230
+ }
231
+
232
+ export interface ReceptionPrinter {
233
+ _id: string;
234
+ name: string;
235
+ type: PrinterDeviceTypeEnum;
236
+ address: string;
237
+ bluetoothName: string;
238
+ printerWidth: PrinterWidthEnum;
239
+ printerNum: number;
240
+ disabled: boolean;
241
+ mergeDishes: boolean;
242
+ bigFont: boolean;
243
+ isPrepayOrderPrinteWithTotalPrice: boolean;
244
+ isAutoPrinteAfterConfirm: boolean;
245
+ isAutoPrinteAfterCheckout: boolean;
246
+ preferLang?: string;
247
+ printChineseAndEnglishAsImg?: boolean;
248
+ largeLineHeight?: boolean;
249
+ lineBetweenDishes?: boolean;
250
+ specificationInNewLine?: boolean;
251
+ customInformationAtStart?: string;
252
+ customInformationAtEnd?: string;
253
+ showWaiterName?: boolean;
254
+ showSalesmanName?: boolean;
255
+ showUnitPrice?: boolean;
256
+ encodeType?: EncodeTypeEnum;
257
+ extendedPrintingLangs?: string[];
258
+ multiLangDirection?: MultiLangDirectionEnum;
259
+ }
260
+
261
+ export interface ChefPrinter {
262
+ name: string;
263
+ type: PrinterDeviceTypeEnum;
264
+ address: string;
265
+ bluetoothName: string;
266
+ printerWidth: PrinterWidthEnum;
267
+ printerNum: number;
268
+ disabled: boolean;
269
+ bigFont: boolean;
270
+ dishIds: string[];
271
+ mergeDishes: boolean;
272
+ isSeparateDishes: boolean;
273
+ isSeparateDishesWithTotal: boolean;
274
+ preferLang?: string;
275
+ printChineseAndEnglishAsImg?: boolean;
276
+ largeLineHeight?: boolean;
277
+ lineBetweenDishes?: boolean;
278
+ specificationInNewLine?: boolean;
279
+ countFront?: boolean;
280
+ showWaiterName?: boolean;
281
+ showSalesmanName?: boolean;
282
+ addTableNumBeforeDishName?: boolean;
283
+ encodeType?: EncodeTypeEnum;
284
+ extendedPrintingLangs?: string[];
285
+ multiLangDirection?: MultiLangDirectionEnum;
286
+ }
287
+
288
+ export interface LabelPrinter {
289
+ name: string;
290
+ type: TagPrinterDeviceTypeEnum;
291
+ address: string;
292
+ printerNum: number;
293
+ disabled: boolean;
294
+ dishIds: string[];
295
+ preferLang?: string;
296
+ rotate?: boolean;
297
+ }
298
+
299
+ interface DayLoopItem {
300
+ startMinute: number;
301
+ endMinute: number;
302
+ removeMode: boolean;
303
+ dishId: string[];
304
+ }
305
+
306
+ export interface Area {
307
+ readonly _id?: string;
308
+ readonly name: string;
309
+ readonly tables: Table[];
310
+ }
311
+
312
+ export interface Table {
313
+ readonly _id?: string;
314
+ readonly name: string;
315
+ readonly seatNum: number;
316
+ }