@rytass/wms-module-graphql 0.7.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +94 -6
- package/docs/api-reference.md +81 -6
- package/docs/events.md +23 -4
- package/index.cjs.js +919 -110
- package/index.d.ts +3 -1
- package/index.js +2 -0
- package/lib/dto/index.d.ts +1 -0
- package/lib/dto/inventory-count-order.dto.d.ts +49 -0
- package/lib/dto/inventory-count-order.dto.js +146 -0
- package/lib/events/operation-result-map.d.ts +8 -0
- package/lib/graphql.module.d.ts +6 -2
- package/lib/graphql.module.js +18 -1
- package/lib/inputs/inventory-count-order.args.d.ts +55 -0
- package/lib/inputs/inventory-count-order.args.js +196 -0
- package/lib/mutations/inventory-count-order.mutation.d.ts +19 -0
- package/lib/mutations/inventory-count-order.mutation.js +138 -0
- package/lib/mutations/loader.mutation.js +1 -0
- package/lib/mutations/material.mutation.js +1 -0
- package/lib/mutations/receive-inventory-order.mutation.js +1 -0
- package/lib/mutations/ship-inventory-order.mutation.js +1 -0
- package/lib/queries/inventory-count-order.query.d.ts +9 -0
- package/lib/queries/inventory-count-order.query.js +44 -0
- package/lib/queries/loader.query.js +1 -0
- package/lib/queries/material.query.js +1 -0
- package/lib/queries/recieve-inventory-order.query.js +1 -0
- package/lib/queries/ship-inventory-order.query.js +1 -0
- package/lib/queries/stock.query.js +1 -0
- package/lib/registry/index.d.ts +1 -0
- package/lib/registry/operation-registry.d.ts +59 -0
- package/lib/registry/operation-registry.js +136 -0
- package/lib/resolvers/aggregated-stock.resolver.d.ts +3 -11
- package/lib/resolvers/aggregated-stock.resolver.js +10 -18
- package/lib/resolvers/change-log.resolver.d.ts +8 -8
- package/lib/resolvers/change-log.resolver.js +14 -15
- package/lib/resolvers/inventory-count-order.resolver.d.ts +34 -0
- package/lib/resolvers/inventory-count-order.resolver.js +148 -0
- package/lib/resolvers/loader-type.resolver.js +1 -0
- package/lib/resolvers/loader.resolver.d.ts +10 -2
- package/lib/resolvers/loader.resolver.js +15 -4
- package/lib/resolvers/location.resolver.d.ts +10 -1
- package/lib/resolvers/location.resolver.js +17 -6
- package/lib/resolvers/material.resolver.js +1 -0
- package/lib/resolvers/receive-inventory-order.resolver.d.ts +8 -8
- package/lib/resolvers/receive-inventory-order.resolver.js +14 -15
- package/lib/resolvers/ship-inventory-order.resolver.d.ts +15 -15
- package/lib/resolvers/ship-inventory-order.resolver.js +27 -29
- package/lib/resolvers/stock.resolver.d.ts +8 -8
- package/lib/resolvers/stock.resolver.js +14 -15
- package/lib/resolvers/transfer-order.resolver.d.ts +17 -8
- package/lib/resolvers/transfer-order.resolver.js +30 -19
- package/lib/resolvers/warehouse-map.resolver.d.ts +10 -1
- package/lib/resolvers/warehouse-map.resolver.js +15 -3
- package/package.json +2 -2
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { __decorate, __param, __metadata } from 'tslib';
|
|
2
|
-
import { Inject } from '@nestjs/common';
|
|
3
2
|
import { ResolveField, Parent, Context, Resolver, ID, Int } from '@nestjs/graphql';
|
|
4
3
|
import '../dto/loader-type.dto.js';
|
|
5
4
|
import { LoaderDto } from '../dto/loader.dto.js';
|
|
@@ -25,7 +24,8 @@ import '../dto/scrape-order.dto.js';
|
|
|
25
24
|
import '../dto/scrape-order-item.dto.js';
|
|
26
25
|
import '../dto/quality-inspection-order.dto.js';
|
|
27
26
|
import '../dto/quality-inspection-order-item.dto.js';
|
|
28
|
-
import
|
|
27
|
+
import '../dto/inventory-count-order.dto.js';
|
|
28
|
+
import { ShipInventoryOrderEntityClass, ShipInventoryOrderItemEntityClass, WmsEntities, ShipInventoryOrderReferenceEntityClass, BatchGroupEntityClass, LoadersEntityClass, ShipInventoryOrderChangeEntityClass } from '@rytass/wms-module-core';
|
|
29
29
|
import { BatchDto } from '../dto/batch.dto.js';
|
|
30
30
|
import { LocationDto } from '../dto/location.dto.js';
|
|
31
31
|
import { ShipInventoryOrderReferenceDto } from '../dto/ship-inventory-order-reference.dto.js';
|
|
@@ -65,20 +65,20 @@ ShipInventoryOrderResolver = __decorate([
|
|
|
65
65
|
Resolver(() => ShipInventoryOrderDto)
|
|
66
66
|
], ShipInventoryOrderResolver);
|
|
67
67
|
let ShipInventoryOrderItemResolver = class ShipInventoryOrderItemResolver {
|
|
68
|
-
|
|
68
|
+
entities;
|
|
69
69
|
/**
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
70
|
+
* The configured entities, not the built-in classes: `__entity` decides which
|
|
71
|
+
* repository the DataLoader opens, so it has to follow whatever the consumer
|
|
72
|
+
* passed to `WMSBaseModuleOptions`. Loading a built-in class outright filters
|
|
73
|
+
* on its single-table-inheritance discriminator and resolves nothing for an
|
|
74
|
+
* override.
|
|
75
75
|
*/
|
|
76
|
-
constructor(
|
|
77
|
-
this.
|
|
76
|
+
constructor(entities) {
|
|
77
|
+
this.entities = entities;
|
|
78
78
|
}
|
|
79
79
|
material({ materialId }, { loaders }) {
|
|
80
80
|
return loaders.batchSingle.load({
|
|
81
|
-
__entity: this.
|
|
81
|
+
__entity: this.entities.material,
|
|
82
82
|
__from: { id: materialId },
|
|
83
83
|
});
|
|
84
84
|
}
|
|
@@ -86,7 +86,7 @@ let ShipInventoryOrderItemResolver = class ShipInventoryOrderItemResolver {
|
|
|
86
86
|
if (!batchId)
|
|
87
87
|
return null;
|
|
88
88
|
const { groupId } = await loaders.batchSingle.load({
|
|
89
|
-
__entity:
|
|
89
|
+
__entity: this.entities.batch,
|
|
90
90
|
__from: { id: batchId },
|
|
91
91
|
});
|
|
92
92
|
return loaders.batchSingle.load({
|
|
@@ -98,7 +98,7 @@ let ShipInventoryOrderItemResolver = class ShipInventoryOrderItemResolver {
|
|
|
98
98
|
if (!batchId)
|
|
99
99
|
return null;
|
|
100
100
|
const { groupId } = await loaders.batchSingle.load({
|
|
101
|
-
__entity:
|
|
101
|
+
__entity: this.entities.batch,
|
|
102
102
|
__from: { id: batchId },
|
|
103
103
|
});
|
|
104
104
|
return loaders.batchSingle
|
|
@@ -112,7 +112,7 @@ let ShipInventoryOrderItemResolver = class ShipInventoryOrderItemResolver {
|
|
|
112
112
|
if (!batchId)
|
|
113
113
|
return null;
|
|
114
114
|
const { groupId } = await loaders.batchSingle.load({
|
|
115
|
-
__entity:
|
|
115
|
+
__entity: this.entities.batch,
|
|
116
116
|
__from: { id: batchId },
|
|
117
117
|
});
|
|
118
118
|
return loaders.batchSingle
|
|
@@ -126,7 +126,7 @@ let ShipInventoryOrderItemResolver = class ShipInventoryOrderItemResolver {
|
|
|
126
126
|
if (!locationId)
|
|
127
127
|
return null;
|
|
128
128
|
return loaders.batchSingle.load({
|
|
129
|
-
__entity:
|
|
129
|
+
__entity: this.entities.location,
|
|
130
130
|
__from: { id: locationId },
|
|
131
131
|
});
|
|
132
132
|
}
|
|
@@ -207,20 +207,19 @@ __decorate([
|
|
|
207
207
|
], ShipInventoryOrderItemResolver.prototype, "shippedQuantity", null);
|
|
208
208
|
ShipInventoryOrderItemResolver = __decorate([
|
|
209
209
|
Resolver(() => ShipInventoryOrderItemDto),
|
|
210
|
-
|
|
211
|
-
__metadata("design:paramtypes", [Function])
|
|
210
|
+
__metadata("design:paramtypes", [WmsEntities])
|
|
212
211
|
], ShipInventoryOrderItemResolver);
|
|
213
212
|
let ShipInventoryOrderReferenceResolver = class ShipInventoryOrderReferenceResolver {
|
|
214
|
-
|
|
213
|
+
entities;
|
|
215
214
|
/**
|
|
216
|
-
*
|
|
217
|
-
*
|
|
218
|
-
*
|
|
219
|
-
*
|
|
220
|
-
*
|
|
215
|
+
* The configured entities, not the built-in classes: `__entity` decides which
|
|
216
|
+
* repository the DataLoader opens, so it has to follow whatever the consumer
|
|
217
|
+
* passed to `WMSBaseModuleOptions`. Loading a built-in class outright filters
|
|
218
|
+
* on its single-table-inheritance discriminator and resolves nothing for an
|
|
219
|
+
* override.
|
|
221
220
|
*/
|
|
222
|
-
constructor(
|
|
223
|
-
this.
|
|
221
|
+
constructor(entities) {
|
|
222
|
+
this.entities = entities;
|
|
224
223
|
}
|
|
225
224
|
async shippedQuantity({ orderId, serialId }, { loaders }) {
|
|
226
225
|
const items = await loaders.batchMany.load({
|
|
@@ -236,7 +235,7 @@ let ShipInventoryOrderReferenceResolver = class ShipInventoryOrderReferenceResol
|
|
|
236
235
|
}
|
|
237
236
|
material({ materialId }, { loaders }) {
|
|
238
237
|
return loaders.batchSingle.load({
|
|
239
|
-
__entity: this.
|
|
238
|
+
__entity: this.entities.material,
|
|
240
239
|
__from: { id: materialId },
|
|
241
240
|
});
|
|
242
241
|
}
|
|
@@ -244,7 +243,7 @@ let ShipInventoryOrderReferenceResolver = class ShipInventoryOrderReferenceResol
|
|
|
244
243
|
if (!batchId)
|
|
245
244
|
return null;
|
|
246
245
|
const { groupId } = await loaders.batchSingle.load({
|
|
247
|
-
__entity:
|
|
246
|
+
__entity: this.entities.batch,
|
|
248
247
|
__from: { id: batchId },
|
|
249
248
|
});
|
|
250
249
|
return loaders.batchSingle.load({
|
|
@@ -293,8 +292,7 @@ __decorate([
|
|
|
293
292
|
], ShipInventoryOrderReferenceResolver.prototype, "items", null);
|
|
294
293
|
ShipInventoryOrderReferenceResolver = __decorate([
|
|
295
294
|
Resolver(() => ShipInventoryOrderReferenceDto),
|
|
296
|
-
|
|
297
|
-
__metadata("design:paramtypes", [Function])
|
|
295
|
+
__metadata("design:paramtypes", [WmsEntities])
|
|
298
296
|
], ShipInventoryOrderReferenceResolver);
|
|
299
297
|
|
|
300
298
|
export { ShipInventoryOrderItemResolver, ShipInventoryOrderReferenceResolver, ShipInventoryOrderResolver };
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { MaterialDto } from '../dto';
|
|
2
|
-
import { BatchEntityClass, LocationEntityClass, MaterialEntityClass, StockEntityClass } from '@rytass/wms-module-core';
|
|
2
|
+
import { BatchEntityClass, LocationEntityClass, MaterialEntityClass, StockEntityClass, WmsEntities } from '@rytass/wms-module-core';
|
|
3
3
|
import { type LoaderType } from '../helpers';
|
|
4
4
|
import { LocationDto } from '../dto/location.dto';
|
|
5
5
|
import { BatchDto } from '../dto/batch.dto';
|
|
6
6
|
export declare class StockResolver {
|
|
7
|
-
private readonly
|
|
7
|
+
private readonly entities;
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
9
|
+
* The configured entities, not the built-in classes: `__entity` decides which
|
|
10
|
+
* repository the DataLoader opens, so it has to follow whatever the consumer
|
|
11
|
+
* passed to `WMSBaseModuleOptions`. Loading a built-in class outright filters
|
|
12
|
+
* on its single-table-inheritance discriminator and resolves nothing for an
|
|
13
|
+
* override.
|
|
14
14
|
*/
|
|
15
|
-
constructor(
|
|
15
|
+
constructor(entities: WmsEntities);
|
|
16
16
|
material({ materialId }: StockEntityClass, { loaders }: LoaderType<MaterialEntityClass>): Promise<MaterialDto>;
|
|
17
17
|
location({ locationId }: StockEntityClass, { loaders }: LoaderType<LocationEntityClass>): Promise<LocationDto>;
|
|
18
18
|
batch({ batchId }: StockEntityClass, { loaders }: LoaderType<BatchEntityClass>): Promise<BatchDto | null>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { __decorate, __param, __metadata } from 'tslib';
|
|
2
|
-
import { Inject } from '@nestjs/common';
|
|
3
2
|
import { ResolveField, Parent, Context, Resolver } from '@nestjs/graphql';
|
|
4
3
|
import '../dto/loader-type.dto.js';
|
|
5
4
|
import '../dto/loader.dto.js';
|
|
@@ -25,37 +24,38 @@ import '../dto/scrape-order.dto.js';
|
|
|
25
24
|
import '../dto/scrape-order-item.dto.js';
|
|
26
25
|
import '../dto/quality-inspection-order.dto.js';
|
|
27
26
|
import '../dto/quality-inspection-order-item.dto.js';
|
|
28
|
-
import
|
|
27
|
+
import '../dto/inventory-count-order.dto.js';
|
|
28
|
+
import { StockEntityClass, WmsEntities, BatchGroupEntityClass } from '@rytass/wms-module-core';
|
|
29
29
|
import { LocationDto } from '../dto/location.dto.js';
|
|
30
30
|
import { BatchDto } from '../dto/batch.dto.js';
|
|
31
31
|
|
|
32
32
|
let StockResolver = class StockResolver {
|
|
33
|
-
|
|
33
|
+
entities;
|
|
34
34
|
/**
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
35
|
+
* The configured entities, not the built-in classes: `__entity` decides which
|
|
36
|
+
* repository the DataLoader opens, so it has to follow whatever the consumer
|
|
37
|
+
* passed to `WMSBaseModuleOptions`. Loading a built-in class outright filters
|
|
38
|
+
* on its single-table-inheritance discriminator and resolves nothing for an
|
|
39
|
+
* override.
|
|
40
40
|
*/
|
|
41
|
-
constructor(
|
|
42
|
-
this.
|
|
41
|
+
constructor(entities) {
|
|
42
|
+
this.entities = entities;
|
|
43
43
|
}
|
|
44
44
|
material({ materialId }, { loaders }) {
|
|
45
45
|
return loaders.batchSingle.load({
|
|
46
|
-
__entity: this.
|
|
46
|
+
__entity: this.entities.material,
|
|
47
47
|
__from: { id: materialId },
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
50
|
location({ locationId }, { loaders }) {
|
|
51
51
|
return loaders.batchSingle.load({
|
|
52
|
-
__entity:
|
|
52
|
+
__entity: this.entities.location,
|
|
53
53
|
__from: { id: locationId },
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
56
|
async batch({ batchId }, { loaders }) {
|
|
57
57
|
const { groupId } = await loaders.batchSingle.load({
|
|
58
|
-
__entity:
|
|
58
|
+
__entity: this.entities.batch,
|
|
59
59
|
__from: { id: batchId },
|
|
60
60
|
});
|
|
61
61
|
return loaders.batchSingle.load({
|
|
@@ -90,8 +90,7 @@ __decorate([
|
|
|
90
90
|
], StockResolver.prototype, "batch", null);
|
|
91
91
|
StockResolver = __decorate([
|
|
92
92
|
Resolver(() => StockDto),
|
|
93
|
-
|
|
94
|
-
__metadata("design:paramtypes", [Function])
|
|
93
|
+
__metadata("design:paramtypes", [WmsEntities])
|
|
95
94
|
], StockResolver);
|
|
96
95
|
|
|
97
96
|
export { StockResolver };
|
|
@@ -1,25 +1,34 @@
|
|
|
1
1
|
import { TransferOrderDto } from '../dto/transfer-order.dto';
|
|
2
2
|
import { TransferOrderItemDto } from '../dto/transfer-order-item.dto';
|
|
3
3
|
import { type LoaderType } from '../helpers';
|
|
4
|
-
import { BatchEntityClass, LoadersEntityClass, LocationEntityClass, MaterialEntityClass, TransferOrderChangeEntityClass, TransferOrderItemEntityClass } from '@rytass/wms-module-core';
|
|
4
|
+
import { BatchEntityClass, LoadersEntityClass, LocationEntityClass, MaterialEntityClass, TransferOrderChangeEntityClass, TransferOrderItemEntityClass, WmsEntities } from '@rytass/wms-module-core';
|
|
5
5
|
import { LoaderDto, MaterialDto } from '../dto';
|
|
6
6
|
import { BatchDto } from '../dto/batch.dto';
|
|
7
7
|
import { LocationDto } from '../dto/location.dto';
|
|
8
8
|
export declare class TransferOrderResolver {
|
|
9
|
+
private readonly entities;
|
|
10
|
+
/**
|
|
11
|
+
* The configured entities, not the built-in classes: `__entity` decides which
|
|
12
|
+
* repository the DataLoader opens, so it has to follow whatever the consumer
|
|
13
|
+
* passed to `WMSBaseModuleOptions`. Loading a built-in class outright filters
|
|
14
|
+
* on its single-table-inheritance discriminator and resolves nothing for an
|
|
15
|
+
* override.
|
|
16
|
+
*/
|
|
17
|
+
constructor(entities: WmsEntities);
|
|
9
18
|
items({ id }: TransferOrderDto, { loaders }: LoaderType<TransferOrderItemEntityClass>): Promise<TransferOrderItemDto[]>;
|
|
10
19
|
targetLocation({ id }: TransferOrderDto, { loaders }: LoaderType<TransferOrderItemEntityClass>, locationLoader: LoaderType<LocationEntityClass>): Promise<LocationDto | null>;
|
|
11
20
|
targetLoader({ id }: TransferOrderDto, { loaders }: LoaderType<TransferOrderItemEntityClass>, loaderLoader: LoaderType<LoadersEntityClass>): Promise<LoaderDto | null>;
|
|
12
21
|
}
|
|
13
22
|
export declare class TransferOrderItemResolver {
|
|
14
|
-
private readonly
|
|
23
|
+
private readonly entities;
|
|
15
24
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
25
|
+
* The configured entities, not the built-in classes: `__entity` decides which
|
|
26
|
+
* repository the DataLoader opens, so it has to follow whatever the consumer
|
|
27
|
+
* passed to `WMSBaseModuleOptions`. Loading a built-in class outright filters
|
|
28
|
+
* on its single-table-inheritance discriminator and resolves nothing for an
|
|
29
|
+
* override.
|
|
21
30
|
*/
|
|
22
|
-
constructor(
|
|
31
|
+
constructor(entities: WmsEntities);
|
|
23
32
|
material({ materialId }: TransferOrderItemEntityClass, { loaders }: LoaderType<MaterialEntityClass>): Promise<MaterialDto>;
|
|
24
33
|
batch({ batchId }: TransferOrderItemEntityClass, { loaders }: LoaderType<BatchEntityClass>): Promise<BatchDto | null>;
|
|
25
34
|
location({ locationId }: TransferOrderItemEntityClass, { loaders }: LoaderType<LocationEntityClass>): Promise<LocationDto | null>;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { __decorate, __param, __metadata } from 'tslib';
|
|
2
|
-
import { Inject } from '@nestjs/common';
|
|
3
2
|
import { ResolveField, Parent, Context, Resolver, ID, Int } from '@nestjs/graphql';
|
|
4
3
|
import { TransferOrderDto } from '../dto/transfer-order.dto.js';
|
|
5
4
|
import { TransferOrderItemDto } from '../dto/transfer-order-item.dto.js';
|
|
6
|
-
import {
|
|
5
|
+
import { WmsEntities, TransferOrderItemEntityClass, LoadersEntityClass, BatchGroupEntityClass, TransferOrderChangeEntityClass } from '@rytass/wms-module-core';
|
|
7
6
|
import '../dto/loader-type.dto.js';
|
|
8
7
|
import { LoaderDto } from '../dto/loader.dto.js';
|
|
9
8
|
import { MaterialDto } from '../dto/material.dto.js';
|
|
@@ -26,10 +25,22 @@ import '../dto/scrape-order.dto.js';
|
|
|
26
25
|
import '../dto/scrape-order-item.dto.js';
|
|
27
26
|
import '../dto/quality-inspection-order.dto.js';
|
|
28
27
|
import '../dto/quality-inspection-order-item.dto.js';
|
|
28
|
+
import '../dto/inventory-count-order.dto.js';
|
|
29
29
|
import { BatchDto } from '../dto/batch.dto.js';
|
|
30
30
|
import { LocationDto } from '../dto/location.dto.js';
|
|
31
31
|
|
|
32
32
|
let TransferOrderResolver = class TransferOrderResolver {
|
|
33
|
+
entities;
|
|
34
|
+
/**
|
|
35
|
+
* The configured entities, not the built-in classes: `__entity` decides which
|
|
36
|
+
* repository the DataLoader opens, so it has to follow whatever the consumer
|
|
37
|
+
* passed to `WMSBaseModuleOptions`. Loading a built-in class outright filters
|
|
38
|
+
* on its single-table-inheritance discriminator and resolves nothing for an
|
|
39
|
+
* override.
|
|
40
|
+
*/
|
|
41
|
+
constructor(entities) {
|
|
42
|
+
this.entities = entities;
|
|
43
|
+
}
|
|
33
44
|
items({ id }, { loaders }) {
|
|
34
45
|
return loaders.batchMany.load({
|
|
35
46
|
__entity: TransferOrderItemEntityClass,
|
|
@@ -44,7 +55,7 @@ let TransferOrderResolver = class TransferOrderResolver {
|
|
|
44
55
|
if (!item?.targetLocationId)
|
|
45
56
|
return null;
|
|
46
57
|
return locationLoader.loaders.batchSingle.load({
|
|
47
|
-
__entity:
|
|
58
|
+
__entity: this.entities.location,
|
|
48
59
|
__from: { id: item.targetLocationId },
|
|
49
60
|
});
|
|
50
61
|
}
|
|
@@ -88,23 +99,24 @@ __decorate([
|
|
|
88
99
|
__metadata("design:returntype", Promise)
|
|
89
100
|
], TransferOrderResolver.prototype, "targetLoader", null);
|
|
90
101
|
TransferOrderResolver = __decorate([
|
|
91
|
-
Resolver(() => TransferOrderDto)
|
|
102
|
+
Resolver(() => TransferOrderDto),
|
|
103
|
+
__metadata("design:paramtypes", [WmsEntities])
|
|
92
104
|
], TransferOrderResolver);
|
|
93
105
|
let TransferOrderItemResolver = class TransferOrderItemResolver {
|
|
94
|
-
|
|
106
|
+
entities;
|
|
95
107
|
/**
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
*
|
|
108
|
+
* The configured entities, not the built-in classes: `__entity` decides which
|
|
109
|
+
* repository the DataLoader opens, so it has to follow whatever the consumer
|
|
110
|
+
* passed to `WMSBaseModuleOptions`. Loading a built-in class outright filters
|
|
111
|
+
* on its single-table-inheritance discriminator and resolves nothing for an
|
|
112
|
+
* override.
|
|
101
113
|
*/
|
|
102
|
-
constructor(
|
|
103
|
-
this.
|
|
114
|
+
constructor(entities) {
|
|
115
|
+
this.entities = entities;
|
|
104
116
|
}
|
|
105
117
|
material({ materialId }, { loaders }) {
|
|
106
118
|
return loaders.batchSingle.load({
|
|
107
|
-
__entity: this.
|
|
119
|
+
__entity: this.entities.material,
|
|
108
120
|
__from: { id: materialId },
|
|
109
121
|
});
|
|
110
122
|
}
|
|
@@ -112,7 +124,7 @@ let TransferOrderItemResolver = class TransferOrderItemResolver {
|
|
|
112
124
|
if (!batchId)
|
|
113
125
|
return null;
|
|
114
126
|
const { groupId } = await loaders.batchSingle.load({
|
|
115
|
-
__entity:
|
|
127
|
+
__entity: this.entities.batch,
|
|
116
128
|
__from: { id: batchId },
|
|
117
129
|
});
|
|
118
130
|
return loaders.batchSingle.load({
|
|
@@ -124,7 +136,7 @@ let TransferOrderItemResolver = class TransferOrderItemResolver {
|
|
|
124
136
|
if (!locationId)
|
|
125
137
|
return null;
|
|
126
138
|
return loaders.batchSingle.load({
|
|
127
|
-
__entity:
|
|
139
|
+
__entity: this.entities.location,
|
|
128
140
|
__from: { id: locationId },
|
|
129
141
|
});
|
|
130
142
|
}
|
|
@@ -141,7 +153,7 @@ let TransferOrderItemResolver = class TransferOrderItemResolver {
|
|
|
141
153
|
return null;
|
|
142
154
|
return loaders.batchSingle
|
|
143
155
|
.load({
|
|
144
|
-
__entity:
|
|
156
|
+
__entity: this.entities.batch,
|
|
145
157
|
__from: { id: batchId },
|
|
146
158
|
})
|
|
147
159
|
.then((batch) => batch.saleId);
|
|
@@ -151,7 +163,7 @@ let TransferOrderItemResolver = class TransferOrderItemResolver {
|
|
|
151
163
|
return null;
|
|
152
164
|
return loaders.batchSingle
|
|
153
165
|
.load({
|
|
154
|
-
__entity:
|
|
166
|
+
__entity: this.entities.batch,
|
|
155
167
|
__from: { id: batchId },
|
|
156
168
|
})
|
|
157
169
|
.then((batch) => batch.saleSerialId);
|
|
@@ -225,8 +237,7 @@ __decorate([
|
|
|
225
237
|
], TransferOrderItemResolver.prototype, "transferredQuantity", null);
|
|
226
238
|
TransferOrderItemResolver = __decorate([
|
|
227
239
|
Resolver(() => TransferOrderItemDto),
|
|
228
|
-
|
|
229
|
-
__metadata("design:paramtypes", [Function])
|
|
240
|
+
__metadata("design:paramtypes", [WmsEntities])
|
|
230
241
|
], TransferOrderItemResolver);
|
|
231
242
|
|
|
232
243
|
export { TransferOrderItemResolver, TransferOrderResolver };
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import { type LoaderType } from '../helpers';
|
|
2
|
-
import { LocationEntityClass } from '@rytass/wms-module-core';
|
|
2
|
+
import { LocationEntityClass, WmsEntities } from '@rytass/wms-module-core';
|
|
3
3
|
import { MapRangeDto } from '../dto/warehouse-map.dto';
|
|
4
4
|
export declare class MapRangeUnionResolver {
|
|
5
|
+
private readonly entities;
|
|
6
|
+
/**
|
|
7
|
+
* The configured entities, not the built-in classes: `__entity` decides which
|
|
8
|
+
* repository the DataLoader opens, so it has to follow whatever the consumer
|
|
9
|
+
* passed to `WMSBaseModuleOptions`. Loading a built-in class outright filters
|
|
10
|
+
* on its single-table-inheritance discriminator and resolves nothing for an
|
|
11
|
+
* override.
|
|
12
|
+
*/
|
|
13
|
+
constructor(entities: WmsEntities);
|
|
5
14
|
location({ id }: MapRangeDto, { loaders }: LoaderType<LocationEntityClass>): Promise<LocationEntityClass> | null;
|
|
6
15
|
}
|
|
@@ -1,15 +1,26 @@
|
|
|
1
1
|
import { __decorate, __param, __metadata } from 'tslib';
|
|
2
2
|
import { ResolveField, Parent, Context, Resolver } from '@nestjs/graphql';
|
|
3
3
|
import { LocationDto } from '../dto/location.dto.js';
|
|
4
|
-
import {
|
|
4
|
+
import { WmsEntities } from '@rytass/wms-module-core';
|
|
5
5
|
import { MapRangeDto } from '../dto/warehouse-map.dto.js';
|
|
6
6
|
|
|
7
7
|
let MapRangeUnionResolver = class MapRangeUnionResolver {
|
|
8
|
+
entities;
|
|
9
|
+
/**
|
|
10
|
+
* The configured entities, not the built-in classes: `__entity` decides which
|
|
11
|
+
* repository the DataLoader opens, so it has to follow whatever the consumer
|
|
12
|
+
* passed to `WMSBaseModuleOptions`. Loading a built-in class outright filters
|
|
13
|
+
* on its single-table-inheritance discriminator and resolves nothing for an
|
|
14
|
+
* override.
|
|
15
|
+
*/
|
|
16
|
+
constructor(entities) {
|
|
17
|
+
this.entities = entities;
|
|
18
|
+
}
|
|
8
19
|
location({ id }, { loaders }) {
|
|
9
20
|
if (!id)
|
|
10
21
|
return null;
|
|
11
22
|
return loaders.batchSingle.load({
|
|
12
|
-
__entity:
|
|
23
|
+
__entity: this.entities.location,
|
|
13
24
|
__from: { key: id },
|
|
14
25
|
});
|
|
15
26
|
}
|
|
@@ -23,7 +34,8 @@ __decorate([
|
|
|
23
34
|
__metadata("design:returntype", void 0)
|
|
24
35
|
], MapRangeUnionResolver.prototype, "location", null);
|
|
25
36
|
MapRangeUnionResolver = __decorate([
|
|
26
|
-
Resolver(() => MapRangeDto)
|
|
37
|
+
Resolver(() => MapRangeDto),
|
|
38
|
+
__metadata("design:paramtypes", [WmsEntities])
|
|
27
39
|
], MapRangeUnionResolver);
|
|
28
40
|
|
|
29
41
|
export { MapRangeUnionResolver };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rytass/wms-module-graphql",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Rytass WMS Module — GraphQL schema, resolvers and DTOs for warehouse management",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"rytass",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"@nestjs/apollo": ">=13.0.0 <13.2.0",
|
|
58
58
|
"@nestjs/common": "^11.0.0",
|
|
59
59
|
"@nestjs/graphql": "^13.0.0",
|
|
60
|
-
"@rytass/wms-module-core": "^0.
|
|
60
|
+
"@rytass/wms-module-core": "^0.6.0",
|
|
61
61
|
"graphql": "^16.0.0",
|
|
62
62
|
"reflect-metadata": "^0.1.13 || ^0.2.0",
|
|
63
63
|
"rxjs": "^7.8.0",
|