@rytass/wms-module-core 0.9.1 → 0.10.1
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/README.md +15 -2
- package/docs/README.md +2 -2
- package/docs/api-reference.md +129 -10
- package/docs/host-integration.md +172 -0
- package/docs/integration-guide.md +84 -43
- package/index.cjs.js +2462 -1658
- package/index.d.ts +2 -0
- package/lib/events/inventory-count-lock.subscriber.d.ts +17 -5
- package/lib/models/metadata/index.d.ts +1 -0
- package/lib/models/metadata/sequence.entity.d.ts +9 -0
- package/lib/models/models.module.d.ts +7 -0
- package/lib/services/allocate-inventory-order.service.d.ts +3 -3
- package/lib/services/batch.service.d.ts +13 -1
- package/lib/services/consumption-order.service.d.ts +6 -6
- package/lib/services/helper.service.d.ts +10 -4
- package/lib/services/hold-inventory-order.service.d.ts +3 -3
- package/lib/services/index.d.ts +1 -0
- package/lib/services/inventory-count-order.service.d.ts +28 -9
- package/lib/services/loader.service.d.ts +11 -3
- package/lib/services/material.service.d.ts +1 -1
- package/lib/services/merge-batch-order.service.d.ts +2 -2
- package/lib/services/quality-inspection-order.service.d.ts +1 -1
- package/lib/services/receive-inventory-order.service.d.ts +4 -4
- package/lib/services/reclassify-inventory-order.service.d.ts +2 -2
- package/lib/services/scrape.service.d.ts +1 -1
- package/lib/services/sequence.service.d.ts +58 -0
- package/lib/services/ship-inventory-order.service.d.ts +6 -6
- package/lib/services/split-batch-order.service.d.ts +2 -2
- package/lib/services/stock.service.d.ts +48 -2
- package/lib/services/transfer-customer-order.service.d.ts +3 -3
- package/lib/services/transfer-order.service.d.ts +7 -5
- package/lib/services/transfer-vendor-order.service.d.ts +3 -3
- package/lib/table-prefix/logical-table-name.d.ts +21 -0
- package/lib/table-prefix/table-prefix.d.ts +30 -0
- package/lib/typings/core-module-options.d.ts +31 -0
- package/lib/typings/create-transfer-order.input.d.ts +2 -0
- package/lib/typings/index.d.ts +20 -0
- package/lib/utils/run-in-transaction.d.ts +23 -0
- package/lib/utils/table-path.d.ts +13 -0
- package/package.json +3 -12
- package/index.d.mts +0 -6
- package/index.mjs +0 -98
- package/lib/constants/consumption-change-kind.mjs +0 -20
- package/lib/constants/inventory-count-status.mjs +0 -22
- package/lib/constants/operations.mjs +0 -76
- package/lib/constants/order-type.mjs +0 -33
- package/lib/constants/stock-status.mjs +0 -61
- package/lib/core.module.mjs +0 -287
- package/lib/events/dispatch-scope.mjs +0 -29
- package/lib/events/inventory-count-lock.subscriber.mjs +0 -98
- package/lib/events/stock-change.subscriber.mjs +0 -252
- package/lib/events/wms-event.collector.mjs +0 -22
- package/lib/events/wms-event.dispatcher.mjs +0 -63
- package/lib/events/wms-event.tokens.mjs +0 -12
- package/lib/events/wms-operation-runner.mjs +0 -101
- package/lib/models/extensions/allocate-inventory-order/allocate-inventory-order-change.entity.mjs +0 -40
- package/lib/models/extensions/allocate-inventory-order/allocate-inventory-order-item.entity.mjs +0 -104
- package/lib/models/extensions/allocate-inventory-order/allocate-inventory-order.entity.mjs +0 -33
- package/lib/models/extensions/consumption-order/consumption-order-change.entity.mjs +0 -59
- package/lib/models/extensions/consumption-order/consumption-order-item.entity.mjs +0 -114
- package/lib/models/extensions/consumption-order/consumption-order.entity.mjs +0 -69
- package/lib/models/extensions/hold-inventory-order/hold-inventory-order-change.entity.mjs +0 -40
- package/lib/models/extensions/hold-inventory-order/hold-inventory-order-item.entity.mjs +0 -98
- package/lib/models/extensions/hold-inventory-order/hold-inventory-order.entity.mjs +0 -43
- package/lib/models/extensions/inventory-count-order/inventory-count-order-change.entity.mjs +0 -50
- package/lib/models/extensions/inventory-count-order/inventory-count-order-item.entity.mjs +0 -191
- package/lib/models/extensions/inventory-count-order/inventory-count-order.entity.mjs +0 -155
- package/lib/models/extensions/merge-batch-order/merge-batch-order-change.entity.mjs +0 -40
- package/lib/models/extensions/merge-batch-order/merge-batch-order-item.entity.mjs +0 -75
- package/lib/models/extensions/merge-batch-order/merge-batch-order.entity.mjs +0 -33
- package/lib/models/extensions/order-reference/order-reference.entity.mjs +0 -95
- package/lib/models/extensions/quality-inspection-order/quality-inspection-order-change.entity.mjs +0 -45
- package/lib/models/extensions/quality-inspection-order/quality-inspection-order-item.entity.mjs +0 -94
- package/lib/models/extensions/quality-inspection-order/quality-inspection-order.entity.mjs +0 -38
- package/lib/models/extensions/receive-inventory-order/receive-inventory-order-change.entity.mjs +0 -46
- package/lib/models/extensions/receive-inventory-order/receive-inventory-order-item.entity.mjs +0 -89
- package/lib/models/extensions/receive-inventory-order/receive-inventory-order.entity.mjs +0 -57
- package/lib/models/extensions/reclassify-inventory-order/reclassify-inventory-order-change.entity.mjs +0 -40
- package/lib/models/extensions/reclassify-inventory-order/reclassify-inventory-order-item.entity.mjs +0 -75
- package/lib/models/extensions/reclassify-inventory-order/reclassify-inventory-order.entity.mjs +0 -33
- package/lib/models/extensions/scrape-order/scrape-order-change.entity.mjs +0 -40
- package/lib/models/extensions/scrape-order/scrape-order-item.entity.mjs +0 -94
- package/lib/models/extensions/scrape-order/scrape-order.entity.mjs +0 -33
- package/lib/models/extensions/ship-inventory-order/ship-inventory-order-change.entity.mjs +0 -46
- package/lib/models/extensions/ship-inventory-order/ship-inventory-order-item.entity.mjs +0 -90
- package/lib/models/extensions/ship-inventory-order/ship-inventory-order-reference.entity.mjs +0 -65
- package/lib/models/extensions/ship-inventory-order/ship-inventory-order.entity.mjs +0 -56
- package/lib/models/extensions/split-batch-order/split-batch-order-change.entity.mjs +0 -40
- package/lib/models/extensions/split-batch-order/split-batch-order-item.entity.mjs +0 -75
- package/lib/models/extensions/split-batch-order/split-batch-order.entity.mjs +0 -33
- package/lib/models/extensions/transfer-customer-order/transfer-customer-order-change.entity.mjs +0 -40
- package/lib/models/extensions/transfer-customer-order/transfer-customer-order-item.entity.mjs +0 -99
- package/lib/models/extensions/transfer-customer-order/transfer-customer-order.entity.mjs +0 -33
- package/lib/models/extensions/transfer-order/transfer-order-change.entity.mjs +0 -40
- package/lib/models/extensions/transfer-order/transfer-order-item.entity.mjs +0 -109
- package/lib/models/extensions/transfer-order/transfer-order.entity.mjs +0 -53
- package/lib/models/extensions/transfer-vendor-order/transfer-vendor-order-change.entity.mjs +0 -40
- package/lib/models/extensions/transfer-vendor-order/transfer-vendor-order-item.entity.mjs +0 -99
- package/lib/models/extensions/transfer-vendor-order/transfer-vendor-order.entity.mjs +0 -33
- package/lib/models/metadata/batch-group.entity.mjs +0 -31
- package/lib/models/metadata/batch.entity.mjs +0 -131
- package/lib/models/metadata/loader-type.entity.mjs +0 -43
- package/lib/models/metadata/loader-unit.entity.mjs +0 -21
- package/lib/models/metadata/loader.entity.mjs +0 -98
- package/lib/models/metadata/location.entity.mjs +0 -28
- package/lib/models/metadata/material-unit.entity.mjs +0 -51
- package/lib/models/metadata/material.entity.mjs +0 -28
- package/lib/models/metadata/order.entity.mjs +0 -5
- package/lib/models/metadata/sale-order.entity.mjs +0 -21
- package/lib/models/metadata/stock.entity.mjs +0 -29
- package/lib/models/metadata/unit.entity.mjs +0 -21
- package/lib/models/models.module.mjs +0 -158
- package/lib/models/wms-entities.mjs +0 -82
- package/lib/services/allocate-inventory-order.service.mjs +0 -310
- package/lib/services/base-order.service.mjs +0 -76
- package/lib/services/batch.service.mjs +0 -272
- package/lib/services/consumption-order.service.mjs +0 -504
- package/lib/services/helper.service.mjs +0 -28
- package/lib/services/hold-inventory-order.service.mjs +0 -296
- package/lib/services/inventory-count-order.service.mjs +0 -648
- package/lib/services/loader.service.mjs +0 -291
- package/lib/services/location.service.mjs +0 -139
- package/lib/services/material.service.mjs +0 -181
- package/lib/services/merge-batch-order.service.mjs +0 -206
- package/lib/services/order-reference.service.mjs +0 -136
- package/lib/services/quality-inspection-order.service.mjs +0 -146
- package/lib/services/receive-inventory-order.service.mjs +0 -468
- package/lib/services/reclassify-inventory-order.service.mjs +0 -192
- package/lib/services/sale-order.service.mjs +0 -20
- package/lib/services/scrape.service.mjs +0 -150
- package/lib/services/ship-inventory-order.service.mjs +0 -610
- package/lib/services/split-batch-order.service.mjs +0 -191
- package/lib/services/stock.service.mjs +0 -559
- package/lib/services/transfer-customer-order.service.mjs +0 -290
- package/lib/services/transfer-order.service.mjs +0 -641
- package/lib/services/transfer-vendor-order.service.mjs +0 -290
- package/lib/services/unit.service.mjs +0 -76
- package/lib/services/warehouse-map.service.mjs +0 -50
- package/lib/typings/core-module-options.mjs +0 -3
- package/lib/typings/find-receive-inventory-order.input.mjs +0 -9
- package/lib/typings/find-ship-inventory-order.input.mjs +0 -9
|
@@ -13,6 +13,7 @@ Target audience: engineers integrating WMS into a new product who want a working
|
|
|
13
13
|
3. [Quick start (60 seconds)](#3-quick-start-60-seconds)
|
|
14
14
|
4. [Backend setup (NestJS + GraphQL + TypeORM)](#4-backend-setup-nestjs--graphql--typeorm)
|
|
15
15
|
- [4.6 Version compatibility matrix](#46-version-compatibility-matrix)
|
|
16
|
+
- [4.7 Module format: CommonJS only](#47-module-format-commonjs-only)
|
|
16
17
|
5. [Frontend setup (Next.js Pages Router)](#5-frontend-setup-nextjs-pages-router)
|
|
17
18
|
6. [Pages Router shell pattern (the 19 thin shells)](#6-pages-router-shell-pattern-the-19-thin-shells)
|
|
18
19
|
7. [Apollo client wiring](#7-apollo-client-wiring)
|
|
@@ -228,7 +229,7 @@ See [API Reference - wms-module-graphql](./api-reference.md) for the full `forRo
|
|
|
228
229
|
|
|
229
230
|
### Adding your own resolvers alongside WMS
|
|
230
231
|
|
|
231
|
-
`WmsModuleGraphqlModule`
|
|
232
|
+
`WmsModuleGraphqlModule` only registers providers (resolvers and the core module); it does not call `GraphQLModule.forRootAsync(...)`. Your host registers the single `GraphQLModule` (see §13.1). What you **can** do is put your own resolvers in **sibling NestJS modules** imported in `AppModule`:
|
|
232
233
|
|
|
233
234
|
```ts
|
|
234
235
|
// apps/api/src/modules/posts/posts.module.ts
|
|
@@ -253,7 +254,7 @@ export class PostsModule {}
|
|
|
253
254
|
export class AppModule {}
|
|
254
255
|
```
|
|
255
256
|
|
|
256
|
-
NestJS's GraphQL module discovers every `@Resolver()` class from every imported module via DI and merges them into the **same** schema. So your `Post`/`User` resolvers coexist in one schema with the WMS resolvers automatically — no extra wiring needed.
|
|
257
|
+
NestJS's GraphQL module discovers every `@Resolver()` class from every imported module via DI and merges them into the **same** schema. So your `Post`/`User` resolvers coexist in one schema with the WMS resolvers automatically — no extra wiring needed. Only a second `GraphQLModule.forRoot(...)` registration is forbidden (see §13.1), not additional resolvers.
|
|
257
258
|
|
|
258
259
|
### 4.3 `.env`
|
|
259
260
|
|
|
@@ -288,8 +289,8 @@ WMS_DB_SCHEMA=wms_demo
|
|
|
288
289
|
"@nestjs/graphql": "^13.0.0",
|
|
289
290
|
"@nestjs/platform-express": "^11.0.0",
|
|
290
291
|
"@nestjs/typeorm": "^11.0.0",
|
|
291
|
-
"@rytass/wms-module-core": "^0.1
|
|
292
|
-
"@rytass/wms-module-graphql": "^0.1
|
|
292
|
+
"@rytass/wms-module-core": "^0.9.1",
|
|
293
|
+
"@rytass/wms-module-graphql": "^0.11.1",
|
|
293
294
|
"graphql": "^16.0.0",
|
|
294
295
|
"pg": "^8.0.0",
|
|
295
296
|
"reflect-metadata": "^0.2.0",
|
|
@@ -346,7 +347,7 @@ combination the integration suite actually runs against.
|
|
|
346
347
|
|
|
347
348
|
| Package | Accepted (peer range) | Tested | Notes |
|
|
348
349
|
|--------------------------|------------------------|--------------|-----------------------------------------------------------------------------|
|
|
349
|
-
| `@nestjs/common` | 10.x – 11.x | 11.1.x | **12.x is not accepted**: the
|
|
350
|
+
| `@nestjs/common` | 10.x – 11.x | 11.1.x | **12.x is not accepted**: the NestJS 12 line is ESM-only, and this package ships CommonJS only and has not been tested against it (see §4.7) |
|
|
350
351
|
| `@nestjs/typeorm` | 10.x – 11.x | 11.0.x | Three import sites (`InjectDataSource`, `forFeature`), stable across both |
|
|
351
352
|
| TypeORM | 0.3.x – 1.x | 1.1.1 | The suite is run against both 0.3.31 and 1.1.1. 0.2.x is not supported (different DataSource API). Note 0.3.x is now tagged `legacy` on npm |
|
|
352
353
|
| `@nestjs/typeorm` | 10.x – 11.x | 11.0.3 | **TypeORM 1.x needs `@nestjs/typeorm` >= 11.0.1** — earlier releases peer `^0.3.0` only |
|
|
@@ -381,6 +382,22 @@ The GraphQL-side packages (`@nestjs/graphql`, `@nestjs/apollo`, `@apollo/server`
|
|
|
381
382
|
|
|
382
383
|
---
|
|
383
384
|
|
|
385
|
+
### 4.7 Module format: CommonJS only
|
|
386
|
+
|
|
387
|
+
`@rytass/wms-module-core` and `@rytass/wms-module-graphql` ship one CommonJS file
|
|
388
|
+
(`index.cjs.js`), and every condition in their `exports` points at it. There is no ESM build,
|
|
389
|
+
on purpose. The packages export DI tokens (`Symbol`s) and TypeORM entity classes, and both are
|
|
390
|
+
identities: if one process loads the package through two module records, it gets two copies of
|
|
391
|
+
each. A provider registered under one copy's token is invisible to a lookup holding the other,
|
|
392
|
+
and `instanceof` against an entity class is false for rows the other copy built. An earlier
|
|
393
|
+
release shipped both formats, and loading the same package with `require()` and `import()` in
|
|
394
|
+
one process disagreed on every token and every entity class. `withWmsTablePrefix` has the same
|
|
395
|
+
problem: it finds the tables to prefix by class identity.
|
|
396
|
+
|
|
397
|
+
ESM consumers lose nothing. Node reads named exports out of CommonJS through `cjs-module-lexer`,
|
|
398
|
+
so `import { WmsModuleCoreModule } from '@rytass/wms-module-core'` works as written. The NestJS 12
|
|
399
|
+
line is ESM-only; it is outside the accepted peer range (see §4.6).
|
|
400
|
+
|
|
384
401
|
## 5. Frontend setup (Next.js Pages Router)
|
|
385
402
|
|
|
386
403
|
The frontend package targets **Next.js Pages Router**, not App Router. The pre-built page bodies use SSR-incompatible providers and must be loaded on the client.
|
|
@@ -521,7 +538,7 @@ be listed in `transpilePackages`. Install it as a regular production dependency:
|
|
|
521
538
|
pnpm add @rytass/wms-map-react-components
|
|
522
539
|
```
|
|
523
540
|
|
|
524
|
-
|
|
541
|
+
Check the latest published version with `npm view @rytass/wms-map-react-components version`. Registry: `https://registry.npmjs.org/`.
|
|
525
542
|
|
|
526
543
|
### 5.4 `apps/client/package.json` essentials
|
|
527
544
|
|
|
@@ -541,8 +558,8 @@ Current published version: `^0.1.0`. Registry: `https://registry.npmjs.org/`.
|
|
|
541
558
|
"@mezzanine-ui/icons": "^1.0.0",
|
|
542
559
|
"@mezzanine-ui/react": "^1.0.0",
|
|
543
560
|
"@mezzanine-ui/system": "^1.0.0",
|
|
544
|
-
"@rytass/wms-map-react-components": "^0.1.
|
|
545
|
-
"@rytass/wms-module-react": "^0.1
|
|
561
|
+
"@rytass/wms-map-react-components": "^0.1.10",
|
|
562
|
+
"@rytass/wms-module-react": "^0.5.1",
|
|
546
563
|
"@xyflow/react": "^12.0.0",
|
|
547
564
|
"graphql": "^16.0.0",
|
|
548
565
|
"lodash": "^4.17.0",
|
|
@@ -669,10 +686,10 @@ import { createApolloClient } from '@rytass/wms-module-react';
|
|
|
669
686
|
const client = createApolloClient();
|
|
670
687
|
```
|
|
671
688
|
|
|
672
|
-
|
|
689
|
+
`createApolloClient()` takes **no parameters** and returns a fresh
|
|
673
690
|
`ApolloClient<NormalizedCacheObject>` instance configured with the same `/graphql` URI as
|
|
674
|
-
the default singleton. A URL/header override parameter is planned
|
|
675
|
-
non-breaking addition
|
|
691
|
+
the default singleton. A URL/header override parameter is planned as a
|
|
692
|
+
non-breaking addition, and is not available yet. See [API Reference - createApolloClient](./api-reference.md).
|
|
676
693
|
|
|
677
694
|
### 7.3 GraphQL operations & DocumentNode constants
|
|
678
695
|
|
|
@@ -861,7 +878,10 @@ The entities are designed for PostgreSQL:
|
|
|
861
878
|
|
|
862
879
|
- `timestamptz` columns map to native `timestamp with time zone`
|
|
863
880
|
- `bool` maps to PG `boolean`
|
|
864
|
-
-
|
|
881
|
+
- Serial IDs (order keys, loader serials) come from `WmsSequenceService`; `CURRVAL` is not used. `sequenceStorage` selects one of two modes:
|
|
882
|
+
- `'sequence'` (default): one PostgreSQL sequence per counter. The first use of a counter in a process runs `CREATE SEQUENCE IF NOT EXISTS` on a separate connection in autocommit, so a rollback cannot drop it and other callers are not blocked. Consecutive runs (loader serials) hold a transaction-scoped advisory lock on the counter.
|
|
883
|
+
- `'table'`: one row per counter in the `sequences` table, advanced by a single `INSERT … ON CONFLICT … RETURNING` statement. No DDL is run.
|
|
884
|
+
- In both modes a `maxValue` bound refuses a reservation before the counter moves.
|
|
865
885
|
- `synchronize: true` works for dev/demo; use proper migrations in production
|
|
866
886
|
|
|
867
887
|
This is the only database where the lib runs without any consumer-side workaround.
|
|
@@ -879,7 +899,7 @@ If you must run against SQLite (e.g. for local prototyping without a PG server):
|
|
|
879
899
|
|
|
880
900
|
At the disk layer SQLite is liberal — it accepts any column type string and gives it NUMERIC affinity — so once the validator is past, schema creation works.
|
|
881
901
|
|
|
882
|
-
2.
|
|
902
|
+
2. **Sequence reservation** — order keys and loader serials come from `WmsSequenceService`, which emits PostgreSQL-specific SQL in both storage modes. `sequenceStorage: 'sequence'` (default) uses `CREATE SEQUENCE`, `nextval` / `setval`, `to_regclass` and `pg_advisory_xact_lock`; `sequenceStorage: 'table'` avoids DDL but still uses the PostgreSQL `::bigint` cast. Neither mode runs on SQLite, so running `createLoader` or any order-creation flow on SQLite is not supported.
|
|
883
903
|
|
|
884
904
|
3. **DateTime serialize round-trip** — SQLite returns datetime strings in `YYYY-MM-DD HH:MM:SS` format. The GraphQL DateTime scalar may emit `null` for some columns; the consumer-visible effect is blank `createdAt` fields in some payloads.
|
|
885
905
|
|
|
@@ -981,37 +1001,59 @@ This section covers the real-world scenarios where the WMS modules are added to
|
|
|
981
1001
|
that already has its own NestJS backend, GraphQL setup, or Next.js frontend. The greenfield
|
|
982
1002
|
setup in sections 4-7 is the baseline; read this section for the delta.
|
|
983
1003
|
|
|
984
|
-
> **Scope**:
|
|
1004
|
+
> **Scope**: the current published releases. Many limitations listed here are known gaps — roadmap notes are included
|
|
985
1005
|
> where improvements are planned.
|
|
986
1006
|
|
|
987
1007
|
### 13.1 Coexisting with an existing `GraphQLModule`
|
|
988
1008
|
|
|
989
|
-
**Status**:
|
|
990
|
-
|
|
991
|
-
`WmsModuleGraphqlModule.forRootAsync(...)` internally calls `GraphQLModule.forRootAsync(...)`.
|
|
992
|
-
NestJS does not allow two `GraphQLModule` registrations in the same application — the second
|
|
993
|
-
registration throws `Error: Cannot register 2 GraphQL modules`. If your host app already
|
|
994
|
-
imports `GraphQLModule`, you cannot simply add `WmsModuleGraphqlModule` to the same
|
|
995
|
-
`imports: [...]` array.
|
|
1009
|
+
**Status**: Supported. No fork or workaround is needed.
|
|
996
1010
|
|
|
997
|
-
|
|
1011
|
+
`WmsModuleGraphqlModule.forRootAsync(...)` only registers providers (resolvers, `LoaderService`,
|
|
1012
|
+
core module) — it does **not** call `GraphQLModule.forRoot` internally. The host application
|
|
1013
|
+
registers a **single** `GraphQLModule.forRootAsync(...)` of its own. NestJS's schema builder
|
|
1014
|
+
walks the DI container at boot, collects every `@Resolver()` class from every imported module,
|
|
1015
|
+
and merges them into one schema.
|
|
998
1016
|
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1017
|
+
This means a host app with an existing GraphQL server just adds `WmsModuleGraphqlModule` next to
|
|
1018
|
+
its existing `GraphQLModule.forRootAsync(...)`. To preserve N+1 prevention for the WMS resolvers,
|
|
1019
|
+
the host must inject `LoaderService` into its own context factory and call `createWmsLoaders(...)`
|
|
1020
|
+
per request:
|
|
1002
1021
|
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1022
|
+
```ts
|
|
1023
|
+
import {
|
|
1024
|
+
WmsModuleGraphqlModule,
|
|
1025
|
+
LoaderService,
|
|
1026
|
+
createWmsLoaders,
|
|
1027
|
+
} from '@rytass/wms-module-graphql';
|
|
1006
1028
|
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1029
|
+
@Module({
|
|
1030
|
+
imports: [
|
|
1031
|
+
// ... your existing modules ...
|
|
1032
|
+
WmsModuleGraphqlModule.forRootAsync({
|
|
1033
|
+
useFactory: async () => ({}),
|
|
1034
|
+
defaultLoaderSerialId: 'DEFAULT',
|
|
1035
|
+
defaultLoaderTypeKey: 'DEFAULT',
|
|
1036
|
+
defaultLocationKey: 'DEFAULT',
|
|
1037
|
+
}),
|
|
1038
|
+
GraphQLModule.forRootAsync({
|
|
1039
|
+
driver: ApolloDriver,
|
|
1040
|
+
inject: [LoaderService, /* your existing deps */],
|
|
1041
|
+
useFactory: (loaderService: LoaderService /* , ... */) => ({
|
|
1042
|
+
autoSchemaFile: 'schema.gql',
|
|
1043
|
+
context: ({ req }) => ({
|
|
1044
|
+
...createWmsLoaders(loaderService), // WMS DataLoader trio
|
|
1045
|
+
user: req.user, // your existing context fields
|
|
1046
|
+
// ... any other context shape you already had ...
|
|
1047
|
+
}),
|
|
1048
|
+
}),
|
|
1049
|
+
}),
|
|
1050
|
+
],
|
|
1051
|
+
})
|
|
1052
|
+
export class AppModule {}
|
|
1053
|
+
```
|
|
1011
1054
|
|
|
1012
|
-
**
|
|
1013
|
-
|
|
1014
|
-
the same process.
|
|
1055
|
+
**Type name conflicts**: still a separate concern — see §13.14. The shared-schema model means
|
|
1056
|
+
your `type Material`, `type Location`, etc. must not collide with the WMS counterparts.
|
|
1015
1057
|
|
|
1016
1058
|
---
|
|
1017
1059
|
|
|
@@ -1371,7 +1413,7 @@ the navigation chrome with your own.
|
|
|
1371
1413
|
|
|
1372
1414
|
### 13.9 i18n: Current Limitations and Workarounds
|
|
1373
1415
|
|
|
1374
|
-
**Status**: No i18n support
|
|
1416
|
+
**Status**: No i18n support. All user-visible strings in the lib are hardcoded
|
|
1375
1417
|
Traditional Chinese (zh-TW).
|
|
1376
1418
|
|
|
1377
1419
|
Affected areas:
|
|
@@ -1422,13 +1464,13 @@ WMS page components (`MaterialsManagement`, `InventoryList`, etc.) are designed
|
|
|
1422
1464
|
**full-viewport rendering**. They use `PageWrapper` and `SectionWrapper` internally which
|
|
1423
1465
|
set `width: 100%` and `height: 100%` of the viewport.
|
|
1424
1466
|
|
|
1425
|
-
**Embedding in a tab, panel, or drawer is not officially supported
|
|
1467
|
+
**Embedding in a tab, panel, or drawer is not officially supported.** Known issues
|
|
1426
1468
|
when embedded in a constrained container:
|
|
1427
1469
|
- Mezzanine Table column-width calculations use the viewport width
|
|
1428
1470
|
- Modal/dialog portals render at document body, not relative to the container
|
|
1429
1471
|
- React Flow (used by Maps and LocationsManagement map tab) requires a fixed-height container
|
|
1430
1472
|
|
|
1431
|
-
There is no clean workaround
|
|
1473
|
+
There is no clean workaround. If you need sectional embedding, fork the lib and
|
|
1432
1474
|
modify the `PageWrapper`/`SectionWrapper` styles to be container-relative.
|
|
1433
1475
|
|
|
1434
1476
|
---
|
|
@@ -1560,7 +1602,7 @@ export default defineConfig({
|
|
|
1560
1602
|
4. `@mezzanine-ui/react` imports `lodash/compact` without a `.js` extension, which may
|
|
1561
1603
|
require `resolve.alias` configuration in Vite.
|
|
1562
1604
|
|
|
1563
|
-
No official Vite setup guide exists
|
|
1605
|
+
No official Vite setup guide exists.
|
|
1564
1606
|
|
|
1565
1607
|
---
|
|
1566
1608
|
|
|
@@ -1614,7 +1656,7 @@ same `@nestjs/*` major version. Options:
|
|
|
1614
1656
|
```yaml
|
|
1615
1657
|
# pnpm-workspace.yaml
|
|
1616
1658
|
overrides:
|
|
1617
|
-
'@rytass/wms-module-core': '0.1
|
|
1659
|
+
'@rytass/wms-module-core': '0.9.1'
|
|
1618
1660
|
```
|
|
1619
1661
|
|
|
1620
1662
|
3. Apply `public-hoist-pattern[]` for `@rytass/wms-module-*` in `.npmrc`
|
|
@@ -1643,7 +1685,7 @@ There is no name-prefixing or namespace configuration in the lib's DTOs. This co
|
|
|
1643
1685
|
affects **all** GraphQL types in the WMS schema: ObjectTypes, InputTypes, Enums, and any
|
|
1644
1686
|
union types.
|
|
1645
1687
|
|
|
1646
|
-
The viable options are
|
|
1688
|
+
The viable options are:
|
|
1647
1689
|
|
|
1648
1690
|
1. **Run WMS as a separate NestJS process** (recommended) — isolates schemas entirely;
|
|
1649
1691
|
no type name collisions possible.
|
|
@@ -1652,8 +1694,7 @@ The viable options are the same as those described in §13.1:
|
|
|
1652
1694
|
3. **Wait for a future major release** — a type prefix configuration option is a candidate
|
|
1653
1695
|
for a future major version that introduces namespace support.
|
|
1654
1696
|
|
|
1655
|
-
|
|
1656
|
-
both APIs in the same process is not supported in 0.1.x.
|
|
1697
|
+
Type-name collisions are a shared-schema concern (see §13.1): both APIs in one process must not declare the same type names.
|
|
1657
1698
|
|
|
1658
1699
|
|
|
1659
1700
|
## 14. Reference implementation (`wms-standalone`)
|