@rytass/wms-module-graphql 0.1.1 → 0.1.3
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 -0
- package/docs/README.md +33 -0
- package/docs/api-reference.md +957 -0
- package/docs/integration-guide.md +1568 -0
- package/package.json +4 -3
|
@@ -0,0 +1,957 @@
|
|
|
1
|
+
# API Reference — @rytass/wms-module-*
|
|
2
|
+
|
|
3
|
+
Complete export catalog for the three publishable libraries:
|
|
4
|
+
|
|
5
|
+
- `@rytass/wms-module-core` — NestJS module, TypeORM entities, services, DI tokens
|
|
6
|
+
- `@rytass/wms-module-graphql` — GraphQL resolvers, DTOs, DataLoader helpers
|
|
7
|
+
- `@rytass/wms-module-react` — React components, hooks, Apollo client, GraphQL operations
|
|
8
|
+
|
|
9
|
+
Current versions: **0.1.2** (all three packages).
|
|
10
|
+
|
|
11
|
+
This document mirrors the actual `src/index.ts` barrel exports and is generated by static analysis of the lib sources. For runtime behavior changes between versions, see each package's `CHANGELOG.md`.
|
|
12
|
+
|
|
13
|
+
> Companion document — **[Integration Guide](./integration-guide.md)** — step-by-step instructions for wiring the three packages into a new consumer project.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
# @rytass/wms-module-core
|
|
19
|
+
|
|
20
|
+
## NestJS Modules
|
|
21
|
+
|
|
22
|
+
### `WmsModuleCoreModule`
|
|
23
|
+
- 用途: WMS 核心 NestJS 動態模組,整合 TypeORM 實體、服務與 Vault 認證;透過 `forRoot` / `forRootAsync` 初始化整個核心功能。
|
|
24
|
+
- 來源: `lib/core.module.ts`
|
|
25
|
+
|
|
26
|
+
**`forRoot(options, coreOptions): DynamicModule`**
|
|
27
|
+
```ts
|
|
28
|
+
static forRoot(
|
|
29
|
+
options: WMSBaseModuleOptions, // @rytass/wms-base-nestjs-module 選項(DB 連線等)
|
|
30
|
+
coreOptions: WmsModuleCoreModuleOptions, // defaultLoaderSerialId / defaultLoaderTypeKey / defaultLocationKey
|
|
31
|
+
): DynamicModule
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
**`forRootAsync(options): DynamicModule`**
|
|
35
|
+
```ts
|
|
36
|
+
static forRootAsync(
|
|
37
|
+
options: WmsModuleCoreModuleAsyncOptions, // WMSBaseModuleAsyncOptions + WmsModuleCoreModuleOptions
|
|
38
|
+
): DynamicModule
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### `ModelsModule`
|
|
42
|
+
- 用途: 內部模組,向 TypeORM 註冊所有 WMS 實體(via DI token 形式),並透過 `ResolvedEntitiesProviders` 提供 DI。**消費端不直接 import**;它由 `WmsModuleCoreModule.forRoot` 自動引入並 re-export。
|
|
43
|
+
- 來源: `lib/models/models.module.ts`
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## TypeORM Entities(Metadata — 基礎主檔)
|
|
48
|
+
|
|
49
|
+
每個實體都同時匯出一個 **`Symbol` DI token** 和一個 **`EntityClass`**:
|
|
50
|
+
|
|
51
|
+
| Symbol (DI token) | EntityClass | 說明 | 來源 |
|
|
52
|
+
|---|---|---|---|
|
|
53
|
+
| `UnitEntity` | `UnitEntityClass` | 單位主檔(kg / pcs 等) | `lib/models/metadata/unit.entity.ts` |
|
|
54
|
+
| `MaterialEntity` | `MaterialEntityClass` | 料號主檔,繼承 `BaseMaterialEntity` | `lib/models/metadata/material.entity.ts` |
|
|
55
|
+
| `MaterialUnitEntity` | `MaterialUnitEntityClass` | 料號換算單位(含換算係數) | `lib/models/metadata/material-unit.entity.ts` |
|
|
56
|
+
| `BatchEntity` | `BatchEntityClass` | 批號主檔,繼承 `BaseBatchEntity` | `lib/models/metadata/batch.entity.ts` |
|
|
57
|
+
| `BatchGroupEntity` | `BatchGroupEntityClass` | 批號群組,支援多批合併情境 | `lib/models/metadata/batch-group.entity.ts` |
|
|
58
|
+
| `LoadersEntity` | `LoadersEntityClass` | 載具主檔(托板/棧板等),含尺寸欄位 | `lib/models/metadata/loader.entity.ts` |
|
|
59
|
+
| `LoaderTypeEntity` | `LoaderTypeEntityClass` | 載具類型 | `lib/models/metadata/loader-type.entity.ts` |
|
|
60
|
+
| `LoaderUnitEntity` | `LoaderUnitEntityClass` | 載具與單位的對應關係 | `lib/models/metadata/loader-unit.entity.ts` |
|
|
61
|
+
| `LocationEntity` | `LocationEntityClass` | 儲存位置,繼承 `BaseLocationEntity` | `lib/models/metadata/location.entity.ts` |
|
|
62
|
+
| `WarehouseMapEntity` | — | 倉庫地圖(Symbol,class 來自 base module) | `lib/models/metadata/location.entity.ts` |
|
|
63
|
+
| `StockEntity` | `StockEntityClass` | 庫存記錄,繼承 `BaseStockEntity` | `lib/models/metadata/stock.entity.ts` |
|
|
64
|
+
| `SaleOrderEntity` | `SaleOrderEntityClass` | 銷售訂單主檔 | `lib/models/metadata/sale-order.entity.ts` |
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## TypeORM Entities(Extensions — 訂單與作業)
|
|
69
|
+
|
|
70
|
+
同樣每個都有 Symbol + EntityClass 雙匯出,共 37 個:
|
|
71
|
+
|
|
72
|
+
**入庫訂單 (Receive Inventory Order)**
|
|
73
|
+
- `ReceiveInventoryOrderEntity` / `ReceiveInventoryOrderEntityClass` — 入庫單主檔
|
|
74
|
+
- `ReceiveInventoryOrderItemEntity` / `ReceiveInventoryOrderItemEntityClass` — 入庫單明細
|
|
75
|
+
- `ReceiveInventoryOrderChangeEntity` / `ReceiveInventoryOrderChangeEntityClass` — 入庫異動紀錄
|
|
76
|
+
- 來源: `lib/models/extensions/receive-inventory-order/`
|
|
77
|
+
|
|
78
|
+
**出庫訂單 (Ship Inventory Order)**
|
|
79
|
+
- `ShipInventoryOrderEntity` / `ShipInventoryOrderEntityClass` — 出庫單主檔
|
|
80
|
+
- `ShipInventoryOrderItemEntity` / `ShipInventoryOrderItemEntityClass` — 出庫單明細
|
|
81
|
+
- `ShipInventoryOrderReferenceEntity` / `ShipInventoryOrderReferenceEntityClass` — 出庫單參考(連結銷售單)
|
|
82
|
+
- `ShipInventoryOrderChangeEntity` / `ShipInventoryOrderChangeEntityClass` — 出庫異動紀錄
|
|
83
|
+
- 來源: `lib/models/extensions/ship-inventory-order/`
|
|
84
|
+
|
|
85
|
+
**調撥訂單 (Transfer Order)**
|
|
86
|
+
- `TransferOrderEntity` / `TransferOrderEntityClass`
|
|
87
|
+
- `TransferOrderItemEntity` / `TransferOrderItemEntityClass`
|
|
88
|
+
- `TransferOrderChangeEntity` / `TransferOrderChangeEntityClass`
|
|
89
|
+
- 來源: `lib/models/extensions/transfer-order/`
|
|
90
|
+
|
|
91
|
+
**客戶調撥訂單 (Transfer Customer Order)**
|
|
92
|
+
- `TransferCustomerOrderEntity` / `TransferCustomerOrderEntityClass`
|
|
93
|
+
- `TransferCustomerOrderItemEntity` / `TransferCustomerOrderItemEntityClass`
|
|
94
|
+
- `TransferCustomerOrderChangeEntity` / `TransferCustomerOrderChangeEntityClass`
|
|
95
|
+
- 來源: `lib/models/extensions/transfer-customer-order/`
|
|
96
|
+
|
|
97
|
+
**供應商調撥訂單 (Transfer Vendor Order)**
|
|
98
|
+
- `TransferVendorOrderEntity` / `TransferVendorOrderEntityClass`
|
|
99
|
+
- `TransferVendorOrderItemEntity` / `TransferVendorOrderItemEntityClass`
|
|
100
|
+
- `TransferVendorOrderChangeEntity` / `TransferVendorOrderChangeEntityClass`
|
|
101
|
+
- 來源: `lib/models/extensions/transfer-vendor-order/`
|
|
102
|
+
|
|
103
|
+
**凍結庫存訂單 (Hold Inventory Order)**
|
|
104
|
+
- `HoldInventoryOrderEntity` / `HoldInventoryOrderEntityClass`
|
|
105
|
+
- `HoldInventoryOrderItemEntity` / `HoldInventoryOrderItemEntityClass`
|
|
106
|
+
- `HoldInventoryOrderChangeEntity` / `HoldInventoryOrderChangeEntityClass`
|
|
107
|
+
- 來源: `lib/models/extensions/hold-inventory-order/`
|
|
108
|
+
|
|
109
|
+
**分配庫存訂單 (Allocate Inventory Order)**
|
|
110
|
+
- `AllocateInventoryOrderEntity` / `AllocateInventoryOrderEntityClass`
|
|
111
|
+
- `AllocateInventoryOrderItemEntity` / `AllocateInventoryOrderItemEntityClass`
|
|
112
|
+
- `AllocateInventoryOrderChangeEntity` / `AllocateInventoryOrderChangeEntityClass`
|
|
113
|
+
- 來源: `lib/models/extensions/allocate-inventory-order/`
|
|
114
|
+
|
|
115
|
+
**拆批訂單 (Split Batch Order)**
|
|
116
|
+
- `SplitBatchOrderEntity` / `SplitBatchOrderEntityClass`
|
|
117
|
+
- `SplitBatchOrderItemEntity` / `SplitBatchOrderItemEntityClass`
|
|
118
|
+
- `SplitBatchOrderChangeEntity` / `SplitBatchOrderChangeEntityClass`
|
|
119
|
+
- 來源: `lib/models/extensions/split-batch-order/`
|
|
120
|
+
|
|
121
|
+
**併批訂單 (Merge Batch Order)**
|
|
122
|
+
- `MergeBatchOrderEntity` / `MergeBatchOrderEntityClass`
|
|
123
|
+
- `MergeBatchOrderItemEntity` / `MergeBatchOrderItemEntityClass`
|
|
124
|
+
- `MergeBatchOrderChangeEntity` / `MergeBatchOrderChangeEntityClass`
|
|
125
|
+
- 來源: `lib/models/extensions/merge-batch-order/`
|
|
126
|
+
|
|
127
|
+
**轉料號訂單 (Reclassify Inventory Order)**
|
|
128
|
+
- `ReclassifyInventoryOrderEntity` / `ReclassifyInventoryOrderEntityClass`
|
|
129
|
+
- `ReclassifyInventoryOrderItemEntity` / `ReclassifyInventoryOrderItemEntityClass`
|
|
130
|
+
- `ReclassifyInventoryOrderChangeEntity` / `ReclassifyInventoryOrderChangeEntityClass`
|
|
131
|
+
- 來源: `lib/models/extensions/reclassify-inventory-order/`
|
|
132
|
+
|
|
133
|
+
**品質檢驗訂單 (Quality Inspection Order)**
|
|
134
|
+
- `QualityInspectionOrderEntity` / `QualityInspectionOrderEntityClass`
|
|
135
|
+
- `QualityInspectionOrderItemEntity` / `QualityInspectionOrderItemEntityClass`
|
|
136
|
+
- `QualityInspectionOrderChangeEntity` / `QualityInspectionOrderChangeEntityClass`
|
|
137
|
+
- 來源: `lib/models/extensions/quality-inspection-order/`
|
|
138
|
+
|
|
139
|
+
**報廢訂單 (Scrape Order)**
|
|
140
|
+
- `ScrapeOrderEntity` / `ScrapeOrderEntityClass`
|
|
141
|
+
- `ScrapeOrderItemEntity` / `ScrapeOrderItemEntityClass`
|
|
142
|
+
- `ScrapeOrderChangeEntity` / `ScrapeOrderChangeEntityClass`
|
|
143
|
+
- 來源: `lib/models/extensions/scrape-order/`
|
|
144
|
+
|
|
145
|
+
**另有輔助 provider**
|
|
146
|
+
- `ResolvedEntitiesProviders: Provider[]` — 由 `ModelsModule` 內部使用,把所有 [Symbol, EntityClass] pair 轉為 NestJS DI providers,供服務注入實體 class。
|
|
147
|
+
- 來源: `lib/models/models.module.ts`
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## Services(`@Injectable()`)
|
|
152
|
+
|
|
153
|
+
| Class | 主要方法 | 說明 | 來源 |
|
|
154
|
+
|---|---|---|---|
|
|
155
|
+
| `MaterialService<T>` | `createMaterial`, `updateMaterial`, `findMany`, `getConversionFactor` | 料號 CRUD | `lib/services/material.service.ts` |
|
|
156
|
+
| `UnitService` | (DataSource 直接操作) | 單位查詢 | `lib/services/unit.service.ts` |
|
|
157
|
+
| `BatchService<T>` | `getBatch`, `splitBatch`, `findMany` | 批號管理 | `lib/services/batch.service.ts` |
|
|
158
|
+
| `LoaderService<T, K>` | `createLoader`, `createBatchLoaders`, `updateLoader`, `createLoaderType`, `updateLoaderType`, `getSeq`, `findManyLoaders`, `findManyLoaderTypes` | 載具與類型 CRUD | `lib/services/loader.service.ts` |
|
|
159
|
+
| `LocationService<T>` | `createLocation`, `updateLocation`, `findMany` | 庫位 CRUD | `lib/services/location.service.ts` |
|
|
160
|
+
| `StockService<T>` | `findMany`, `findManyGroupedByMaterialId`, `findAggregatedStock`, `validateStockAvailability`, `findAggregatedStocks`, `findChangeLogs`, `resolveLoaderId`, `resolveLocationId` | 庫存查詢與聚合 | `lib/services/stock.service.ts` |
|
|
161
|
+
| `ReceiveInventoryOrderService<T>` | `createReceiveInventoryOrder`, `updateReceiveInventoryOrder`, `removeReceiveInventoryOrder`, `findMany`, `receive` | 入庫單管理 | `lib/services/receive-inventory-order.service.ts` |
|
|
162
|
+
| `ShipInventoryOrderService<T>` | `createShipInventoryOrder`, `updateShipInventoryOrder`, `removeShipInventoryOrder`, `findMany`, `addShipInventoryOrderItems`, `ship`, `cancelShip` | 出庫單管理 | `lib/services/ship-inventory-order.service.ts` |
|
|
163
|
+
| `TransferOrderService<T>` | `createTransferOrder`, `updateTransferOrder`, `findMany`, `transfer`, `cancelTransfer`, `removeTransferOrder` | 調撥單管理 | `lib/services/transfer-order.service.ts` |
|
|
164
|
+
| `TransferCustomerOrderService<T>` | `createTransferCustomerOrder`, `updateTransferCustomerOrder`, `returnTransferCustomerOrder` | 客戶調撥管理 | `lib/services/transfer-customer-order.service.ts` |
|
|
165
|
+
| `TransferVendorOrderService<T>` | `createTransferVendorOrder`, `updateTransferVendorOrder`, `returnTransferVendorOrder` | 供應商調撥管理 | `lib/services/transfer-vendor-order.service.ts` |
|
|
166
|
+
| `HoldInventoryOrderService<T>` | `createHoldInventoryOrder`, `updateHoldInventoryOrder`, `findMany`, `release` | 凍結庫存管理 | `lib/services/hold-inventory-order.service.ts` |
|
|
167
|
+
| `AllocateInventoryOrderService<T>` | `createAllocateInventoryOrder`, `updateAllocateInventoryOrder`, `deallocate`, `findMany` | 分配庫存管理 | `lib/services/allocate-inventory-order.service.ts` |
|
|
168
|
+
| `SplitBatchOrderService<T>` | `split` | 批號拆分 | `lib/services/split-batch-order.service.ts` |
|
|
169
|
+
| `MergeBatchOrderService<T>` | `merge` | 批號合併 | `lib/services/merge-batch-order.service.ts` |
|
|
170
|
+
| `ReclassifyInventoryOrderService<T>` | `reclassify` | 庫存轉料號 | `lib/services/reclassify-inventory-order.service.ts` |
|
|
171
|
+
| `ScrapeService<T>` | `scrape` | 庫存報廢 | `lib/services/scrape.service.ts` |
|
|
172
|
+
| `QualityInspectionOrderService<T>` | `inspect` | 品質檢驗 | `lib/services/quality-inspection-order.service.ts` |
|
|
173
|
+
| `SaleOrderService` | (DataSource 直接操作) | 銷售訂單查詢 | `lib/services/sale-order.service.ts` |
|
|
174
|
+
| `HelperService` | `getSeq` | 序號產生工具 | `lib/services/helper.service.ts` |
|
|
175
|
+
| `WarehouseMapDataService` | `onApplicationBootstrap` | 倉庫地圖資料初始化,implements `OnApplicationBootstrap` | `lib/services/warehouse-map.service.ts` |
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
## Interfaces / Types
|
|
180
|
+
|
|
181
|
+
### 模組選項
|
|
182
|
+
- `WmsModuleCoreModuleOptions` — `{ defaultLoaderSerialId: string; defaultLoaderTypeKey: string; defaultLocationKey: string; }`
|
|
183
|
+
- `WmsModuleCoreModuleAsyncOptions` — `WMSBaseModuleAsyncOptions & WmsModuleCoreModuleOptions`
|
|
184
|
+
- 來源: `lib/typings/core-module-options.ts`
|
|
185
|
+
|
|
186
|
+
### 服務輸入 (Service Input Types)
|
|
187
|
+
|
|
188
|
+
**載具**
|
|
189
|
+
- `CreateLoaderInput`, `UpdateLoaderInput` — 來源: `lib/typings/create-loader.input.ts`
|
|
190
|
+
- `CreateLoaderTypeInput`, `UpdateLoaderTypeInput` — 來源: `lib/typings/create-loader-type.input.ts`
|
|
191
|
+
- `FindLoaderInput<U>`, `FindLoaderTypeInput<U>` (extends `PaginationInput`) — 來源: `lib/typings/find-loader.input.ts`
|
|
192
|
+
|
|
193
|
+
**料號**
|
|
194
|
+
- `CreateMaterialInput`, `UpdateMaterialInput` — 來源: `lib/typings/create-material.input.ts`
|
|
195
|
+
- `CreateMaterialUnitInput` — 來源: `lib/typings/create-material-unit.input.ts`
|
|
196
|
+
- `FindMaterialInput<U>` (extends `PaginationInput`) — 來源: `lib/typings/find-material.input.ts`
|
|
197
|
+
|
|
198
|
+
**庫位**
|
|
199
|
+
- `CreateLocationInput`, `UpdateLocationInput` — 來源: `lib/typings/create-location.input.ts`
|
|
200
|
+
- `FindLocationInput<U extends object>` (extends `PaginationInput`) — 來源: `lib/typings/find-location.input.ts`
|
|
201
|
+
|
|
202
|
+
**庫存**
|
|
203
|
+
- `FindStockInput<U extends object>` (extends `PaginationInput`) — 來源: `lib/typings/find-stock.input.ts`
|
|
204
|
+
- `AggregatedStock`, `ValidateStockDeductionParams`, `ChangeLog` — 來源: `lib/typings/aggregated-stock.ts`
|
|
205
|
+
|
|
206
|
+
**批號**
|
|
207
|
+
- `SplitBatchInput`, `GetBatchInput` — 來源: `lib/typings/get-batch.input.ts`
|
|
208
|
+
- `MergeBatchInput` — 來源: `lib/typings/merge-batch.input.ts`
|
|
209
|
+
- `FindBatchInput<U extends object>` (extends `PaginationInput`) — 來源: `lib/typings/find-batch.input.ts`
|
|
210
|
+
|
|
211
|
+
**入庫單**
|
|
212
|
+
- `CreateReceiveInventoryOrderInput`, `CreateReceiveInventoryOrderItemInput`, `UpdateReceiveInventoryOrderInput`, `UpdateReceiveInventoryOrderItemInput` — 來源: `lib/typings/create-receive-inventory-order.input.ts`
|
|
213
|
+
- `FindReceiveInventoryOrderInput<T>` (extends `PaginationInput`) — 來源: `lib/typings/find-receive-inventory-order.input.ts`
|
|
214
|
+
- `ReceiveInventoryOrderInput` — 來源: `lib/typings/receive-inventory-order.input.ts`
|
|
215
|
+
|
|
216
|
+
**出庫單**
|
|
217
|
+
- `CreateShipInventoryOrderInput`, `CreateShipInventoryOrderItemInput`, `CreateShipInventoryOrderReferenceInput`, `CreateShipInventoryOrderItemsInput`, `UpdateShipInventoryOrderInput`, `UpdateShipInventoryOrderItemInput`, `UpdateShipInventoryOrderReferenceInput` — 來源: `lib/typings/create-ship-inventory-order.input.ts`
|
|
218
|
+
- `FindShipInventoryOrderInput<T>` (extends `PaginationInput`) — 來源: `lib/typings/find-ship-inventory-order.input.ts`
|
|
219
|
+
- `ShipInventoryOrderInput` — 來源: `lib/typings/ship-inventory-order.input.ts`
|
|
220
|
+
- `CancelShipInventoryOrderInput` — 來源: `lib/typings/cancel-ship-inventory-order.input.ts`
|
|
221
|
+
|
|
222
|
+
**調撥**
|
|
223
|
+
- `CreateTransferOrderInput`, `CreateTransferOrderItemInput`, `UpdateTransferOrderInput`, `UpdateTransferOrderItemInput` — 來源: `lib/typings/create-transfer-order.input.ts`
|
|
224
|
+
- `FindTransferOrderInput` (extends `PaginationInput`) — 來源: `lib/typings/find-transfer-order.input.ts`
|
|
225
|
+
- `TransferOrderInput` — 來源: `lib/typings/transfer-order.input.ts`
|
|
226
|
+
- `CancelTransferOrderInput` — 來源: `lib/typings/cancel-transfer-order.input.ts`
|
|
227
|
+
- `CreateTransferCustomerOrderInput`, `CreateTransferCustomerOrderItemInput`, `UpdateTransferCustomerOrderInput`, `UpdateTransferCustomerOrderItemInput` — 來源: `lib/typings/create-transfer-customer-order.input.ts`
|
|
228
|
+
- `CreateTransferVendorOrderInput`, `CreateTransferVendorOrderItemInput`, `UpdateTransferVendorOrderInput`, `UpdateTransferVendorOrderItemInput` — 來源: `lib/typings/create-transfer-vendor-order.input.ts`
|
|
229
|
+
|
|
230
|
+
**凍結/分配**
|
|
231
|
+
- `CreateHoldInventoryOrderInput`, `CreateHoldInventoryOrderItemInput`, `UpdateHoldInventoryOrderInput`, `UpdateHoldInventoryOrderItemInput` — 來源: `lib/typings/create-hold-inventory-order.input.ts`
|
|
232
|
+
- `FindHoldInventoryOrderInput` (extends `PaginationInput`) — 來源: `lib/typings/find-hold-inventory-order.input.ts`
|
|
233
|
+
- `ReleaseInventoryOrderItemInput` — 來源: `lib/typings/release-inventory-order.input.ts`
|
|
234
|
+
- `CreateAllocateInventoryOrderInput`, `CreateAllocateInventoryOrderItemInput`, `UpdateAllocateInventoryOrderInput`, `UpdateAllocateInventoryOrderItemInput` — 來源: `lib/typings/create-allocate-inventory-order.input.ts`
|
|
235
|
+
- `FindAllocateInventoryOrderInput` (extends `PaginationInput`) — 來源: `lib/typings/find-allocate-inventory-order.input.ts`
|
|
236
|
+
- `DeallocateInventoryOrderItemInput` — 來源: `lib/typings/deallocate-inventory-order.ts`
|
|
237
|
+
|
|
238
|
+
**其他**
|
|
239
|
+
- `ReclassifyInventoryOrderInput` — 來源: `lib/typings/reclassify-inventory-order.input.ts`
|
|
240
|
+
- `ScrapeInput` — 來源: `lib/typings/scrape.input.ts`
|
|
241
|
+
- `CreateInspectionOrderInput`, `CreateInspectionOrderItemInput` — 來源: `lib/typings/create-inspection-order.input.ts`
|
|
242
|
+
- `PaginationInput = { offset?: number; limit?: number; }` — 來源: `lib/typings/paginations.ts`
|
|
243
|
+
|
|
244
|
+
---
|
|
245
|
+
|
|
246
|
+
## Enums / Constants
|
|
247
|
+
|
|
248
|
+
### `StockStatus` (enum)
|
|
249
|
+
```ts
|
|
250
|
+
enum StockStatus {
|
|
251
|
+
PENDING_INSPECTION, INSPECTION_FAILED, HELD, IN_TRANSFER,
|
|
252
|
+
IN_SHIPMENT, ALLOCATED, VENDOR_INVENTORY, CUSTOMER_INVENTORY, FREE
|
|
253
|
+
}
|
|
254
|
+
```
|
|
255
|
+
來源: `lib/constants/stock-status.ts`
|
|
256
|
+
|
|
257
|
+
### `ChangeType` (enum)
|
|
258
|
+
```ts
|
|
259
|
+
enum ChangeType {
|
|
260
|
+
RECEIVED, IN_SHIPMENT, SHIPPED, IN_TRANSFER, TRANSFERRED,
|
|
261
|
+
VENDOR_TRANSFERRED, VENDOR_RETURNED, HELD, RELEASED,
|
|
262
|
+
CUSTOMER_HELD, CUSTOMER_RETURNED, SPLITTED, MERGED,
|
|
263
|
+
ALLOCATED, DEALLOCATED, RECLASSIFIED, SCRAPED
|
|
264
|
+
}
|
|
265
|
+
```
|
|
266
|
+
來源: `lib/constants/stock-status.ts`
|
|
267
|
+
|
|
268
|
+
### `ReceiveInventoryOrderStatus` (enum)
|
|
269
|
+
```ts
|
|
270
|
+
enum ReceiveInventoryOrderStatus { PENDING, PARTIAL_RECEIVED, RECEIVED, REMOVED }
|
|
271
|
+
```
|
|
272
|
+
來源: `lib/typings/find-receive-inventory-order.input.ts`
|
|
273
|
+
|
|
274
|
+
### `ShipInventoryOrderStatus` (enum)
|
|
275
|
+
```ts
|
|
276
|
+
enum ShipInventoryOrderStatus { PENDING, PARTIAL_SHIPPED, SHIPPED, REMOVED }
|
|
277
|
+
```
|
|
278
|
+
來源: `lib/typings/find-ship-inventory-order.input.ts`
|
|
279
|
+
|
|
280
|
+
---
|
|
281
|
+
|
|
282
|
+
## Symbols / DI Tokens
|
|
283
|
+
|
|
284
|
+
- `WMS_CORE_MODULE_OPTIONS` (`Symbol`) — 提供 `WmsModuleCoreModuleOptions` 給服務注入 — 來源: `lib/typings/core-module-options.ts`
|
|
285
|
+
- 所有 Entity Symbols(`UnitEntity`, `MaterialEntity`, `BatchEntity` 等,上方 Entity 表格中已列出) — 用於在自訂服務中注入對應的 TypeORM Entity class。
|
|
286
|
+
|
|
287
|
+
---
|
|
288
|
+
|
|
289
|
+
---
|
|
290
|
+
|
|
291
|
+
# @rytass/wms-module-graphql
|
|
292
|
+
|
|
293
|
+
## NestJS Modules
|
|
294
|
+
|
|
295
|
+
### `WmsModuleGraphqlModule`
|
|
296
|
+
- 用途: WMS GraphQL NestJS 動態模組,整合 Apollo GraphQL、DataLoader 與所有 Resolver/Query/Mutation。是消費端 `apps/api` 唯一需要 `imports: [...]` 的 WMS 模組。
|
|
297
|
+
- 來源: `lib/graphql.module.ts`
|
|
298
|
+
|
|
299
|
+
**`forRootAsync(options, gqlOptions): DynamicModule`**
|
|
300
|
+
```ts
|
|
301
|
+
static forRootAsync(
|
|
302
|
+
options: WmsModuleCoreModuleAsyncOptions,
|
|
303
|
+
// WMSBaseModuleAsyncOptions(Vault/DB 選項)
|
|
304
|
+
// + WmsModuleCoreModuleOptions:
|
|
305
|
+
// defaultLoaderSerialId: string — 庫存作業預設載具序號
|
|
306
|
+
// defaultLoaderTypeKey: string — 預設載具類型 key
|
|
307
|
+
// defaultLocationKey: string — 預設儲存位置 key
|
|
308
|
+
gqlOptions: GqlModuleAsyncOptions,
|
|
309
|
+
// 標準 @nestjs/graphql GqlModuleAsyncOptions,
|
|
310
|
+
// 例如 autoSchemaFile、context factory 等
|
|
311
|
+
// 注意:此方法會自動在 context 中注入 loaders(DataLoader instances):
|
|
312
|
+
// loaders.batchSingle — DataLoader<LoaderOptions<T>, T>
|
|
313
|
+
// loaders.batchMany — DataLoader<LoaderOptions<T>, T[]>
|
|
314
|
+
// loaders.batchManyWithPagination — DataLoader<LoaderOptionsWithPagination<T>, { items: T[]; total: number }>
|
|
315
|
+
): DynamicModule
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
---
|
|
319
|
+
|
|
320
|
+
## Resolvers(`@Resolver()` decorator class)
|
|
321
|
+
|
|
322
|
+
以下 Resolver 類別處理 GraphQL `@ResolveField`,解析關聯欄位(防止 N+1):
|
|
323
|
+
|
|
324
|
+
| Class | 功能 | 來源 |
|
|
325
|
+
|---|---|---|
|
|
326
|
+
| `LoaderResolver` | 解析 loader.type、loader.location、loader.totalQuantity | `lib/resolvers/loader.resolver.ts` |
|
|
327
|
+
| `LoaderTypeResolver` | 解析 loaderType.referencedQuantity | `lib/resolvers/loader-type.resolver.ts` |
|
|
328
|
+
| `LocationResolver` | 解析 location.mapData、location.parent、location.children | `lib/resolvers/location.resolver.ts` |
|
|
329
|
+
| `MaterialResolver` | 解析 material.aggregatedStock、material.materialUnits、material.baseUnit | `lib/resolvers/material.resolver.ts` |
|
|
330
|
+
| `StockResolver` | 解析 stock.material、stock.location、stock.batch | `lib/resolvers/stock.resolver.ts` |
|
|
331
|
+
| `AggregatedStockResolver` | 解析 aggregatedStock.id、.material、.batch、.location、.loader | `lib/resolvers/aggregated-stock.resolver.ts` |
|
|
332
|
+
| `ChangeLogResolver` | 解析 changeLog.material、.location、.batch | `lib/resolvers/change-log.resolver.ts` |
|
|
333
|
+
| `ReceiveInventoryOrderResolver` | 解析 order.items | `lib/resolvers/receive-inventory-order.resolver.ts` |
|
|
334
|
+
| `ReceiveInventoryOrderItemResolver` | 解析 item.material、.batch、.location、.loader、.receivedQuantity | `lib/resolvers/receive-inventory-order.resolver.ts` |
|
|
335
|
+
| `ShipInventoryOrderResolver` | 解析 order.items、order.references | `lib/resolvers/ship-inventory-order.resolver.ts` |
|
|
336
|
+
| `ShipInventoryOrderItemResolver` | 解析 item.material、.batch、.saleId、.saleSerialId、.location、.loader、.shippedQuantity | `lib/resolvers/ship-inventory-order.resolver.ts` |
|
|
337
|
+
| `ShipInventoryOrderReferenceResolver` | 解析 reference 關聯欄位 | `lib/resolvers/ship-inventory-order.resolver.ts` |
|
|
338
|
+
| `TransferOrderResolver` | 解析 order.items、.targetLocation、.targetLoader | `lib/resolvers/transfer-order.resolver.ts` |
|
|
339
|
+
| `TransferOrderItemResolver` | 解析 item.material、.batch、.location、.loader、.saleId、.saleSerialId | `lib/resolvers/transfer-order.resolver.ts` |
|
|
340
|
+
| `HoldInventoryOrderResolver` | 解析 order.items | `lib/resolvers/hold-inventory-order.resolver.ts` |
|
|
341
|
+
| `AllocateInventoryOrderResolver` | 解析 order.items | `lib/resolvers/allocate-inventory-order.resolver.ts` |
|
|
342
|
+
| `TransferCustomerOrderResolver` | 解析 order.items | `lib/resolvers/transfer-customer-order.resolver.ts` |
|
|
343
|
+
| `TransferVendorOrderResolver` | 解析 order.items | `lib/resolvers/transfer-vendor-order.resolver.ts` |
|
|
344
|
+
| `SplitBatchResolver` | 解析 order.items | `lib/resolvers/split-batch.resolver.ts` |
|
|
345
|
+
| `MergeBatchOrderResolver` | 解析 order.items | `lib/resolvers/merge-batch.resolver.ts` |
|
|
346
|
+
| `MapRangeUnionResolver` | 解析 mapRange.location | `lib/resolvers/warehouse-map.resolver.ts` |
|
|
347
|
+
|
|
348
|
+
---
|
|
349
|
+
|
|
350
|
+
## Queries(`@Query()` methods,放在 Query class 內)
|
|
351
|
+
|
|
352
|
+
| Class | GraphQL Query 欄位 | 回傳型別 | 來源 |
|
|
353
|
+
|---|---|---|---|
|
|
354
|
+
| `UnitQuery` | `units` | `[UnitDto]` | `lib/queries/unit.query.ts` |
|
|
355
|
+
| `LoaderQuery` | `loader`, `loaders`, `loaderType`, `loaderTypes`, `loaderUnits`, `availableLoaders` | `LoaderDto`, `Loaders`, `LoaderTypeDto`, `LoaderTypes`, `[LoaderUnitDto]`, `[LoaderDto]` | `lib/queries/loader.query.ts` |
|
|
356
|
+
| `MaterialQuery` | `material`, `materials` | `MaterialDto`, `Materials` | `lib/queries/material.query.ts` |
|
|
357
|
+
| `StockQuery` | `stock`, `stocks`, `stocksGroupedByMaterial`, `aggregatedStocks`, `changeLogs` | `StockDto`, `Stocks`, `Materials`, `AggregatedStocks`, `ChangeLogs` | `lib/queries/stock.query.ts` |
|
|
358
|
+
| `BatchQuery` | `batches` | `Batches` | `lib/queries/batch.query.ts` |
|
|
359
|
+
| `LocationQuery` | `location`, `locations` | `LocationDto`, `Locations` | `lib/queries/location.query.ts` |
|
|
360
|
+
| `ReceiveInventoryOrderQuery` | `receiveInventoryOrder`, `receiveInventoryOrders` | `ReceiveInventoryOrderDto`, `ReceiveInventoryOrders` | `lib/queries/recieve-inventory-order.query.ts` |
|
|
361
|
+
| `ShipInventoryOrderQuery` | `shipInventoryOrder`, `shipInventoryOrders` | `ShipInventoryOrderDto`, `ShipInventoryOrders` | `lib/queries/ship-inventory-order.query.ts` |
|
|
362
|
+
| `TransferOrderQuery` | `transferOrders`, `transferOrder` | `TransferOrders`, `TransferOrderDto` | `lib/queries/transfer-order.query.ts` |
|
|
363
|
+
| `HoldInventoryOrderQuery` | `holdInventoryOrders` | `HoldInventoryOrders` | `lib/queries/hold-inventory-order.query.ts` |
|
|
364
|
+
| `AllocateInventoryOrderQuery` | `allocateInventoryOrders` | `AllocateInventoryOrders` | `lib/queries/allocate-inventory-order.query.ts` |
|
|
365
|
+
| `SaleOrderQuery` | `saleOrderDistinctIds`, `saleOrders` | `[String]` | `lib/queries/sale-order.query.ts` |
|
|
366
|
+
| `WarehouseMapDataQuery` | `mapData` | `MapDataDto` | `lib/queries/warehouse-map.query.ts` |
|
|
367
|
+
|
|
368
|
+
---
|
|
369
|
+
|
|
370
|
+
## Mutations(`@Mutation()` methods)
|
|
371
|
+
|
|
372
|
+
| Class | Mutation 方法 | 說明 | 來源 |
|
|
373
|
+
|---|---|---|---|
|
|
374
|
+
| `LoaderMutation` | `createLoader`, `createBatchLoader`, `updateLoader`, `createLoaderType`(方法名未確認), `updateLoaderType` | 載具與類型 | `lib/mutations/loader.mutation.ts` |
|
|
375
|
+
| `LocationMutation` | `createLocation`, `updateLocation` | 庫位 | `lib/mutations/location.mutation.ts` |
|
|
376
|
+
| `MaterialMutation` | `createMaterial`, `updateMaterial` | 料號 | `lib/mutations/material.mutation.ts` |
|
|
377
|
+
| `ReceiveInventoryOrderMutation` | `createReceiveInventoryOrder`, `updateReceiveInventoryOrder`, `receive` | 入庫單 | `lib/mutations/receive-inventory-order.mutation.ts` |
|
|
378
|
+
| `ShipInventoryOrderMutation` | `createShipInventoryOrder`, `updateShipInventoryOrder`, `ship`, `cancelShip` | 出庫單 | `lib/mutations/ship-inventory-order.mutation.ts` |
|
|
379
|
+
| `TransferOrderMutation` | `createTransferOrder`, `updateTransferOrder`, `transfer`, `cancelTransfer` | 調撥單 | `lib/mutations/transfer-order.mutation.ts` |
|
|
380
|
+
| `HoldInventoryOrderMutation` | `createHoldInventoryOrder`, `updateHoldInventoryOrder`, `release` | 凍結庫存 | `lib/mutations/hold-inventory-order.mutation.ts` |
|
|
381
|
+
| `AllocateInventoryOrderMutation` | `createAllocateInventoryOrder`, `updateAllocateInventoryOrder`, `deallocate` | 分配庫存 | `lib/mutations/allocate-inventory-order.mutation.ts` |
|
|
382
|
+
| `TransferCustomerOrderMutation` | `createTransferCustomerOrder`, `updateTransferCustomerOrder`, `returnTransferCustomerOrder` | 客戶調撥 | `lib/mutations/transfer-customer-order.mutation.ts` |
|
|
383
|
+
| `TransferVendorOrderMutation` | `createTransferVendorOrder`, `updateTransferVendorOrder`, `returnTransferVendorOrder` | 供應商調撥 | `lib/mutations/transfer-vendor-order.mutation.ts` |
|
|
384
|
+
| `SplitBatchMutation` | `splitBatch` | 拆批 | `lib/mutations/split-batch.mutation.ts` |
|
|
385
|
+
| `MergeBatchMutation` | `mergeBatch` | 併批 | `lib/mutations/merge-batch.mutation.ts` |
|
|
386
|
+
| `ReclassifyInventoryOrderMutation` | `reclassifyInventoryOrder` | 轉料號 | `lib/mutations/reclassify-inventory-order.mutation.ts` |
|
|
387
|
+
| `ScrapeMutation` | `scrapeMaterials` | 報廢 | `lib/mutations/scrape-order.mutation.ts` |
|
|
388
|
+
| `QualityInspectionOrderMutation` | `inspectMaterials` | 品質檢驗 | `lib/mutations/quality-inspection-order.mutation.ts` |
|
|
389
|
+
| `WarehouseMapMutation` | `updateWarehouseMap` | 倉庫地圖 | `lib/mutations/warehouse-map.mutation.ts` |
|
|
390
|
+
|
|
391
|
+
---
|
|
392
|
+
|
|
393
|
+
## GraphQL DTOs(`@ObjectType()` class)
|
|
394
|
+
|
|
395
|
+
### 主檔 DTOs
|
|
396
|
+
| Class | Paginated Wrapper | 說明 | 來源 |
|
|
397
|
+
|---|---|---|---|
|
|
398
|
+
| `UnitDto` | — | 單位 | `lib/dto/unit.dto.ts` |
|
|
399
|
+
| `LoaderDto` | `Loaders` | 載具 | `lib/dto/loader.dto.ts` |
|
|
400
|
+
| `LoaderTypeDto` | `LoaderTypes` | 載具類型 | `lib/dto/loader-type.dto.ts` |
|
|
401
|
+
| `LoaderUnitDto` | — | 載具單位 | `lib/dto/loader-unit.dto.ts` |
|
|
402
|
+
| `MaterialDto` | `Materials` | 料號 | `lib/dto/material.dto.ts` |
|
|
403
|
+
| `MaterialUnitDto` | `MaterialUnits` | 料號換算單位 | `lib/dto/material-unit.dto.ts` |
|
|
404
|
+
| `LocationDto` | `Locations` | 庫位 | `lib/dto/location.dto.ts` |
|
|
405
|
+
| `StockDto` | `Stocks` | 庫存 | `lib/dto/stock.dto.ts` |
|
|
406
|
+
| `SaleOrderDto` | — | 銷售訂單 | `lib/dto/sale-order.dto.ts` |
|
|
407
|
+
| `BatchDto` | `Batches` | 批號 | `lib/dto/batch.dto.ts` |
|
|
408
|
+
|
|
409
|
+
### 訂單 DTOs
|
|
410
|
+
| Class | Paginated Wrapper | 說明 | 來源 |
|
|
411
|
+
|---|---|---|---|
|
|
412
|
+
| `ReceiveInventoryOrderDto` | `ReceiveInventoryOrders` | 入庫單 | `lib/dto/receive-inventory-order.dto.ts` |
|
|
413
|
+
| `ReceiveInventoryOrderItemDto` | `ReceiveInventoryOrderItems` | 入庫單明細 | `lib/dto/receive-inventory-order-item.dto.ts` |
|
|
414
|
+
| `ShipInventoryOrderDto` | `ShipInventoryOrders` | 出庫單 | `lib/dto/ship-inventory-order.dto.ts` |
|
|
415
|
+
| `ShipInventoryOrderItemDto` | `ShipInventoryOrderItems` | 出庫單明細 | `lib/dto/ship-inventory-order-item.dto.ts` |
|
|
416
|
+
| `ShipInventoryOrderReferenceDto` | — | 出庫單參考 | `lib/dto/ship-inventory-order-reference.dto.ts` |
|
|
417
|
+
| `TransferOrderDto` | `TransferOrders` | 調撥單 | `lib/dto/transfer-order.dto.ts` |
|
|
418
|
+
| `TransferOrderItemDto` | `TransferOrderItems` | 調撥單明細 | `lib/dto/transfer-order-item.dto.ts` |
|
|
419
|
+
| `TransferCustomerOrderDto` | `TransferCustomerOrders` | 客戶調撥單 | `lib/dto/transfer-customer-order.dto.ts` |
|
|
420
|
+
| `TransferCustomerOrderItemDto` | `TransferCustomerOrderItems` | 客戶調撥單明細 | `lib/dto/transfer-customer-order-item.dto.ts` |
|
|
421
|
+
| `TransferVendorOrderDto` | `TransferVendorOrders` | 供應商調撥單 | `lib/dto/transfer-vendor-order.dto.ts` |
|
|
422
|
+
| `TransferVendorOrderItemDto` | `TransferVendorOrderItems` | 供應商調撥單明細 | `lib/dto/transfer-vendor-order-item.dto.ts` |
|
|
423
|
+
| `HoldInventoryOrderDto` | `HoldInventoryOrders` | 凍結庫存單 | `lib/dto/hold-inventory-order.dto.ts` |
|
|
424
|
+
| `HoldInventoryOrderItemDto` | `HoldInventoryOrderItems` | 凍結庫存單明細 | `lib/dto/hold-inventory-order-item.dto.ts` |
|
|
425
|
+
| `AllocateInventoryOrderDto` | `AllocateInventoryOrders` | 分配庫存單 | `lib/dto/allocate-inventory-order.dto.ts` |
|
|
426
|
+
| `AllocateInventoryOrderItemDto` | — | 分配庫存單明細 | `lib/dto/allocate-inventory-order-item.dto.ts` |
|
|
427
|
+
| `SplitBatchOrderDto` | — | 拆批單 | `lib/dto/split-batch-order.dto.ts` |
|
|
428
|
+
| `SplitBatchOrderItemDto` | — | 拆批單明細 | `lib/dto/split-batch-order.dto.ts` |
|
|
429
|
+
| `MergeBatchOrderDto` | — | 併批單 | `lib/dto/merge-batch-order.dto.ts` |
|
|
430
|
+
| `MergeBatchOrderItemDto` | — | 併批單明細 | `lib/dto/merge-batch-order.dto.ts` |
|
|
431
|
+
| `ReclassifyInventoryOrderDto` | — | 轉料號單 | `lib/dto/reclassify-inventory-order.dto.ts` |
|
|
432
|
+
| `ReclassifyInventoryOrderItemDto` | — | 轉料號單明細 | `lib/dto/reclassify-inventory-order.dto.ts` |
|
|
433
|
+
| `QualityInspectionOrderDto` | `QualityInspectionOrders` | 品質檢驗單 | `lib/dto/quality-inspection-order.dto.ts` |
|
|
434
|
+
| `QualityInspectionOrderItemDto` | — | 品質檢驗單明細 | `lib/dto/quality-inspection-order-item.dto.ts` |
|
|
435
|
+
| `ScrapeOrderDto` | `ScrapeOrders` | 報廢單 | `lib/dto/scrape-order.dto.ts` |
|
|
436
|
+
| `ScrapeOrderItemDto` | `ScrapeOrderItems` | 報廢單明細 | `lib/dto/scrape-order-item.dto.ts` |
|
|
437
|
+
| `MapPolygonRangePointDto` | — | 地圖多邊形頂點 | `lib/dto/warehouse-map.dto.ts` |
|
|
438
|
+
| `MapBackgroundDto` | — | 地圖背景圖層 | `lib/dto/warehouse-map.dto.ts` |
|
|
439
|
+
|
|
440
|
+
---
|
|
441
|
+
|
|
442
|
+
## Input Types(`@InputType()` / `@ArgsType()` class)
|
|
443
|
+
|
|
444
|
+
位於 `lib/inputs/`,共 70+ 個。以下列出主要類別:
|
|
445
|
+
|
|
446
|
+
**Pagination**
|
|
447
|
+
- `PaginationArgs` (`@ArgsType`) — `{ offset?, limit? }` — 來源: `lib/inputs/pagination.args.ts`
|
|
448
|
+
|
|
449
|
+
**載具**
|
|
450
|
+
- `CreateLoaderArgs`, `UpdateLoaderArgs` (`@ArgsType`) — 來源: `lib/inputs/create-loader.args.ts`
|
|
451
|
+
- `CreateLoaderTypeArgs`, `UpdateLoaderTypeArgs` (`@ArgsType`) — 來源: `lib/inputs/create-loader-type.args.ts`
|
|
452
|
+
- `FindLoaderArgs`, `FindLoaderTypeArgs` (extends `PaginationArgs`) — 來源: `lib/inputs/find-loader.args.ts`, `find-loader-type.args.ts`
|
|
453
|
+
|
|
454
|
+
**料號**
|
|
455
|
+
- `CreateMaterialArgs`, `UpdateMaterialArgs` (`@ArgsType`) — 來源: `lib/inputs/create-material.args.ts`
|
|
456
|
+
- `CreateMaterialUnitArgs` (`@InputType`) — 來源: `lib/inputs/create-material-unit.args.ts`
|
|
457
|
+
- `FindMaterialArgs` (extends `PaginationArgs`) — 來源: `lib/inputs/find-material.args.ts`
|
|
458
|
+
|
|
459
|
+
**庫位**
|
|
460
|
+
- `CreateLocationArgs`, `UpdateLocationArgs` (`@ArgsType`) — 來源: `lib/inputs/create-location.args.ts`
|
|
461
|
+
- `FindLocationArgs` (extends `PaginationArgs`) — 來源: `lib/inputs/find-location.args.ts`
|
|
462
|
+
|
|
463
|
+
**庫存**
|
|
464
|
+
- `FindStockArgs` (extends `PaginationArgs`) — 來源: `lib/inputs/find-stock.args.ts`
|
|
465
|
+
- `DateRangeArgs` (`@InputType`) — 來源: `lib/inputs/date-range.args.ts`
|
|
466
|
+
|
|
467
|
+
**批號**
|
|
468
|
+
- `FindBatchArgs` (extends `PaginationArgs`) — 來源: `lib/inputs/find-batch.args.ts`
|
|
469
|
+
- `SplitBatchArgs`, `SplitBatchItemInput` — 來源: `lib/inputs/split-batch.args.ts`
|
|
470
|
+
- `MergeBatchArgs`, `MergeBatchItemInput` — 來源: `lib/inputs/merge-batch.args.ts`
|
|
471
|
+
|
|
472
|
+
**入庫單**
|
|
473
|
+
- `CreateReceiveInventoryOrderArgs`, `UpdateReceiveInventoryOrderArgs` (`@ArgsType`) — 來源: `lib/inputs/create-receive-inventory-order.args.ts`
|
|
474
|
+
- `CreateReceiveInventoryOrderItemArgs`, `UpdateReceiveInventoryOrderItemArgs` (`@InputType`) — 來源: `lib/inputs/create-receive-inventory-order-item.args.ts`
|
|
475
|
+
- `FindReceiveInventoryOrderArgs` (extends `PaginationArgs`) — 來源: `lib/inputs/find-receive-inventory-order.args.ts`
|
|
476
|
+
- `ReceiveOrderArgs` (`@InputType`) — 來源: `lib/inputs/receive-order.args.ts`
|
|
477
|
+
|
|
478
|
+
**出庫單**
|
|
479
|
+
- `CreateShipInventoryOrderArgs`, `UpdateShipInventoryOrderArgs` (`@ArgsType`) — 來源: `lib/inputs/create-ship-inventory-order.args.ts`
|
|
480
|
+
- `CreateShipInventoryOrderItemArgs`, `UpdateShipInventoryOrderItemArgs` (`@InputType`) — 來源: `lib/inputs/create-ship-inventory-order-item.args.ts`
|
|
481
|
+
- `CreateShipInventoryOrderReferenceArgs`, `UpdateShipInventoryOrderReferenceArgs` (`@InputType`) — 來源: `lib/inputs/create-ship-inventory-order-reference.args.ts`
|
|
482
|
+
- `FindShipInventoryOrderArgs` (extends `PaginationArgs`) — 來源: `lib/inputs/find-ship-inventory-order.args.ts`
|
|
483
|
+
- `ShipOrderArgs` (`@InputType`) — 來源: `lib/inputs/ship-order.args.ts`
|
|
484
|
+
- `CancelShipOrderArgs` (`@InputType`) — 來源: `lib/inputs/cancel-ship-order.args.ts`
|
|
485
|
+
|
|
486
|
+
**調撥**
|
|
487
|
+
- `CreateTransferOrderArgs`, `UpdateTransferOrderArgs` (`@ArgsType`) — 來源: `lib/inputs/create-transfer-order.args.ts`
|
|
488
|
+
- `CreateTransferOrderItemArgs`, `UpdateTransferOrderItemArgs` (`@InputType`) — 來源: `lib/inputs/create-transfer-order-item.args.ts`
|
|
489
|
+
- `FindTransferOrderArgs` (extends `PaginationArgs`) — 來源: `lib/inputs/find-transfer-order.args.ts`
|
|
490
|
+
- `TransferOrderArgs` (`@InputType`) — 來源: `lib/inputs/transfer-order.args.ts`
|
|
491
|
+
- `CancelTransferOrderArgs` (`@InputType`) — 來源: `lib/inputs/cancel-transfer-order.args.ts`
|
|
492
|
+
- `CreateTransferCustomerOrderArgs`, `UpdateTransferCustomerOrderArgs`, `CreateTransferCustomerOrderItemArgs`, `UpdateTransferCustomerOrderItemArgs` — 來源: `lib/inputs/create-transfer-customer-order*.args.ts`
|
|
493
|
+
- `CreateTransferVendorOrderArgs`, `UpdateTransferVendorOrderArgs`, `CreateTransferVendorOrderItemArgs`, `UpdateTransferVendorOrderItemArgs` — 來源: `lib/inputs/create-transfer-vendor-order*.args.ts`
|
|
494
|
+
- `ReturnTransferCustomerOrderArgs`, `ReturnTransferVendorOrderArgs` — 來源: `lib/inputs/return-transfer-*-order.args.ts`
|
|
495
|
+
|
|
496
|
+
**凍結/分配**
|
|
497
|
+
- `CreateHoldInventoryOrderArgs`, `UpdateHoldInventoryOrderArgs` (`@ArgsType`) — 來源: `lib/inputs/create-hold-inventory-order.args.ts`
|
|
498
|
+
- `CreateHoldInventoryOrderItemArgs`, `UpdateHoldInventoryOrderItemArgs` (`@InputType`) — 來源: `lib/inputs/create-hold-inventory-order-item.args.ts`
|
|
499
|
+
- `FindHoldInventoryOrderArgs` (extends `PaginationArgs`) — 來源: `lib/inputs/find-hold-inventory-order.args.ts`
|
|
500
|
+
- `ReleaseOrderArgs` (`@InputType`) — 來源: `lib/inputs/release-order.args.ts`
|
|
501
|
+
- `CreateAllocateInventoryOrderArgs`, `UpdateAllocateInventoryOrderArgs` (`@ArgsType`) — 來源: `lib/inputs/create-allocate-inventory-order.args.ts`
|
|
502
|
+
- `CreateAllocateInventoryOrderItemArgs`, `UpdateAllocateInventoryOrderItemArgs` (`@InputType`) — 來源: `lib/inputs/create-allocate-inventory-order-item.args.ts`
|
|
503
|
+
- `FindAllocateInventoryOrderArgs` (extends `PaginationArgs`) — 來源: `lib/inputs/find-allocate-inventory-order.args.ts`
|
|
504
|
+
- `DeallocateOrderArgs` (`@InputType`) — 來源: `lib/inputs/deallocate-order.args.ts`
|
|
505
|
+
|
|
506
|
+
**其他**
|
|
507
|
+
- `ReclassifyInventoryOrderArgs`, `ReclassifyInventoryOrderItemInput` — 來源: `lib/inputs/reclassify-inventory-order.args.ts`
|
|
508
|
+
- `ScrapeOrderArgs`, `ScrapeOrderItemInput` — 來源: `lib/inputs/scrape-order.args.ts`
|
|
509
|
+
- `CreateQualityInspectionOrderArgs`, `CreateQualityInspectionOrderItemArgs` — 來源: `lib/inputs/create-quality-inspection-order.args.ts`
|
|
510
|
+
- `FindSaleOrderArgs` (extends `PaginationArgs`) — 來源: `lib/inputs/find-sale-order.args.ts`
|
|
511
|
+
- `MapBackgroundInput`, `MapPolygonRangePointInput`, `MapRangeInput` — 來源: `lib/inputs/update-warehouse-map.args.ts`
|
|
512
|
+
|
|
513
|
+
---
|
|
514
|
+
|
|
515
|
+
## DataLoader Helpers
|
|
516
|
+
|
|
517
|
+
### `LoaderService` (`@Injectable()`)
|
|
518
|
+
- 用途: LRU 快取 DataLoader 工廠,防止 GraphQL N+1 查詢。
|
|
519
|
+
- 來源: `lib/helpers/loader.service.ts`
|
|
520
|
+
|
|
521
|
+
```ts
|
|
522
|
+
class LoaderService {
|
|
523
|
+
batchEntity<T>(): DataLoader<LoaderOptions<T>, T>
|
|
524
|
+
batchEntities<T>(): DataLoader<LoaderOptions<T>, T[]>
|
|
525
|
+
batchEntitiesWithPagination<T>(): DataLoader<LoaderOptionsWithPagination<T>, { items: T[]; total: number }>
|
|
526
|
+
}
|
|
527
|
+
```
|
|
528
|
+
|
|
529
|
+
### `LoaderOptions<K>` (interface)
|
|
530
|
+
```ts
|
|
531
|
+
interface LoaderOptions<K> {
|
|
532
|
+
__entity: ObjectLiteral; // TypeORM entity class
|
|
533
|
+
__from: FindOptionsWhere<K>; // 查詢條件(主鍵)
|
|
534
|
+
__conditions?: (qb: SelectQueryBuilder) => SelectQueryBuilder; // 可選 query builder hook
|
|
535
|
+
__seed?: string; // cache key 用的額外 seed
|
|
536
|
+
__pagination?: { offset: number; limit: number };
|
|
537
|
+
}
|
|
538
|
+
```
|
|
539
|
+
來源: `lib/helpers/loader.service.ts`
|
|
540
|
+
|
|
541
|
+
### `LoaderOptionsWithPagination<K>` (interface)
|
|
542
|
+
- 繼承 `LoaderOptions<K>`,`__pagination` 為必填。
|
|
543
|
+
- 來源: `lib/helpers/loader.service.ts`
|
|
544
|
+
|
|
545
|
+
### `LoaderType<T>` (interface)
|
|
546
|
+
```ts
|
|
547
|
+
interface LoaderType<T> {
|
|
548
|
+
loaders: {
|
|
549
|
+
batchMany: DataLoader<LoaderOptions<T>, T[]>;
|
|
550
|
+
batchSingle: DataLoader<LoaderOptions<T>, T>;
|
|
551
|
+
batchManyWithPagination: DataLoader<LoaderOptionsWithPagination<T>, { items: T[]; total: number }>;
|
|
552
|
+
};
|
|
553
|
+
}
|
|
554
|
+
```
|
|
555
|
+
- 用途: 定義 GraphQL context 中 `loaders` 欄位的型別。
|
|
556
|
+
- 來源: `lib/helpers/dataloader.type.ts`
|
|
557
|
+
|
|
558
|
+
### `HelperModule`
|
|
559
|
+
- 用途: `@Global()` NestJS 模組,提供 `LoaderService`;由 `WmsModuleGraphqlModule.forRootAsync` 自動 import。
|
|
560
|
+
- 來源: `lib/helpers/helper.module.ts`
|
|
561
|
+
|
|
562
|
+
### `QueryPath`
|
|
563
|
+
- 用途: NestJS param decorator,從 GraphQL ExecutionContext 萃取目前 resolver 路徑字串(如 `"materials/aggregatedStock"`)。
|
|
564
|
+
- 來源: `lib/helpers/query-path.ts`
|
|
565
|
+
|
|
566
|
+
---
|
|
567
|
+
|
|
568
|
+
---
|
|
569
|
+
|
|
570
|
+
# @rytass/wms-module-react
|
|
571
|
+
|
|
572
|
+
> **Public API vs Library Internals**: this package exposes a curated public barrel
|
|
573
|
+
> (`src/index.ts`). Only the symbols listed under **Public API (in barrel)** below can be
|
|
574
|
+
> imported directly from `@rytass/wms-module-react`. Everything listed under
|
|
575
|
+
> **Library Internals** exists in the source tree but is **not** barrel-exported; attempting to
|
|
576
|
+
> import those symbols will result in a module-not-found / tree-shaker error.
|
|
577
|
+
|
|
578
|
+
---
|
|
579
|
+
|
|
580
|
+
## Public API (in barrel)
|
|
581
|
+
|
|
582
|
+
### Apollo Client
|
|
583
|
+
|
|
584
|
+
#### `createApolloClient(): ApolloClient<NormalizedCacheObject>`
|
|
585
|
+
- Purpose: Factory function that creates an Apollo client with error link, auth link (extensible for Authorization headers), and HttpLink pointing at `/graphql`.
|
|
586
|
+
- Source: `apollo/index.ts`
|
|
587
|
+
|
|
588
|
+
```ts
|
|
589
|
+
export const createApolloClient: () => ApolloClient<NormalizedCacheObject>
|
|
590
|
+
```
|
|
591
|
+
|
|
592
|
+
As of 0.1.2, this factory takes **no parameters** and returns a fresh instance with `/graphql`
|
|
593
|
+
as the endpoint URI (the same as the default singleton). A URL/header override parameter is
|
|
594
|
+
planned for 0.2.0 (semver minor, non-breaking addition).
|
|
595
|
+
|
|
596
|
+
#### `ApolloClient` (named export — singleton instance)
|
|
597
|
+
- Purpose: The pre-built Apollo client singleton created by `createApolloClient()`. Re-exported
|
|
598
|
+
as a **named** export (`export { ..., default as ApolloClient }`), so consumers must use a
|
|
599
|
+
**named import**.
|
|
600
|
+
- Source: `apollo/index.ts`
|
|
601
|
+
|
|
602
|
+
```ts
|
|
603
|
+
// Correct — named import:
|
|
604
|
+
import { ApolloClient, createApolloClient } from '@rytass/wms-module-react';
|
|
605
|
+
<ApolloProvider client={ApolloClient}>...</ApolloProvider>
|
|
606
|
+
|
|
607
|
+
// Wrong — default import (will be undefined):
|
|
608
|
+
// import ApolloClient from '@rytass/wms-module-react';
|
|
609
|
+
```
|
|
610
|
+
|
|
611
|
+
---
|
|
612
|
+
|
|
613
|
+
### Providers (Context Providers)
|
|
614
|
+
|
|
615
|
+
#### `DialogProvider`
|
|
616
|
+
- Purpose: Global confirmation dialog Context Provider. Pair with `useDialog()` (internal) to
|
|
617
|
+
open modal confirmation dialogs from any descendant component.
|
|
618
|
+
- Source: `components/dialog/DialogProvider.tsx`
|
|
619
|
+
|
|
620
|
+
```tsx
|
|
621
|
+
import { DialogProvider } from '@rytass/wms-module-react';
|
|
622
|
+
<DialogProvider><App /></DialogProvider>
|
|
623
|
+
```
|
|
624
|
+
|
|
625
|
+
#### `ModalProvider`
|
|
626
|
+
- Purpose: Global programmable Modal Context Provider.
|
|
627
|
+
- Source: `components/modal/ModalProvider.tsx`
|
|
628
|
+
|
|
629
|
+
```tsx
|
|
630
|
+
import { ModalProvider } from '@rytass/wms-module-react';
|
|
631
|
+
<ModalProvider><App /></ModalProvider>
|
|
632
|
+
```
|
|
633
|
+
|
|
634
|
+
#### `InventoryActionsProvider`
|
|
635
|
+
- Purpose: Global context for managing the list of selected inventory items and the current
|
|
636
|
+
operation type. Required by all inventory action flows.
|
|
637
|
+
- Source: `components/inventoryActions/InventoryActionsProvider.tsx`
|
|
638
|
+
|
|
639
|
+
```tsx
|
|
640
|
+
import { InventoryActionsProvider } from '@rytass/wms-module-react';
|
|
641
|
+
<InventoryActionsProvider><App /></InventoryActionsProvider>
|
|
642
|
+
```
|
|
643
|
+
|
|
644
|
+
---
|
|
645
|
+
|
|
646
|
+
### Page-level Components (for Next.js Pages-Router shells)
|
|
647
|
+
|
|
648
|
+
All 11 page components take no props (fully self-contained) and are default-exported from their
|
|
649
|
+
source file, re-exported as named exports from the barrel.
|
|
650
|
+
|
|
651
|
+
| Named Export | Route |
|
|
652
|
+
|---------------------------|-----------------------------|
|
|
653
|
+
| `ChangeHistory` | `/change-history` |
|
|
654
|
+
| `InventoryCount` | `/inventory-count` |
|
|
655
|
+
| `InventoryList` | `/inventory-list` |
|
|
656
|
+
| `InventoryMovement` | `/inventory-movement` |
|
|
657
|
+
| `LabelSearch` | `/label-search` |
|
|
658
|
+
| `LoadersManagement` | `/loaders-management` |
|
|
659
|
+
| `LocationsManagement` | `/locations-management` |
|
|
660
|
+
| `Maps` | `/maps` |
|
|
661
|
+
| `MaterialsManagement` | `/materials-management` |
|
|
662
|
+
| `ReceiveInventoryOrders` | `/receive-inventory-orders` |
|
|
663
|
+
| `ShipInventoryOrders` | `/ship-inventory-orders` |
|
|
664
|
+
|
|
665
|
+
```tsx
|
|
666
|
+
import { MaterialsManagement } from '@rytass/wms-module-react';
|
|
667
|
+
export default function Page() { return <MaterialsManagement />; }
|
|
668
|
+
```
|
|
669
|
+
|
|
670
|
+
---
|
|
671
|
+
|
|
672
|
+
### Sub-page Components (for dynamic route shells)
|
|
673
|
+
|
|
674
|
+
| Named Export | Dynamic Route |
|
|
675
|
+
|------------------------------|--------------------------------------------------|
|
|
676
|
+
| `CreateLoader` | `/loaders-management/create` |
|
|
677
|
+
| `EditReceiveInventoryOrder` | `/receive-inventory-orders/[id]/edit` |
|
|
678
|
+
| `ViewReceiveInventoryOrder` | `/receive-inventory-orders/[id]/view` |
|
|
679
|
+
| `EditShipInventoryOrder` | `/ship-inventory-orders/[id]/edit` |
|
|
680
|
+
| `ViewShipInventoryOrder` | `/ship-inventory-orders/[id]/view` |
|
|
681
|
+
| `EditTransferOrder` | `/inventory-movement/transfer-order/[id]` |
|
|
682
|
+
|
|
683
|
+
---
|
|
684
|
+
|
|
685
|
+
### Generic Hooks
|
|
686
|
+
|
|
687
|
+
#### `useRoutes()`
|
|
688
|
+
- Source: `hooks/useRoutes.ts`
|
|
689
|
+
```ts
|
|
690
|
+
useRoutes(): Array<{
|
|
691
|
+
title: string;
|
|
692
|
+
icon: IconDefinition;
|
|
693
|
+
href?: NextPath;
|
|
694
|
+
children?: Array<{ title: string; href: NextPath }>;
|
|
695
|
+
}>
|
|
696
|
+
```
|
|
697
|
+
Returns the full WMS sidebar navigation tree. Titles are hardcoded zh-TW strings; there is
|
|
698
|
+
no i18n mechanism in 0.1.x (see §13.9 in the integration guide for workarounds).
|
|
699
|
+
|
|
700
|
+
#### `useTablePageState(usePageQs?: boolean)`
|
|
701
|
+
- Source: `hooks/useTablePagination.ts`
|
|
702
|
+
```ts
|
|
703
|
+
useTablePageState(usePageQs?: boolean): {
|
|
704
|
+
page: number;
|
|
705
|
+
setPage: (p: number) => void;
|
|
706
|
+
limit: number;
|
|
707
|
+
setLimit: (limit: number) => void;
|
|
708
|
+
offset: number; // (page - 1) * limit
|
|
709
|
+
}
|
|
710
|
+
```
|
|
711
|
+
|
|
712
|
+
#### `useTablePageTotal(params)`
|
|
713
|
+
- Source: `hooks/useTablePagination.ts`
|
|
714
|
+
```ts
|
|
715
|
+
useTablePageTotal(params: {
|
|
716
|
+
total?: number;
|
|
717
|
+
page: number;
|
|
718
|
+
setPage: (p: number) => void;
|
|
719
|
+
filterValues: unknown[];
|
|
720
|
+
}): { pageTotal: number | undefined }
|
|
721
|
+
```
|
|
722
|
+
|
|
723
|
+
#### `useFormCancel(params)`
|
|
724
|
+
- Source: `hooks/useFormCancel.ts`
|
|
725
|
+
```ts
|
|
726
|
+
useFormCancel(params: { onCancel?: () => void }): () => Promise<void>
|
|
727
|
+
```
|
|
728
|
+
|
|
729
|
+
#### `useFetchMoreOptions<T>(params)`
|
|
730
|
+
- Source: `hooks/useSelectorOptions.ts`
|
|
731
|
+
```ts
|
|
732
|
+
useFetchMoreOptions<T>(params: {
|
|
733
|
+
fetchData: LazyQueryExecFunction;
|
|
734
|
+
getNewOptions: (data: T | undefined) => SelectValue[];
|
|
735
|
+
otherArgs?: Record<string, unknown>;
|
|
736
|
+
searchByDescription?: boolean;
|
|
737
|
+
}): {
|
|
738
|
+
currentOptions: SelectValue[];
|
|
739
|
+
setOptions: Dispatch<SetStateAction<SelectValue[]>>;
|
|
740
|
+
onVisibilityChange: (open: boolean) => void;
|
|
741
|
+
onSearch: (input: string) => void;
|
|
742
|
+
onClear: () => void;
|
|
743
|
+
onReachBottom: () => void;
|
|
744
|
+
}
|
|
745
|
+
```
|
|
746
|
+
|
|
747
|
+
#### `useInsertOption(setOptions)`
|
|
748
|
+
- Source: `hooks/useSelectorOptions.ts`
|
|
749
|
+
```ts
|
|
750
|
+
useInsertOption(
|
|
751
|
+
setOptions: Dispatch<SetStateAction<SelectValue<string>[]>>
|
|
752
|
+
): (text: string, currentOptions: SelectValue[]) => SelectValue[]
|
|
753
|
+
```
|
|
754
|
+
|
|
755
|
+
#### `useSortTable()`
|
|
756
|
+
- Source: `hooks/useSortTable.ts`
|
|
757
|
+
```ts
|
|
758
|
+
useSortTable(): {
|
|
759
|
+
sortOrder: { key: string; sortOrder: SortOrder } | null;
|
|
760
|
+
setSortOrder: Dispatch;
|
|
761
|
+
getCurrentSortOrder: (key: string) => SortOrder | undefined;
|
|
762
|
+
onSort: (key: string, order: SortOrder) => void;
|
|
763
|
+
}
|
|
764
|
+
```
|
|
765
|
+
|
|
766
|
+
#### `useColumnWidthPersistence<T>(tableKey, columns)`
|
|
767
|
+
- Source: `hooks/useColumnWidthPersistence.ts`
|
|
768
|
+
```ts
|
|
769
|
+
useColumnWidthPersistence<T extends TableDataSource>(
|
|
770
|
+
tableKey: string,
|
|
771
|
+
columns: TableColumn<T>[]
|
|
772
|
+
): {
|
|
773
|
+
containerRef: RefObject<HTMLDivElement>;
|
|
774
|
+
columnsWithWidths: TableColumn<T>[];
|
|
775
|
+
}
|
|
776
|
+
```
|
|
777
|
+
|
|
778
|
+
#### `usePreviousValue<T>(value: T): T`
|
|
779
|
+
- Source: `hooks/usePreviousValue.ts`
|
|
780
|
+
|
|
781
|
+
---
|
|
782
|
+
|
|
783
|
+
### Route Utilities
|
|
784
|
+
|
|
785
|
+
#### `NextPath` (enum)
|
|
786
|
+
- Source: `utils/nextpath.ts`
|
|
787
|
+
- Generated by `yarn pages` from the `apps/client/src/pages` tree. **Renaming or removing
|
|
788
|
+
existing enum values is a breaking change** for downstream consumers.
|
|
789
|
+
|
|
790
|
+
```ts
|
|
791
|
+
enum NextPath {
|
|
792
|
+
CHANGEHISTORY = "/change-history",
|
|
793
|
+
INVENTORYCOUNT = "/inventory-count",
|
|
794
|
+
INVENTORYLIST = "/inventory-list",
|
|
795
|
+
INVENTORYMOVEMENT = "/inventory-movement",
|
|
796
|
+
INVENTORYMOVEMENT_TRANSFERORDER_ID = "/inventory-movement/transfer-order/[id]",
|
|
797
|
+
LABELSEARCH = "/label-search",
|
|
798
|
+
LOADERSMANAGEMENT = "/loaders-management",
|
|
799
|
+
LOADERSMANAGEMENT_CREATE = "/loaders-management/create",
|
|
800
|
+
LOCATIONSMANAGEMENT = "/locations-management",
|
|
801
|
+
MAPS = "/maps",
|
|
802
|
+
MATERIALSMANAGEMENT = "/materials-management",
|
|
803
|
+
RECEIVEINVENTORYORDERS = "/receive-inventory-orders",
|
|
804
|
+
RECEIVEINVENTORYORDERS_ID_EDIT = "/receive-inventory-orders/[id]/edit",
|
|
805
|
+
RECEIVEINVENTORYORDERS_ID_VIEW = "/receive-inventory-orders/[id]/view",
|
|
806
|
+
SHIPINVENTORYORDERS = "/ship-inventory-orders",
|
|
807
|
+
SHIPINVENTORYORDERS_ID_EDIT = "/ship-inventory-orders/[id]/edit",
|
|
808
|
+
SHIPINVENTORYORDERS_ID_VIEW = "/ship-inventory-orders/[id]/view",
|
|
809
|
+
}
|
|
810
|
+
```
|
|
811
|
+
|
|
812
|
+
#### `nextDynamicPath(nextPath, replaceDynamicPaths)`
|
|
813
|
+
- Source: `utils/path.ts`
|
|
814
|
+
```ts
|
|
815
|
+
nextDynamicPath(
|
|
816
|
+
nextPath: NextPath,
|
|
817
|
+
replaceDynamicPaths: Record<string, string>
|
|
818
|
+
): string
|
|
819
|
+
// e.g. nextDynamicPath(NextPath.RECEIVEINVENTORYORDERS_ID_VIEW, { '[id]': 'abc' })
|
|
820
|
+
// => "/receive-inventory-orders/abc/view"
|
|
821
|
+
```
|
|
822
|
+
|
|
823
|
+
---
|
|
824
|
+
|
|
825
|
+
### Icons (re-export)
|
|
826
|
+
|
|
827
|
+
`export * from './icons'` — re-exports all custom WMS icon components:
|
|
828
|
+
`UnlinkIcon`, `CarIcon`, `SplitIcon`, `MergeIcon`, `UpRightIcon`, `TransferIcon`, `WaitIcon`.
|
|
829
|
+
|
|
830
|
+
---
|
|
831
|
+
|
|
832
|
+
### Generated GraphQL Operations (`graphql/generated/.graphql`)
|
|
833
|
+
|
|
834
|
+
`export * from './graphql/generated/.graphql'` — re-exports everything from the
|
|
835
|
+
generated file (committed, shipped with the package). Consumers do **not** need to run
|
|
836
|
+
codegen themselves.
|
|
837
|
+
|
|
838
|
+
The generated file exports four categories of symbols:
|
|
839
|
+
|
|
840
|
+
#### 1. DocumentNode Constants
|
|
841
|
+
|
|
842
|
+
Used as the first argument to `useQuery` / `useMutation` from `@apollo/client/react`.
|
|
843
|
+
|
|
844
|
+
**Queries (41)**:
|
|
845
|
+
`AggregatedStocksDocument`, `AggregatedStocksForInventoryActionsDocument`, `AllocateInventoryOrdersDocument`, `AvailableLoadersDocument`, `BatchesDocument`, `BatchOptionsDocument`, `ChangeLogsDocument`, `FullReceiveInventoryOrdersDocument`, `FullShipInventoryOrdersDocument`, `HoldInventoryOrdersDocument`, `LoaderDocument`, `LoaderOptionsDocument`, `LoadersDocument`, `LoaderTypeDocument`, `LoaderTypeOptionsDocument`, `LoaderTypesDocument`, `LoaderUnitsDocument`, `LocationDocument`, `LocationOptionsDocument`, `LocationsDocument`, `MapDataDocument`, `MaterialDocument`, `MaterialOptionsDocument`, `MaterialsDocument`, `ReceiveInventoryOrderDocument`, `ReceiveInventoryOrderOptionsDocument`, `ReceiveInventoryOrderPendingOptionsDocument`, `ReceiveInventoryOrdersDocument`, `SaleOrderDistinctIdsDocument`, `SaleOrdersDocument`, `ShipInventoryOrderDocument`, `ShipInventoryOrderOptionsDocument`, `ShipInventoryOrderPendingOptionsDocument`, `ShipInventoryOrdersDocument`, `StockDocument`, `StocksDocument`, `StocksGroupedByMaterialDocument`, `TransferOrderDocument`, `TransferOrderOptionsDocument`, `TransferOrdersDocument`, `UnitsDocument`
|
|
846
|
+
|
|
847
|
+
**Mutations (34)**:
|
|
848
|
+
`CancelShipDocument`, `CancelTransferDocument`, `CreateAllocateInventoryOrderDocument`, `CreateBatchLoaderDocument`, `CreateHoldInventoryOrderDocument`, `CreateLoaderTypeDocument`, `CreateLocationDocument`, `CreateMaterialDocument`, `CreateReceiveInventoryOrderDocument`, `CreateShipInventoryOrderDocument`, `CreateTransferCustomerOrderDocument`, `CreateTransferOrderDocument`, `CreateTransferVendorOrderDocument`, `DeallocateDocument`, `InspectMaterialsDocument`, `MergeBatchDocument`, `ReceiveDocument`, `ReclassifyInventoryOrderDocument`, `ReleaseDocument`, `ReturnTransferCustomerOrderDocument`, `ReturnTransferVendorOrderDocument`, `ScrapeMaterialsDocument`, `ShipDocument`, `SplitBatchDocument`, `TransferDocument`, `UpdateHoldInventoryOrderDocument`, `UpdateLoaderDocument`, `UpdateLoaderTypeDocument`, `UpdateLocationDocument`, `UpdateMaterialDocument`, `UpdateReceiveInventoryOrderDocument`, `UpdateShipInventoryOrderDocument`, `UpdateTransferOrderDocument`, `UpdateWarehouseMapDocument`
|
|
849
|
+
|
|
850
|
+
#### 2. Fragment Types
|
|
851
|
+
|
|
852
|
+
42 fragment types named `<Domain>Fragment`, used for prop type annotations in custom components:
|
|
853
|
+
|
|
854
|
+
`AggregatedStockFragment`, `AllocateInventoryOrderFragment`, `AllocateInventoryOrderItemFragment`, `BatchFragment`, `ChangeLogFragment`, `HoldInventoryOrderFragment`, `HoldInventoryOrderItemFragment`, `LoaderFragment`, `LoaderTypeFragment`, `LoaderWithTotalFragment`, `LocationFragment`, `SimpleLocationFragment`, `MapDataFragment`, `MaterialFragment`, `SimpleMaterialFragment`, `MaterialWithAggregatedStockFragment`, `MaterialUnitFragment`, `MergeBatchOrderItemFragment`, `QualityInspectionOrderFragment`, `QualityInspectionOrderItemFragment`, `ReceiveInventoryOrderFragment`, `ReceiveInventoryOrderItemFragment`, `SimpleReceiveInventoryOrderFragment`, `ReclassifyInventoryOrderItemFragment`, `ScrapeOrderFragment`, `ScrapeOrderItemFragment`, `ShipInventoryOrderFragment`, `ShipInventoryOrderItemFragment`, `ShipInventoryOrderReferenceFragment`, `SimpleShipInventoryOrderFragment`, `SimpleStockFragment`, `StockFragment`, `StockInActionsFragment`, `SplitBatchOrderItemFragment`, `SimplerAllocateInventoryOrderFragment`, `SimpleTransferOrderFragment`, `TransferCustomerOrderFragment`, `TransferCustomerOrderItemFragment`, `TransferOrderFragment`, `TransferOrderItemFragment`, `TransferVendorOrderFragment`, `TransferVendorOrderItemFragment`, `UnitFragment`
|
|
855
|
+
|
|
856
|
+
#### 3. Query/Mutation Type Pairs
|
|
857
|
+
|
|
858
|
+
Each DocumentNode constant has paired TypeScript types (75 pairs total, 150 types):
|
|
859
|
+
- `LoadersQuery` + `LoadersQueryVariables`
|
|
860
|
+
- `CreateMaterialMutation` + `CreateMaterialMutationVariables`
|
|
861
|
+
- etc.
|
|
862
|
+
|
|
863
|
+
#### 4. Schema Types and Enums
|
|
864
|
+
|
|
865
|
+
All GraphQL schema DTO types and enums are re-exported:
|
|
866
|
+
|
|
867
|
+
Schema types: `AggregatedStockDto`, `AllocateInventoryOrderDto`, `BatchDto`, `ChangeLogDto`, `HoldInventoryOrderDto`, `LoaderDto`, `LoaderTypeDto`, `LoaderUnitDto`, `Loaders`, `LocationDto`, `Locations`, `MapDataDto`, `MaterialDto`, `Materials`, `ReceiveInventoryOrderDto`, `ReceiveInventoryOrders`, `ShipInventoryOrderDto`, `ShipInventoryOrders`, `StockDto`, `Stocks`, `TransferOrderDto`, and many more.
|
|
868
|
+
|
|
869
|
+
Enums: `ChangeType`, `LoaderUnit`, `MapRangeType`, `ReceiveInventoryOrderStatus`, `ShipInventoryOrderStatus`, `StockStatus`
|
|
870
|
+
|
|
871
|
+
---
|
|
872
|
+
|
|
873
|
+
## Library Internals (NOT exported from barrel)
|
|
874
|
+
|
|
875
|
+
> **Warning**: The following symbols **exist in the source tree** of `@rytass/wms-module-react`
|
|
876
|
+
> but are **not exported from the package barrel** (`src/index.ts`). Attempting to import them
|
|
877
|
+
> directly from `@rytass/wms-module-react` will fail with `Module not found` or
|
|
878
|
+
> `is not exported from module`.
|
|
879
|
+
>
|
|
880
|
+
> They are listed here for reference — developers inspecting the source or planning to fork/patch
|
|
881
|
+
> the lib may find this useful. Some may be promoted to public exports via subpath exports or in
|
|
882
|
+
> a future 0.2.0 release.
|
|
883
|
+
|
|
884
|
+
### Internal Form Field Components (`components/fields/`)
|
|
885
|
+
|
|
886
|
+
These field components are used internally by the page components but are not barrel-exported.
|
|
887
|
+
A consumer cannot import `{ InputField }` from `@rytass/wms-module-react`.
|
|
888
|
+
|
|
889
|
+
| Component | Description |
|
|
890
|
+
|------------------------------|--------------------------------------------------|
|
|
891
|
+
| `BaseField` | Generic form field wrapper (label + error) |
|
|
892
|
+
| `InputField` | Text input field |
|
|
893
|
+
| `NumberInputField` | Numeric input field |
|
|
894
|
+
| `DateField` | Date picker field (Dayjs) |
|
|
895
|
+
| `RadioField` | Radio button field |
|
|
896
|
+
| `SelectInputField` | Searchable select field |
|
|
897
|
+
| `SingleSelectField` | Single-select field |
|
|
898
|
+
| `SingleSelectByIdField` | Single-select by ID |
|
|
899
|
+
| `SingleAutoCompleteField` | Auto-complete single select |
|
|
900
|
+
| `SingleAutoCompleteByIdField`| Auto-complete by ID |
|
|
901
|
+
| `YesNoField` | Yes/No toggle field |
|
|
902
|
+
| `MaterialsField` | Material picker (with fetch/search) |
|
|
903
|
+
| `UnitsField` | Unit picker |
|
|
904
|
+
| `BatchesField` | Batch picker |
|
|
905
|
+
| `LoadersField` | Loader picker |
|
|
906
|
+
| `LoaderTypesField` | Loader type picker |
|
|
907
|
+
| `LoaderUnitsField` | Loader unit picker |
|
|
908
|
+
| `LocationsField` | Location picker |
|
|
909
|
+
| `AvailableLoadersField` | Available loader picker (for inventory actions) |
|
|
910
|
+
| `ReceiveInventoryOrdersField`| Receive order picker |
|
|
911
|
+
| `ShipInventoryOrdersField` | Ship order picker |
|
|
912
|
+
| `TransferOrdersField` | Transfer order picker |
|
|
913
|
+
| `SaleOrdersField` | Sale order picker |
|
|
914
|
+
| `SaleOrderIdsField` | Sale order ID picker |
|
|
915
|
+
| `MembersField` | Member picker |
|
|
916
|
+
|
|
917
|
+
### Internal Form Wrappers
|
|
918
|
+
|
|
919
|
+
`FormWrapper`, `FormModalWrapper`, `FormDrawerWrapper` — React Hook Form wrappers used
|
|
920
|
+
internally by page components.
|
|
921
|
+
|
|
922
|
+
### Internal Layout Wrappers
|
|
923
|
+
|
|
924
|
+
`PageWrapper`, `SectionWrapper`, `TableWrapper`, `FilterWrapper` — layout containers used
|
|
925
|
+
internally. WMS pages expect full-viewport rendering via these wrappers; embedding a page
|
|
926
|
+
in a smaller container is not officially supported (see §13.10 in the integration guide).
|
|
927
|
+
|
|
928
|
+
### Internal UI Components
|
|
929
|
+
|
|
930
|
+
`PageTabs`, `FormActionButtons`, `Loading`, `InventoryActionDrawers`
|
|
931
|
+
|
|
932
|
+
### Internal Hooks (not in barrel)
|
|
933
|
+
|
|
934
|
+
The following hooks exist in source but are internal implementation details:
|
|
935
|
+
|
|
936
|
+
- `useInventoryActions()` — reads `InventoryActionsContext`; used by page components internally
|
|
937
|
+
- `useAddInventories()` — inventory selection logic
|
|
938
|
+
- `useInventorySignature()` — per-inventory-item signature reader
|
|
939
|
+
- `useDialog()` — opens the global confirmation dialog (requires `DialogProvider`)
|
|
940
|
+
- `useModal()` — opens the global modal (requires `ModalProvider`)
|
|
941
|
+
|
|
942
|
+
### Internal Constants and Utilities (not in barrel)
|
|
943
|
+
|
|
944
|
+
`BASE_UNIT`, `DEFAULT_MAP_DATA_KEY`, `DEFAULT_MAP_DATA_NAME`, `YesOrNo` (enum),
|
|
945
|
+
`UnitOptionsType`, `yesNoName`, `yesNoOptions`, `formatKeyName`, `changeTypeName`,
|
|
946
|
+
`shipInventoryOrderStatusName`, `shipInventoryOrderStatusOptions`,
|
|
947
|
+
`receiveInventoryOrderStatusName`, `receiveInventoryOrderStatusOptions`,
|
|
948
|
+
`uploadFile`, `aggregatedStockColumns`
|
|
949
|
+
|
|
950
|
+
---
|
|
951
|
+
|
|
952
|
+
以上為三個 lib 的完整 export API 名單。
|
|
953
|
+
|
|
954
|
+
**關鍵路徑摘要:**
|
|
955
|
+
- `/Users/fantasyatelier/Repositories/WMS-Module/libs/core/src/index.ts`
|
|
956
|
+
- `/Users/fantasyatelier/Repositories/WMS-Module/libs/graphql/src/index.ts`
|
|
957
|
+
- `/Users/fantasyatelier/Repositories/WMS-Module/libs/react/src/index.ts`
|