@freedom_sky/feige-lib 5.21.0 → 5.23.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/.eslintignore +2 -2
- package/.eslintrc.js +15 -15
- package/.prettierrc.js +6 -6
- package/AGENTS.md +75 -75
- package/CHANGE.md +38 -32
- package/azure-pipelines-release.yml +56 -0
- package/dist/announcement/enum/announcement.enum.d.ts +11 -11
- package/dist/announcement/enum/announcement.enum.js +15 -15
- package/dist/buffet/index.d.ts +46 -46
- package/dist/buffet/index.js +95 -95
- package/dist/const/const.d.ts +372 -370
- package/dist/const/const.js +2387 -2374
- package/dist/enum/ai-token.enum.d.ts +10 -10
- package/dist/enum/ai-token.enum.js +14 -14
- package/dist/enum/checkout.enum.d.ts +13 -13
- package/dist/enum/checkout.enum.js +17 -17
- package/dist/enum/common.enum.d.ts +18 -14
- package/dist/enum/common.enum.js +23 -18
- package/dist/enum/continent.enum.d.ts +8 -8
- package/dist/enum/continent.enum.js +11 -11
- package/dist/enum/dish.enum.d.ts +4 -4
- package/dist/enum/dish.enum.js +7 -7
- package/dist/enum/from.enum.d.ts +14 -14
- package/dist/enum/from.enum.js +17 -17
- package/dist/enum/member.enum.d.ts +16 -16
- package/dist/enum/member.enum.js +21 -21
- package/dist/enum/menu-io.enum.d.ts +4 -4
- package/dist/enum/menu-io.enum.js +7 -7
- package/dist/enum/order.enum.d.ts +7 -7
- package/dist/enum/order.enum.js +10 -10
- package/dist/enum/pay-company.enum.d.ts +4 -4
- package/dist/enum/pay-company.enum.js +7 -7
- package/dist/enum/printer.enum.d.ts +36 -36
- package/dist/enum/printer.enum.js +45 -45
- package/dist/enum/receptionist.enum.d.ts +8 -8
- package/dist/enum/receptionist.enum.js +11 -11
- package/dist/enum/reservation.enum.d.ts +5 -5
- package/dist/enum/reservation.enum.js +8 -8
- package/dist/enum/role.enum.d.ts +7 -7
- package/dist/enum/role.enum.js +10 -10
- package/dist/enum/sms.enum.d.ts +14 -14
- package/dist/enum/sms.enum.js +18 -18
- package/dist/enum/tax.enum.d.ts +4 -4
- package/dist/enum/tax.enum.js +7 -7
- package/dist/enum/time-menu.enum.d.ts +4 -4
- package/dist/enum/time-menu.enum.js +7 -7
- package/dist/enum/timezone.emum.d.ts +33 -33
- package/dist/enum/timezone.emum.js +36 -36
- package/dist/enum/user-status.enum.d.ts +9 -9
- package/dist/enum/user-status.enum.js +12 -12
- package/dist/enum/visit-task.enum.d.ts +13 -13
- package/dist/enum/visit-task.enum.js +17 -17
- package/dist/enum/yeepay.enum.d.ts +22 -22
- package/dist/enum/yeepay.enum.js +30 -30
- package/dist/index.d.ts +203 -201
- package/dist/index.js +564 -562
- package/dist/interfaces/common/language.interface.d.ts +13 -13
- package/dist/interfaces/common/language.interface.js +2 -2
- package/dist/interfaces/member/member-transaction.interface.d.ts +27 -27
- package/dist/interfaces/member/member-transaction.interface.js +2 -2
- package/dist/interfaces/member/member.interface.d.ts +16 -16
- package/dist/interfaces/member/member.interface.js +2 -2
- package/dist/interfaces/order/baseOrder.interface.d.ts +84 -84
- package/dist/interfaces/order/baseOrder.interface.js +2 -2
- package/dist/interfaces/order/buffetOrder.interface.d.ts +13 -13
- package/dist/interfaces/order/buffetOrder.interface.js +2 -2
- package/dist/interfaces/order/deliveryOrder.interface.d.ts +9 -9
- package/dist/interfaces/order/deliveryOrder.interface.js +2 -2
- package/dist/interfaces/order/index.d.ts +7 -7
- package/dist/interfaces/order/index.js +6 -6
- package/dist/interfaces/order/order.interface.d.ts +75 -75
- package/dist/interfaces/order/order.interface.js +17 -17
- package/dist/interfaces/order/pickupOrder.interface.d.ts +8 -8
- package/dist/interfaces/order/pickupOrder.interface.js +2 -2
- package/dist/interfaces/order/serialOrder.interface.d.ts +4 -4
- package/dist/interfaces/order/serialOrder.interface.js +2 -2
- package/dist/interfaces/order/tableOrder.interface.d.ts +7 -7
- package/dist/interfaces/order/tableOrder.interface.js +2 -2
- package/dist/interfaces/reservation/reservation.interface.d.ts +46 -0
- package/dist/interfaces/reservation/reservation.interface.js +2 -0
- package/dist/interfaces/store/classification.interface.d.ts +7 -7
- package/dist/interfaces/store/classification.interface.js +2 -2
- package/dist/interfaces/store/dish.interface.d.ts +18 -18
- package/dist/interfaces/store/dish.interface.js +2 -2
- package/dist/interfaces/store/dishSnapshot.interface.d.ts +11 -11
- package/dist/interfaces/store/dishSnapshot.interface.js +2 -2
- package/dist/interfaces/store/member.interface.d.ts +8 -8
- package/dist/interfaces/store/member.interface.js +2 -2
- package/dist/interfaces/store/menu-export.interface.d.ts +12 -12
- package/dist/interfaces/store/menu-export.interface.js +2 -2
- package/dist/interfaces/store/specification.interface.d.ts +17 -17
- package/dist/interfaces/store/specification.interface.js +2 -2
- package/dist/interfaces/store/store.interface.d.ts +300 -300
- package/dist/interfaces/store/store.interface.js +2 -2
- package/dist/interfaces/store/subscription.interface.d.ts +43 -43
- package/dist/interfaces/store/subscription.interface.js +2 -2
- package/dist/interfaces/user/user.interface.d.ts +139 -139
- package/dist/interfaces/user/user.interface.js +2 -2
- package/dist/interfaces/visit-task/visit-task.interface.d.ts +17 -17
- package/dist/interfaces/visit-task/visit-task.interface.js +2 -2
- package/dist/order/index.d.ts +22 -22
- package/dist/order/index.js +58 -58
- package/jest.config.js +189 -189
- package/josn-hub/orders/tax-have-price-bind-order.ts +381 -381
- package/josn-hub/orders/tax-order.ts +371 -371
- package/josn-hub/orders//346/225/264/345/215/225/344/273/267/346/240/274/351/203/275/346/230/257/350/264/237/346/225/260/347/232/204/346/203/205/345/206/265.ts +321 -321
- package/josn-hub/orders//346/234/211/344/270/200/344/270/252/350/217/234/347/232/204/344/273/267/346/240/274/346/230/257/350/264/237/346/225/260/347/232/204/346/203/205/345/206/265.ts +348 -348
- package/josn-hub/orders//347/202/271/344/272/206/344/270/215/345/212/240/344/273/267/345/222/214/345/233/272/345/256/232/345/212/240/345/207/217/344/273/267/350/247/204/346/240/274/347/232/204/350/256/242/345/215/225.ts +350 -350
- package/josn-hub/orders//347/202/271/344/272/206/345/233/272/345/256/232/345/212/240/344/273/267-/347/231/276/345/210/206/346/257/224/345/212/240/344/273/267/350/247/204/346/240/274/347/232/204/350/256/242/345/215/225.ts +301 -301
- package/josn-hub/orders//347/202/271/344/272/206/346/234/252/345/212/240/344/273/267/350/247/204/346/240/274/347/232/204/350/256/242/345/215/225.ts +321 -321
- package/josn-hub/orders//347/202/271/344/272/206/346/234/252/345/212/240/344/273/267/350/247/204/346/240/274/347/232/204/350/256/242/345/215/225/345/271/266/346/234/211/351/205/215/351/200/201/350/264/271.ts +159 -159
- package/josn-hub/orders//350/207/252/345/212/251/351/244/220/347/232/204/346/203/205/345/206/265.ts +665 -665
- package/josn-hub/orders//351/203/250/345/210/206/351/200/200/350/217/234/347/232/204/346/203/205/345/206/265.ts +73 -73
- package/package.json +59 -59
- package/src/announcement/enum/announcement.enum.ts +12 -12
- package/src/buffet/index.ts +123 -123
- package/src/const/const.ts +2407 -2394
- package/src/enum/ai-token.enum.ts +10 -10
- package/src/enum/checkout.enum.ts +14 -14
- package/src/enum/common.enum.ts +20 -15
- package/src/enum/continent.enum.ts +8 -8
- package/src/enum/dish.enum.ts +4 -4
- package/src/enum/from.enum.ts +14 -14
- package/src/enum/member.enum.ts +16 -16
- package/src/enum/menu-io.enum.ts +4 -4
- package/src/enum/order.enum.ts +7 -7
- package/src/enum/pay-company.enum.ts +4 -4
- package/src/enum/printer.enum.ts +40 -40
- package/src/enum/receptionist.enum.ts +8 -8
- package/src/enum/reservation.enum.ts +5 -5
- package/src/enum/role.enum.ts +7 -7
- package/src/enum/sms.enum.ts +14 -14
- package/src/enum/tax.enum.ts +4 -4
- package/src/enum/time-menu.enum.ts +4 -4
- package/src/enum/timezone.emum.ts +33 -33
- package/src/enum/user-status.enum.ts +9 -9
- package/src/enum/visit-task.enum.ts +14 -14
- package/src/enum/yeepay.enum.ts +27 -27
- package/src/index.spec.ts +1082 -1082
- package/src/index.ts +616 -613
- package/src/interfaces/common/language.interface.ts +13 -13
- package/src/interfaces/member/member-transaction.interface.ts +32 -32
- package/src/interfaces/member/member.interface.ts +16 -16
- package/src/interfaces/order/baseOrder.interface.ts +89 -89
- package/src/interfaces/order/buffetOrder.interface.ts +14 -14
- package/src/interfaces/order/deliveryOrder.interface.ts +10 -10
- package/src/interfaces/order/index.ts +7 -7
- package/src/interfaces/order/order.interface.ts +84 -84
- package/src/interfaces/order/pickupOrder.interface.ts +9 -9
- package/src/interfaces/order/serialOrder.interface.ts +5 -5
- package/src/interfaces/order/tableOrder.interface.ts +8 -8
- package/src/interfaces/reservation/reservation.interface.ts +48 -0
- package/src/interfaces/store/classification.interface.ts +7 -7
- package/src/interfaces/store/dish.interface.ts +18 -18
- package/src/interfaces/store/dishSnapshot.interface.ts +12 -12
- package/src/interfaces/store/member.interface.ts +9 -9
- package/src/interfaces/store/menu-export.interface.ts +13 -13
- package/src/interfaces/store/specification.interface.ts +17 -17
- package/src/interfaces/store/store.interface.ts +316 -316
- package/src/interfaces/store/subscription.interface.ts +43 -43
- package/src/interfaces/user/user.interface.ts +139 -139
- package/src/interfaces/visit-task/visit-task.interface.ts +17 -17
- package/src/order/currency-settlement.spec.ts +72 -0
- package/src/order/index.ts +91 -91
- package/tsconfig.json +12 -12
package/.eslintignore
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
dist
|
|
2
|
-
node_modules
|
|
1
|
+
dist
|
|
2
|
+
node_modules
|
|
3
3
|
jest.config.js
|
package/.eslintrc.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
parser: "@typescript-eslint/parser", // Specifies the ESLint parser
|
|
3
|
-
extends: [
|
|
4
|
-
"plugin:@typescript-eslint/recommended", // Uses the recommended rules from the @typescript-eslint/eslint-plugin
|
|
5
|
-
"prettier/@typescript-eslint", // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
|
|
6
|
-
"plugin:jsdoc/recommended",
|
|
7
|
-
"plugin:prettier/recommended" // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
|
|
8
|
-
],
|
|
9
|
-
parserOptions: {
|
|
10
|
-
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
|
|
11
|
-
sourceType: "module" // Allows for the use of imports
|
|
12
|
-
},
|
|
13
|
-
rules: {
|
|
14
|
-
'@typescript-eslint/no-use-before-define': 'off',
|
|
15
|
-
},
|
|
1
|
+
module.exports = {
|
|
2
|
+
parser: "@typescript-eslint/parser", // Specifies the ESLint parser
|
|
3
|
+
extends: [
|
|
4
|
+
"plugin:@typescript-eslint/recommended", // Uses the recommended rules from the @typescript-eslint/eslint-plugin
|
|
5
|
+
"prettier/@typescript-eslint", // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
|
|
6
|
+
"plugin:jsdoc/recommended",
|
|
7
|
+
"plugin:prettier/recommended" // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
|
|
8
|
+
],
|
|
9
|
+
parserOptions: {
|
|
10
|
+
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
|
|
11
|
+
sourceType: "module" // Allows for the use of imports
|
|
12
|
+
},
|
|
13
|
+
rules: {
|
|
14
|
+
'@typescript-eslint/no-use-before-define': 'off',
|
|
15
|
+
},
|
|
16
16
|
};
|
package/.prettierrc.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
semi: true,
|
|
3
|
-
trailingComma: "all",
|
|
4
|
-
singleQuote: true,
|
|
5
|
-
printWidth: 120,
|
|
6
|
-
tabWidth: 4
|
|
1
|
+
module.exports = {
|
|
2
|
+
semi: true,
|
|
3
|
+
trailingComma: "all",
|
|
4
|
+
singleQuote: true,
|
|
5
|
+
printWidth: 120,
|
|
6
|
+
tabWidth: 4
|
|
7
7
|
};
|
package/AGENTS.md
CHANGED
|
@@ -1,75 +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`).
|
|
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,32 +1,38 @@
|
|
|
1
|
-
# 5.
|
|
2
|
-
- add
|
|
3
|
-
- add
|
|
4
|
-
-
|
|
5
|
-
# 5.
|
|
6
|
-
- add
|
|
7
|
-
# 5.
|
|
8
|
-
- add
|
|
9
|
-
|
|
10
|
-
- add
|
|
11
|
-
#
|
|
12
|
-
- add
|
|
13
|
-
#
|
|
14
|
-
- add
|
|
15
|
-
# 4.
|
|
16
|
-
- add
|
|
17
|
-
# 4.
|
|
18
|
-
- add
|
|
19
|
-
# 4.
|
|
20
|
-
- add
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
# 4.
|
|
26
|
-
-
|
|
27
|
-
|
|
28
|
-
# 4.
|
|
29
|
-
- add
|
|
30
|
-
|
|
31
|
-
# 4.
|
|
32
|
-
-
|
|
1
|
+
# 5.23.0
|
|
2
|
+
- add shared ascending and descending sort direction enum
|
|
3
|
+
- add MAD and AOA currency formatting and Angola regional defaults
|
|
4
|
+
- make balance settlement currency-aware for large currencies
|
|
5
|
+
# 5.22.0
|
|
6
|
+
- 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)
|
|
7
|
+
# 5.21.0
|
|
8
|
+
- add ReservationStatusEnum (WAITING / CANCELLED / COMPLETED) for cross-repo reservation feature
|
|
9
|
+
- 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
|
|
10
|
+
- add AGENTS.md documenting UPPER_LIMIT naming rules (COMMON_ vs domain prefix)
|
|
11
|
+
# 5.20.0
|
|
12
|
+
- add ADDRESS_DETAIL_MAX_LENGTH constant
|
|
13
|
+
# 5.19.0
|
|
14
|
+
- add Store.location field for map-location feature
|
|
15
|
+
# 4.45.0
|
|
16
|
+
- add store auditedNames
|
|
17
|
+
# 4.44.0
|
|
18
|
+
- add half hour timezone
|
|
19
|
+
# 4.43.0
|
|
20
|
+
- add Czech language
|
|
21
|
+
# 4.42.0
|
|
22
|
+
- add STORE_DESCRIPTION_MAX_LENGTH
|
|
23
|
+
# 4.41.0
|
|
24
|
+
- add currency CZK
|
|
25
|
+
# 4.40.0
|
|
26
|
+
- add proclamationPopUp
|
|
27
|
+
|
|
28
|
+
# 4.39.0
|
|
29
|
+
- add China Kazakh language kk-Arab-CN
|
|
30
|
+
|
|
31
|
+
# 4.38.1
|
|
32
|
+
- change ug dateFormat to DateFormat.YEAR_MONTH_DAY,
|
|
33
|
+
|
|
34
|
+
# 4.38.0
|
|
35
|
+
- add extendedPrintingLangs and multiLangDirection to store printer interface
|
|
36
|
+
|
|
37
|
+
# 4.37.0
|
|
38
|
+
- add MultiLangDirectionEnum
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
trigger:
|
|
2
|
+
branches:
|
|
3
|
+
exclude:
|
|
4
|
+
- '*'
|
|
5
|
+
tags:
|
|
6
|
+
include:
|
|
7
|
+
- 'release/v*'
|
|
8
|
+
|
|
9
|
+
pr: none
|
|
10
|
+
|
|
11
|
+
pool:
|
|
12
|
+
vmImage: ubuntu-latest
|
|
13
|
+
|
|
14
|
+
steps:
|
|
15
|
+
- task: NodeTool@0
|
|
16
|
+
displayName: Use Node.js 18
|
|
17
|
+
inputs:
|
|
18
|
+
versionSpec: 18.x
|
|
19
|
+
|
|
20
|
+
- script: npm ci
|
|
21
|
+
displayName: Install dependencies
|
|
22
|
+
|
|
23
|
+
- script: npm run build
|
|
24
|
+
displayName: Test and build
|
|
25
|
+
|
|
26
|
+
- bash: |
|
|
27
|
+
set -euo pipefail
|
|
28
|
+
|
|
29
|
+
PACKAGE_NAME="$(node -p "require('./package.json').name")"
|
|
30
|
+
PACKAGE_VERSION="$(node -p "require('./package.json').version")"
|
|
31
|
+
EXPECTED_TAG="refs/tags/release/v$PACKAGE_VERSION"
|
|
32
|
+
|
|
33
|
+
if [ "$BUILD_SOURCEBRANCH" != "$EXPECTED_TAG" ]; then
|
|
34
|
+
echo "Expected tag $EXPECTED_TAG, got $BUILD_SOURCEBRANCH."
|
|
35
|
+
exit 1
|
|
36
|
+
fi
|
|
37
|
+
|
|
38
|
+
if [ -z "${NPM_TOKEN:-}" ] || [ "$NPM_TOKEN" = "SET_AT_RUN_TIME" ]; then
|
|
39
|
+
echo "NPM_TOKEN must be configured as a secret pipeline variable."
|
|
40
|
+
exit 1
|
|
41
|
+
fi
|
|
42
|
+
|
|
43
|
+
if npm view "$PACKAGE_NAME@$PACKAGE_VERSION" version --registry=https://registry.npmjs.org/ >/dev/null 2>&1; then
|
|
44
|
+
echo "$PACKAGE_NAME@$PACKAGE_VERSION is already published."
|
|
45
|
+
exit 1
|
|
46
|
+
fi
|
|
47
|
+
|
|
48
|
+
NPMRC="$AGENT_TEMPDIRECTORY/feige-lib.npmrc"
|
|
49
|
+
trap 'rm -f "$NPMRC"' EXIT
|
|
50
|
+
printf '//registry.npmjs.org/:_authToken=%s\n' "$NPM_TOKEN" > "$NPMRC"
|
|
51
|
+
|
|
52
|
+
npm whoami --userconfig "$NPMRC" --registry=https://registry.npmjs.org/
|
|
53
|
+
npm publish --ignore-scripts --userconfig "$NPMRC" --registry=https://registry.npmjs.org/ --access public
|
|
54
|
+
displayName: Publish npm package
|
|
55
|
+
env:
|
|
56
|
+
NPM_TOKEN: $(NPM_TOKEN)
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export declare enum AnnouncementTypeEnum {
|
|
2
|
-
Text = "text",
|
|
3
|
-
Image = "image"
|
|
4
|
-
}
|
|
5
|
-
export declare enum AnnouncementTargetEnum {
|
|
6
|
-
Table = "table",
|
|
7
|
-
Buffet = "buffet",
|
|
8
|
-
Serial = "serial",
|
|
9
|
-
PickUp = "pickup",
|
|
10
|
-
Delivery = "delivery"
|
|
11
|
-
}
|
|
1
|
+
export declare enum AnnouncementTypeEnum {
|
|
2
|
+
Text = "text",
|
|
3
|
+
Image = "image"
|
|
4
|
+
}
|
|
5
|
+
export declare enum AnnouncementTargetEnum {
|
|
6
|
+
Table = "table",
|
|
7
|
+
Buffet = "buffet",
|
|
8
|
+
Serial = "serial",
|
|
9
|
+
PickUp = "pickup",
|
|
10
|
+
Delivery = "delivery"
|
|
11
|
+
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var AnnouncementTypeEnum;
|
|
4
|
-
(function (AnnouncementTypeEnum) {
|
|
5
|
-
AnnouncementTypeEnum["Text"] = "text";
|
|
6
|
-
AnnouncementTypeEnum["Image"] = "image";
|
|
7
|
-
})(AnnouncementTypeEnum = exports.AnnouncementTypeEnum || (exports.AnnouncementTypeEnum = {}));
|
|
8
|
-
var AnnouncementTargetEnum;
|
|
9
|
-
(function (AnnouncementTargetEnum) {
|
|
10
|
-
AnnouncementTargetEnum["Table"] = "table";
|
|
11
|
-
AnnouncementTargetEnum["Buffet"] = "buffet";
|
|
12
|
-
AnnouncementTargetEnum["Serial"] = "serial";
|
|
13
|
-
AnnouncementTargetEnum["PickUp"] = "pickup";
|
|
14
|
-
AnnouncementTargetEnum["Delivery"] = "delivery";
|
|
15
|
-
})(AnnouncementTargetEnum = exports.AnnouncementTargetEnum || (exports.AnnouncementTargetEnum = {}));
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var AnnouncementTypeEnum;
|
|
4
|
+
(function (AnnouncementTypeEnum) {
|
|
5
|
+
AnnouncementTypeEnum["Text"] = "text";
|
|
6
|
+
AnnouncementTypeEnum["Image"] = "image";
|
|
7
|
+
})(AnnouncementTypeEnum = exports.AnnouncementTypeEnum || (exports.AnnouncementTypeEnum = {}));
|
|
8
|
+
var AnnouncementTargetEnum;
|
|
9
|
+
(function (AnnouncementTargetEnum) {
|
|
10
|
+
AnnouncementTargetEnum["Table"] = "table";
|
|
11
|
+
AnnouncementTargetEnum["Buffet"] = "buffet";
|
|
12
|
+
AnnouncementTargetEnum["Serial"] = "serial";
|
|
13
|
+
AnnouncementTargetEnum["PickUp"] = "pickup";
|
|
14
|
+
AnnouncementTargetEnum["Delivery"] = "delivery";
|
|
15
|
+
})(AnnouncementTargetEnum = exports.AnnouncementTargetEnum || (exports.AnnouncementTargetEnum = {}));
|
package/dist/buffet/index.d.ts
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
import { BuffetCombosItems, BuffetDishItem, Order } from '../index';
|
|
2
|
-
/**
|
|
3
|
-
* 计算自助餐总价
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
export declare function getDishItemInBuffet({ dishId, buffet, }: {
|
|
9
|
-
dishId: string;
|
|
10
|
-
buffet?: BuffetCombosItems;
|
|
11
|
-
}): BuffetDishItem | undefined;
|
|
12
|
-
/**
|
|
13
|
-
*
|
|
14
|
-
*/
|
|
15
|
-
export declare function getMaxBuffetDishUpperLimit({ buffetDishItem, adultNum, childNum, }: {
|
|
16
|
-
buffetDishItem: BuffetDishItem;
|
|
17
|
-
adultNum: number;
|
|
18
|
-
childNum: number;
|
|
19
|
-
}): number;
|
|
20
|
-
/**
|
|
21
|
-
* @param buffetCombosItem
|
|
22
|
-
* @param adultNum
|
|
23
|
-
* @param childNum
|
|
24
|
-
*/
|
|
25
|
-
export declare function calcBuffetTotalPrice(buffetCombosItem: BuffetCombosItems, adultNum: number, childNum: number): number;
|
|
26
|
-
/**
|
|
27
|
-
*
|
|
28
|
-
*/
|
|
29
|
-
export declare function dishShowPriceWithBuffet({ dishPrice, dishId, buffet, orderedCound, adultNum, childNum, }: {
|
|
30
|
-
dishPrice: number;
|
|
31
|
-
dishId: string;
|
|
32
|
-
buffet?: BuffetCombosItems;
|
|
33
|
-
orderedCound: number;
|
|
34
|
-
adultNum: number;
|
|
35
|
-
childNum: number;
|
|
36
|
-
}): number;
|
|
37
|
-
/**
|
|
38
|
-
*
|
|
39
|
-
*/
|
|
40
|
-
export declare function getRoundCoundAndSecondsToNextTurn({ order, }: {
|
|
41
|
-
order: Order;
|
|
42
|
-
}): {
|
|
43
|
-
roundCount?: number;
|
|
44
|
-
maxRounds?: number;
|
|
45
|
-
secondsToNextTurn: number;
|
|
46
|
-
};
|
|
1
|
+
import { BuffetCombosItems, BuffetDishItem, Order } from '../index';
|
|
2
|
+
/**
|
|
3
|
+
* 计算自助餐总价
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
export declare function getDishItemInBuffet({ dishId, buffet, }: {
|
|
9
|
+
dishId: string;
|
|
10
|
+
buffet?: BuffetCombosItems;
|
|
11
|
+
}): BuffetDishItem | undefined;
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
*/
|
|
15
|
+
export declare function getMaxBuffetDishUpperLimit({ buffetDishItem, adultNum, childNum, }: {
|
|
16
|
+
buffetDishItem: BuffetDishItem;
|
|
17
|
+
adultNum: number;
|
|
18
|
+
childNum: number;
|
|
19
|
+
}): number;
|
|
20
|
+
/**
|
|
21
|
+
* @param buffetCombosItem
|
|
22
|
+
* @param adultNum
|
|
23
|
+
* @param childNum
|
|
24
|
+
*/
|
|
25
|
+
export declare function calcBuffetTotalPrice(buffetCombosItem: BuffetCombosItems, adultNum: number, childNum: number): number;
|
|
26
|
+
/**
|
|
27
|
+
*
|
|
28
|
+
*/
|
|
29
|
+
export declare function dishShowPriceWithBuffet({ dishPrice, dishId, buffet, orderedCound, adultNum, childNum, }: {
|
|
30
|
+
dishPrice: number;
|
|
31
|
+
dishId: string;
|
|
32
|
+
buffet?: BuffetCombosItems;
|
|
33
|
+
orderedCound: number;
|
|
34
|
+
adultNum: number;
|
|
35
|
+
childNum: number;
|
|
36
|
+
}): number;
|
|
37
|
+
/**
|
|
38
|
+
*
|
|
39
|
+
*/
|
|
40
|
+
export declare function getRoundCoundAndSecondsToNextTurn({ order, }: {
|
|
41
|
+
order: Order;
|
|
42
|
+
}): {
|
|
43
|
+
roundCount?: number;
|
|
44
|
+
maxRounds?: number;
|
|
45
|
+
secondsToNextTurn: number;
|
|
46
|
+
};
|