@rytass/wms-module-graphql 0.10.2 → 0.11.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.
Files changed (190) hide show
  1. package/adapters/event-emitter.d.mts +6 -0
  2. package/adapters/member-base.d.mts +6 -0
  3. package/index.cjs.js +1009 -98
  4. package/index.d.mts +6 -0
  5. package/{index.js → index.mjs} +11 -11
  6. package/lib/auth/{wms-auth.guard.js → wms-auth.guard.mjs} +1 -1
  7. package/lib/auth/{wms-operation.decorator.js → wms-operation.decorator.mjs} +3 -3
  8. package/lib/dto/{allocate-inventory-order.dto.js → allocate-inventory-order.dto.mjs} +1 -1
  9. package/lib/dto/{batch.dto.js → batch.dto.mjs} +1 -1
  10. package/lib/dto/consumption-order-item.dto.d.ts +17 -0
  11. package/lib/dto/consumption-order-item.dto.mjs +43 -0
  12. package/lib/dto/consumption-order.dto.d.ts +14 -0
  13. package/lib/dto/consumption-order.dto.mjs +52 -0
  14. package/lib/dto/{hold-inventory-order-item.dto.js → hold-inventory-order-item.dto.mjs} +1 -1
  15. package/lib/dto/{hold-inventory-order.dto.js → hold-inventory-order.dto.mjs} +2 -2
  16. package/lib/dto/index.d.ts +3 -0
  17. package/lib/dto/inventory-count-order.dto.d.ts +7 -1
  18. package/lib/dto/{inventory-count-order.dto.js → inventory-count-order.dto.mjs} +12 -2
  19. package/lib/dto/{loader-type.dto.js → loader-type.dto.mjs} +1 -1
  20. package/lib/dto/{loader.dto.js → loader.dto.mjs} +1 -1
  21. package/lib/dto/{location.dto.js → location.dto.mjs} +1 -1
  22. package/lib/dto/{material-unit.dto.js → material-unit.dto.mjs} +1 -1
  23. package/lib/dto/{material.dto.js → material.dto.mjs} +1 -1
  24. package/lib/dto/order-reference.dto.d.ts +22 -0
  25. package/lib/dto/order-reference.dto.mjs +73 -0
  26. package/lib/dto/{quality-inspection-order.dto.js → quality-inspection-order.dto.mjs} +2 -2
  27. package/lib/dto/{receive-inventory-order-item.dto.js → receive-inventory-order-item.dto.mjs} +1 -1
  28. package/lib/dto/{receive-inventory-order.dto.js → receive-inventory-order.dto.mjs} +2 -2
  29. package/lib/dto/{scrape-order-item.dto.js → scrape-order-item.dto.mjs} +1 -1
  30. package/lib/dto/{scrape-order.dto.js → scrape-order.dto.mjs} +2 -2
  31. package/lib/dto/{ship-inventory-order-item.dto.js → ship-inventory-order-item.dto.mjs} +1 -1
  32. package/lib/dto/{ship-inventory-order.dto.js → ship-inventory-order.dto.mjs} +2 -2
  33. package/lib/dto/stock.dto.d.ts +15 -0
  34. package/lib/dto/{stock.dto.js → stock.dto.mjs} +29 -1
  35. package/lib/dto/{transfer-customer-order-item.dto.js → transfer-customer-order-item.dto.mjs} +1 -1
  36. package/lib/dto/{transfer-customer-order.dto.js → transfer-customer-order.dto.mjs} +2 -2
  37. package/lib/dto/{transfer-order-item.dto.js → transfer-order-item.dto.mjs} +1 -1
  38. package/lib/dto/{transfer-order.dto.js → transfer-order.dto.mjs} +2 -2
  39. package/lib/dto/{transfer-vendor-order-item.dto.js → transfer-vendor-order-item.dto.mjs} +1 -1
  40. package/lib/dto/{transfer-vendor-order.dto.js → transfer-vendor-order.dto.mjs} +2 -2
  41. package/lib/events/operation-result-map.d.ts +13 -0
  42. package/lib/events/typed-maps.d.ts +17 -7
  43. package/lib/events/{wms-mutation-event.decorator.js → wms-mutation-event.decorator.mjs} +2 -2
  44. package/lib/events/wms-mutation.interceptor.d.ts +11 -9
  45. package/lib/events/wms-mutation.interceptor.mjs +64 -0
  46. package/lib/graphql.module.d.ts +1 -1
  47. package/lib/{graphql.module.js → graphql.module.mjs} +86 -69
  48. package/lib/helpers/{helper.module.js → helper.module.mjs} +1 -1
  49. package/lib/inputs/consumption-order.args.d.ts +47 -0
  50. package/lib/inputs/consumption-order.args.mjs +182 -0
  51. package/lib/inputs/{create-allocate-inventory-order.args.js → create-allocate-inventory-order.args.mjs} +1 -1
  52. package/lib/inputs/{create-hold-inventory-order.args.js → create-hold-inventory-order.args.mjs} +1 -1
  53. package/lib/inputs/{create-material.args.js → create-material.args.mjs} +1 -1
  54. package/lib/inputs/{create-receive-inventory-order.args.js → create-receive-inventory-order.args.mjs} +1 -1
  55. package/lib/inputs/{create-ship-inventory-order.args.js → create-ship-inventory-order.args.mjs} +2 -2
  56. package/lib/inputs/{create-transfer-customer-order.args.js → create-transfer-customer-order.args.mjs} +1 -1
  57. package/lib/inputs/{create-transfer-order.args.js → create-transfer-order.args.mjs} +1 -1
  58. package/lib/inputs/{create-transfer-vendor-order.args.js → create-transfer-vendor-order.args.mjs} +1 -1
  59. package/lib/inputs/{find-allocate-inventory-order.args.js → find-allocate-inventory-order.args.mjs} +2 -2
  60. package/lib/inputs/{find-batch.args.js → find-batch.args.mjs} +1 -1
  61. package/lib/inputs/{find-hold-inventory-order.args.js → find-hold-inventory-order.args.mjs} +2 -2
  62. package/lib/inputs/{find-loader-type.args.js → find-loader-type.args.mjs} +2 -2
  63. package/lib/inputs/{find-loader.args.js → find-loader.args.mjs} +2 -2
  64. package/lib/inputs/{find-location.args.js → find-location.args.mjs} +1 -1
  65. package/lib/inputs/{find-material.args.js → find-material.args.mjs} +1 -1
  66. package/lib/inputs/{find-receive-inventory-order.args.js → find-receive-inventory-order.args.mjs} +2 -2
  67. package/lib/inputs/{find-sale-order.args.js → find-sale-order.args.mjs} +1 -1
  68. package/lib/inputs/{find-ship-inventory-order.args.js → find-ship-inventory-order.args.mjs} +2 -2
  69. package/lib/inputs/find-stock.args.d.ts +6 -0
  70. package/lib/inputs/{find-stock.args.js → find-stock.args.mjs} +11 -1
  71. package/lib/inputs/{find-transfer-order.args.js → find-transfer-order.args.mjs} +2 -2
  72. package/lib/inputs/{inventory-count-order.args.js → inventory-count-order.args.mjs} +1 -1
  73. package/lib/inputs/order-reference.args.d.ts +32 -0
  74. package/lib/inputs/order-reference.args.mjs +103 -0
  75. package/lib/inputs/split-batch.args.d.ts +6 -0
  76. package/lib/inputs/{split-batch.args.js → split-batch.args.mjs} +11 -0
  77. package/lib/inputs/{update-warehouse-map.args.js → update-warehouse-map.args.mjs} +1 -1
  78. package/lib/mutations/{allocate-inventory-order.mutation.js → allocate-inventory-order.mutation.mjs} +7 -7
  79. package/lib/mutations/consumption-order.mutation.d.ts +18 -0
  80. package/lib/mutations/consumption-order.mutation.mjs +90 -0
  81. package/lib/mutations/{hold-inventory-order.mutation.js → hold-inventory-order.mutation.mjs} +7 -7
  82. package/lib/mutations/{inventory-count-order.mutation.js → inventory-count-order.mutation.mjs} +6 -6
  83. package/lib/mutations/{loader.mutation.js → loader.mutation.mjs} +34 -31
  84. package/lib/mutations/{location.mutation.js → location.mutation.mjs} +6 -6
  85. package/lib/mutations/{material.mutation.js → material.mutation.mjs} +33 -30
  86. package/lib/mutations/{merge-batch.mutation.js → merge-batch.mutation.mjs} +6 -6
  87. package/lib/mutations/order-reference.mutation.d.ts +13 -0
  88. package/lib/mutations/order-reference.mutation.mjs +57 -0
  89. package/lib/mutations/{quality-inspection-order.mutation.js → quality-inspection-order.mutation.mjs} +6 -6
  90. package/lib/mutations/{receive-inventory-order.mutation.js → receive-inventory-order.mutation.mjs} +34 -31
  91. package/lib/mutations/{reclassify-inventory-order.mutation.js → reclassify-inventory-order.mutation.mjs} +6 -6
  92. package/lib/mutations/{scrape-order.mutation.js → scrape-order.mutation.mjs} +6 -6
  93. package/lib/mutations/{ship-inventory-order.mutation.js → ship-inventory-order.mutation.mjs} +35 -32
  94. package/lib/mutations/{split-batch.mutation.js → split-batch.mutation.mjs} +6 -6
  95. package/lib/mutations/{transfer-customer-order.mutation.js → transfer-customer-order.mutation.mjs} +7 -7
  96. package/lib/mutations/{transfer-order.mutation.js → transfer-order.mutation.mjs} +8 -8
  97. package/lib/mutations/{transfer-vendor-order.mutation.js → transfer-vendor-order.mutation.mjs} +7 -7
  98. package/lib/mutations/{warehouse-map.mutation.js → warehouse-map.mutation.mjs} +6 -6
  99. package/lib/queries/{allocate-inventory-order.query.js → allocate-inventory-order.query.mjs} +4 -4
  100. package/lib/queries/{batch.query.js → batch.query.mjs} +4 -4
  101. package/lib/queries/consumption-order.query.d.ts +9 -0
  102. package/lib/queries/consumption-order.query.mjs +45 -0
  103. package/lib/queries/{hold-inventory-order.query.js → hold-inventory-order.query.mjs} +4 -4
  104. package/lib/queries/{inventory-count-order.query.js → inventory-count-order.query.mjs} +4 -4
  105. package/lib/queries/{loader.query.js → loader.query.mjs} +33 -30
  106. package/lib/queries/{location.query.js → location.query.mjs} +4 -4
  107. package/lib/queries/{material.query.js → material.query.mjs} +31 -28
  108. package/lib/queries/order-reference.query.d.ts +8 -0
  109. package/lib/queries/order-reference.query.mjs +34 -0
  110. package/lib/queries/{recieve-inventory-order.query.js → recieve-inventory-order.query.mjs} +31 -28
  111. package/lib/queries/{sale-order.query.js → sale-order.query.mjs} +3 -3
  112. package/lib/queries/{ship-inventory-order.query.js → ship-inventory-order.query.mjs} +31 -28
  113. package/lib/queries/{stock.query.js → stock.query.mjs} +31 -28
  114. package/lib/queries/{transfer-order.query.js → transfer-order.query.mjs} +4 -4
  115. package/lib/queries/{unit.query.js → unit.query.mjs} +3 -3
  116. package/lib/queries/{warehouse-map.query.js → warehouse-map.query.mjs} +3 -3
  117. package/lib/registry/{operation-registry.js → operation-registry.mjs} +1 -1
  118. package/lib/resolvers/{aggregated-stock.resolver.js → aggregated-stock.resolver.mjs} +30 -27
  119. package/lib/resolvers/{allocate-inventory-order.resolver.js → allocate-inventory-order.resolver.mjs} +2 -2
  120. package/lib/resolvers/{change-log.resolver.js → change-log.resolver.mjs} +30 -27
  121. package/lib/resolvers/consumption-order.resolver.d.ts +40 -0
  122. package/lib/resolvers/consumption-order.resolver.mjs +238 -0
  123. package/lib/resolvers/{hold-inventory-order.resolver.js → hold-inventory-order.resolver.mjs} +2 -2
  124. package/lib/resolvers/{inventory-count-order.resolver.js → inventory-count-order.resolver.mjs} +5 -5
  125. package/lib/resolvers/loader-type.resolver.mjs +54 -0
  126. package/lib/resolvers/{loader.resolver.js → loader.resolver.mjs} +29 -26
  127. package/lib/resolvers/{location.resolver.js → location.resolver.mjs} +2 -2
  128. package/lib/resolvers/{material.resolver.js → material.resolver.mjs} +29 -26
  129. package/lib/resolvers/{merge-batch.resolver.js → merge-batch.resolver.mjs} +1 -1
  130. package/lib/resolvers/{receive-inventory-order.resolver.js → receive-inventory-order.resolver.mjs} +30 -27
  131. package/lib/resolvers/{ship-inventory-order.resolver.js → ship-inventory-order.resolver.mjs} +31 -28
  132. package/lib/resolvers/{split-batch.resolver.js → split-batch.resolver.mjs} +1 -1
  133. package/lib/resolvers/{stock.resolver.js → stock.resolver.mjs} +30 -27
  134. package/lib/resolvers/{transfer-customer-order.resolver.js → transfer-customer-order.resolver.mjs} +2 -2
  135. package/lib/resolvers/{transfer-order.resolver.js → transfer-order.resolver.mjs} +30 -27
  136. package/lib/resolvers/{transfer-vendor-order.resolver.js → transfer-vendor-order.resolver.mjs} +2 -2
  137. package/lib/resolvers/{warehouse-map.resolver.js → warehouse-map.resolver.mjs} +2 -2
  138. package/lib/scalars/index.d.ts +1 -0
  139. package/lib/scalars/json-object.scalar.d.ts +2 -0
  140. package/lib/scalars/json-object.scalar.mjs +62 -0
  141. package/package.json +36 -14
  142. package/lib/events/wms-mutation.interceptor.js +0 -90
  143. package/lib/inputs/index.d.ts +0 -0
  144. package/lib/resolvers/loader-type.resolver.js +0 -51
  145. /package/adapters/{event-emitter.js → event-emitter.mjs} +0 -0
  146. /package/adapters/{member-base.js → member-base.mjs} +0 -0
  147. /package/lib/auth/{host-skip.constant.js → host-skip.constant.mjs} +0 -0
  148. /package/lib/auth/{wms-auth.types.js → wms-auth.types.mjs} +0 -0
  149. /package/lib/dto/{allocate-inventory-order-item.dto.js → allocate-inventory-order-item.dto.mjs} +0 -0
  150. /package/lib/dto/{loader-unit.dto.js → loader-unit.dto.mjs} +0 -0
  151. /package/lib/dto/{merge-batch-order.dto.js → merge-batch-order.dto.mjs} +0 -0
  152. /package/lib/dto/{pagination.dto.js → pagination.dto.mjs} +0 -0
  153. /package/lib/dto/{quality-inspection-order-item.dto.js → quality-inspection-order-item.dto.mjs} +0 -0
  154. /package/lib/dto/{reclassify-inventory-order.dto.js → reclassify-inventory-order.dto.mjs} +0 -0
  155. /package/lib/dto/{sale-order.dto.js → sale-order.dto.mjs} +0 -0
  156. /package/lib/dto/{ship-inventory-order-reference.dto.js → ship-inventory-order-reference.dto.mjs} +0 -0
  157. /package/lib/dto/{split-batch-order.dto.js → split-batch-order.dto.mjs} +0 -0
  158. /package/lib/dto/{unit.dto.js → unit.dto.mjs} +0 -0
  159. /package/lib/dto/{warehouse-map.dto.js → warehouse-map.dto.mjs} +0 -0
  160. /package/lib/events/{wms-mutation-event.constants.js → wms-mutation-event.constants.mjs} +0 -0
  161. /package/lib/helpers/{create-wms-loaders.js → create-wms-loaders.mjs} +0 -0
  162. /package/lib/helpers/{loader.service.js → loader.service.mjs} +0 -0
  163. /package/lib/helpers/{query-path.js → query-path.mjs} +0 -0
  164. /package/lib/inputs/{cancel-ship-order.args.js → cancel-ship-order.args.mjs} +0 -0
  165. /package/lib/inputs/{cancel-transfer-order.args.js → cancel-transfer-order.args.mjs} +0 -0
  166. /package/lib/inputs/{create-allocate-inventory-order-item.args.js → create-allocate-inventory-order-item.args.mjs} +0 -0
  167. /package/lib/inputs/{create-hold-inventory-order-item.args.js → create-hold-inventory-order-item.args.mjs} +0 -0
  168. /package/lib/inputs/{create-loader-type.args.js → create-loader-type.args.mjs} +0 -0
  169. /package/lib/inputs/{create-loader.args.js → create-loader.args.mjs} +0 -0
  170. /package/lib/inputs/{create-location.args.js → create-location.args.mjs} +0 -0
  171. /package/lib/inputs/{create-material-unit.args.js → create-material-unit.args.mjs} +0 -0
  172. /package/lib/inputs/{create-quality-inspection-order.args.js → create-quality-inspection-order.args.mjs} +0 -0
  173. /package/lib/inputs/{create-receive-inventory-order-item.args.js → create-receive-inventory-order-item.args.mjs} +0 -0
  174. /package/lib/inputs/{create-ship-inventory-order-item.args.js → create-ship-inventory-order-item.args.mjs} +0 -0
  175. /package/lib/inputs/{create-ship-inventory-order-reference.args.js → create-ship-inventory-order-reference.args.mjs} +0 -0
  176. /package/lib/inputs/{create-transfer-customer-order-item.args.js → create-transfer-customer-order-item.args.mjs} +0 -0
  177. /package/lib/inputs/{create-transfer-order-item.args.js → create-transfer-order-item.args.mjs} +0 -0
  178. /package/lib/inputs/{create-transfer-vendor-order-item.args.js → create-transfer-vendor-order-item.args.mjs} +0 -0
  179. /package/lib/inputs/{date-range.args.js → date-range.args.mjs} +0 -0
  180. /package/lib/inputs/{deallocate-order.args.js → deallocate-order.args.mjs} +0 -0
  181. /package/lib/inputs/{merge-batch.args.js → merge-batch.args.mjs} +0 -0
  182. /package/lib/inputs/{pagination.args.js → pagination.args.mjs} +0 -0
  183. /package/lib/inputs/{receive-order.args.js → receive-order.args.mjs} +0 -0
  184. /package/lib/inputs/{reclassify-inventory-order.args.js → reclassify-inventory-order.args.mjs} +0 -0
  185. /package/lib/inputs/{release-order.args.js → release-order.args.mjs} +0 -0
  186. /package/lib/inputs/{return-transfer-customer-order.args.js → return-transfer-customer-order.args.mjs} +0 -0
  187. /package/lib/inputs/{return-transfer-vendor-order.args.js → return-transfer-vendor-order.args.mjs} +0 -0
  188. /package/lib/inputs/{scrape-order.args.js → scrape-order.args.mjs} +0 -0
  189. /package/lib/inputs/{ship-order.args.js → ship-order.args.mjs} +0 -0
  190. /package/lib/inputs/{transfer-order.args.js → transfer-order.args.mjs} +0 -0
