@rytass/wms-module-core 0.9.1 → 0.10.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.
Files changed (141) hide show
  1. package/README.md +15 -2
  2. package/docs/README.md +2 -2
  3. package/docs/api-reference.md +129 -10
  4. package/docs/host-integration.md +172 -0
  5. package/docs/integration-guide.md +84 -43
  6. package/index.cjs.js +2454 -1658
  7. package/index.d.ts +2 -0
  8. package/lib/events/inventory-count-lock.subscriber.d.ts +17 -5
  9. package/lib/models/metadata/index.d.ts +1 -0
  10. package/lib/models/metadata/sequence.entity.d.ts +9 -0
  11. package/lib/models/models.module.d.ts +7 -0
  12. package/lib/services/allocate-inventory-order.service.d.ts +3 -3
  13. package/lib/services/batch.service.d.ts +13 -1
  14. package/lib/services/consumption-order.service.d.ts +6 -6
  15. package/lib/services/helper.service.d.ts +10 -4
  16. package/lib/services/hold-inventory-order.service.d.ts +3 -3
  17. package/lib/services/index.d.ts +1 -0
  18. package/lib/services/inventory-count-order.service.d.ts +28 -9
  19. package/lib/services/loader.service.d.ts +11 -3
  20. package/lib/services/material.service.d.ts +1 -1
  21. package/lib/services/merge-batch-order.service.d.ts +2 -2
  22. package/lib/services/quality-inspection-order.service.d.ts +1 -1
  23. package/lib/services/receive-inventory-order.service.d.ts +4 -4
  24. package/lib/services/reclassify-inventory-order.service.d.ts +2 -2
  25. package/lib/services/scrape.service.d.ts +1 -1
  26. package/lib/services/sequence.service.d.ts +58 -0
  27. package/lib/services/ship-inventory-order.service.d.ts +6 -6
  28. package/lib/services/split-batch-order.service.d.ts +2 -2
  29. package/lib/services/stock.service.d.ts +48 -2
  30. package/lib/services/transfer-customer-order.service.d.ts +3 -3
  31. package/lib/services/transfer-order.service.d.ts +7 -5
  32. package/lib/services/transfer-vendor-order.service.d.ts +3 -3
  33. package/lib/table-prefix/logical-table-name.d.ts +21 -0
  34. package/lib/table-prefix/table-prefix.d.ts +30 -0
  35. package/lib/typings/core-module-options.d.ts +31 -0
  36. package/lib/typings/create-transfer-order.input.d.ts +2 -0
  37. package/lib/typings/index.d.ts +20 -0
  38. package/lib/utils/run-in-transaction.d.ts +23 -0
  39. package/lib/utils/table-path.d.ts +13 -0
  40. package/package.json +3 -12
  41. package/index.d.mts +0 -6
  42. package/index.mjs +0 -98
  43. package/lib/constants/consumption-change-kind.mjs +0 -20
  44. package/lib/constants/inventory-count-status.mjs +0 -22
  45. package/lib/constants/operations.mjs +0 -76
  46. package/lib/constants/order-type.mjs +0 -33
  47. package/lib/constants/stock-status.mjs +0 -61
  48. package/lib/core.module.mjs +0 -287
  49. package/lib/events/dispatch-scope.mjs +0 -29
  50. package/lib/events/inventory-count-lock.subscriber.mjs +0 -98
  51. package/lib/events/stock-change.subscriber.mjs +0 -252
  52. package/lib/events/wms-event.collector.mjs +0 -22
  53. package/lib/events/wms-event.dispatcher.mjs +0 -63
  54. package/lib/events/wms-event.tokens.mjs +0 -12
  55. package/lib/events/wms-operation-runner.mjs +0 -101
  56. package/lib/models/extensions/allocate-inventory-order/allocate-inventory-order-change.entity.mjs +0 -40
  57. package/lib/models/extensions/allocate-inventory-order/allocate-inventory-order-item.entity.mjs +0 -104
  58. package/lib/models/extensions/allocate-inventory-order/allocate-inventory-order.entity.mjs +0 -33
  59. package/lib/models/extensions/consumption-order/consumption-order-change.entity.mjs +0 -59
  60. package/lib/models/extensions/consumption-order/consumption-order-item.entity.mjs +0 -114
  61. package/lib/models/extensions/consumption-order/consumption-order.entity.mjs +0 -69
  62. package/lib/models/extensions/hold-inventory-order/hold-inventory-order-change.entity.mjs +0 -40
  63. package/lib/models/extensions/hold-inventory-order/hold-inventory-order-item.entity.mjs +0 -98
  64. package/lib/models/extensions/hold-inventory-order/hold-inventory-order.entity.mjs +0 -43
  65. package/lib/models/extensions/inventory-count-order/inventory-count-order-change.entity.mjs +0 -50
  66. package/lib/models/extensions/inventory-count-order/inventory-count-order-item.entity.mjs +0 -191
  67. package/lib/models/extensions/inventory-count-order/inventory-count-order.entity.mjs +0 -155
  68. package/lib/models/extensions/merge-batch-order/merge-batch-order-change.entity.mjs +0 -40
  69. package/lib/models/extensions/merge-batch-order/merge-batch-order-item.entity.mjs +0 -75
  70. package/lib/models/extensions/merge-batch-order/merge-batch-order.entity.mjs +0 -33
  71. package/lib/models/extensions/order-reference/order-reference.entity.mjs +0 -95
  72. package/lib/models/extensions/quality-inspection-order/quality-inspection-order-change.entity.mjs +0 -45
  73. package/lib/models/extensions/quality-inspection-order/quality-inspection-order-item.entity.mjs +0 -94
  74. package/lib/models/extensions/quality-inspection-order/quality-inspection-order.entity.mjs +0 -38
  75. package/lib/models/extensions/receive-inventory-order/receive-inventory-order-change.entity.mjs +0 -46
  76. package/lib/models/extensions/receive-inventory-order/receive-inventory-order-item.entity.mjs +0 -89
  77. package/lib/models/extensions/receive-inventory-order/receive-inventory-order.entity.mjs +0 -57
  78. package/lib/models/extensions/reclassify-inventory-order/reclassify-inventory-order-change.entity.mjs +0 -40
  79. package/lib/models/extensions/reclassify-inventory-order/reclassify-inventory-order-item.entity.mjs +0 -75
  80. package/lib/models/extensions/reclassify-inventory-order/reclassify-inventory-order.entity.mjs +0 -33
  81. package/lib/models/extensions/scrape-order/scrape-order-change.entity.mjs +0 -40
  82. package/lib/models/extensions/scrape-order/scrape-order-item.entity.mjs +0 -94
  83. package/lib/models/extensions/scrape-order/scrape-order.entity.mjs +0 -33
  84. package/lib/models/extensions/ship-inventory-order/ship-inventory-order-change.entity.mjs +0 -46
  85. package/lib/models/extensions/ship-inventory-order/ship-inventory-order-item.entity.mjs +0 -90
  86. package/lib/models/extensions/ship-inventory-order/ship-inventory-order-reference.entity.mjs +0 -65
  87. package/lib/models/extensions/ship-inventory-order/ship-inventory-order.entity.mjs +0 -56
  88. package/lib/models/extensions/split-batch-order/split-batch-order-change.entity.mjs +0 -40
  89. package/lib/models/extensions/split-batch-order/split-batch-order-item.entity.mjs +0 -75
  90. package/lib/models/extensions/split-batch-order/split-batch-order.entity.mjs +0 -33
  91. package/lib/models/extensions/transfer-customer-order/transfer-customer-order-change.entity.mjs +0 -40
  92. package/lib/models/extensions/transfer-customer-order/transfer-customer-order-item.entity.mjs +0 -99
  93. package/lib/models/extensions/transfer-customer-order/transfer-customer-order.entity.mjs +0 -33
  94. package/lib/models/extensions/transfer-order/transfer-order-change.entity.mjs +0 -40
  95. package/lib/models/extensions/transfer-order/transfer-order-item.entity.mjs +0 -109
  96. package/lib/models/extensions/transfer-order/transfer-order.entity.mjs +0 -53
  97. package/lib/models/extensions/transfer-vendor-order/transfer-vendor-order-change.entity.mjs +0 -40
  98. package/lib/models/extensions/transfer-vendor-order/transfer-vendor-order-item.entity.mjs +0 -99
  99. package/lib/models/extensions/transfer-vendor-order/transfer-vendor-order.entity.mjs +0 -33
  100. package/lib/models/metadata/batch-group.entity.mjs +0 -31
  101. package/lib/models/metadata/batch.entity.mjs +0 -131
  102. package/lib/models/metadata/loader-type.entity.mjs +0 -43
  103. package/lib/models/metadata/loader-unit.entity.mjs +0 -21
  104. package/lib/models/metadata/loader.entity.mjs +0 -98
  105. package/lib/models/metadata/location.entity.mjs +0 -28
  106. package/lib/models/metadata/material-unit.entity.mjs +0 -51
  107. package/lib/models/metadata/material.entity.mjs +0 -28
  108. package/lib/models/metadata/order.entity.mjs +0 -5
  109. package/lib/models/metadata/sale-order.entity.mjs +0 -21
  110. package/lib/models/metadata/stock.entity.mjs +0 -29
  111. package/lib/models/metadata/unit.entity.mjs +0 -21
  112. package/lib/models/models.module.mjs +0 -158
  113. package/lib/models/wms-entities.mjs +0 -82
  114. package/lib/services/allocate-inventory-order.service.mjs +0 -310
  115. package/lib/services/base-order.service.mjs +0 -76
  116. package/lib/services/batch.service.mjs +0 -272
  117. package/lib/services/consumption-order.service.mjs +0 -504
  118. package/lib/services/helper.service.mjs +0 -28
  119. package/lib/services/hold-inventory-order.service.mjs +0 -296
  120. package/lib/services/inventory-count-order.service.mjs +0 -648
  121. package/lib/services/loader.service.mjs +0 -291
  122. package/lib/services/location.service.mjs +0 -139
  123. package/lib/services/material.service.mjs +0 -181
  124. package/lib/services/merge-batch-order.service.mjs +0 -206
  125. package/lib/services/order-reference.service.mjs +0 -136
  126. package/lib/services/quality-inspection-order.service.mjs +0 -146
  127. package/lib/services/receive-inventory-order.service.mjs +0 -468
  128. package/lib/services/reclassify-inventory-order.service.mjs +0 -192
  129. package/lib/services/sale-order.service.mjs +0 -20
  130. package/lib/services/scrape.service.mjs +0 -150
  131. package/lib/services/ship-inventory-order.service.mjs +0 -610
  132. package/lib/services/split-batch-order.service.mjs +0 -191
  133. package/lib/services/stock.service.mjs +0 -559
  134. package/lib/services/transfer-customer-order.service.mjs +0 -290
  135. package/lib/services/transfer-order.service.mjs +0 -641
  136. package/lib/services/transfer-vendor-order.service.mjs +0 -290
  137. package/lib/services/unit.service.mjs +0 -76
  138. package/lib/services/warehouse-map.service.mjs +0 -50
  139. package/lib/typings/core-module-options.mjs +0 -3
  140. package/lib/typings/find-receive-inventory-order.input.mjs +0 -9
  141. 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` calls `GraphQLModule.forRootAsync(...)` internally — that registration is workspace-global, so you cannot register a second `GraphQLModule` (see §13.1). What you **can** do is put your own resolvers in **sibling NestJS modules** imported in `AppModule`:
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. The §13.1 "one GraphQLModule" constraint only forbids a second `GraphQLModule.forRoot(...)` registration, not additional resolvers.
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.2",
292
- "@rytass/wms-module-graphql": "^0.1.2",
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 whole NestJS 12 line is ESM-only, which this package (dual CJS+ESM) and a webpack-bundled host cannot consume yet |
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
- Current published version: `^0.1.0`. Registry: `https://registry.npmjs.org/`.
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.0",
545
- "@rytass/wms-module-react": "^0.1.2",
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
- As of **0.1.2**, `createApolloClient()` takes **no parameters** and returns a fresh
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 for **0.2.0** (will be a
675
- non-breaking addition). See [API Reference - createApolloClient](./api-reference.md).
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
- - Sequence-based serial IDs (e.g. loader.serialId) use PG `CURRVAL`
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. **`CURRVAL(seq_name)` PostgreSQL function** — used internally to compute loader serial IDs. SQLite has no equivalent. All `createLoader` mutations will fail with `no such function: CURRVAL`. There is no clean consumer-side workaround; running real loader creation flows on SQLite is not supported as of 0.1.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**: 0.1.x. Many limitations listed here are known gaps — roadmap notes are included
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**: Not supported in 0.1.x without forking the library.
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
- **Recommended workarounds** (in order of practicality):
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
- 1. **Separate NestJS process** — run the WMS API as its own NestJS server on a different port
1000
- (e.g. 7103) and have the host API proxy or federate as needed. This is the architecture
1001
- used by `wms-standalone` and is the safest path.
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
- 2. **NestJS sub-app (monorepo)** — if you use the Nx or NestJS CLI monorepo pattern, you can
1004
- host the WMS app as a separate application inside the same repo that shares code with your
1005
- existing app but runs as a distinct process.
1022
+ ```ts
1023
+ import {
1024
+ WmsModuleGraphqlModule,
1025
+ LoaderService,
1026
+ createWmsLoaders,
1027
+ } from '@rytass/wms-module-graphql';
1006
1028
 
1007
- 3. **Fork and merge** — advanced consumers can fork `libs/graphql` and extract the resolver
1008
- registrations, removing the internal `GraphQLModule.forRootAsync(...)` call. The host app
1009
- then registers a single `GraphQLModule` that includes the WMS resolver classes. This requires
1010
- maintaining a fork and is not recommended unless you intend to take full ownership of the lib.
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
- **Tied to §13.1**: the `/graphql` endpoint name conflict (see §13.14 for GraphQL type name conflicts) is also
1013
- fundamentally blocked by this same single-GraphQLModule constraint when running both APIs in
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 in 0.1.x. All user-visible strings in the lib are hardcoded
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 in 0.1.x.** Known issues
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 in 0.1.x. If you need sectional embedding, fork the lib and
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 for 0.1.x.
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.4'
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 the same as those described in §13.1:
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
- This is the same fundamental single-`GraphQLModule` constraint discussed in §13.1. Running
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`)