@things-factory/warehouse-base 5.0.2 → 5.0.12
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/dist-server/constants/index.js +6 -19
- package/dist-server/constants/index.js.map +1 -1
- package/dist-server/constants/inventory.js.map +1 -1
- package/dist-server/constants/location.js.map +1 -1
- package/dist-server/constants/pallet.js.map +1 -1
- package/dist-server/constants/rule-type.js.map +1 -1
- package/dist-server/constants/tote.js.map +1 -1
- package/dist-server/controllers/ecommerce/ecommerce-controller.js.map +1 -1
- package/dist-server/controllers/ecommerce/index.js +3 -16
- package/dist-server/controllers/ecommerce/index.js.map +1 -1
- package/dist-server/controllers/ecommerce/sellercraft-controller.js.map +1 -1
- package/dist-server/controllers/index.js +3 -16
- package/dist-server/controllers/index.js.map +1 -1
- package/dist-server/controllers/warehouse-controller.js.map +1 -1
- package/dist-server/index.js +6 -19
- package/dist-server/index.js.map +1 -1
- package/dist-server/middlewares/index.js.map +1 -1
- package/dist-server/migrations/index.js.map +1 -1
- package/dist-server/service/index.js +28 -41
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/service/inventory/index.js.map +1 -1
- package/dist-server/service/inventory/inventory-mutation.js +50 -61
- package/dist-server/service/inventory/inventory-mutation.js.map +1 -1
- package/dist-server/service/inventory/inventory-query.js +125 -136
- package/dist-server/service/inventory/inventory-query.js.map +1 -1
- package/dist-server/service/inventory/inventory-types.js +198 -206
- package/dist-server/service/inventory/inventory-types.js.map +1 -1
- package/dist-server/service/inventory/inventory.js +133 -141
- package/dist-server/service/inventory/inventory.js.map +1 -1
- package/dist-server/service/inventory-change/index.js.map +1 -1
- package/dist-server/service/inventory-change/inventory-change-mutation.js +51 -62
- package/dist-server/service/inventory-change/inventory-change-mutation.js.map +1 -1
- package/dist-server/service/inventory-change/inventory-change-query.js +29 -40
- package/dist-server/service/inventory-change/inventory-change-query.js.map +1 -1
- package/dist-server/service/inventory-change/inventory-change-types.js +20 -28
- package/dist-server/service/inventory-change/inventory-change-types.js.map +1 -1
- package/dist-server/service/inventory-change/inventory-change.js +68 -76
- package/dist-server/service/inventory-change/inventory-change.js.map +1 -1
- package/dist-server/service/inventory-history/index.js.map +1 -1
- package/dist-server/service/inventory-history/inventory-history-mutation.js +33 -44
- package/dist-server/service/inventory-history/inventory-history-mutation.js.map +1 -1
- package/dist-server/service/inventory-history/inventory-history-query.js +105 -116
- package/dist-server/service/inventory-history/inventory-history-query.js.map +1 -1
- package/dist-server/service/inventory-history/inventory-history-types.js +282 -290
- package/dist-server/service/inventory-history/inventory-history-types.js.map +1 -1
- package/dist-server/service/inventory-history/inventory-history.js +82 -90
- package/dist-server/service/inventory-history/inventory-history.js.map +1 -1
- package/dist-server/service/inventory-item/index.js.map +1 -1
- package/dist-server/service/inventory-item/inventory-item-mutation.js +47 -58
- package/dist-server/service/inventory-item/inventory-item-mutation.js.map +1 -1
- package/dist-server/service/inventory-item/inventory-item-query.js +41 -52
- package/dist-server/service/inventory-item/inventory-item-query.js.map +1 -1
- package/dist-server/service/inventory-item/inventory-item-type.js +44 -52
- package/dist-server/service/inventory-item/inventory-item-type.js.map +1 -1
- package/dist-server/service/inventory-item/inventory-item.js +44 -52
- package/dist-server/service/inventory-item/inventory-item.js.map +1 -1
- package/dist-server/service/inventory-item-change/index.js.map +1 -1
- package/dist-server/service/inventory-item-change/inventory-item-change-mutation.js +33 -44
- package/dist-server/service/inventory-item-change/inventory-item-change-mutation.js.map +1 -1
- package/dist-server/service/inventory-item-change/inventory-item-change-query.js +29 -40
- package/dist-server/service/inventory-item-change/inventory-item-change-query.js.map +1 -1
- package/dist-server/service/inventory-item-change/inventory-item-change-type.js +40 -48
- package/dist-server/service/inventory-item-change/inventory-item-change-type.js.map +1 -1
- package/dist-server/service/inventory-item-change/inventory-item-change.js +34 -42
- package/dist-server/service/inventory-item-change/inventory-item-change.js.map +1 -1
- package/dist-server/service/inventory-product/index.js.map +1 -1
- package/dist-server/service/inventory-product/inventory-product-mutation.js +33 -44
- package/dist-server/service/inventory-product/inventory-product-mutation.js.map +1 -1
- package/dist-server/service/inventory-product/inventory-product-query.js +29 -40
- package/dist-server/service/inventory-product/inventory-product-query.js.map +1 -1
- package/dist-server/service/inventory-product/inventory-product-type.js +34 -42
- package/dist-server/service/inventory-product/inventory-product-type.js.map +1 -1
- package/dist-server/service/inventory-product/inventory-product.js +34 -42
- package/dist-server/service/inventory-product/inventory-product.js.map +1 -1
- package/dist-server/service/location/index.js.map +1 -1
- package/dist-server/service/location/location-mutation.js +39 -50
- package/dist-server/service/location/location-mutation.js.map +1 -1
- package/dist-server/service/location/location-query.js +65 -76
- package/dist-server/service/location/location-query.js.map +1 -1
- package/dist-server/service/location/location-types.js +105 -113
- package/dist-server/service/location/location-types.js.map +1 -1
- package/dist-server/service/location/location.js +41 -49
- package/dist-server/service/location/location.js.map +1 -1
- package/dist-server/service/movement/index.js.map +1 -1
- package/dist-server/service/movement/movement-mutation.js +21 -32
- package/dist-server/service/movement/movement-mutation.js.map +1 -1
- package/dist-server/service/movement/movement-query.js +51 -65
- package/dist-server/service/movement/movement-query.js.map +1 -1
- package/dist-server/service/movement/movement-types.js +43 -51
- package/dist-server/service/movement/movement-types.js.map +1 -1
- package/dist-server/service/movement/movement.js +30 -38
- package/dist-server/service/movement/movement.js.map +1 -1
- package/dist-server/service/pallet/index.js.map +1 -1
- package/dist-server/service/pallet/pallet-mutation.js +39 -50
- package/dist-server/service/pallet/pallet-mutation.js.map +1 -1
- package/dist-server/service/pallet/pallet-query.js +48 -59
- package/dist-server/service/pallet/pallet-query.js.map +1 -1
- package/dist-server/service/pallet/pallet-types.js +39 -47
- package/dist-server/service/pallet/pallet-types.js.map +1 -1
- package/dist-server/service/pallet/pallet.js +34 -42
- package/dist-server/service/pallet/pallet.js.map +1 -1
- package/dist-server/service/pallet-count/index.js.map +1 -1
- package/dist-server/service/pallet-count/pallet-count-mutation.js +39 -50
- package/dist-server/service/pallet-count/pallet-count-mutation.js.map +1 -1
- package/dist-server/service/pallet-count/pallet-count-query.js +28 -39
- package/dist-server/service/pallet-count/pallet-count-query.js.map +1 -1
- package/dist-server/service/pallet-count/pallet-count-types.js +20 -28
- package/dist-server/service/pallet-count/pallet-count-types.js.map +1 -1
- package/dist-server/service/pallet-count/pallet-count.js +26 -34
- package/dist-server/service/pallet-count/pallet-count.js.map +1 -1
- package/dist-server/service/pallet-history/index.js.map +1 -1
- package/dist-server/service/pallet-history/pallet-history-mutation.js +33 -44
- package/dist-server/service/pallet-history/pallet-history-mutation.js.map +1 -1
- package/dist-server/service/pallet-history/pallet-history-query.js +29 -40
- package/dist-server/service/pallet-history/pallet-history-query.js.map +1 -1
- package/dist-server/service/pallet-history/pallet-history-types.js +20 -28
- package/dist-server/service/pallet-history/pallet-history-types.js.map +1 -1
- package/dist-server/service/pallet-history/pallet-history.js +34 -42
- package/dist-server/service/pallet-history/pallet-history.js.map +1 -1
- package/dist-server/service/reduced-inventory-history/index.js.map +1 -1
- package/dist-server/service/reduced-inventory-history/reduced-inventory-history.js +52 -60
- package/dist-server/service/reduced-inventory-history/reduced-inventory-history.js.map +1 -1
- package/dist-server/service/tote/index.js.map +1 -1
- package/dist-server/service/tote/tote-mutation.js +46 -57
- package/dist-server/service/tote/tote-mutation.js.map +1 -1
- package/dist-server/service/tote/tote-query.js +44 -55
- package/dist-server/service/tote/tote-query.js.map +1 -1
- package/dist-server/service/tote/tote-types.js +24 -32
- package/dist-server/service/tote/tote-types.js.map +1 -1
- package/dist-server/service/tote/tote.js +30 -38
- package/dist-server/service/tote/tote.js.map +1 -1
- package/dist-server/service/warehouse/index.js.map +1 -1
- package/dist-server/service/warehouse/warehouse-mutation.js +33 -44
- package/dist-server/service/warehouse/warehouse-mutation.js.map +1 -1
- package/dist-server/service/warehouse/warehouse-query.js +29 -40
- package/dist-server/service/warehouse/warehouse-query.js.map +1 -1
- package/dist-server/service/warehouse/warehouse-types.js +28 -36
- package/dist-server/service/warehouse/warehouse-types.js.map +1 -1
- package/dist-server/service/warehouse/warehouse.js +31 -39
- package/dist-server/service/warehouse/warehouse.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -0
- package/dist-server/utils/datetime-util.js.map +1 -1
- package/dist-server/utils/index.js +4 -17
- package/dist-server/utils/index.js.map +1 -1
- package/dist-server/utils/inventory-no-generator.js.map +1 -1
- package/dist-server/utils/inventory-util.js.map +1 -1
- package/package.json +8 -8
- package/server/service/inventory/inventory-mutation.ts +2 -2
- package/server/service/inventory/inventory-query.ts +48 -16
- package/server/service/inventory/inventory.ts +6 -5
- package/server/service/inventory-change/inventory-change-mutation.ts +1 -1
- package/server/service/inventory-change/inventory-change-query.ts +2 -2
- package/server/service/inventory-history/inventory-history-query.ts +29 -28
- package/server/service/inventory-history/inventory-history.ts +39 -39
- package/server/service/inventory-item/inventory-item-mutation.ts +3 -3
- package/server/service/movement/movement-query.ts +3 -6
|
@@ -1,108 +1,100 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
2
|
var _a, _b, _c, _d, _e;
|
|
12
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
4
|
exports.PalletValidate = exports.PalletPatch = exports.PalletList = exports.NewPallet = void 0;
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
14
6
|
const type_graphql_1 = require("type-graphql");
|
|
15
7
|
const shell_1 = require("@things-factory/shell");
|
|
16
8
|
const pallet_1 = require("./pallet");
|
|
17
9
|
let NewPallet = class NewPallet {
|
|
18
10
|
};
|
|
19
|
-
__decorate([
|
|
11
|
+
tslib_1.__decorate([
|
|
20
12
|
(0, type_graphql_1.Field)(),
|
|
21
|
-
__metadata("design:type", String)
|
|
13
|
+
tslib_1.__metadata("design:type", String)
|
|
22
14
|
], NewPallet.prototype, "name", void 0);
|
|
23
|
-
__decorate([
|
|
15
|
+
tslib_1.__decorate([
|
|
24
16
|
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
|
|
25
|
-
__metadata("design:type", Number)
|
|
17
|
+
tslib_1.__metadata("design:type", Number)
|
|
26
18
|
], NewPallet.prototype, "seq", void 0);
|
|
27
|
-
__decorate([
|
|
19
|
+
tslib_1.__decorate([
|
|
28
20
|
(0, type_graphql_1.Field)(type => shell_1.ObjectRef, { nullable: true }),
|
|
29
|
-
__metadata("design:type", typeof (_a = typeof shell_1.ObjectRef !== "undefined" && shell_1.ObjectRef) === "function" ? _a : Object)
|
|
21
|
+
tslib_1.__metadata("design:type", typeof (_a = typeof shell_1.ObjectRef !== "undefined" && shell_1.ObjectRef) === "function" ? _a : Object)
|
|
30
22
|
], NewPallet.prototype, "owner", void 0);
|
|
31
|
-
__decorate([
|
|
23
|
+
tslib_1.__decorate([
|
|
32
24
|
(0, type_graphql_1.Field)(type => shell_1.ObjectRef, { nullable: true }),
|
|
33
|
-
__metadata("design:type", typeof (_b = typeof shell_1.ObjectRef !== "undefined" && shell_1.ObjectRef) === "function" ? _b : Object)
|
|
25
|
+
tslib_1.__metadata("design:type", typeof (_b = typeof shell_1.ObjectRef !== "undefined" && shell_1.ObjectRef) === "function" ? _b : Object)
|
|
34
26
|
], NewPallet.prototype, "holder", void 0);
|
|
35
|
-
__decorate([
|
|
27
|
+
tslib_1.__decorate([
|
|
36
28
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
37
|
-
__metadata("design:type", String)
|
|
29
|
+
tslib_1.__metadata("design:type", String)
|
|
38
30
|
], NewPallet.prototype, "status", void 0);
|
|
39
|
-
NewPallet = __decorate([
|
|
31
|
+
NewPallet = tslib_1.__decorate([
|
|
40
32
|
(0, type_graphql_1.InputType)()
|
|
41
33
|
], NewPallet);
|
|
42
34
|
exports.NewPallet = NewPallet;
|
|
43
35
|
let PalletList = class PalletList {
|
|
44
36
|
};
|
|
45
|
-
__decorate([
|
|
37
|
+
tslib_1.__decorate([
|
|
46
38
|
(0, type_graphql_1.Field)(type => [pallet_1.Pallet], { nullable: true }),
|
|
47
|
-
__metadata("design:type", Array)
|
|
39
|
+
tslib_1.__metadata("design:type", Array)
|
|
48
40
|
], PalletList.prototype, "items", void 0);
|
|
49
|
-
__decorate([
|
|
41
|
+
tslib_1.__decorate([
|
|
50
42
|
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
|
|
51
|
-
__metadata("design:type", Number)
|
|
43
|
+
tslib_1.__metadata("design:type", Number)
|
|
52
44
|
], PalletList.prototype, "total", void 0);
|
|
53
|
-
PalletList = __decorate([
|
|
45
|
+
PalletList = tslib_1.__decorate([
|
|
54
46
|
(0, type_graphql_1.ObjectType)()
|
|
55
47
|
], PalletList);
|
|
56
48
|
exports.PalletList = PalletList;
|
|
57
49
|
let PalletPatch = class PalletPatch {
|
|
58
50
|
};
|
|
59
|
-
__decorate([
|
|
51
|
+
tslib_1.__decorate([
|
|
60
52
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
61
|
-
__metadata("design:type", String)
|
|
53
|
+
tslib_1.__metadata("design:type", String)
|
|
62
54
|
], PalletPatch.prototype, "id", void 0);
|
|
63
|
-
__decorate([
|
|
55
|
+
tslib_1.__decorate([
|
|
64
56
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
65
|
-
__metadata("design:type", String)
|
|
57
|
+
tslib_1.__metadata("design:type", String)
|
|
66
58
|
], PalletPatch.prototype, "name", void 0);
|
|
67
|
-
__decorate([
|
|
59
|
+
tslib_1.__decorate([
|
|
68
60
|
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
|
|
69
|
-
__metadata("design:type", Number)
|
|
61
|
+
tslib_1.__metadata("design:type", Number)
|
|
70
62
|
], PalletPatch.prototype, "seq", void 0);
|
|
71
|
-
__decorate([
|
|
63
|
+
tslib_1.__decorate([
|
|
72
64
|
(0, type_graphql_1.Field)(type => shell_1.ObjectRef, { nullable: true }),
|
|
73
|
-
__metadata("design:type", typeof (_c = typeof shell_1.ObjectRef !== "undefined" && shell_1.ObjectRef) === "function" ? _c : Object)
|
|
65
|
+
tslib_1.__metadata("design:type", typeof (_c = typeof shell_1.ObjectRef !== "undefined" && shell_1.ObjectRef) === "function" ? _c : Object)
|
|
74
66
|
], PalletPatch.prototype, "owner", void 0);
|
|
75
|
-
__decorate([
|
|
67
|
+
tslib_1.__decorate([
|
|
76
68
|
(0, type_graphql_1.Field)(type => shell_1.ObjectRef, { nullable: true }),
|
|
77
|
-
__metadata("design:type", typeof (_d = typeof shell_1.ObjectRef !== "undefined" && shell_1.ObjectRef) === "function" ? _d : Object)
|
|
69
|
+
tslib_1.__metadata("design:type", typeof (_d = typeof shell_1.ObjectRef !== "undefined" && shell_1.ObjectRef) === "function" ? _d : Object)
|
|
78
70
|
], PalletPatch.prototype, "holder", void 0);
|
|
79
|
-
__decorate([
|
|
71
|
+
tslib_1.__decorate([
|
|
80
72
|
(0, type_graphql_1.Field)(type => shell_1.ObjectRef, { nullable: true }),
|
|
81
|
-
__metadata("design:type", typeof (_e = typeof shell_1.ObjectRef !== "undefined" && shell_1.ObjectRef) === "function" ? _e : Object)
|
|
73
|
+
tslib_1.__metadata("design:type", typeof (_e = typeof shell_1.ObjectRef !== "undefined" && shell_1.ObjectRef) === "function" ? _e : Object)
|
|
82
74
|
], PalletPatch.prototype, "inventory", void 0);
|
|
83
|
-
__decorate([
|
|
75
|
+
tslib_1.__decorate([
|
|
84
76
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
85
|
-
__metadata("design:type", String)
|
|
77
|
+
tslib_1.__metadata("design:type", String)
|
|
86
78
|
], PalletPatch.prototype, "status", void 0);
|
|
87
|
-
__decorate([
|
|
79
|
+
tslib_1.__decorate([
|
|
88
80
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
89
|
-
__metadata("design:type", String)
|
|
81
|
+
tslib_1.__metadata("design:type", String)
|
|
90
82
|
], PalletPatch.prototype, "cuFlag", void 0);
|
|
91
|
-
PalletPatch = __decorate([
|
|
83
|
+
PalletPatch = tslib_1.__decorate([
|
|
92
84
|
(0, type_graphql_1.InputType)()
|
|
93
85
|
], PalletPatch);
|
|
94
86
|
exports.PalletPatch = PalletPatch;
|
|
95
87
|
let PalletValidate = class PalletValidate {
|
|
96
88
|
};
|
|
97
|
-
__decorate([
|
|
89
|
+
tslib_1.__decorate([
|
|
98
90
|
(0, type_graphql_1.Field)(type => pallet_1.Pallet, { nullable: true }),
|
|
99
|
-
__metadata("design:type", pallet_1.Pallet)
|
|
91
|
+
tslib_1.__metadata("design:type", pallet_1.Pallet)
|
|
100
92
|
], PalletValidate.prototype, "item", void 0);
|
|
101
|
-
__decorate([
|
|
93
|
+
tslib_1.__decorate([
|
|
102
94
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
103
|
-
__metadata("design:type", String)
|
|
95
|
+
tslib_1.__metadata("design:type", String)
|
|
104
96
|
], PalletValidate.prototype, "error", void 0);
|
|
105
|
-
PalletValidate = __decorate([
|
|
97
|
+
PalletValidate = tslib_1.__decorate([
|
|
106
98
|
(0, type_graphql_1.ObjectType)()
|
|
107
99
|
], PalletValidate);
|
|
108
100
|
exports.PalletValidate = PalletValidate;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pallet-types.js","sourceRoot":"","sources":["../../../server/service/pallet/pallet-types.ts"],"names":[],"mappings":"
|
|
1
|
+
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@things-factory/shell'\n\nimport { Pallet } from './pallet'\n\n@InputType()\nexport class NewPallet {\n @Field()\n name: string\n\n @Field(type => Int, { nullable: true })\n seq?: number\n\n @Field(type => ObjectRef, { nullable: true })\n owner?: ObjectRef\n\n @Field(type => ObjectRef, { nullable: true })\n holder?: ObjectRef\n\n @Field({ nullable: true })\n status?: string\n}\n\n@ObjectType()\nexport class PalletList {\n @Field(type => [Pallet], { nullable: true })\n items?: Pallet[]\n\n @Field(type => Int, { nullable: true })\n total?: number\n}\n\n@InputType()\nexport class PalletPatch {\n @Field({ nullable: true })\n id?: string\n\n @Field({ nullable: true })\n name?: string\n\n @Field(type => Int, { nullable: true })\n seq?: number\n\n @Field(type => ObjectRef, { nullable: true })\n owner?: ObjectRef\n\n @Field(type => ObjectRef, { nullable: true })\n holder?: ObjectRef\n\n @Field(type => ObjectRef, { nullable: true })\n inventory?: ObjectRef\n\n @Field({ nullable: true })\n status?: string\n\n @Field({ nullable: true })\n cuFlag?: string\n}\n\n@ObjectType()\nexport class PalletValidate {\n @Field(type => Pallet, { nullable: true })\n item?: Pallet\n\n @Field({ nullable: true })\n error?: string\n}\n"]}
|
|
@@ -1,16 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
2
|
var _a, _b, _c, _d, _e;
|
|
12
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
4
|
exports.Pallet = void 0;
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
14
6
|
const type_graphql_1 = require("type-graphql");
|
|
15
7
|
const typeorm_1 = require("typeorm");
|
|
16
8
|
const auth_base_1 = require("@things-factory/auth-base");
|
|
@@ -19,91 +11,91 @@ const shell_1 = require("@things-factory/shell");
|
|
|
19
11
|
const inventory_1 = require("../inventory/inventory");
|
|
20
12
|
let Pallet = class Pallet {
|
|
21
13
|
};
|
|
22
|
-
__decorate([
|
|
14
|
+
tslib_1.__decorate([
|
|
23
15
|
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
24
16
|
(0, type_graphql_1.Field)(),
|
|
25
|
-
__metadata("design:type", String)
|
|
17
|
+
tslib_1.__metadata("design:type", String)
|
|
26
18
|
], Pallet.prototype, "id", void 0);
|
|
27
|
-
__decorate([
|
|
19
|
+
tslib_1.__decorate([
|
|
28
20
|
(0, typeorm_1.ManyToOne)(type => shell_1.Domain),
|
|
29
21
|
(0, type_graphql_1.Field)(),
|
|
30
|
-
__metadata("design:type", typeof (_a = typeof shell_1.Domain !== "undefined" && shell_1.Domain) === "function" ? _a : Object)
|
|
22
|
+
tslib_1.__metadata("design:type", typeof (_a = typeof shell_1.Domain !== "undefined" && shell_1.Domain) === "function" ? _a : Object)
|
|
31
23
|
], Pallet.prototype, "domain", void 0);
|
|
32
|
-
__decorate([
|
|
24
|
+
tslib_1.__decorate([
|
|
33
25
|
(0, typeorm_1.RelationId)((pallet) => pallet.domain),
|
|
34
|
-
__metadata("design:type", String)
|
|
26
|
+
tslib_1.__metadata("design:type", String)
|
|
35
27
|
], Pallet.prototype, "domainId", void 0);
|
|
36
|
-
__decorate([
|
|
28
|
+
tslib_1.__decorate([
|
|
37
29
|
(0, typeorm_1.Column)(),
|
|
38
30
|
(0, type_graphql_1.Field)(),
|
|
39
|
-
__metadata("design:type", String)
|
|
31
|
+
tslib_1.__metadata("design:type", String)
|
|
40
32
|
], Pallet.prototype, "name", void 0);
|
|
41
|
-
__decorate([
|
|
33
|
+
tslib_1.__decorate([
|
|
42
34
|
(0, typeorm_1.Column)({ default: 0 }),
|
|
43
35
|
(0, type_graphql_1.Field)(type => type_graphql_1.Int),
|
|
44
|
-
__metadata("design:type", Number)
|
|
36
|
+
tslib_1.__metadata("design:type", Number)
|
|
45
37
|
], Pallet.prototype, "seq", void 0);
|
|
46
|
-
__decorate([
|
|
38
|
+
tslib_1.__decorate([
|
|
47
39
|
(0, typeorm_1.ManyToOne)(type => biz_base_1.Bizplace),
|
|
48
40
|
(0, type_graphql_1.Field)(),
|
|
49
|
-
__metadata("design:type", typeof (_b = typeof biz_base_1.Bizplace !== "undefined" && biz_base_1.Bizplace) === "function" ? _b : Object)
|
|
41
|
+
tslib_1.__metadata("design:type", typeof (_b = typeof biz_base_1.Bizplace !== "undefined" && biz_base_1.Bizplace) === "function" ? _b : Object)
|
|
50
42
|
], Pallet.prototype, "owner", void 0);
|
|
51
|
-
__decorate([
|
|
43
|
+
tslib_1.__decorate([
|
|
52
44
|
(0, typeorm_1.ManyToOne)(type => biz_base_1.Bizplace),
|
|
53
45
|
(0, type_graphql_1.Field)(),
|
|
54
|
-
__metadata("design:type", typeof (_c = typeof biz_base_1.Bizplace !== "undefined" && biz_base_1.Bizplace) === "function" ? _c : Object)
|
|
46
|
+
tslib_1.__metadata("design:type", typeof (_c = typeof biz_base_1.Bizplace !== "undefined" && biz_base_1.Bizplace) === "function" ? _c : Object)
|
|
55
47
|
], Pallet.prototype, "holder", void 0);
|
|
56
|
-
__decorate([
|
|
48
|
+
tslib_1.__decorate([
|
|
57
49
|
(0, typeorm_1.OneToOne)(type => inventory_1.Inventory, { nullable: true }),
|
|
58
50
|
(0, typeorm_1.JoinColumn)(),
|
|
59
51
|
(0, type_graphql_1.Field)(type => inventory_1.Inventory, { nullable: true }),
|
|
60
|
-
__metadata("design:type", inventory_1.Inventory)
|
|
52
|
+
tslib_1.__metadata("design:type", inventory_1.Inventory)
|
|
61
53
|
], Pallet.prototype, "inventory", void 0);
|
|
62
|
-
__decorate([
|
|
54
|
+
tslib_1.__decorate([
|
|
63
55
|
(0, typeorm_1.Column)({
|
|
64
56
|
nullable: true
|
|
65
57
|
}),
|
|
66
58
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
67
|
-
__metadata("design:type", String)
|
|
59
|
+
tslib_1.__metadata("design:type", String)
|
|
68
60
|
], Pallet.prototype, "refOrderNo", void 0);
|
|
69
|
-
__decorate([
|
|
61
|
+
tslib_1.__decorate([
|
|
70
62
|
(0, typeorm_1.Column)(),
|
|
71
63
|
(0, type_graphql_1.Field)(),
|
|
72
|
-
__metadata("design:type", String)
|
|
64
|
+
tslib_1.__metadata("design:type", String)
|
|
73
65
|
], Pallet.prototype, "status", void 0);
|
|
74
|
-
__decorate([
|
|
66
|
+
tslib_1.__decorate([
|
|
75
67
|
(0, typeorm_1.CreateDateColumn)(),
|
|
76
68
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
77
|
-
__metadata("design:type", Date)
|
|
69
|
+
tslib_1.__metadata("design:type", Date)
|
|
78
70
|
], Pallet.prototype, "createdAt", void 0);
|
|
79
|
-
__decorate([
|
|
71
|
+
tslib_1.__decorate([
|
|
80
72
|
(0, typeorm_1.UpdateDateColumn)(),
|
|
81
73
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
82
|
-
__metadata("design:type", Date)
|
|
74
|
+
tslib_1.__metadata("design:type", Date)
|
|
83
75
|
], Pallet.prototype, "updatedAt", void 0);
|
|
84
|
-
__decorate([
|
|
76
|
+
tslib_1.__decorate([
|
|
85
77
|
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
|
|
86
78
|
nullable: true
|
|
87
79
|
}),
|
|
88
80
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
89
|
-
__metadata("design:type", typeof (_d = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _d : Object)
|
|
81
|
+
tslib_1.__metadata("design:type", typeof (_d = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _d : Object)
|
|
90
82
|
], Pallet.prototype, "creator", void 0);
|
|
91
|
-
__decorate([
|
|
83
|
+
tslib_1.__decorate([
|
|
92
84
|
(0, typeorm_1.RelationId)((pallet) => pallet.creator),
|
|
93
|
-
__metadata("design:type", String)
|
|
85
|
+
tslib_1.__metadata("design:type", String)
|
|
94
86
|
], Pallet.prototype, "creatorId", void 0);
|
|
95
|
-
__decorate([
|
|
87
|
+
tslib_1.__decorate([
|
|
96
88
|
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
|
|
97
89
|
nullable: true
|
|
98
90
|
}),
|
|
99
91
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
100
|
-
__metadata("design:type", typeof (_e = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _e : Object)
|
|
92
|
+
tslib_1.__metadata("design:type", typeof (_e = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _e : Object)
|
|
101
93
|
], Pallet.prototype, "updater", void 0);
|
|
102
|
-
__decorate([
|
|
94
|
+
tslib_1.__decorate([
|
|
103
95
|
(0, typeorm_1.RelationId)((pallet) => pallet.updater),
|
|
104
|
-
__metadata("design:type", String)
|
|
96
|
+
tslib_1.__metadata("design:type", String)
|
|
105
97
|
], Pallet.prototype, "updaterId", void 0);
|
|
106
|
-
Pallet = __decorate([
|
|
98
|
+
Pallet = tslib_1.__decorate([
|
|
107
99
|
(0, typeorm_1.Entity)(),
|
|
108
100
|
(0, typeorm_1.Index)('ix_pallet_0', (pallet) => [pallet.domain, pallet.name], { unique: true }),
|
|
109
101
|
(0, type_graphql_1.ObjectType)()
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pallet.js","sourceRoot":"","sources":["../../../server/service/pallet/pallet.ts"],"names":[],"mappings":"
|
|
1
|
+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;IACxF,IAAA,yBAAU,GAAE;GACA,MAAM,CAoElB;AApEY,wBAAM","sourcesContent":["import { Field, Int, ObjectType } from 'type-graphql'\nimport {\n Column,\n CreateDateColumn,\n Entity,\n Index,\n JoinColumn,\n ManyToOne,\n OneToOne,\n PrimaryGeneratedColumn,\n RelationId,\n UpdateDateColumn\n} from 'typeorm'\n\nimport { User } from '@things-factory/auth-base'\nimport { Bizplace } from '@things-factory/biz-base'\nimport { Domain } from '@things-factory/shell'\n\nimport { Inventory } from '../inventory/inventory'\n\n@Entity()\n@Index('ix_pallet_0', (pallet: Pallet) => [pallet.domain, pallet.name], { unique: true })\n@ObjectType()\nexport class Pallet {\n @PrimaryGeneratedColumn('uuid')\n @Field()\n id: string\n\n @ManyToOne(type => Domain)\n @Field()\n domain: Domain\n\n @RelationId((pallet: Pallet) => pallet.domain)\n domainId: string\n\n @Column()\n @Field()\n name: string\n\n @Column({ default: 0 })\n @Field(type => Int)\n seq: number\n\n @ManyToOne(type => Bizplace)\n @Field()\n owner: Bizplace\n\n @ManyToOne(type => Bizplace)\n @Field()\n holder: Bizplace\n\n @OneToOne(type => Inventory, { nullable: true })\n @JoinColumn()\n @Field(type => Inventory, { nullable: true })\n inventory: Inventory\n\n @Column({\n nullable: true\n })\n @Field({ nullable: true })\n refOrderNo: string\n\n @Column()\n @Field()\n status: string\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt: Date\n\n @ManyToOne(type => User, {\n nullable: true\n })\n @Field({ nullable: true })\n creator: User\n\n @RelationId((pallet: Pallet) => pallet.creator)\n creatorId: string\n\n @ManyToOne(type => User, {\n nullable: true\n })\n @Field({ nullable: true })\n updater: User\n\n @RelationId((pallet: Pallet) => pallet.updater)\n updaterId: string\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/pallet-count/index.ts"],"names":[],"mappings":";;;AAAA,iDAA4C;AAC5C,mEAA6D;AAC7D,6DAAuD;AAE1C,QAAA,QAAQ,GAAG,CAAC,0BAAW,CAAC,CAAA;AACxB,QAAA,SAAS,GAAG,CAAC,qCAAgB,EAAE,2CAAmB,CAAC,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/pallet-count/index.ts"],"names":[],"mappings":";;;AAAA,iDAA4C;AAC5C,mEAA6D;AAC7D,6DAAuD;AAE1C,QAAA,QAAQ,GAAG,CAAC,0BAAW,CAAC,CAAA;AACxB,QAAA,SAAS,GAAG,CAAC,qCAAgB,EAAE,2CAAmB,CAAC,CAAA","sourcesContent":["import { PalletCount } from './pallet-count'\nimport { PalletCountMutation } from './pallet-count-mutation'\nimport { PalletCountQuery } from './pallet-count-query'\n\nexport const entities = [PalletCount]\nexport const resolvers = [PalletCountQuery, PalletCountMutation]\n"]}
|
|
@@ -1,18 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
3
|
exports.PalletCountMutation = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
16
5
|
const type_graphql_1 = require("type-graphql");
|
|
17
6
|
const typeorm_1 = require("typeorm");
|
|
18
7
|
const uuid_1 = require("uuid");
|
|
@@ -91,62 +80,62 @@ let PalletCountMutation = class PalletCountMutation {
|
|
|
91
80
|
}
|
|
92
81
|
}
|
|
93
82
|
};
|
|
94
|
-
__decorate([
|
|
83
|
+
tslib_1.__decorate([
|
|
95
84
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
96
85
|
(0, type_graphql_1.Mutation)(returns => pallet_count_1.PalletCount),
|
|
97
|
-
__param(0, (0, type_graphql_1.Arg)('palletCount')),
|
|
98
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
|
99
|
-
__metadata("design:type", Function),
|
|
100
|
-
__metadata("design:paramtypes", [pallet_count_types_1.NewPalletCount, Object]),
|
|
101
|
-
__metadata("design:returntype", Promise)
|
|
86
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('palletCount')),
|
|
87
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
88
|
+
tslib_1.__metadata("design:type", Function),
|
|
89
|
+
tslib_1.__metadata("design:paramtypes", [pallet_count_types_1.NewPalletCount, Object]),
|
|
90
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
102
91
|
], PalletCountMutation.prototype, "createPalletCount", null);
|
|
103
|
-
__decorate([
|
|
92
|
+
tslib_1.__decorate([
|
|
104
93
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
105
94
|
(0, type_graphql_1.Mutation)(returns => pallet_count_1.PalletCount),
|
|
106
|
-
__param(0, (0, type_graphql_1.Arg)('name')),
|
|
107
|
-
__param(1, (0, type_graphql_1.Arg)('patch')),
|
|
108
|
-
__param(2, (0, type_graphql_1.Ctx)()),
|
|
109
|
-
__metadata("design:type", Function),
|
|
110
|
-
__metadata("design:paramtypes", [String, pallet_count_types_1.PalletCountPatch, Object]),
|
|
111
|
-
__metadata("design:returntype", Promise)
|
|
95
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('name')),
|
|
96
|
+
tslib_1.__param(1, (0, type_graphql_1.Arg)('patch')),
|
|
97
|
+
tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
|
|
98
|
+
tslib_1.__metadata("design:type", Function),
|
|
99
|
+
tslib_1.__metadata("design:paramtypes", [String, pallet_count_types_1.PalletCountPatch, Object]),
|
|
100
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
112
101
|
], PalletCountMutation.prototype, "updatePalletCount", null);
|
|
113
|
-
__decorate([
|
|
102
|
+
tslib_1.__decorate([
|
|
114
103
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
115
104
|
(0, type_graphql_1.Mutation)(returns => [pallet_count_1.PalletCount]),
|
|
116
|
-
__param(0, (0, type_graphql_1.Arg)('patches', type => [pallet_count_types_1.PalletCountPatch])),
|
|
117
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
|
118
|
-
__metadata("design:type", Function),
|
|
119
|
-
__metadata("design:paramtypes", [Array, Object]),
|
|
120
|
-
__metadata("design:returntype", Promise)
|
|
105
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('patches', type => [pallet_count_types_1.PalletCountPatch])),
|
|
106
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
107
|
+
tslib_1.__metadata("design:type", Function),
|
|
108
|
+
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
109
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
121
110
|
], PalletCountMutation.prototype, "updateMultiplePalletCount", null);
|
|
122
|
-
__decorate([
|
|
111
|
+
tslib_1.__decorate([
|
|
123
112
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
124
113
|
(0, type_graphql_1.Mutation)(returns => Boolean),
|
|
125
|
-
__param(0, (0, type_graphql_1.Arg)('name')),
|
|
126
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
|
127
|
-
__metadata("design:type", Function),
|
|
128
|
-
__metadata("design:paramtypes", [String, Object]),
|
|
129
|
-
__metadata("design:returntype", Promise)
|
|
114
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('name')),
|
|
115
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
116
|
+
tslib_1.__metadata("design:type", Function),
|
|
117
|
+
tslib_1.__metadata("design:paramtypes", [String, Object]),
|
|
118
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
130
119
|
], PalletCountMutation.prototype, "deletePalletCount", null);
|
|
131
|
-
__decorate([
|
|
120
|
+
tslib_1.__decorate([
|
|
132
121
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
133
122
|
(0, type_graphql_1.Mutation)(returns => Boolean),
|
|
134
|
-
__param(0, (0, type_graphql_1.Arg)('names', type => [String])),
|
|
135
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
|
136
|
-
__metadata("design:type", Function),
|
|
137
|
-
__metadata("design:paramtypes", [Array, Object]),
|
|
138
|
-
__metadata("design:returntype", Promise)
|
|
123
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('names', type => [String])),
|
|
124
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
125
|
+
tslib_1.__metadata("design:type", Function),
|
|
126
|
+
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
127
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
139
128
|
], PalletCountMutation.prototype, "deletePalletCounts", null);
|
|
140
|
-
__decorate([
|
|
129
|
+
tslib_1.__decorate([
|
|
141
130
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
142
131
|
(0, type_graphql_1.Mutation)(returns => pallet_count_1.PalletCount),
|
|
143
|
-
__param(0, (0, type_graphql_1.Arg)('printQty')),
|
|
144
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
|
145
|
-
__metadata("design:type", Function),
|
|
146
|
-
__metadata("design:paramtypes", [Number, Object]),
|
|
147
|
-
__metadata("design:returntype", Promise)
|
|
132
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('printQty')),
|
|
133
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
134
|
+
tslib_1.__metadata("design:type", Function),
|
|
135
|
+
tslib_1.__metadata("design:paramtypes", [Number, Object]),
|
|
136
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
148
137
|
], PalletCountMutation.prototype, "updatePalletCountSeq", null);
|
|
149
|
-
PalletCountMutation = __decorate([
|
|
138
|
+
PalletCountMutation = tslib_1.__decorate([
|
|
150
139
|
(0, type_graphql_1.Resolver)(pallet_count_1.PalletCount)
|
|
151
140
|
], PalletCountMutation);
|
|
152
141
|
exports.PalletCountMutation = PalletCountMutation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pallet-count-mutation.js","sourceRoot":"","sources":["../../../server/service/pallet-count/pallet-count-mutation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pallet-count-mutation.js","sourceRoot":"","sources":["../../../server/service/pallet-count/pallet-count-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAAqD;AACrD,+BAAmC;AAKnC,iDAA4C;AAC5C,6DAAuE;AAGvE,IAAa,mBAAmB,GAAhC,MAAa,mBAAmB;IAG9B,KAAK,CAAC,iBAAiB,CAAqB,WAA2B,EAAS,OAAY;QAC1F,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAsD,OAAO,CAAC,KAAK,CAAA;QAE7F,OAAO,MAAM,EAAE,CAAC,aAAa,CAAC,0BAAW,CAAC,CAAC,IAAI,iCAC1C,WAAW,KACd,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,IAAI,IACb,CAAA;IACJ,CAAC;IAID,KAAK,CAAC,iBAAiB,CACR,IAAY,EACX,KAAuB,EAC9B,OAAY;QAEnB,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EA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GACT,mBAAmB,CAwI/B;AAxIY,kDAAmB","sourcesContent":["import { Arg, Ctx, Directive, Mutation, Resolver } from 'type-graphql'\nimport { EntityManager, In, MoreThan } from 'typeorm'\nimport { v4 as uuidv4 } from 'uuid'\n\nimport { User } from '@things-factory/auth-base'\nimport { Domain } from '@things-factory/shell'\n\nimport { PalletCount } from './pallet-count'\nimport { NewPalletCount, PalletCountPatch } from './pallet-count-types'\n\n@Resolver(PalletCount)\nexport class PalletCountMutation {\n @Directive('@transaction')\n @Mutation(returns => PalletCount)\n async createPalletCount(@Arg('palletCount') palletCount: NewPalletCount, @Ctx() context: any): Promise<PalletCount> {\n const { domain, user, tx }: { domain: Domain; user: User; tx: EntityManager } = context.state\n\n return await tx.getRepository(PalletCount).save({\n ...palletCount,\n domain: domain,\n creator: user,\n updater: user\n })\n }\n\n @Directive('@transaction')\n @Mutation(returns => PalletCount)\n async updatePalletCount(\n @Arg('name') name: string,\n @Arg('patch') patch: PalletCountPatch,\n @Ctx() context: any\n ): Promise<PalletCount> {\n const { domain, user, tx }: { domain: Domain; user: User; tx: EntityManager } = context.state\n\n const repository = tx.getRepository(PalletCount)\n const palletCount = await repository.findOne({\n where: { domain: domain, name }\n })\n\n return await repository.save({\n ...palletCount,\n ...patch,\n updater: user\n })\n }\n\n @Directive('@transaction')\n @Mutation(returns => [PalletCount])\n async updateMultiplePalletCount(\n @Arg('patches', type => [PalletCountPatch]) patches: PalletCountPatch[],\n @Ctx() context: any\n ): Promise<PalletCount[]> {\n const { domain, user, tx }: { domain: Domain; user: User; tx: EntityManager } = context.state\n\n let results = []\n const _createRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === '+')\n const _updateRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === 'M')\n const palletCountRepo = tx.getRepository(PalletCount)\n\n if (_createRecords.length > 0) {\n for (let i = 0; i < _createRecords.length; i++) {\n const newRecord = _createRecords[i]\n\n const result = await palletCountRepo.save({\n ...newRecord,\n domain: domain,\n creator: user,\n updater: user\n })\n\n results.push({ ...result, cuFlag: '+' })\n }\n }\n\n if (_updateRecords.length > 0) {\n for (let i = 0; i < _updateRecords.length; i++) {\n const newRecord = _updateRecords[i]\n const palletCount = await palletCountRepo.findOne(newRecord.id)\n\n const result = await palletCountRepo.save({\n ...palletCount,\n ...newRecord,\n updater: user\n })\n\n results.push({ ...result, cuFlag: 'M' })\n }\n }\n\n return results\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean)\n async deletePalletCount(@Arg('name') name: string, @Ctx() context: any): Promise<Boolean> {\n const { domain, tx }: { domain: Domain; tx: EntityManager } = context.state\n\n await tx.getRepository(PalletCount).delete({ domain: domain, name })\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean)\n async deletePalletCounts(@Arg('names', type => [String]) names: string[], @Ctx() context: any): Promise<Boolean> {\n const { domain, tx }: { domain: Domain; tx: EntityManager } = context.state\n\n await tx.getRepository(PalletCount).delete({\n domain: domain,\n name: In(names)\n })\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => PalletCount)\n async updatePalletCountSeq(@Arg('printQty') printQty: number, @Ctx() context: any): Promise<PalletCount> {\n const { domain, user, tx }: { domain: Domain; user: User; tx: EntityManager } = context.state\n\n const repository = tx.getRepository(PalletCount)\n const todayDate = new Date()\n todayDate.setHours(0, 0, 0, 0)\n const palletCount = await repository.findOne({\n where: { domain: domain, createdAt: MoreThan(todayDate) }\n })\n\n if (!palletCount) {\n let newPallet = {\n name: uuidv4(),\n seq: 0,\n domain: domain,\n creator: user,\n updater: user\n }\n\n return await tx.getRepository(PalletCount).save({\n ...newPallet,\n seq: printQty\n })\n } else {\n await tx.getRepository(PalletCount).save({\n ...palletCount,\n seq: printQty + palletCount.seq\n })\n\n return palletCount\n }\n }\n}\n"]}
|
|
@@ -1,19 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
2
|
var _a;
|
|
15
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
4
|
exports.PalletCountQuery = void 0;
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
17
6
|
const type_graphql_1 = require("type-graphql");
|
|
18
7
|
const typeorm_1 = require("typeorm");
|
|
19
8
|
const auth_base_1 = require("@things-factory/auth-base");
|
|
@@ -43,43 +32,43 @@ let PalletCountQuery = class PalletCountQuery {
|
|
|
43
32
|
return await (0, typeorm_1.getRepository)(auth_base_1.User).findOne(palletCount.creatorId);
|
|
44
33
|
}
|
|
45
34
|
};
|
|
46
|
-
__decorate([
|
|
35
|
+
tslib_1.__decorate([
|
|
47
36
|
(0, type_graphql_1.Query)(returns => pallet_count_types_1.PalletCountList),
|
|
48
|
-
__param(0, (0, type_graphql_1.Args)()),
|
|
49
|
-
__metadata("design:type", Function),
|
|
50
|
-
__metadata("design:paramtypes", [typeof (_a = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _a : Object]),
|
|
51
|
-
__metadata("design:returntype", Promise)
|
|
37
|
+
tslib_1.__param(0, (0, type_graphql_1.Args)()),
|
|
38
|
+
tslib_1.__metadata("design:type", Function),
|
|
39
|
+
tslib_1.__metadata("design:paramtypes", [typeof (_a = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _a : Object]),
|
|
40
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
52
41
|
], PalletCountQuery.prototype, "palletCounts", null);
|
|
53
|
-
__decorate([
|
|
42
|
+
tslib_1.__decorate([
|
|
54
43
|
(0, type_graphql_1.Query)(returns => pallet_count_1.PalletCount),
|
|
55
|
-
__param(0, (0, type_graphql_1.Arg)('name')),
|
|
56
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
|
57
|
-
__metadata("design:type", Function),
|
|
58
|
-
__metadata("design:paramtypes", [String, Object]),
|
|
59
|
-
__metadata("design:returntype", Promise)
|
|
44
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('name')),
|
|
45
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
46
|
+
tslib_1.__metadata("design:type", Function),
|
|
47
|
+
tslib_1.__metadata("design:paramtypes", [String, Object]),
|
|
48
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
60
49
|
], PalletCountQuery.prototype, "palletCount", null);
|
|
61
|
-
__decorate([
|
|
50
|
+
tslib_1.__decorate([
|
|
62
51
|
(0, type_graphql_1.FieldResolver)(type => shell_1.Domain),
|
|
63
|
-
__param(0, (0, type_graphql_1.Root)()),
|
|
64
|
-
__metadata("design:type", Function),
|
|
65
|
-
__metadata("design:paramtypes", [pallet_count_1.PalletCount]),
|
|
66
|
-
__metadata("design:returntype", Promise)
|
|
52
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
53
|
+
tslib_1.__metadata("design:type", Function),
|
|
54
|
+
tslib_1.__metadata("design:paramtypes", [pallet_count_1.PalletCount]),
|
|
55
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
67
56
|
], PalletCountQuery.prototype, "domain", null);
|
|
68
|
-
__decorate([
|
|
57
|
+
tslib_1.__decorate([
|
|
69
58
|
(0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
|
|
70
|
-
__param(0, (0, type_graphql_1.Root)()),
|
|
71
|
-
__metadata("design:type", Function),
|
|
72
|
-
__metadata("design:paramtypes", [pallet_count_1.PalletCount]),
|
|
73
|
-
__metadata("design:returntype", Promise)
|
|
59
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
60
|
+
tslib_1.__metadata("design:type", Function),
|
|
61
|
+
tslib_1.__metadata("design:paramtypes", [pallet_count_1.PalletCount]),
|
|
62
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
74
63
|
], PalletCountQuery.prototype, "updater", null);
|
|
75
|
-
__decorate([
|
|
64
|
+
tslib_1.__decorate([
|
|
76
65
|
(0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
|
|
77
|
-
__param(0, (0, type_graphql_1.Root)()),
|
|
78
|
-
__metadata("design:type", Function),
|
|
79
|
-
__metadata("design:paramtypes", [pallet_count_1.PalletCount]),
|
|
80
|
-
__metadata("design:returntype", Promise)
|
|
66
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
67
|
+
tslib_1.__metadata("design:type", Function),
|
|
68
|
+
tslib_1.__metadata("design:paramtypes", [pallet_count_1.PalletCount]),
|
|
69
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
81
70
|
], PalletCountQuery.prototype, "creator", null);
|
|
82
|
-
PalletCountQuery = __decorate([
|
|
71
|
+
PalletCountQuery = tslib_1.__decorate([
|
|
83
72
|
(0, type_graphql_1.Resolver)(pallet_count_1.PalletCount)
|
|
84
73
|
], PalletCountQuery);
|
|
85
74
|
exports.PalletCountQuery = PalletCountQuery;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pallet-count-query.js","sourceRoot":"","sources":["../../../server/service/pallet-count/pallet-count-query.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pallet-count-query.js","sourceRoot":"","sources":["../../../server/service/pallet-count/pallet-count-query.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C,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,CAAA;IACjE,CAAC;CACF,CAAA;AAjCC;IADC,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,oCAAe,CAAC;IACd,mBAAA,IAAA,mBAAI,GAAE,CAAA;;iEAAS,iBAAS,oBAAT,iBAAS;;oDAO3C;AAGD;IADC,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,0BAAW,CAAC;IACX,mBAAA,IAAA,kBAAG,EAAC,MAAM,CAAC,CAAA;IAAgB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;mDAOlD;AAGD;IADC,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IAChB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAc,0BAAW;;8CAE5C;AAGD;IADC,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAc,0BAAW;;+CAE7C;AAGD;IADC,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAc,0BAAW;;+CAE7C;AAlCU,gBAAgB;IAD5B,IAAA,uBAAQ,EAAC,0BAAW,CAAC;GACT,gBAAgB,CAmC5B;AAnCY,4CAAgB","sourcesContent":["import { Arg, Args, Ctx, FieldResolver, Query, Resolver, Root } from 'type-graphql'\nimport { getRepository } from 'typeorm'\n\nimport { User } from '@things-factory/auth-base'\nimport { convertListParams, Domain, ListParam } from '@things-factory/shell'\n\nimport { PalletCount } from './pallet-count'\nimport { PalletCountList } from './pallet-count-types'\n\n@Resolver(PalletCount)\nexport class PalletCountQuery {\n @Query(returns => PalletCountList)\n async palletCounts(@Args() params: ListParam): Promise<PalletCountList> {\n const convertedParams = convertListParams(params)\n const [items, total] = await getRepository(PalletCount).findAndCount({\n ...convertedParams,\n relations: ['domain', 'creator', 'updater']\n })\n return { items, total }\n }\n\n @Query(returns => PalletCount)\n async palletCount(@Arg('name') name: string, @Ctx() context: any): Promise<PalletCount> {\n const { domain }: { domain: Domain } = context.state\n\n return await getRepository(PalletCount).findOne({\n where: { domain: domain, name },\n relations: ['domain', 'creator', 'updater']\n })\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() palletCount: PalletCount) {\n return await getRepository(Domain).findOne(palletCount.domainId)\n }\n\n @FieldResolver(type => User)\n async updater(@Root() palletCount: PalletCount) {\n return await getRepository(User).findOne(palletCount.updaterId)\n }\n\n @FieldResolver(type => User)\n async creator(@Root() palletCount: PalletCount) {\n return await getRepository(User).findOne(palletCount.creatorId)\n }\n}\n"]}
|