@@ -17,6 +17,8 @@ import type { MapDataDto } from '../dto/warehouse-map.dto';
17
17
  import type { MergeBatchOrderDto } from '../dto/merge-batch-order.dto';
18
18
  import type { ReclassifyInventoryOrderDto } from '../dto/reclassify-inventory-order.dto';
19
19
  import type { SplitBatchOrderDto } from '../dto/split-batch-order.dto';
20
+ import type { OrderReferenceDto } from '../dto/order-reference.dto';
21
+ import type { ConsumptionOrderDto } from '../dto/consumption-order.dto';
20
22
  /**
21
23
  * Maps every {@link WmsOperationEventName} to the concrete type returned by
22
24
  * the corresponding mutation resolver.
@@ -68,6 +70,17 @@ export interface WmsOperationResultMap extends Record<WmsOperationEventName, unk
68
70
  'batch.splitted': SplitBatchOrderDto;
69
71
  'scrape-order.scraped': ScrapeOrderDto;
70
72
  'quality-inspection-order.inspected': QualityInspectionOrderDto;
73
+ 'consumption-order.created': ConsumptionOrderDto;
74
+ 'consumption-order.updated': ConsumptionOrderDto;
75
+ /** Action mutation — result is a success flag; use args + stock.issued. */
76
+ 'consumption-order.issued': boolean;
77
+ /** Action mutation — result is a success flag; use args + stock.returned. */
78
+ 'consumption-order.returned': boolean;
79
+ /** Action mutation — result is a success flag; use args + stock.consumed. */
80
+ 'consumption-order.settled': boolean;
81
+ 'order-reference.attached': OrderReferenceDto[];
82
+ /** Action mutation — result is a success flag; the id is in `args`. */
83
+ 'order-reference.detached': boolean;
71
84
  'transfer-order.created': TransferOrderDto;
