@freedom_sky/feige-lib 5.21.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/CHANGE.md CHANGED
@@ -1,3 +1,5 @@
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)
1
3
  # 5.21.0
2
4
  - add ReservationStatusEnum (WAITING / CANCELLED / COMPLETED) for cross-repo reservation feature
3
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
package/dist/index.d.ts CHANGED
@@ -37,6 +37,7 @@ export * from './interfaces/store/specification.interface';
37
37
  export * from './interfaces/store/menu-export.interface';
38
38
  export { MenuImportModeEnum } from './enum/menu-io.enum';
39
39
  export * from './interfaces/order';
40
+ export * from './interfaces/reservation/reservation.interface';
40
41
  export { PayCompanyEnum } from './enum/pay-company.enum';
41
42
  import * as moment from 'moment';
42
43
  import Big from 'big.js';
@@ -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.21.0",
3
+ "version": "5.22.0",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
package/src/index.ts CHANGED
@@ -38,6 +38,7 @@ export * from './interfaces/store/specification.interface';
38
38
  export * from './interfaces/store/menu-export.interface';
39
39
  export { MenuImportModeEnum } from './enum/menu-io.enum';
40
40
  export * from './interfaces/order';
41
+ export * from './interfaces/reservation/reservation.interface';
41
42
  export { PayCompanyEnum } from './enum/pay-company.enum';
42
43
  import * as moment from 'moment';
43
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
+ }