@rytass/wms-module-graphql 0.11.0 → 0.12.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 +19 -0
- package/docs/README.md +5 -2
- package/docs/api-reference.md +10 -8
- package/docs/integration-guide.md +34 -17
- package/docs/inventory-count.md +372 -0
- package/index.cjs.js +10 -0
- package/lib/inputs/inventory-count-order.args.d.ts +6 -0
- package/package.json +12 -11
- package/adapters/event-emitter.js +0 -41
- package/adapters/member-base.js +0 -63
- package/index.js +0 -12
- package/lib/auth/host-skip.constant.js +0 -29
- package/lib/auth/wms-auth.guard.js +0 -41
- package/lib/auth/wms-auth.types.js +0 -6
- package/lib/auth/wms-operation.decorator.js +0 -29
- package/lib/dto/allocate-inventory-order-item.dto.js +0 -36
- package/lib/dto/allocate-inventory-order.dto.js +0 -31
- package/lib/dto/batch.dto.js +0 -26
- package/lib/dto/consumption-order-item.dto.js +0 -43
- package/lib/dto/consumption-order.dto.js +0 -52
- package/lib/dto/hold-inventory-order-item.dto.js +0 -37
- package/lib/dto/hold-inventory-order.dto.js +0 -47
- package/lib/dto/inventory-count-order.dto.js +0 -207
- package/lib/dto/loader-type.dto.js +0 -46
- package/lib/dto/loader-unit.dto.js +0 -21
- package/lib/dto/loader.dto.js +0 -71
- package/lib/dto/location.dto.js +0 -36
- package/lib/dto/material-unit.dto.js +0 -46
- package/lib/dto/material.dto.js +0 -36
- package/lib/dto/merge-batch-order.dto.js +0 -50
- package/lib/dto/order-reference.dto.js +0 -73
- package/lib/dto/pagination.dto.js +0 -51
- package/lib/dto/quality-inspection-order-item.dto.js +0 -50
- package/lib/dto/quality-inspection-order.dto.js +0 -42
- package/lib/dto/receive-inventory-order-item.dto.js +0 -60
- package/lib/dto/receive-inventory-order.dto.js +0 -58
- package/lib/dto/reclassify-inventory-order.dto.js +0 -55
- package/lib/dto/sale-order.dto.js +0 -20
- package/lib/dto/scrape-order-item.dto.js +0 -56
- package/lib/dto/scrape-order.dto.js +0 -37
- package/lib/dto/ship-inventory-order-item.dto.js +0 -56
- package/lib/dto/ship-inventory-order-reference.dto.js +0 -48
- package/lib/dto/ship-inventory-order.dto.js +0 -58
- package/lib/dto/split-batch-order.dto.js +0 -50
- package/lib/dto/stock.dto.js +0 -166
- package/lib/dto/transfer-customer-order-item.dto.js +0 -61
- package/lib/dto/transfer-customer-order.dto.js +0 -37
- package/lib/dto/transfer-order-item.dto.js +0 -41
- package/lib/dto/transfer-order.dto.js +0 -57
- package/lib/dto/transfer-vendor-order-item.dto.js +0 -61
- package/lib/dto/transfer-vendor-order.dto.js +0 -37
- package/lib/dto/unit.dto.js +0 -20
- package/lib/dto/warehouse-map.dto.js +0 -165
- package/lib/events/wms-mutation-event.constants.js +0 -4
- package/lib/events/wms-mutation-event.decorator.js +0 -20
- package/lib/events/wms-mutation.interceptor.js +0 -64
- package/lib/graphql.module.js +0 -183
- package/lib/helpers/create-wms-loaders.js +0 -11
- package/lib/helpers/helper.module.js +0 -15
- package/lib/helpers/loader.service.js +0 -230
- package/lib/helpers/query-path.js +0 -19
- package/lib/inputs/cancel-ship-order.args.js +0 -20
- package/lib/inputs/cancel-transfer-order.args.js +0 -23
- package/lib/inputs/consumption-order.args.js +0 -182
- package/lib/inputs/create-allocate-inventory-order-item.args.js +0 -50
- package/lib/inputs/create-allocate-inventory-order.args.js +0 -36
- package/lib/inputs/create-hold-inventory-order-item.args.js +0 -40
- package/lib/inputs/create-hold-inventory-order.args.js +0 -41
- package/lib/inputs/create-loader-type.args.js +0 -35
- package/lib/inputs/create-loader.args.js +0 -130
- package/lib/inputs/create-location.args.js +0 -50
- package/lib/inputs/create-material-unit.args.js +0 -25
- package/lib/inputs/create-material.args.js +0 -51
- package/lib/inputs/create-quality-inspection-order.args.js +0 -50
- package/lib/inputs/create-receive-inventory-order-item.args.js +0 -70
- package/lib/inputs/create-receive-inventory-order.args.js +0 -51
- package/lib/inputs/create-ship-inventory-order-item.args.js +0 -45
- package/lib/inputs/create-ship-inventory-order-reference.args.js +0 -65
- package/lib/inputs/create-ship-inventory-order.args.js +0 -57
- package/lib/inputs/create-transfer-customer-order-item.args.js +0 -40
- package/lib/inputs/create-transfer-customer-order.args.js +0 -51
- package/lib/inputs/create-transfer-order-item.args.js +0 -40
- package/lib/inputs/create-transfer-order.args.js +0 -61
- package/lib/inputs/create-transfer-vendor-order-item.args.js +0 -40
- package/lib/inputs/create-transfer-vendor-order.args.js +0 -51
- package/lib/inputs/date-range.args.js +0 -20
- package/lib/inputs/deallocate-order.args.js +0 -25
- package/lib/inputs/find-allocate-inventory-order.args.js +0 -42
- package/lib/inputs/find-batch.args.js +0 -21
- package/lib/inputs/find-hold-inventory-order.args.js +0 -42
- package/lib/inputs/find-loader-type.args.js +0 -32
- package/lib/inputs/find-loader.args.js +0 -72
- package/lib/inputs/find-location.args.js +0 -26
- package/lib/inputs/find-material.args.js +0 -21
- package/lib/inputs/find-receive-inventory-order.args.js +0 -71
- package/lib/inputs/find-sale-order.args.js +0 -16
- package/lib/inputs/find-ship-inventory-order.args.js +0 -71
- package/lib/inputs/find-stock.args.js +0 -102
- package/lib/inputs/find-transfer-order.args.js +0 -82
- package/lib/inputs/inventory-count-order.args.js +0 -257
- package/lib/inputs/merge-batch.args.js +0 -40
- package/lib/inputs/order-reference.args.js +0 -103
- package/lib/inputs/pagination.args.js +0 -20
- package/lib/inputs/receive-order.args.js +0 -40
- package/lib/inputs/reclassify-inventory-order.args.js +0 -40
- package/lib/inputs/release-order.args.js +0 -25
- package/lib/inputs/return-transfer-customer-order.args.js +0 -35
- package/lib/inputs/return-transfer-vendor-order.args.js +0 -35
- package/lib/inputs/scrape-order.args.js +0 -35
- package/lib/inputs/ship-order.args.js +0 -20
- package/lib/inputs/split-batch.args.js +0 -51
- package/lib/inputs/transfer-order.args.js +0 -20
- package/lib/inputs/update-warehouse-map.args.js +0 -121
- package/lib/mutations/allocate-inventory-order.mutation.js +0 -91
- package/lib/mutations/consumption-order.mutation.js +0 -90
- package/lib/mutations/hold-inventory-order.mutation.js +0 -91
- package/lib/mutations/inventory-count-order.mutation.js +0 -138
- package/lib/mutations/loader.mutation.js +0 -123
- package/lib/mutations/location.mutation.js +0 -47
- package/lib/mutations/material.mutation.js +0 -74
- package/lib/mutations/merge-batch.mutation.js +0 -50
- package/lib/mutations/order-reference.mutation.js +0 -57
- package/lib/mutations/quality-inspection-order.mutation.js +0 -50
- package/lib/mutations/receive-inventory-order.mutation.js +0 -106
- package/lib/mutations/reclassify-inventory-order.mutation.js +0 -51
- package/lib/mutations/scrape-order.mutation.js +0 -44
- package/lib/mutations/ship-inventory-order.mutation.js +0 -123
- package/lib/mutations/split-batch.mutation.js +0 -44
- package/lib/mutations/transfer-customer-order.mutation.js +0 -91
- package/lib/mutations/transfer-order.mutation.js +0 -96
- package/lib/mutations/transfer-vendor-order.mutation.js +0 -91
- package/lib/mutations/warehouse-map.mutation.js +0 -60
- package/lib/queries/allocate-inventory-order.query.js +0 -33
- package/lib/queries/batch.query.js +0 -36
- package/lib/queries/consumption-order.query.js +0 -45
- package/lib/queries/hold-inventory-order.query.js +0 -33
- package/lib/queries/inventory-count-order.query.js +0 -63
- package/lib/queries/loader.query.js +0 -167
- package/lib/queries/location.query.js +0 -51
- package/lib/queries/material.query.js +0 -79
- package/lib/queries/order-reference.query.js +0 -34
- package/lib/queries/recieve-inventory-order.query.js +0 -77
- package/lib/queries/sale-order.query.js +0 -57
- package/lib/queries/ship-inventory-order.query.js +0 -77
- package/lib/queries/stock.query.js +0 -116
- package/lib/queries/transfer-order.query.js +0 -46
- package/lib/queries/unit.query.js +0 -30
- package/lib/queries/warehouse-map.query.js +0 -32
- package/lib/registry/operation-registry.js +0 -136
- package/lib/resolvers/aggregated-stock.resolver.js +0 -119
- package/lib/resolvers/allocate-inventory-order.resolver.js +0 -27
- package/lib/resolvers/change-log.resolver.js +0 -99
- package/lib/resolvers/consumption-order.resolver.js +0 -238
- package/lib/resolvers/hold-inventory-order.resolver.js +0 -27
- package/lib/resolvers/inventory-count-order.resolver.js +0 -148
- package/lib/resolvers/loader-type.resolver.js +0 -54
- package/lib/resolvers/loader.resolver.js +0 -99
- package/lib/resolvers/location.resolver.js +0 -80
- package/lib/resolvers/material.resolver.js +0 -87
- package/lib/resolvers/merge-batch.resolver.js +0 -26
- package/lib/resolvers/receive-inventory-order.resolver.js +0 -156
- package/lib/resolvers/ship-inventory-order.resolver.js +0 -301
- package/lib/resolvers/split-batch.resolver.js +0 -26
- package/lib/resolvers/stock.resolver.js +0 -99
- package/lib/resolvers/transfer-customer-order.resolver.js +0 -27
- package/lib/resolvers/transfer-order.resolver.js +0 -246
- package/lib/resolvers/transfer-vendor-order.resolver.js +0 -27
- package/lib/resolvers/warehouse-map.resolver.js +0 -41
- package/lib/scalars/json-object.scalar.js +0 -62
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { __decorate, __metadata } from 'tslib';
|
|
2
|
-
import { Field, ID, InputType, ArgsType } from '@nestjs/graphql';
|
|
3
|
-
import { GraphQLJSONObject } from '../scalars/json-object.scalar.js';
|
|
4
|
-
|
|
5
|
-
let SplitBatchItemInput = class SplitBatchItemInput {
|
|
6
|
-
batchKey;
|
|
7
|
-
quantity;
|
|
8
|
-
/**
|
|
9
|
-
* Host-defined attributes for this child batch. Applied only when the split
|
|
10
|
-
* creates the batch; reusing an existing `batchKey` keeps what that batch
|
|
11
|
-
* already carries.
|
|
12
|
-
*/
|
|
13
|
-
attributes;
|
|
14
|
-
};
|
|
15
|
-
__decorate([
|
|
16
|
-
Field(() => ID),
|
|
17
|
-
__metadata("design:type", String)
|
|
18
|
-
], SplitBatchItemInput.prototype, "batchKey", void 0);
|
|
19
|
-
__decorate([
|
|
20
|
-
Field(() => Number),
|
|
21
|
-
__metadata("design:type", Number)
|
|
22
|
-
], SplitBatchItemInput.prototype, "quantity", void 0);
|
|
23
|
-
__decorate([
|
|
24
|
-
Field(() => GraphQLJSONObject, { nullable: true }),
|
|
25
|
-
__metadata("design:type", Object)
|
|
26
|
-
], SplitBatchItemInput.prototype, "attributes", void 0);
|
|
27
|
-
SplitBatchItemInput = __decorate([
|
|
28
|
-
InputType()
|
|
29
|
-
], SplitBatchItemInput);
|
|
30
|
-
let SplitBatchArgs = class SplitBatchArgs {
|
|
31
|
-
aggregatedKey;
|
|
32
|
-
unitId;
|
|
33
|
-
items;
|
|
34
|
-
};
|
|
35
|
-
__decorate([
|
|
36
|
-
Field(() => ID),
|
|
37
|
-
__metadata("design:type", String)
|
|
38
|
-
], SplitBatchArgs.prototype, "aggregatedKey", void 0);
|
|
39
|
-
__decorate([
|
|
40
|
-
Field(() => ID, { nullable: true }),
|
|
41
|
-
__metadata("design:type", String)
|
|
42
|
-
], SplitBatchArgs.prototype, "unitId", void 0);
|
|
43
|
-
__decorate([
|
|
44
|
-
Field(() => [SplitBatchItemInput]),
|
|
45
|
-
__metadata("design:type", Array)
|
|
46
|
-
], SplitBatchArgs.prototype, "items", void 0);
|
|
47
|
-
SplitBatchArgs = __decorate([
|
|
48
|
-
ArgsType()
|
|
49
|
-
], SplitBatchArgs);
|
|
50
|
-
|
|
51
|
-
export { SplitBatchArgs, SplitBatchItemInput };
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { __decorate, __metadata } from 'tslib';
|
|
2
|
-
import { Field, ID, Int, InputType } from '@nestjs/graphql';
|
|
3
|
-
|
|
4
|
-
let TransferOrderArgs = class TransferOrderArgs {
|
|
5
|
-
itemId;
|
|
6
|
-
quantity;
|
|
7
|
-
};
|
|
8
|
-
__decorate([
|
|
9
|
-
Field(() => ID, { description: 'The ID of transfer order item' }),
|
|
10
|
-
__metadata("design:type", String)
|
|
11
|
-
], TransferOrderArgs.prototype, "itemId", void 0);
|
|
12
|
-
__decorate([
|
|
13
|
-
Field(() => Int, { description: 'The quantity to transfer' }),
|
|
14
|
-
__metadata("design:type", Number)
|
|
15
|
-
], TransferOrderArgs.prototype, "quantity", void 0);
|
|
16
|
-
TransferOrderArgs = __decorate([
|
|
17
|
-
InputType()
|
|
18
|
-
], TransferOrderArgs);
|
|
19
|
-
|
|
20
|
-
export { TransferOrderArgs };
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import { __decorate, __metadata } from 'tslib';
|
|
2
|
-
import { Field, ID, Float, InputType, ArgsType } from '@nestjs/graphql';
|
|
3
|
-
import { MapRangeType } from '../dto/warehouse-map.dto.js';
|
|
4
|
-
|
|
5
|
-
let MapBackgroundInput = class MapBackgroundInput {
|
|
6
|
-
id;
|
|
7
|
-
filename;
|
|
8
|
-
x;
|
|
9
|
-
y;
|
|
10
|
-
height;
|
|
11
|
-
width;
|
|
12
|
-
};
|
|
13
|
-
__decorate([
|
|
14
|
-
Field(() => ID),
|
|
15
|
-
__metadata("design:type", String)
|
|
16
|
-
], MapBackgroundInput.prototype, "id", void 0);
|
|
17
|
-
__decorate([
|
|
18
|
-
Field(),
|
|
19
|
-
__metadata("design:type", String)
|
|
20
|
-
], MapBackgroundInput.prototype, "filename", void 0);
|
|
21
|
-
__decorate([
|
|
22
|
-
Field(() => Float),
|
|
23
|
-
__metadata("design:type", Number)
|
|
24
|
-
], MapBackgroundInput.prototype, "x", void 0);
|
|
25
|
-
__decorate([
|
|
26
|
-
Field(() => Float),
|
|
27
|
-
__metadata("design:type", Number)
|
|
28
|
-
], MapBackgroundInput.prototype, "y", void 0);
|
|
29
|
-
__decorate([
|
|
30
|
-
Field(() => Float),
|
|
31
|
-
__metadata("design:type", Number)
|
|
32
|
-
], MapBackgroundInput.prototype, "height", void 0);
|
|
33
|
-
__decorate([
|
|
34
|
-
Field(() => Float),
|
|
35
|
-
__metadata("design:type", Number)
|
|
36
|
-
], MapBackgroundInput.prototype, "width", void 0);
|
|
37
|
-
MapBackgroundInput = __decorate([
|
|
38
|
-
InputType()
|
|
39
|
-
], MapBackgroundInput);
|
|
40
|
-
let MapPolygonRangePointInput = class MapPolygonRangePointInput {
|
|
41
|
-
x;
|
|
42
|
-
y;
|
|
43
|
-
};
|
|
44
|
-
__decorate([
|
|
45
|
-
Field(() => Float),
|
|
46
|
-
__metadata("design:type", Number)
|
|
47
|
-
], MapPolygonRangePointInput.prototype, "x", void 0);
|
|
48
|
-
__decorate([
|
|
49
|
-
Field(() => Float),
|
|
50
|
-
__metadata("design:type", Number)
|
|
51
|
-
], MapPolygonRangePointInput.prototype, "y", void 0);
|
|
52
|
-
MapPolygonRangePointInput = __decorate([
|
|
53
|
-
InputType()
|
|
54
|
-
], MapPolygonRangePointInput);
|
|
55
|
-
let MapRangeInput = class MapRangeInput {
|
|
56
|
-
id;
|
|
57
|
-
type;
|
|
58
|
-
color;
|
|
59
|
-
x;
|
|
60
|
-
y;
|
|
61
|
-
width;
|
|
62
|
-
height;
|
|
63
|
-
points;
|
|
64
|
-
};
|
|
65
|
-
__decorate([
|
|
66
|
-
Field(() => ID),
|
|
67
|
-
__metadata("design:type", String)
|
|
68
|
-
], MapRangeInput.prototype, "id", void 0);
|
|
69
|
-
__decorate([
|
|
70
|
-
Field(() => MapRangeType),
|
|
71
|
-
__metadata("design:type", String)
|
|
72
|
-
], MapRangeInput.prototype, "type", void 0);
|
|
73
|
-
__decorate([
|
|
74
|
-
Field(() => String),
|
|
75
|
-
__metadata("design:type", String)
|
|
76
|
-
], MapRangeInput.prototype, "color", void 0);
|
|
77
|
-
__decorate([
|
|
78
|
-
Field(() => Float, { nullable: true }),
|
|
79
|
-
__metadata("design:type", Number)
|
|
80
|
-
], MapRangeInput.prototype, "x", void 0);
|
|
81
|
-
__decorate([
|
|
82
|
-
Field(() => Float, { nullable: true }),
|
|
83
|
-
__metadata("design:type", Number)
|
|
84
|
-
], MapRangeInput.prototype, "y", void 0);
|
|
85
|
-
__decorate([
|
|
86
|
-
Field(() => Float, { nullable: true }),
|
|
87
|
-
__metadata("design:type", Number)
|
|
88
|
-
], MapRangeInput.prototype, "width", void 0);
|
|
89
|
-
__decorate([
|
|
90
|
-
Field(() => Float, { nullable: true }),
|
|
91
|
-
__metadata("design:type", Number)
|
|
92
|
-
], MapRangeInput.prototype, "height", void 0);
|
|
93
|
-
__decorate([
|
|
94
|
-
Field(() => [MapPolygonRangePointInput], { nullable: true }),
|
|
95
|
-
__metadata("design:type", Array)
|
|
96
|
-
], MapRangeInput.prototype, "points", void 0);
|
|
97
|
-
MapRangeInput = __decorate([
|
|
98
|
-
InputType()
|
|
99
|
-
], MapRangeInput);
|
|
100
|
-
let UpdateWarehouseMapArgs = class UpdateWarehouseMapArgs {
|
|
101
|
-
locationKey;
|
|
102
|
-
backgrounds;
|
|
103
|
-
ranges;
|
|
104
|
-
};
|
|
105
|
-
__decorate([
|
|
106
|
-
Field(() => ID),
|
|
107
|
-
__metadata("design:type", String)
|
|
108
|
-
], UpdateWarehouseMapArgs.prototype, "locationKey", void 0);
|
|
109
|
-
__decorate([
|
|
110
|
-
Field(() => [MapBackgroundInput]),
|
|
111
|
-
__metadata("design:type", Array)
|
|
112
|
-
], UpdateWarehouseMapArgs.prototype, "backgrounds", void 0);
|
|
113
|
-
__decorate([
|
|
114
|
-
Field(() => [MapRangeInput]),
|
|
115
|
-
__metadata("design:type", Array)
|
|
116
|
-
], UpdateWarehouseMapArgs.prototype, "ranges", void 0);
|
|
117
|
-
UpdateWarehouseMapArgs = __decorate([
|
|
118
|
-
ArgsType()
|
|
119
|
-
], UpdateWarehouseMapArgs);
|
|
120
|
-
|
|
121
|
-
export { MapBackgroundInput, MapPolygonRangePointInput, MapRangeInput, UpdateWarehouseMapArgs };
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { __decorate, __param, __metadata } from 'tslib';
|
|
2
|
-
import { Injectable } from '@nestjs/common';
|
|
3
|
-
import { Mutation, Args } from '@nestjs/graphql';
|
|
4
|
-
import { AllocateInventoryOrderService, StockService } from '@rytass/wms-module-core';
|
|
5
|
-
import { AllocateInventoryOrderDto } from '../dto/allocate-inventory-order.dto.js';
|
|
6
|
-
import { CreateAllocateInventoryOrderArgs, UpdateAllocateInventoryOrderArgs } from '../inputs/create-allocate-inventory-order.args.js';
|
|
7
|
-
import { DeallocateOrderArgs } from '../inputs/deallocate-order.args.js';
|
|
8
|
-
import '../auth/wms-auth.guard.js';
|
|
9
|
-
import { WmsOperation } from '../auth/wms-operation.decorator.js';
|
|
10
|
-
import { WmsMutationEvent } from '../events/wms-mutation-event.decorator.js';
|
|
11
|
-
import '../events/wms-mutation.interceptor.js';
|
|
12
|
-
|
|
13
|
-
let AllocateInventoryOrderMutation = class AllocateInventoryOrderMutation {
|
|
14
|
-
allocateInventoryOrderService;
|
|
15
|
-
stockService;
|
|
16
|
-
constructor(allocateInventoryOrderService, stockService) {
|
|
17
|
-
this.allocateInventoryOrderService = allocateInventoryOrderService;
|
|
18
|
-
this.stockService = stockService;
|
|
19
|
-
}
|
|
20
|
-
async createAllocateInventoryOrder(args) {
|
|
21
|
-
return this.allocateInventoryOrderService.createAllocateInventoryOrder({
|
|
22
|
-
...args,
|
|
23
|
-
items: args.items.map(({ aggregatedKey, ...item }) => {
|
|
24
|
-
const keys = this.stockService.destructAggregateKey(aggregatedKey);
|
|
25
|
-
return {
|
|
26
|
-
...item,
|
|
27
|
-
...keys,
|
|
28
|
-
};
|
|
29
|
-
}),
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
async updateAllocateInventoryOrder(args) {
|
|
33
|
-
return this.allocateInventoryOrderService.updateAllocateInventoryOrder({
|
|
34
|
-
...args,
|
|
35
|
-
items: args?.items?.map(({ aggregatedKey, ...item }) => {
|
|
36
|
-
const keys = aggregatedKey
|
|
37
|
-
? this.stockService.destructAggregateKey(aggregatedKey)
|
|
38
|
-
: {};
|
|
39
|
-
return {
|
|
40
|
-
...item,
|
|
41
|
-
...keys,
|
|
42
|
-
};
|
|
43
|
-
}),
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
async deallocate(args) {
|
|
47
|
-
return this.allocateInventoryOrderService
|
|
48
|
-
.deallocate(args.map(({ aggregatedKey, ...item }) => {
|
|
49
|
-
const keys = this.stockService.destructAggregateKey(aggregatedKey);
|
|
50
|
-
return {
|
|
51
|
-
...item,
|
|
52
|
-
...keys,
|
|
53
|
-
};
|
|
54
|
-
}))
|
|
55
|
-
.then(() => true);
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
__decorate([
|
|
59
|
-
Mutation(() => AllocateInventoryOrderDto),
|
|
60
|
-
WmsOperation({ resource: 'allocate-inventory-order', action: 'create' }),
|
|
61
|
-
WmsMutationEvent({ event: 'allocate-inventory-order.created' }),
|
|
62
|
-
__param(0, Args()),
|
|
63
|
-
__metadata("design:type", Function),
|
|
64
|
-
__metadata("design:paramtypes", [CreateAllocateInventoryOrderArgs]),
|
|
65
|
-
__metadata("design:returntype", Promise)
|
|
66
|
-
], AllocateInventoryOrderMutation.prototype, "createAllocateInventoryOrder", null);
|
|
67
|
-
__decorate([
|
|
68
|
-
Mutation(() => AllocateInventoryOrderDto),
|
|
69
|
-
WmsOperation({ resource: 'allocate-inventory-order', action: 'update' }),
|
|
70
|
-
WmsMutationEvent({ event: 'allocate-inventory-order.updated' }),
|
|
71
|
-
__param(0, Args()),
|
|
72
|
-
__metadata("design:type", Function),
|
|
73
|
-
__metadata("design:paramtypes", [UpdateAllocateInventoryOrderArgs]),
|
|
74
|
-
__metadata("design:returntype", Promise)
|
|
75
|
-
], AllocateInventoryOrderMutation.prototype, "updateAllocateInventoryOrder", null);
|
|
76
|
-
__decorate([
|
|
77
|
-
Mutation(() => Boolean),
|
|
78
|
-
WmsOperation({ resource: 'allocate-inventory-order', action: 'deallocate' }),
|
|
79
|
-
WmsMutationEvent({ event: 'allocate-inventory-order.deallocated' }),
|
|
80
|
-
__param(0, Args('items', { type: () => [DeallocateOrderArgs] })),
|
|
81
|
-
__metadata("design:type", Function),
|
|
82
|
-
__metadata("design:paramtypes", [Array]),
|
|
83
|
-
__metadata("design:returntype", Promise)
|
|
84
|
-
], AllocateInventoryOrderMutation.prototype, "deallocate", null);
|
|
85
|
-
AllocateInventoryOrderMutation = __decorate([
|
|
86
|
-
Injectable(),
|
|
87
|
-
__metadata("design:paramtypes", [AllocateInventoryOrderService,
|
|
88
|
-
StockService])
|
|
89
|
-
], AllocateInventoryOrderMutation);
|
|
90
|
-
|
|
91
|
-
export { AllocateInventoryOrderMutation };
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { __decorate, __param, __metadata } from 'tslib';
|
|
2
|
-
import { Injectable } from '@nestjs/common';
|
|
3
|
-
import { Mutation, Args, Resolver } from '@nestjs/graphql';
|
|
4
|
-
import { ConsumptionOrderService } from '@rytass/wms-module-core';
|
|
5
|
-
import { ConsumptionOrderDto } from '../dto/consumption-order.dto.js';
|
|
6
|
-
import { CreateConsumptionOrderArgs, UpdateConsumptionOrderArgs, ConsumptionOrderActionArgs } from '../inputs/consumption-order.args.js';
|
|
7
|
-
import '../auth/wms-auth.guard.js';
|
|
8
|
-
import { WmsOperation } from '../auth/wms-operation.decorator.js';
|
|
9
|
-
import { WmsMutationEvent } from '../events/wms-mutation-event.decorator.js';
|
|
10
|
-
import '../events/wms-mutation.interceptor.js';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* The three actions are separate mutations rather than one with a mode
|
|
14
|
-
* argument: they carry different permissions (a host may well let the floor
|
|
15
|
-
* issue and return but not settle) and different events, and both of those are
|
|
16
|
-
* keyed per field.
|
|
17
|
-
*/
|
|
18
|
-
let ConsumptionOrderMutation = class ConsumptionOrderMutation {
|
|
19
|
-
consumptionOrderService;
|
|
20
|
-
constructor(consumptionOrderService) {
|
|
21
|
-
this.consumptionOrderService = consumptionOrderService;
|
|
22
|
-
}
|
|
23
|
-
createConsumptionOrder(args) {
|
|
24
|
-
return this.consumptionOrderService.createConsumptionOrder(args);
|
|
25
|
-
}
|
|
26
|
-
updateConsumptionOrder(args) {
|
|
27
|
-
return this.consumptionOrderService.updateConsumptionOrder(args);
|
|
28
|
-
}
|
|
29
|
-
issueConsumptionOrder(args) {
|
|
30
|
-
return this.consumptionOrderService.issue(args);
|
|
31
|
-
}
|
|
32
|
-
returnConsumptionOrder(args) {
|
|
33
|
-
return this.consumptionOrderService.return(args);
|
|
34
|
-
}
|
|
35
|
-
settleConsumptionOrder(args) {
|
|
36
|
-
return this.consumptionOrderService.settle(args);
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
__decorate([
|
|
40
|
-
Mutation(() => ConsumptionOrderDto),
|
|
41
|
-
WmsOperation({ resource: 'consumption-order', action: 'create' }),
|
|
42
|
-
WmsMutationEvent({ event: 'consumption-order.created' }),
|
|
43
|
-
__param(0, Args()),
|
|
44
|
-
__metadata("design:type", Function),
|
|
45
|
-
__metadata("design:paramtypes", [CreateConsumptionOrderArgs]),
|
|
46
|
-
__metadata("design:returntype", Promise)
|
|
47
|
-
], ConsumptionOrderMutation.prototype, "createConsumptionOrder", null);
|
|
48
|
-
__decorate([
|
|
49
|
-
Mutation(() => ConsumptionOrderDto),
|
|
50
|
-
WmsOperation({ resource: 'consumption-order', action: 'update' }),
|
|
51
|
-
WmsMutationEvent({ event: 'consumption-order.updated' }),
|
|
52
|
-
__param(0, Args()),
|
|
53
|
-
__metadata("design:type", Function),
|
|
54
|
-
__metadata("design:paramtypes", [UpdateConsumptionOrderArgs]),
|
|
55
|
-
__metadata("design:returntype", Promise)
|
|
56
|
-
], ConsumptionOrderMutation.prototype, "updateConsumptionOrder", null);
|
|
57
|
-
__decorate([
|
|
58
|
-
Mutation(() => Boolean),
|
|
59
|
-
WmsOperation({ resource: 'consumption-order', action: 'issue' }),
|
|
60
|
-
WmsMutationEvent({ event: 'consumption-order.issued' }),
|
|
61
|
-
__param(0, Args()),
|
|
62
|
-
__metadata("design:type", Function),
|
|
63
|
-
__metadata("design:paramtypes", [ConsumptionOrderActionArgs]),
|
|
64
|
-
__metadata("design:returntype", Promise)
|
|
65
|
-
], ConsumptionOrderMutation.prototype, "issueConsumptionOrder", null);
|
|
66
|
-
__decorate([
|
|
67
|
-
Mutation(() => Boolean),
|
|
68
|
-
WmsOperation({ resource: 'consumption-order', action: 'return' }),
|
|
69
|
-
WmsMutationEvent({ event: 'consumption-order.returned' }),
|
|
70
|
-
__param(0, Args()),
|
|
71
|
-
__metadata("design:type", Function),
|
|
72
|
-
__metadata("design:paramtypes", [ConsumptionOrderActionArgs]),
|
|
73
|
-
__metadata("design:returntype", Promise)
|
|
74
|
-
], ConsumptionOrderMutation.prototype, "returnConsumptionOrder", null);
|
|
75
|
-
__decorate([
|
|
76
|
-
Mutation(() => Boolean),
|
|
77
|
-
WmsOperation({ resource: 'consumption-order', action: 'settle' }),
|
|
78
|
-
WmsMutationEvent({ event: 'consumption-order.settled' }),
|
|
79
|
-
__param(0, Args()),
|
|
80
|
-
__metadata("design:type", Function),
|
|
81
|
-
__metadata("design:paramtypes", [ConsumptionOrderActionArgs]),
|
|
82
|
-
__metadata("design:returntype", Promise)
|
|
83
|
-
], ConsumptionOrderMutation.prototype, "settleConsumptionOrder", null);
|
|
84
|
-
ConsumptionOrderMutation = __decorate([
|
|
85
|
-
Injectable(),
|
|
86
|
-
Resolver(),
|
|
87
|
-
__metadata("design:paramtypes", [ConsumptionOrderService])
|
|
88
|
-
], ConsumptionOrderMutation);
|
|
89
|
-
|
|
90
|
-
export { ConsumptionOrderMutation };
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { __decorate, __param, __metadata } from 'tslib';
|
|
2
|
-
import { Injectable } from '@nestjs/common';
|
|
3
|
-
import { Mutation, Args } from '@nestjs/graphql';
|
|
4
|
-
import { HoldInventoryOrderService, StockService } from '@rytass/wms-module-core';
|
|
5
|
-
import { HoldInventoryOrderDto } from '../dto/hold-inventory-order.dto.js';
|
|
6
|
-
import { CreateHoldInventoryOrderArgs, UpdateHoldInventoryOrderArgs } from '../inputs/create-hold-inventory-order.args.js';
|
|
7
|
-
import { ReleaseOrderArgs } from '../inputs/release-order.args.js';
|
|
8
|
-
import '../auth/wms-auth.guard.js';
|
|
9
|
-
import { WmsOperation } from '../auth/wms-operation.decorator.js';
|
|
10
|
-
import { WmsMutationEvent } from '../events/wms-mutation-event.decorator.js';
|
|
11
|
-
import '../events/wms-mutation.interceptor.js';
|
|
12
|
-
|
|
13
|
-
let HoldInventoryOrderMutation = class HoldInventoryOrderMutation {
|
|
14
|
-
holdInventoryOrderService;
|
|
15
|
-
stockService;
|
|
16
|
-
constructor(holdInventoryOrderService, stockService) {
|
|
17
|
-
this.holdInventoryOrderService = holdInventoryOrderService;
|
|
18
|
-
this.stockService = stockService;
|
|
19
|
-
}
|
|
20
|
-
async createHoldInventoryOrder(args) {
|
|
21
|
-
return this.holdInventoryOrderService.createHoldInventoryOrder({
|
|
22
|
-
...args,
|
|
23
|
-
items: args.items.map(({ aggregatedKey, ...item }) => {
|
|
24
|
-
const keys = this.stockService.destructAggregateKey(aggregatedKey);
|
|
25
|
-
return {
|
|
26
|
-
...item,
|
|
27
|
-
...keys,
|
|
28
|
-
};
|
|
29
|
-
}),
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
async updateHoldInventoryOrder(args) {
|
|
33
|
-
return this.holdInventoryOrderService.updateHoldInventoryOrder({
|
|
34
|
-
...args,
|
|
35
|
-
items: args?.items?.map(({ aggregatedKey, ...item }) => {
|
|
36
|
-
const keys = aggregatedKey
|
|
37
|
-
? this.stockService.destructAggregateKey(aggregatedKey)
|
|
38
|
-
: {};
|
|
39
|
-
return {
|
|
40
|
-
...item,
|
|
41
|
-
...keys,
|
|
42
|
-
};
|
|
43
|
-
}),
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
async release(args) {
|
|
47
|
-
return this.holdInventoryOrderService
|
|
48
|
-
.release(args.map(({ aggregatedKey, ...item }) => {
|
|
49
|
-
const keys = this.stockService.destructAggregateKey(aggregatedKey);
|
|
50
|
-
return {
|
|
51
|
-
...item,
|
|
52
|
-
...keys,
|
|
53
|
-
};
|
|
54
|
-
}))
|
|
55
|
-
.then(() => true);
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
__decorate([
|
|
59
|
-
Mutation(() => HoldInventoryOrderDto),
|
|
60
|
-
WmsOperation({ resource: 'hold-inventory-order', action: 'create' }),
|
|
61
|
-
WmsMutationEvent({ event: 'hold-inventory-order.created' }),
|
|
62
|
-
__param(0, Args()),
|
|
63
|
-
__metadata("design:type", Function),
|
|
64
|
-
__metadata("design:paramtypes", [CreateHoldInventoryOrderArgs]),
|
|
65
|
-
__metadata("design:returntype", Promise)
|
|
66
|
-
], HoldInventoryOrderMutation.prototype, "createHoldInventoryOrder", null);
|
|
67
|
-
__decorate([
|
|
68
|
-
Mutation(() => HoldInventoryOrderDto),
|
|
69
|
-
WmsOperation({ resource: 'hold-inventory-order', action: 'update' }),
|
|
70
|
-
WmsMutationEvent({ event: 'hold-inventory-order.updated' }),
|
|
71
|
-
__param(0, Args()),
|
|
72
|
-
__metadata("design:type", Function),
|
|
73
|
-
__metadata("design:paramtypes", [UpdateHoldInventoryOrderArgs]),
|
|
74
|
-
__metadata("design:returntype", Promise)
|
|
75
|
-
], HoldInventoryOrderMutation.prototype, "updateHoldInventoryOrder", null);
|
|
76
|
-
__decorate([
|
|
77
|
-
Mutation(() => Boolean),
|
|
78
|
-
WmsOperation({ resource: 'hold-inventory-order', action: 'release' }),
|
|
79
|
-
WmsMutationEvent({ event: 'hold-inventory-order.released' }),
|
|
80
|
-
__param(0, Args('items', { type: () => [ReleaseOrderArgs] })),
|
|
81
|
-
__metadata("design:type", Function),
|
|
82
|
-
__metadata("design:paramtypes", [Array]),
|
|
83
|
-
__metadata("design:returntype", Promise)
|
|
84
|
-
], HoldInventoryOrderMutation.prototype, "release", null);
|
|
85
|
-
HoldInventoryOrderMutation = __decorate([
|
|
86
|
-
Injectable(),
|
|
87
|
-
__metadata("design:paramtypes", [HoldInventoryOrderService,
|
|
88
|
-
StockService])
|
|
89
|
-
], HoldInventoryOrderMutation);
|
|
90
|
-
|
|
91
|
-
export { HoldInventoryOrderMutation };
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
import { __decorate, __param, __metadata } from 'tslib';
|
|
2
|
-
import { Injectable } from '@nestjs/common';
|
|
3
|
-
import { Mutation, Args } from '@nestjs/graphql';
|
|
4
|
-
import { InventoryCountOrderService } from '@rytass/wms-module-core';
|
|
5
|
-
import { InventoryCountOrderDto, InventoryCountOrderItemDto } from '../dto/inventory-count-order.dto.js';
|
|
6
|
-
import { CreateInventoryCountOrderArgs, UpdateInventoryCountOrderArgs, InventoryCountOrderIdArgs, CountInventoryArgs, AddInventoryCountItemArgs, RemoveInventoryCountItemArgs } from '../inputs/inventory-count-order.args.js';
|
|
7
|
-
import '../auth/wms-auth.guard.js';
|
|
8
|
-
import { WmsOperation } from '../auth/wms-operation.decorator.js';
|
|
9
|
-
import { WmsMutationEvent } from '../events/wms-mutation-event.decorator.js';
|
|
10
|
-
import '../events/wms-mutation.interceptor.js';
|
|
11
|
-
|
|
12
|
-
let InventoryCountOrderMutation = class InventoryCountOrderMutation {
|
|
13
|
-
inventoryCountOrderService;
|
|
14
|
-
constructor(inventoryCountOrderService) {
|
|
15
|
-
this.inventoryCountOrderService = inventoryCountOrderService;
|
|
16
|
-
}
|
|
17
|
-
async createInventoryCountOrder(args) {
|
|
18
|
-
return this.inventoryCountOrderService.create(args);
|
|
19
|
-
}
|
|
20
|
-
async updateInventoryCountOrder({ id, ...input }) {
|
|
21
|
-
return this.inventoryCountOrderService.update(id, input);
|
|
22
|
-
}
|
|
23
|
-
async startInventoryCount({ id }) {
|
|
24
|
-
return this.inventoryCountOrderService.start(id);
|
|
25
|
-
}
|
|
26
|
-
/** "暫存結果" — record what was counted without touching stock. */
|
|
27
|
-
async countInventory({ id, items }) {
|
|
28
|
-
return this.inventoryCountOrderService.count(id, items.map((item) => ({
|
|
29
|
-
itemId: item.itemId,
|
|
30
|
-
countedQuantity: item.countedQuantity ?? null,
|
|
31
|
-
unitId: item.unitId,
|
|
32
|
-
})));
|
|
33
|
-
}
|
|
34
|
-
async addInventoryCountItem({ id, ...input }) {
|
|
35
|
-
return this.inventoryCountOrderService.addItem(id, input);
|
|
36
|
-
}
|
|
37
|
-
async removeInventoryCountItem({ id, itemId }) {
|
|
38
|
-
return this.inventoryCountOrderService.removeItem(id, itemId);
|
|
39
|
-
}
|
|
40
|
-
/** "清空重填" — discard the counting, keep the lock and the status. */
|
|
41
|
-
async resetInventoryCount({ id }) {
|
|
42
|
-
return this.inventoryCountOrderService.reset(id);
|
|
43
|
-
}
|
|
44
|
-
async cancelInventoryCount({ id }) {
|
|
45
|
-
return this.inventoryCountOrderService.cancel(id);
|
|
46
|
-
}
|
|
47
|
-
/** "執行盤差" — the only mutation here that changes stock. */
|
|
48
|
-
async settleInventoryCount({ id }) {
|
|
49
|
-
return this.inventoryCountOrderService.settle(id);
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
__decorate([
|
|
53
|
-
Mutation(() => InventoryCountOrderDto),
|
|
54
|
-
WmsOperation({ resource: 'inventory-count-order', action: 'create' }),
|
|
55
|
-
WmsMutationEvent({ event: 'inventory-count-order.created' }),
|
|
56
|
-
__param(0, Args()),
|
|
57
|
-
__metadata("design:type", Function),
|
|
58
|
-
__metadata("design:paramtypes", [CreateInventoryCountOrderArgs]),
|
|
59
|
-
__metadata("design:returntype", Promise)
|
|
60
|
-
], InventoryCountOrderMutation.prototype, "createInventoryCountOrder", null);
|
|
61
|
-
__decorate([
|
|
62
|
-
Mutation(() => InventoryCountOrderDto),
|
|
63
|
-
WmsOperation({ resource: 'inventory-count-order', action: 'update' }),
|
|
64
|
-
WmsMutationEvent({ event: 'inventory-count-order.updated' }),
|
|
65
|
-
__param(0, Args()),
|
|
66
|
-
__metadata("design:type", Function),
|
|
67
|
-
__metadata("design:paramtypes", [UpdateInventoryCountOrderArgs]),
|
|
68
|
-
__metadata("design:returntype", Promise)
|
|
69
|
-
], InventoryCountOrderMutation.prototype, "updateInventoryCountOrder", null);
|
|
70
|
-
__decorate([
|
|
71
|
-
Mutation(() => InventoryCountOrderDto),
|
|
72
|
-
WmsOperation({ resource: 'inventory-count-order', action: 'start' }),
|
|
73
|
-
WmsMutationEvent({ event: 'inventory-count-order.started' }),
|
|
74
|
-
__param(0, Args()),
|
|
75
|
-
__metadata("design:type", Function),
|
|
76
|
-
__metadata("design:paramtypes", [InventoryCountOrderIdArgs]),
|
|
77
|
-
__metadata("design:returntype", Promise)
|
|
78
|
-
], InventoryCountOrderMutation.prototype, "startInventoryCount", null);
|
|
79
|
-
__decorate([
|
|
80
|
-
Mutation(() => InventoryCountOrderDto),
|
|
81
|
-
WmsOperation({ resource: 'inventory-count-order', action: 'count' }),
|
|
82
|
-
WmsMutationEvent({ event: 'inventory-count-order.counted' }),
|
|
83
|
-
__param(0, Args()),
|
|
84
|
-
__metadata("design:type", Function),
|
|
85
|
-
__metadata("design:paramtypes", [CountInventoryArgs]),
|
|
86
|
-
__metadata("design:returntype", Promise)
|
|
87
|
-
], InventoryCountOrderMutation.prototype, "countInventory", null);
|
|
88
|
-
__decorate([
|
|
89
|
-
Mutation(() => InventoryCountOrderItemDto),
|
|
90
|
-
WmsOperation({ resource: 'inventory-count-order', action: 'add-item' }),
|
|
91
|
-
WmsMutationEvent({ event: 'inventory-count-order.updated' }),
|
|
92
|
-
__param(0, Args()),
|
|
93
|
-
__metadata("design:type", Function),
|
|
94
|
-
__metadata("design:paramtypes", [AddInventoryCountItemArgs]),
|
|
95
|
-
__metadata("design:returntype", Promise)
|
|
96
|
-
], InventoryCountOrderMutation.prototype, "addInventoryCountItem", null);
|
|
97
|
-
__decorate([
|
|
98
|
-
Mutation(() => InventoryCountOrderDto),
|
|
99
|
-
WmsOperation({ resource: 'inventory-count-order', action: 'remove-item' }),
|
|
100
|
-
WmsMutationEvent({ event: 'inventory-count-order.updated' }),
|
|
101
|
-
__param(0, Args()),
|
|
102
|
-
__metadata("design:type", Function),
|
|
103
|
-
__metadata("design:paramtypes", [RemoveInventoryCountItemArgs]),
|
|
104
|
-
__metadata("design:returntype", Promise)
|
|
105
|
-
], InventoryCountOrderMutation.prototype, "removeInventoryCountItem", null);
|
|
106
|
-
__decorate([
|
|
107
|
-
Mutation(() => InventoryCountOrderDto),
|
|
108
|
-
WmsOperation({ resource: 'inventory-count-order', action: 'reset' }),
|
|
109
|
-
WmsMutationEvent({ event: 'inventory-count-order.reset' }),
|
|
110
|
-
__param(0, Args()),
|
|
111
|
-
__metadata("design:type", Function),
|
|
112
|
-
__metadata("design:paramtypes", [InventoryCountOrderIdArgs]),
|
|
113
|
-
__metadata("design:returntype", Promise)
|
|
114
|
-
], InventoryCountOrderMutation.prototype, "resetInventoryCount", null);
|
|
115
|
-
__decorate([
|
|
116
|
-
Mutation(() => InventoryCountOrderDto),
|
|
117
|
-
WmsOperation({ resource: 'inventory-count-order', action: 'cancel' }),
|
|
118
|
-
WmsMutationEvent({ event: 'inventory-count-order.cancelled' }),
|
|
119
|
-
__param(0, Args()),
|
|
120
|
-
__metadata("design:type", Function),
|
|
121
|
-
__metadata("design:paramtypes", [InventoryCountOrderIdArgs]),
|
|
122
|
-
__metadata("design:returntype", Promise)
|
|
123
|
-
], InventoryCountOrderMutation.prototype, "cancelInventoryCount", null);
|
|
124
|
-
__decorate([
|
|
125
|
-
Mutation(() => InventoryCountOrderDto),
|
|
126
|
-
WmsOperation({ resource: 'inventory-count-order', action: 'settle' }),
|
|
127
|
-
WmsMutationEvent({ event: 'inventory-count-order.settled' }),
|
|
128
|
-
__param(0, Args()),
|
|
129
|
-
__metadata("design:type", Function),
|
|
130
|
-
__metadata("design:paramtypes", [InventoryCountOrderIdArgs]),
|
|
131
|
-
__metadata("design:returntype", Promise)
|
|
132
|
-
], InventoryCountOrderMutation.prototype, "settleInventoryCount", null);
|
|
133
|
-
InventoryCountOrderMutation = __decorate([
|
|
134
|
-
Injectable(),
|
|
135
|
-
__metadata("design:paramtypes", [InventoryCountOrderService])
|
|
136
|
-
], InventoryCountOrderMutation);
|
|
137
|
-
|
|
138
|
-
export { InventoryCountOrderMutation };
|