72
85
  'transfer-order.updated': TransferOrderDto;
73
86
  /** Action mutation — result is a success flag; use args + stock.transferred. */
@@ -37,17 +37,27 @@ export interface WmsTypedAfterEventContext<N extends WmsEventName> {
37
37
  }
38
38
  /**
39
39
  * Context passed to a before-hook. Runs *before* any DB work, so
40
- * `payload` / `result` are not yet available — only the raw GraphQL
41
- * arguments (`args`) and the resolved actor. Throwing from a before-hook
42
- * vetoes the mutation with zero side effects.
40
+ * `payload` / `result` are not yet available — only the raw arguments
41
+ * (`args`) and the resolved actor. Throwing from a before-hook vetoes the
42
+ * operation with zero side effects.
43
+ *
44
+ * Structurally identical to the core `WmsBeforeHookContext`; the two must stay
45
+ * in step, because a hook written against either is handed the same object.
43
46
  */
44
47
  export interface WmsTypedBeforeHookContext<N extends WmsEventName> {
45
48
  readonly event: N;
46
- /** Raw GraphQL arguments — the mutation intent (per §3.4 of the design doc). */
49
+ /** Raw arguments — the operation's intent (per §3.4 of the design doc). */
47
50
  readonly args: Readonly<Record<string, unknown>>;
48
- /** The NestJS execution context at the time of the mutation call. */
49
- readonly executionContext: ExecutionContext;
50
- /** Who performed the mutation; `null` when no `actorExtractor` is configured. */
51
+ /**
52
+ * The NestJS execution context, or `null` when the operation did not arrive
53
+ * through one — a host driving a domain service through
54
+ * `WmsOperationRunner`. Branch on {@link WmsTypedBeforeHookContext.source}
55
+ * rather than on this being present.
56
+ */
57
+ readonly executionContext: ExecutionContext | null;
58
+ /** Where the operation came in from. `'host'` means a direct service call. */
59
+ readonly source: 'graphql' | 'host';
60
+ /** Who performed the operation; `null` when no `actorExtractor` is configured. */
51
61
  readonly actor: WmsActor | null;
52
62
  }
53
63
  /**
@@ -1,6 +1,6 @@
1
1
  import { applyDecorators, SetMetadata, UseInterceptors } from '@nestjs/common';
2
- import { WMS_MUTATION_EVENT_METADATA } from './wms-mutation-event.constants.js';
3
- import { WmsMutationInterceptor } from './wms-mutation.interceptor.js';
2
+ import { WMS_MUTATION_EVENT_METADATA } from './wms-mutation-event.constants.mjs';
3
+ import { WmsMutationInterceptor } from './wms-mutation.interceptor.mjs';
4
4
 
5
5
  /**
6
6
  * Declares the operation event for a WMS root mutation and wires the
@@ -1,21 +1,23 @@
1
1
  import { type CallHandler, type ExecutionContext, type NestInterceptor } from '@nestjs/common';
2
2
  import { Reflector } from '@nestjs/core';
3
- import { WmsEventDispatcher, type WmsActorExtractor } from '@rytass/wms-module-core';
3
+ import { WmsOperationRunner, type WmsActorExtractor } from '@rytass/wms-module-core';
4
4
  import { type Observable } from 'rxjs';
5
5
  /**
6
- * Wraps each `@WmsMutationEvent` mutation in a dispatch scope:
7
- * 1. runs the before-hook (throw -> veto, before any transaction);
8
- * 2. executes the resolver (services collect stock events into the scope);
9
- * 3. emits the operation event after the handler resolves (post-commit);
10
- * 4. flushes the whole buffer to after-listeners + emitter bridge.
6
+ * Hands each `@WmsMutationEvent` mutation to {@link WmsOperationRunner}, which
7
+ * owns the before-hook / dispatch scope / post-commit flush sequence.
11
8
  *
12
- * When no hook/listener/bridge is configured it passes through untouched.
9
+ * All this adds on top is what only a GraphQL request can supply: the raw
10
+ * arguments and the actor. Keeping the sequence itself in core is what stops
11
+ * the GraphQL path and a host's direct service call from drifting apart.
12
+ *
13
+ * When no hook, listener or bridge is configured the runner passes through
14
+ * untouched.
13
15
  */
14
16
  export declare class WmsMutationInterceptor implements NestInterceptor {
15
17
  private readonly reflector;
16
- private readonly dispatcher;
18
+ private readonly runner;
17
19
  private readonly actorExtractor;
18
- constructor(reflector: Reflector, dispatcher: WmsEventDispatcher, actorExtractor?: WmsActorExtractor | null);
20
+ constructor(reflector: Reflector, runner: WmsOperationRunner, actorExtractor?: WmsActorExtractor | null);
19
21
  private resolveActor;
20
22
  intercept(context: ExecutionContext, next: CallHandler): Promise<Observable<unknown>>;
21
23
  }
@@ -0,0 +1,64 @@
1
+ import { __decorate, __param, __metadata } from 'tslib';
2
+ import { Injectable, Optional, Inject } from '@nestjs/common';
3
+ import { Reflector } from '@nestjs/core';
4
+ import { GqlExecutionContext } from '@nestjs/graphql';
5
+ import { WMS_ACTOR_EXTRACTOR, WmsOperationRunner } from '@rytass/wms-module-core';
6
+ import { firstValueFrom, of } from 'rxjs';
7
+ import { WMS_MUTATION_EVENT_METADATA } from './wms-mutation-event.constants.mjs';
8
+
9
+ /**
10
+ * Hands each `@WmsMutationEvent` mutation to {@link WmsOperationRunner}, which
11
+ * owns the before-hook / dispatch scope / post-commit flush sequence.
12
+ *
13
+ * All this adds on top is what only a GraphQL request can supply: the raw
14
+ * arguments and the actor. Keeping the sequence itself in core is what stops
15
+ * the GraphQL path and a host's direct service call from drifting apart.
16
+ *
17
+ * When no hook, listener or bridge is configured the runner passes through
18
+ * untouched.
19
+ */
20
+ let WmsMutationInterceptor = class WmsMutationInterceptor {
21
+ reflector;
22
+ runner;
23
+ actorExtractor;
24
+ constructor(reflector, runner, actorExtractor = null) {
25
+ this.reflector = reflector;
26
+ this.runner = runner;
27
+ this.actorExtractor = actorExtractor;
28
+ }
29
+ resolveActor(context) {
30
+ if (!this.actorExtractor) {
31
+ return null;
32
+ }
33
+ try {
34
+ return this.actorExtractor(context);
35
+ }
36
+ catch {
37
+ // Fail-open on actor resolution: never break a mutation over audit metadata.
38
+ return null;
39
+ }
40
+ }
41
+ async intercept(context, next) {
42
+ const config = this.reflector.get(WMS_MUTATION_EVENT_METADATA, context.getHandler());
43
+ if (!config) {
44
+ return next.handle();
45
+ }
46
+ const result = await this.runner.run({
47
+ event: config.event,
48
+ args: GqlExecutionContext.create(context).getArgs() ?? {},
49
+ actor: this.resolveActor(context),
50
+ resolveId: config.resolveId,
51
+ executionContext: context,
52
+ }, () => firstValueFrom(next.handle()));
53
+ return of(result);
54
+ }
55
+ };
56
+ WmsMutationInterceptor = __decorate([
57
+ Injectable(),
58
+ __param(2, Optional()),
59
+ __param(2, Inject(WMS_ACTOR_EXTRACTOR)),
60
+ __metadata("design:paramtypes", [Reflector,
61
+ WmsOperationRunner, Object])
62
+ ], WmsMutationInterceptor);
63
+
64
+ export { WmsMutationInterceptor };
@@ -24,7 +24,7 @@ import { type WmsOperationRegistrationOptions } from './registry';
24
24
  * Everything is optional; with nothing configured the module behaves exactly as
25
25
  * before (no events emitted, fully permissive, every operation registered).
26
26
  */
27
- export type WmsModuleGraphqlModuleAsyncOptions = WmsModuleCoreModuleAsyncOptions & WmsAuthModuleOptions & WmsOperationRegistrationOptions & {
27
+ export type WmsModuleGraphqlModuleAsyncOptions = Omit<WmsModuleCoreModuleAsyncOptions, 'beforeHooks' | 'afterListeners'> & WmsAuthModuleOptions & WmsOperationRegistrationOptions & {
28
28
  readonly beforeHooks?: WmsTypedBeforeHookMap;
29
29
  readonly afterListeners?: WmsTypedAfterListenerMap;
30
30
  readonly actorExtractor?: WmsActorExtractor;
@@ -1,62 +1,67 @@
1
1
  import { __decorate } from 'tslib';
2
2
  import { Module } from '@nestjs/common';
3
- import { WmsModuleCoreModule, WMS_EVENT_OPTIONS, WMS_ACTOR_EXTRACTOR, WmsEventDispatcher } from '@rytass/wms-module-core';
4
- import './helpers/loader.service.js';
5
- import { HelperModule } from './helpers/helper.module.js';
6
- import './helpers/query-path.js';
7
- import { WmsAuthGuard } from './auth/wms-auth.guard.js';
8
- import { WMS_AUTH_OPTIONS } from './auth/wms-auth.types.js';
9
- import { WmsMutationInterceptor } from './events/wms-mutation.interceptor.js';
10
- import { pruneDisabledOperations } from './registry/operation-registry.js';
11
- import { LoaderMutation } from './mutations/loader.mutation.js';
12
- import { LoaderQuery } from './queries/loader.query.js';
13
- import { MaterialMutation } from './mutations/material.mutation.js';
14
- import { MaterialQuery } from './queries/material.query.js';
15
- import { StockQuery } from './queries/stock.query.js';
16
- import { ReceiveInventoryOrderMutation } from './mutations/receive-inventory-order.mutation.js';
17
- import { ReceiveInventoryOrderQuery } from './queries/recieve-inventory-order.query.js';
18
- import { ShipInventoryOrderMutation } from './mutations/ship-inventory-order.mutation.js';
19
- import { ShipInventoryOrderQuery } from './queries/ship-inventory-order.query.js';
20
- import { LoaderResolver } from './resolvers/loader.resolver.js';
21
- import { MaterialResolver } from './resolvers/material.resolver.js';
22
- import { StockResolver } from './resolvers/stock.resolver.js';
23
- import { WarehouseMapMutation } from './mutations/warehouse-map.mutation.js';
24
- import { LocationResolver } from './resolvers/location.resolver.js';
25
- import { LocationQuery } from './queries/location.query.js';
26
- import { LocationMutation } from './mutations/location.mutation.js';
27
- import { LoaderTypeResolver } from './resolvers/loader-type.resolver.js';
28
- import { UnitQuery } from './queries/unit.query.js';
29
- import { AggregatedStockResolver } from './resolvers/aggregated-stock.resolver.js';
30
- import { TransferOrderMutation } from './mutations/transfer-order.mutation.js';
31
- import { TransferOrderQuery } from './queries/transfer-order.query.js';
32
- import { TransferOrderResolver, TransferOrderItemResolver } from './resolvers/transfer-order.resolver.js';
33
- import { HoldInventoryOrderMutation } from './mutations/hold-inventory-order.mutation.js';
34
- import { HoldInventoryOrderQuery } from './queries/hold-inventory-order.query.js';
35
- import { HoldInventoryOrderResolver } from './resolvers/hold-inventory-order.resolver.js';
36
- import { BatchQuery } from './queries/batch.query.js';
37
- import { ChangeLogResolver } from './resolvers/change-log.resolver.js';
38
- import { ReceiveInventoryOrderResolver, ReceiveInventoryOrderItemResolver } from './resolvers/receive-inventory-order.resolver.js';
39
- import { AllocateInventoryOrderQuery } from './queries/allocate-inventory-order.query.js';
40
- import { AllocateInventoryOrderResolver } from './resolvers/allocate-inventory-order.resolver.js';
41
- import { AllocateInventoryOrderMutation } from './mutations/allocate-inventory-order.mutation.js';
42
- import { ShipInventoryOrderResolver, ShipInventoryOrderItemResolver, ShipInventoryOrderReferenceResolver } from './resolvers/ship-inventory-order.resolver.js';
43
- import { SaleOrderQuery } from './queries/sale-order.query.js';
44
- import { SplitBatchMutation } from './mutations/split-batch.mutation.js';
45
- import { MergeBatchMutation } from './mutations/merge-batch.mutation.js';
46
- import { ReclassifyInventoryOrderMutation } from './mutations/reclassify-inventory-order.mutation.js';
47
- import { TransferCustomerOrderMutation } from './mutations/transfer-customer-order.mutation.js';
48
- import { TransferCustomerOrderResolver } from './resolvers/transfer-customer-order.resolver.js';
49
- import { TransferVendorOrderMutation } from './mutations/transfer-vendor-order.mutation.js';
50
- import { TransferVendorOrderResolver } from './resolvers/transfer-vendor-order.resolver.js';
51
- import { SplitBatchResolver } from './resolvers/split-batch.resolver.js';
52
- import { MergeBatchOrderResolver } from './resolvers/merge-batch.resolver.js';
53
- import { ScrapeMutation } from './mutations/scrape-order.mutation.js';
54
- import { QualityInspectionOrderMutation } from './mutations/quality-inspection-order.mutation.js';
55
- import { WarehouseMapDataQuery } from './queries/warehouse-map.query.js';
56
- import { MapRangeUnionResolver } from './resolvers/warehouse-map.resolver.js';
57
- import { InventoryCountOrderQuery } from './queries/inventory-count-order.query.js';
58
- import { InventoryCountOrderMutation } from './mutations/inventory-count-order.mutation.js';
59
- import { InventoryCountOrderResolver, InventoryCountOrderItemResolver } from './resolvers/inventory-count-order.resolver.js';
3
+ import { WmsModuleCoreModule } from '@rytass/wms-module-core';
4
+ import './helpers/loader.service.mjs';
5
+ import { HelperModule } from './helpers/helper.module.mjs';
6
+ import './helpers/query-path.mjs';
7
+ import { WmsAuthGuard } from './auth/wms-auth.guard.mjs';
8
+ import { WMS_AUTH_OPTIONS } from './auth/wms-auth.types.mjs';
9
+ import { WmsMutationInterceptor } from './events/wms-mutation.interceptor.mjs';
10
+ import { pruneDisabledOperations } from './registry/operation-registry.mjs';
11
+ import { LoaderMutation } from './mutations/loader.mutation.mjs';
12
+ import { LoaderQuery } from './queries/loader.query.mjs';
13
+ import { MaterialMutation } from './mutations/material.mutation.mjs';
14
+ import { MaterialQuery } from './queries/material.query.mjs';
15
+ import { StockQuery } from './queries/stock.query.mjs';
16
+ import { ReceiveInventoryOrderMutation } from './mutations/receive-inventory-order.mutation.mjs';
17
+ import { ReceiveInventoryOrderQuery } from './queries/recieve-inventory-order.query.mjs';
18
+ import { ShipInventoryOrderMutation } from './mutations/ship-inventory-order.mutation.mjs';
19
+ import { ShipInventoryOrderQuery } from './queries/ship-inventory-order.query.mjs';
20
+ import { LoaderResolver } from './resolvers/loader.resolver.mjs';
21
+ import { MaterialResolver } from './resolvers/material.resolver.mjs';
22
+ import { StockResolver } from './resolvers/stock.resolver.mjs';
23
+ import { WarehouseMapMutation } from './mutations/warehouse-map.mutation.mjs';
24
+ import { LocationResolver } from './resolvers/location.resolver.mjs';
25
+ import { LocationQuery } from './queries/location.query.mjs';
26
+ import { LocationMutation } from './mutations/location.mutation.mjs';
27
+ import { LoaderTypeResolver } from './resolvers/loader-type.resolver.mjs';
28
+ import { UnitQuery } from './queries/unit.query.mjs';
29
+ import { AggregatedStockResolver } from './resolvers/aggregated-stock.resolver.mjs';
30
+ import { TransferOrderMutation } from './mutations/transfer-order.mutation.mjs';
31
+ import { TransferOrderQuery } from './queries/transfer-order.query.mjs';
32
+ import { TransferOrderResolver, TransferOrderItemResolver } from './resolvers/transfer-order.resolver.mjs';
33
+ import { HoldInventoryOrderMutation } from './mutations/hold-inventory-order.mutation.mjs';
34
+ import { HoldInventoryOrderQuery } from './queries/hold-inventory-order.query.mjs';
35
+ import { HoldInventoryOrderResolver } from './resolvers/hold-inventory-order.resolver.mjs';
36
+ import { BatchQuery } from './queries/batch.query.mjs';
37
+ import { OrderReferenceQuery } from './queries/order-reference.query.mjs';
38
+ import { OrderReferenceMutation } from './mutations/order-reference.mutation.mjs';
39
+ import { ConsumptionOrderQuery } from './queries/consumption-order.query.mjs';
40
+ import { ConsumptionOrderMutation } from './mutations/consumption-order.mutation.mjs';
41
+ import { ConsumptionOrderResolver, ConsumptionOrderItemResolver } from './resolvers/consumption-order.resolver.mjs';
42
+ import { ChangeLogResolver } from './resolvers/change-log.resolver.mjs';
43
+ import { ReceiveInventoryOrderResolver, ReceiveInventoryOrderItemResolver } from './resolvers/receive-inventory-order.resolver.mjs';
44
+ import { AllocateInventoryOrderQuery } from './queries/allocate-inventory-order.query.mjs';
45
+ import { AllocateInventoryOrderResolver } from './resolvers/allocate-inventory-order.resolver.mjs';
46
+ import { AllocateInventoryOrderMutation } from './mutations/allocate-inventory-order.mutation.mjs';
47
+ import { ShipInventoryOrderResolver, ShipInventoryOrderItemResolver, ShipInventoryOrderReferenceResolver } from './resolvers/ship-inventory-order.resolver.mjs';
48
+ import { SaleOrderQuery } from './queries/sale-order.query.mjs';
49
+ import { SplitBatchMutation } from './mutations/split-batch.mutation.mjs';
50
+ import { MergeBatchMutation } from './mutations/merge-batch.mutation.mjs';
51
+ import { ReclassifyInventoryOrderMutation } from './mutations/reclassify-inventory-order.mutation.mjs';
52
+ import { TransferCustomerOrderMutation } from './mutations/transfer-customer-order.mutation.mjs';
53
+ import { TransferCustomerOrderResolver } from './resolvers/transfer-customer-order.resolver.mjs';
54
+ import { TransferVendorOrderMutation } from './mutations/transfer-vendor-order.mutation.mjs';
55
+ import { TransferVendorOrderResolver } from './resolvers/transfer-vendor-order.resolver.mjs';
56
+ import { SplitBatchResolver } from './resolvers/split-batch.resolver.mjs';
57
+ import { MergeBatchOrderResolver } from './resolvers/merge-batch.resolver.mjs';
58
+ import { ScrapeMutation } from './mutations/scrape-order.mutation.mjs';
59
+ import { QualityInspectionOrderMutation } from './mutations/quality-inspection-order.mutation.mjs';
60
+ import { WarehouseMapDataQuery } from './queries/warehouse-map.query.mjs';
61
+ import { MapRangeUnionResolver } from './resolvers/warehouse-map.resolver.mjs';
62
+ import { InventoryCountOrderQuery } from './queries/inventory-count-order.query.mjs';
63
+ import { InventoryCountOrderMutation } from './mutations/inventory-count-order.mutation.mjs';
64
+ import { InventoryCountOrderResolver, InventoryCountOrderItemResolver } from './resolvers/inventory-count-order.resolver.mjs';
60
65
 
61
66
  var WmsModuleGraphqlModule_1;
62
67
  const exportDependencies = [
@@ -116,6 +121,12 @@ const exportDependencies = [
116
121
  InventoryCountOrderMutation,
117
122
  InventoryCountOrderResolver,
118
123
  InventoryCountOrderItemResolver,
124
+ OrderReferenceQuery,
125
+ OrderReferenceMutation,
126
+ ConsumptionOrderQuery,
127
+ ConsumptionOrderMutation,
128
+ ConsumptionOrderResolver,
129
+ ConsumptionOrderItemResolver,
119
130
  ];
120
131
  let WmsModuleGraphqlModule = WmsModuleGraphqlModule_1 = class WmsModuleGraphqlModule {
121
132
  static forRootAsync(options) {
@@ -129,25 +140,31 @@ let WmsModuleGraphqlModule = WmsModuleGraphqlModule_1 = class WmsModuleGraphqlMo
129
140
  disabledOperations,
130
141
  disabledFields,
131
142
  });
132
- // coreOptions still carries `enrichStockEvents`, forwarded to the core module.
133
- const coreModule = WmsModuleCoreModule.forRootAsync(coreOptions);
134
- const authOptions = { authChecker };
135
- // The typed hook maps are a compile-time refinement of the core maps; at
136
- // runtime the dispatched payload IS the concrete result type, so handing the
137
- // refined maps to the (looser) core option contract is sound.
138
- const eventOptions = {
143
+ /*
144
+ * The event wiring goes down to the core module rather than being bound
145
+ * here. `WmsOperationRunner` lives in core so a host calling a service
146
+ * directly gets the same guarantee, and binding the same tokens in both
147
+ * modules would leave two live bindings whose winner depends on which
148
+ * injector the consumer reached first.
149
+ *
150
+ * `coreOptions` still carries `enrichStockEvents`, also forwarded.
151
+ */
152
+ const coreModule = WmsModuleCoreModule.forRootAsync({
153
+ ...coreOptions,
154
+ // The typed hook maps are a compile-time refinement of the core maps; at
155
+ // runtime the dispatched payload IS the concrete result type, so handing
156
+ // the refined maps to the (looser) core option contract is sound.
139
157
  beforeHooks: beforeHooks,
140
158
  afterListeners: afterListeners,
141
- };
159
+ actorExtractor,
160
+ eventEmitterBridge,
161
+ });
162
+ const authOptions = { authChecker };
142
163
  const providers = [
143
164
  ...exportDependencies,
144
165
  WmsAuthGuard,
145
166
  { provide: WMS_AUTH_OPTIONS, useValue: authOptions },
146
- { provide: WMS_EVENT_OPTIONS, useValue: eventOptions },
147
- { provide: WMS_ACTOR_EXTRACTOR, useValue: actorExtractor ?? null },
148
- WmsEventDispatcher,
149
167
  WmsMutationInterceptor,
150
- ...(eventEmitterBridge ? [eventEmitterBridge] : []),
151
168
  ];
152
169
  return {
153
170
  module: WmsModuleGraphqlModule_1,
@@ -1,6 +1,6 @@
1
1
  import { __decorate } from 'tslib';
2
2
  import { Global, Module } from '@nestjs/common';
3
- import { LoaderService } from './loader.service.js';
3
+ import { LoaderService } from './loader.service.mjs';
4
4
 
5
5
  let HelperModule = class HelperModule {
6
6
  };
@@ -0,0 +1,47 @@
1
+ import { PaginationArgs } from './pagination.args';
2
+ export declare class CreateConsumptionOrderItemInputType {
3
+ materialId: string;
4
+ batchId: string;
5
+ /** Where the material is issued from. Defaults to the module's default location. */
6
+ locationId?: string;
7
+ loaderId?: string;
8
+ unitId?: string;
9
+ quantity: number;
10
+ /** Where it sits while the process holds it. Defaults to the source location. */
11
+ targetLocationId?: string;
12
+ targetLoaderId?: string;
13
+ }
14
+ export declare class CreateConsumptionOrderArgs {
15
+ description?: string;
16
+ createdBy?: string;
17
+ items: CreateConsumptionOrderItemInputType[];
18
+ }
19
+ export declare class UpdateConsumptionOrderArgs {
20
+ id: string;
21
+ description?: string;
22
+ /** Replaces every line. Refused once the order has moved any stock. */
23
+ items?: CreateConsumptionOrderItemInputType[];
24
+ }
25
+ export declare class ConsumptionOrderLineInputType {
26
+ itemId: string;
27
+ /** Omit for whatever is outstanding on that line. */
28
+ quantity?: number;
29
+ }
30
+ export declare class ConsumptionOrderActionArgs {
31
+ orderId: string;
32
+ /** Omit to act on every line of the order. */
33
+ items?: ConsumptionOrderLineInputType[];
34
+ }
35
+ export declare class FindConsumptionOrderArgs extends PaginationArgs {
36
+ ids?: string[];
37
+ key?: string;
38
+ description?: string;
39
+ materialId?: string;
40
+ batchId?: string;
41
+ /** Matches either the source or the consuming location. */
42
+ locationId?: string;
43
+ createdBy?: string;
44
+ createdAtFrom?: Date;
45
+ createdAtTo?: Date;
46
+ includeRemoved?: boolean;
47
+ }
@@ -0,0 +1,182 @@
1
+ import { __decorate, __metadata } from 'tslib';
2
+ import { Field, ID, Float, InputType, ArgsType } from '@nestjs/graphql';
3
+ import { PaginationArgs } from './pagination.args.mjs';
4
+
5
+ let CreateConsumptionOrderItemInputType = class CreateConsumptionOrderItemInputType {
6
+ materialId;
7
+ batchId;
8
+ /** Where the material is issued from. Defaults to the module's default location. */
9
+ locationId;
10
+ loaderId;
11
+ unitId;
12
+ quantity;
13
+ /** Where it sits while the process holds it. Defaults to the source location. */
14
+ targetLocationId;
15
+ targetLoaderId;
16
+ };
17
+ __decorate([
18
+ Field(() => ID),
19
+ __metadata("design:type", String)
20
+ ], CreateConsumptionOrderItemInputType.prototype, "materialId", void 0);
21
+ __decorate([
22
+ Field(() => ID),
23
+ __metadata("design:type", String)
24
+ ], CreateConsumptionOrderItemInputType.prototype, "batchId", void 0);
25
+ __decorate([
26
+ Field(() => ID, { nullable: true }),
27
+ __metadata("design:type", String)
28
+ ], CreateConsumptionOrderItemInputType.prototype, "locationId", void 0);
29
+ __decorate([
30
+ Field(() => ID, { nullable: true }),
31
+ __metadata("design:type", String)
32
+ ], CreateConsumptionOrderItemInputType.prototype, "loaderId", void 0);
33
+ __decorate([
34
+ Field(() => ID, { nullable: true }),
35
+ __metadata("design:type", String)
36
+ ], CreateConsumptionOrderItemInputType.prototype, "unitId", void 0);
37
+ __decorate([
38
+ Field(() => Float),
39
+ __metadata("design:type", Number)
40
+ ], CreateConsumptionOrderItemInputType.prototype, "quantity", void 0);
41
+ __decorate([
42
+ Field(() => ID, { nullable: true }),
43
+ __metadata("design:type", String)
44
+ ], CreateConsumptionOrderItemInputType.prototype, "targetLocationId", void 0);
45
+ __decorate([
46
+ Field(() => ID, { nullable: true }),
47
+ __metadata("design:type", String)
48
+ ], CreateConsumptionOrderItemInputType.prototype, "targetLoaderId", void 0);
49
+ CreateConsumptionOrderItemInputType = __decorate([
50
+ InputType()
51
+ ], CreateConsumptionOrderItemInputType);
52
+ let CreateConsumptionOrderArgs = class CreateConsumptionOrderArgs {
53
+ description;
54
+ createdBy;
55
+ items;
56
+ };
57
+ __decorate([
58
+ Field(() => String, { nullable: true }),
59
+ __metadata("design:type", String)
60
+ ], CreateConsumptionOrderArgs.prototype, "description", void 0);
61
+ __decorate([
62
+ Field(() => String, { nullable: true }),
63
+ __metadata("design:type", String)
64
+ ], CreateConsumptionOrderArgs.prototype, "createdBy", void 0);
65
+ __decorate([
66
+ Field(() => [CreateConsumptionOrderItemInputType]),
67
+ __metadata("design:type", Array)
68
+ ], CreateConsumptionOrderArgs.prototype, "items", void 0);
69
+ CreateConsumptionOrderArgs = __decorate([
70
+ ArgsType()
71
+ ], CreateConsumptionOrderArgs);
72
+ let UpdateConsumptionOrderArgs = class UpdateConsumptionOrderArgs {
73
+ id;
74
+ description;
75
+ /** Replaces every line. Refused once the order has moved any stock. */
76
+ items;
77
+ };
78
+ __decorate([
79
+ Field(() => ID),
80
+ __metadata("design:type", String)
81
+ ], UpdateConsumptionOrderArgs.prototype, "id", void 0);
82
+ __decorate([
83
+ Field(() => String, { nullable: true }),
84
+ __metadata("design:type", String)
85
+ ], UpdateConsumptionOrderArgs.prototype, "description", void 0);
86
+ __decorate([
87
+ Field(() => [CreateConsumptionOrderItemInputType], { nullable: true }),
88
+ __metadata("design:type", Array)
89
+ ], UpdateConsumptionOrderArgs.prototype, "items", void 0);
90
+ UpdateConsumptionOrderArgs = __decorate([
91
+ ArgsType()
92
+ ], UpdateConsumptionOrderArgs);
93
+ let ConsumptionOrderLineInputType = class ConsumptionOrderLineInputType {
94
+ itemId;
95
+ /** Omit for whatever is outstanding on that line. */
96
+ quantity;
97
+ };
98
+ __decorate([
99
+ Field(() => ID),
100
+ __metadata("design:type", String)
101
+ ], ConsumptionOrderLineInputType.prototype, "itemId", void 0);
102
+ __decorate([
103
+ Field(() => Float, { nullable: true }),
104
+ __metadata("design:type", Number)
105
+ ], ConsumptionOrderLineInputType.prototype, "quantity", void 0);
106
+ ConsumptionOrderLineInputType = __decorate([
107
+ InputType()
108
+ ], ConsumptionOrderLineInputType);
109
+ let ConsumptionOrderActionArgs = class ConsumptionOrderActionArgs {
110
+ orderId;
111
+ /** Omit to act on every line of the order. */
112
+ items;
113
+ };
114
+ __decorate([
115
+ Field(() => ID),
116
+ __metadata("design:type", String)
117
+ ], ConsumptionOrderActionArgs.prototype, "orderId", void 0);
118
+ __decorate([
119
+ Field(() => [ConsumptionOrderLineInputType], { nullable: true }),
120
+ __metadata("design:type", Array)
121
+ ], ConsumptionOrderActionArgs.prototype, "items", void 0);
122
+ ConsumptionOrderActionArgs = __decorate([
123
+ ArgsType()
124
+ ], ConsumptionOrderActionArgs);
125
+ let FindConsumptionOrderArgs = class FindConsumptionOrderArgs extends PaginationArgs {
126
+ ids;
127
+ key;
128
+ description;
129
+ materialId;
130
+ batchId;
131
+ /** Matches either the source or the consuming location. */
132
+ locationId;
133
+ createdBy;
134
+ createdAtFrom;
135
+ createdAtTo;
136
+ includeRemoved;
137
+ };
138
+ __decorate([
139
+ Field(() => [ID], { nullable: true }),
140
+ __metadata("design:type", Array)
141
+ ], FindConsumptionOrderArgs.prototype, "ids", void 0);
142
+ __decorate([
143
+ Field(() => String, { nullable: true }),
144
+ __metadata("design:type", String)
145
+ ], FindConsumptionOrderArgs.prototype, "key", void 0);
146
+ __decorate([
147
+ Field(() => String, { nullable: true }),
148
+ __metadata("design:type", String)
149
+ ], FindConsumptionOrderArgs.prototype, "description", void 0);
150
+ __decorate([
151
+ Field(() => ID, { nullable: true }),
152
+ __metadata("design:type", String)
153
+ ], FindConsumptionOrderArgs.prototype, "materialId", void 0);
154
+ __decorate([
155
+ Field(() => ID, { nullable: true }),
156
+ __metadata("design:type", String)
157
+ ], FindConsumptionOrderArgs.prototype, "batchId", void 0);
158
+ __decorate([
159
+ Field(() => ID, { nullable: true }),
160
+ __metadata("design:type", String)
161
+ ], FindConsumptionOrderArgs.prototype, "locationId", void 0);
162
+ __decorate([
163
+ Field(() => String, { nullable: true }),
164
+ __metadata("design:type", String)
165
+ ], FindConsumptionOrderArgs.prototype, "createdBy", void 0);
166
+ __decorate([
167
+ Field(() => Date, { nullable: true }),
168
+ __metadata("design:type", Date)
169
+ ], FindConsumptionOrderArgs.prototype, "createdAtFrom", void 0);
170
+ __decorate([
171
+ Field(() => Date, { nullable: true }),
172
+ __metadata("design:type", Date)
173
+ ], FindConsumptionOrderArgs.prototype, "createdAtTo", void 0);
174
+ __decorate([
175
+ Field(() => Boolean, { nullable: true }),
176
+ __metadata("design:type", Boolean)
177
+ ], FindConsumptionOrderArgs.prototype, "includeRemoved", void 0);
178
+ FindConsumptionOrderArgs = __decorate([
179
+ ArgsType()
180
+ ], FindConsumptionOrderArgs);
181
+
182
+ export { ConsumptionOrderActionArgs, ConsumptionOrderLineInputType, CreateConsumptionOrderArgs, CreateConsumptionOrderItemInputType, FindConsumptionOrderArgs, UpdateConsumptionOrderArgs };
@@ -1,6 +1,6 @@
1
1
  import { __decorate, __metadata } from 'tslib';
2
2
  import { Field, ArgsType, PartialType, OmitType } from '@nestjs/graphql';
3
- import { CreateAllocateInventoryOrderItemArgs, UpdateAllocateInventoryOrderItemArgs } from './create-allocate-inventory-order-item.args.js';
3
+ import { CreateAllocateInventoryOrderItemArgs, UpdateAllocateInventoryOrderItemArgs } from './create-allocate-inventory-order-item.args.mjs';
4
4
 
5
5
  let CreateAllocateInventoryOrderArgs = class CreateAllocateInventoryOrderArgs {
6
6
  items;
@@ -1,6 +1,6 @@
1
1
  import { __decorate, __metadata } from 'tslib';
2
2
  import { Field, ArgsType, PartialType, OmitType } from '@nestjs/graphql';
3
- import { CreateHoldInventoryOrderItemArgs, UpdateHoldInventoryOrderItemArgs } from './create-hold-inventory-order-item.args.js';
3
+ import { CreateHoldInventoryOrderItemArgs, UpdateHoldInventoryOrderItemArgs } from './create-hold-inventory-order-item.args.mjs';
4
4
 
5
5
  let CreateHoldInventoryOrderArgs = class CreateHoldInventoryOrderArgs {
6
6
  createdBy;
@@ -1,6 +1,6 @@
1
1
  import { __decorate, __metadata } from 'tslib';
2
2
  import { Field, ArgsType, PartialType, OmitType, ID } from '@nestjs/graphql';
3
- import { CreateMaterialUnitArgs } from './create-material-unit.args.js';
3
+ import { CreateMaterialUnitArgs } from './create-material-unit.args.mjs';
4
4
 
5
5
  let CreateMaterialArgs = class CreateMaterialArgs {
6
6
  key;