@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,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.ToteQuery = 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");
|
|
@@ -83,63 +72,63 @@ let ToteQuery = class ToteQuery {
|
|
|
83
72
|
return await (0, typeorm_1.getRepository)(auth_base_1.User).findOne(tote.creatorId);
|
|
84
73
|
}
|
|
85
74
|
};
|
|
86
|
-
__decorate([
|
|
75
|
+
tslib_1.__decorate([
|
|
87
76
|
(0, type_graphql_1.Query)(returns => tote_types_1.ToteList),
|
|
88
|
-
__param(0, (0, type_graphql_1.Ctx)()),
|
|
89
|
-
__param(1, (0, type_graphql_1.Arg)('filters', type => [shell_1.Filter], { nullable: true })),
|
|
90
|
-
__param(2, (0, type_graphql_1.Arg)('pagination', type => shell_1.Pagination, { nullable: true })),
|
|
91
|
-
__param(3, (0, type_graphql_1.Arg)('sortings', type => [shell_1.Sorting], { nullable: true })),
|
|
92
|
-
__metadata("design:type", Function),
|
|
93
|
-
__metadata("design:paramtypes", [Object, Array, typeof (_a = typeof shell_1.Pagination !== "undefined" && shell_1.Pagination) === "function" ? _a : Object, Array]),
|
|
94
|
-
__metadata("design:returntype", Promise)
|
|
77
|
+
tslib_1.__param(0, (0, type_graphql_1.Ctx)()),
|
|
78
|
+
tslib_1.__param(1, (0, type_graphql_1.Arg)('filters', type => [shell_1.Filter], { nullable: true })),
|
|
79
|
+
tslib_1.__param(2, (0, type_graphql_1.Arg)('pagination', type => shell_1.Pagination, { nullable: true })),
|
|
80
|
+
tslib_1.__param(3, (0, type_graphql_1.Arg)('sortings', type => [shell_1.Sorting], { nullable: true })),
|
|
81
|
+
tslib_1.__metadata("design:type", Function),
|
|
82
|
+
tslib_1.__metadata("design:paramtypes", [Object, Array, typeof (_a = typeof shell_1.Pagination !== "undefined" && shell_1.Pagination) === "function" ? _a : Object, Array]),
|
|
83
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
95
84
|
], ToteQuery.prototype, "totes", null);
|
|
96
|
-
__decorate([
|
|
85
|
+
tslib_1.__decorate([
|
|
97
86
|
(0, type_graphql_1.Query)(returns => tote_1.Tote),
|
|
98
|
-
__param(0, (0, type_graphql_1.Arg)('name')),
|
|
99
|
-
__param(1, (0, type_graphql_1.Arg)('bizplace')),
|
|
100
|
-
__param(2, (0, type_graphql_1.Ctx)()),
|
|
101
|
-
__metadata("design:type", Function),
|
|
102
|
-
__metadata("design:paramtypes", [String, String, Object]),
|
|
103
|
-
__metadata("design:returntype", Promise)
|
|
87
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('name')),
|
|
88
|
+
tslib_1.__param(1, (0, type_graphql_1.Arg)('bizplace')),
|
|
89
|
+
tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
|
|
90
|
+
tslib_1.__metadata("design:type", Function),
|
|
91
|
+
tslib_1.__metadata("design:paramtypes", [String, String, Object]),
|
|
92
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
104
93
|
], ToteQuery.prototype, "tote", null);
|
|
105
|
-
__decorate([
|
|
94
|
+
tslib_1.__decorate([
|
|
106
95
|
(0, type_graphql_1.Query)(returns => String),
|
|
107
|
-
__param(0, (0, type_graphql_1.Arg)('name')),
|
|
108
|
-
__param(1, (0, type_graphql_1.Arg)('bizplace')),
|
|
109
|
-
__param(2, (0, type_graphql_1.Ctx)()),
|
|
110
|
-
__metadata("design:type", Function),
|
|
111
|
-
__metadata("design:paramtypes", [String, String, Object]),
|
|
112
|
-
__metadata("design:returntype", Promise)
|
|
96
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('name')),
|
|
97
|
+
tslib_1.__param(1, (0, type_graphql_1.Arg)('bizplace')),
|
|
98
|
+
tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
|
|
99
|
+
tslib_1.__metadata("design:type", Function),
|
|
100
|
+
tslib_1.__metadata("design:paramtypes", [String, String, Object]),
|
|
101
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
113
102
|
], ToteQuery.prototype, "checkToteStatus", null);
|
|
114
|
-
__decorate([
|
|
103
|
+
tslib_1.__decorate([
|
|
115
104
|
(0, type_graphql_1.FieldResolver)(),
|
|
116
|
-
__param(0, (0, type_graphql_1.Root)()),
|
|
117
|
-
__metadata("design:type", Function),
|
|
118
|
-
__metadata("design:paramtypes", [tote_1.Tote]),
|
|
119
|
-
__metadata("design:returntype", Promise)
|
|
105
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
106
|
+
tslib_1.__metadata("design:type", Function),
|
|
107
|
+
tslib_1.__metadata("design:paramtypes", [tote_1.Tote]),
|
|
108
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
120
109
|
], ToteQuery.prototype, "domain", null);
|
|
121
|
-
__decorate([
|
|
110
|
+
tslib_1.__decorate([
|
|
122
111
|
(0, type_graphql_1.FieldResolver)(),
|
|
123
|
-
__param(0, (0, type_graphql_1.Root)()),
|
|
124
|
-
__metadata("design:type", Function),
|
|
125
|
-
__metadata("design:paramtypes", [tote_1.Tote]),
|
|
126
|
-
__metadata("design:returntype", Promise)
|
|
112
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
113
|
+
tslib_1.__metadata("design:type", Function),
|
|
114
|
+
tslib_1.__metadata("design:paramtypes", [tote_1.Tote]),
|
|
115
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
127
116
|
], ToteQuery.prototype, "bizplace", null);
|
|
128
|
-
__decorate([
|
|
117
|
+
tslib_1.__decorate([
|
|
129
118
|
(0, type_graphql_1.FieldResolver)(),
|
|
130
|
-
__param(0, (0, type_graphql_1.Root)()),
|
|
131
|
-
__metadata("design:type", Function),
|
|
132
|
-
__metadata("design:paramtypes", [tote_1.Tote]),
|
|
133
|
-
__metadata("design:returntype", Promise)
|
|
119
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
120
|
+
tslib_1.__metadata("design:type", Function),
|
|
121
|
+
tslib_1.__metadata("design:paramtypes", [tote_1.Tote]),
|
|
122
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
134
123
|
], ToteQuery.prototype, "updater", null);
|
|
135
|
-
__decorate([
|
|
124
|
+
tslib_1.__decorate([
|
|
136
125
|
(0, type_graphql_1.FieldResolver)(),
|
|
137
|
-
__param(0, (0, type_graphql_1.Root)()),
|
|
138
|
-
__metadata("design:type", Function),
|
|
139
|
-
__metadata("design:paramtypes", [tote_1.Tote]),
|
|
140
|
-
__metadata("design:returntype", Promise)
|
|
126
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
127
|
+
tslib_1.__metadata("design:type", Function),
|
|
128
|
+
tslib_1.__metadata("design:paramtypes", [tote_1.Tote]),
|
|
129
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
141
130
|
], ToteQuery.prototype, "creator", null);
|
|
142
|
-
ToteQuery = __decorate([
|
|
131
|
+
ToteQuery = tslib_1.__decorate([
|
|
143
132
|
(0, type_graphql_1.Resolver)(tote_1.Tote)
|
|
144
133
|
], ToteQuery);
|
|
145
134
|
exports.ToteQuery = ToteQuery;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tote-query.js","sourceRoot":"","sources":["../../../server/service/tote/tote-query.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tote-query.js","sourceRoot":"","sources":["../../../server/service/tote/tote-query.ts"],"names":[],"mappings":";;;;;AAAA,+CAA6E;AAC7E,qCAA+C;AAE/C,yDAAgD;AAChD,uDAAmD;AACnD,iDAAuF;AAEvF,iCAA6B;AAC7B,6CAAuC;AAGvC,IAAa,SAAS,GAAtB,MAAa,SAAS;IAEpB,KAAK,CAAC,KAAK,CACF,OAAY,EACmC,OAAkB,EACb,UAAuB,EAC1B,QAAoB;QAE5E,MAAM,EAAE,MAAM,EAAE,GAAuB,OAAO,CAAC,KAAK,CAAA;QAEpD,MAAM,aAAa,GAAQ,OAAO,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AA,IAAA,kBAAG,EAAC,MAAM,CAAC,CAAA;IACX,mBAAA,IAAA,kBAAG,EAAC,UAAU,CAAC,CAAA;IACf,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;gDAeP;AAGD;IADC,IAAA,4BAAa,GAAE;IACF,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAO,WAAI;;uCAE9B;AAGD;IADC,IAAA,4BAAa,GAAE;IACA,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAO,WAAI;;yCAEhC;AAGD;IADC,IAAA,4BAAa,GAAE;IACD,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAO,WAAI;;wCAE/B;AAGD;IADC,IAAA,4BAAa,GAAE;IACD,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAO,WAAI;;wCAE/B;AAzFU,SAAS;IADrB,IAAA,uBAAQ,EAAC,WAAI,CAAC;GACF,SAAS,CA0FrB;AA1FY,8BAAS","sourcesContent":["import { Arg, Ctx, FieldResolver, Query, Resolver, Root } from 'type-graphql'\nimport { getRepository, IsNull } from 'typeorm'\n\nimport { User } from '@things-factory/auth-base'\nimport { Bizplace } from '@things-factory/biz-base'\nimport { buildQuery, Domain, Filter, Pagination, Sorting } from '@things-factory/shell'\n\nimport { Tote } from './tote'\nimport { ToteList } from './tote-types'\n\n@Resolver(Tote)\nexport class ToteQuery {\n @Query(returns => ToteList)\n async totes(\n @Ctx() context: any,\n @Arg('filters', type => [Filter], { nullable: true }) filters?: Filter[],\n @Arg('pagination', type => Pagination, { nullable: true }) pagination?: Pagination,\n @Arg('sortings', type => [Sorting], { nullable: true }) sortings?: Sorting[]\n ): Promise<ToteList> {\n const { domain }: { domain: Domain } = context.state\n\n const deletedFilter: any = filters.find((filter: any) => filter.name === 'deleted' && filter.value === true)\n\n const queryBuilder = getRepository(Tote).createQueryBuilder()\n buildQuery(queryBuilder, { filters, pagination, sortings }, context)\n\n queryBuilder\n .leftJoinAndSelect('Tote.domain', 'Domain')\n .leftJoinAndSelect('Tote.bizplace', 'Bizplace')\n .leftJoinAndSelect('Tote.creator', 'Creator')\n .leftJoinAndSelect('Tote.updater', 'Updater')\n .where('Domain.id = :domainId', { domainId: domain.id })\n\n if (deletedFilter) {\n queryBuilder.andWhere('Tote.deletedAt IS NOT NULL')\n } else {\n queryBuilder.andWhere('Tote.deletedAt IS NULL')\n }\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n\n @Query(returns => Tote)\n async tote(@Arg('name') name: string, @Arg('bizplace') bizplace: string, @Ctx() context: any): Promise<Tote> {\n const { domain }: { domain: Domain } = context.state\n let foundBizplace = await getRepository(Bizplace).findOne({ where: { name: bizplace } })\n\n let foundTote = await getRepository(Tote).findOne({\n where: { domain, bizplace: foundBizplace, name, deletedAt: IsNull() },\n relations: ['domain', 'bizplace', 'creator', 'updater']\n })\n\n if (!foundTote) {\n throw new Error('Tote not found')\n } else {\n return foundTote\n }\n }\n\n @Query(returns => String)\n async checkToteStatus(\n @Arg('name') name: string,\n @Arg('bizplace') bizplace: string,\n @Ctx() context: any\n ): Promise<String> {\n const { domain }: { domain: Domain } = context.state\n let foundBizplace = await getRepository(Bizplace).findOne({ where: { name: bizplace } })\n\n let foundTote = await getRepository(Tote).findOne({\n where: { domain, bizplace: foundBizplace, name, deletedAt: IsNull() },\n relations: ['domain', 'bizplace', 'creator', 'updater']\n })\n\n if (!foundTote) {\n return ''\n } else {\n return foundTote.status\n }\n }\n\n @FieldResolver()\n async domain(@Root() tote: Tote) {\n return await getRepository(Domain).findOne(tote.domainId)\n }\n\n @FieldResolver()\n async bizplace(@Root() tote: Tote) {\n return await getRepository(Bizplace).findOne(tote.bizplaceId)\n }\n\n @FieldResolver()\n async updater(@Root() tote: Tote) {\n return await getRepository(User).findOne(tote.updaterId)\n }\n\n @FieldResolver()\n async creator(@Root() tote: Tote) {\n return await getRepository(User).findOne(tote.creatorId)\n }\n}\n"]}
|
|
@@ -1,74 +1,66 @@
|
|
|
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;
|
|
12
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
4
|
exports.TotePatch = exports.ToteList = exports.NewTote = 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 tote_1 = require("./tote");
|
|
17
9
|
let NewTote = class NewTote {
|
|
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
|
], NewTote.prototype, "name", void 0);
|
|
23
|
-
__decorate([
|
|
15
|
+
tslib_1.__decorate([
|
|
24
16
|
(0, type_graphql_1.Field)(type => shell_1.ObjectRef, { nullable: true }),
|
|
25
|
-
__metadata("design:type", typeof (_a = typeof shell_1.ObjectRef !== "undefined" && shell_1.ObjectRef) === "function" ? _a : Object)
|
|
17
|
+
tslib_1.__metadata("design:type", typeof (_a = typeof shell_1.ObjectRef !== "undefined" && shell_1.ObjectRef) === "function" ? _a : Object)
|
|
26
18
|
], NewTote.prototype, "bizplace", void 0);
|
|
27
|
-
__decorate([
|
|
19
|
+
tslib_1.__decorate([
|
|
28
20
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
29
|
-
__metadata("design:type", String)
|
|
21
|
+
tslib_1.__metadata("design:type", String)
|
|
30
22
|
], NewTote.prototype, "status", void 0);
|
|
31
|
-
NewTote = __decorate([
|
|
23
|
+
NewTote = tslib_1.__decorate([
|
|
32
24
|
(0, type_graphql_1.InputType)()
|
|
33
25
|
], NewTote);
|
|
34
26
|
exports.NewTote = NewTote;
|
|
35
27
|
let ToteList = class ToteList {
|
|
36
28
|
};
|
|
37
|
-
__decorate([
|
|
29
|
+
tslib_1.__decorate([
|
|
38
30
|
(0, type_graphql_1.Field)(type => [tote_1.Tote], { nullable: true }),
|
|
39
|
-
__metadata("design:type", Array)
|
|
31
|
+
tslib_1.__metadata("design:type", Array)
|
|
40
32
|
], ToteList.prototype, "items", void 0);
|
|
41
|
-
__decorate([
|
|
33
|
+
tslib_1.__decorate([
|
|
42
34
|
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
|
|
43
|
-
__metadata("design:type", Number)
|
|
35
|
+
tslib_1.__metadata("design:type", Number)
|
|
44
36
|
], ToteList.prototype, "total", void 0);
|
|
45
|
-
ToteList = __decorate([
|
|
37
|
+
ToteList = tslib_1.__decorate([
|
|
46
38
|
(0, type_graphql_1.ObjectType)()
|
|
47
39
|
], ToteList);
|
|
48
40
|
exports.ToteList = ToteList;
|
|
49
41
|
let TotePatch = class TotePatch {
|
|
50
42
|
};
|
|
51
|
-
__decorate([
|
|
43
|
+
tslib_1.__decorate([
|
|
52
44
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
53
|
-
__metadata("design:type", String)
|
|
45
|
+
tslib_1.__metadata("design:type", String)
|
|
54
46
|
], TotePatch.prototype, "id", void 0);
|
|
55
|
-
__decorate([
|
|
47
|
+
tslib_1.__decorate([
|
|
56
48
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
57
|
-
__metadata("design:type", String)
|
|
49
|
+
tslib_1.__metadata("design:type", String)
|
|
58
50
|
], TotePatch.prototype, "name", void 0);
|
|
59
|
-
__decorate([
|
|
51
|
+
tslib_1.__decorate([
|
|
60
52
|
(0, type_graphql_1.Field)(type => shell_1.ObjectRef, { nullable: true }),
|
|
61
|
-
__metadata("design:type", typeof (_b = typeof shell_1.ObjectRef !== "undefined" && shell_1.ObjectRef) === "function" ? _b : Object)
|
|
53
|
+
tslib_1.__metadata("design:type", typeof (_b = typeof shell_1.ObjectRef !== "undefined" && shell_1.ObjectRef) === "function" ? _b : Object)
|
|
62
54
|
], TotePatch.prototype, "bizplace", 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
|
], TotePatch.prototype, "status", void 0);
|
|
67
|
-
__decorate([
|
|
59
|
+
tslib_1.__decorate([
|
|
68
60
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
69
|
-
__metadata("design:type", String)
|
|
61
|
+
tslib_1.__metadata("design:type", String)
|
|
70
62
|
], TotePatch.prototype, "cuFlag", void 0);
|
|
71
|
-
TotePatch = __decorate([
|
|
63
|
+
TotePatch = tslib_1.__decorate([
|
|
72
64
|
(0, type_graphql_1.InputType)()
|
|
73
65
|
], TotePatch);
|
|
74
66
|
exports.TotePatch = TotePatch;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tote-types.js","sourceRoot":"","sources":["../../../server/service/tote/tote-types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tote-types.js","sourceRoot":"","sources":["../../../server/service/tote/tote-types.ts"],"names":[],"mappings":";;;;;AAAA,+CAAgE;AAEhE,iDAAiD;AAEjD,iCAA6B;AAG7B,IAAa,OAAO,GAApB,MAAa,O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SAAS,CAerB;AAfY,8BAAS","sourcesContent":["import { Field, InputType, Int, ObjectType } from 'type-graphql'\n\nimport { ObjectRef } from '@things-factory/shell'\n\nimport { Tote } from './tote'\n\n@InputType()\nexport class NewTote {\n @Field()\n name: string\n\n @Field(type => ObjectRef, { nullable: true })\n bizplace?: ObjectRef\n\n @Field({ nullable: true })\n status?: string\n}\n\n@ObjectType()\nexport class ToteList {\n @Field(type => [Tote], { nullable: true })\n items?: Tote[]\n\n @Field(type => Int, { nullable: true })\n total?: number\n}\n\n@InputType()\nexport class TotePatch {\n @Field({ nullable: true })\n id?: string\n\n @Field({ nullable: true })\n name?: string\n\n @Field(type => ObjectRef, { nullable: true })\n bizplace?: ObjectRef\n\n @Field({ nullable: true })\n status?: string\n\n @Field({ nullable: true })\n cuFlag?: 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;
|
|
12
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
4
|
exports.Tote = 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");
|
|
@@ -18,78 +10,78 @@ const biz_base_1 = require("@things-factory/biz-base");
|
|
|
18
10
|
const shell_1 = require("@things-factory/shell");
|
|
19
11
|
let Tote = class Tote {
|
|
20
12
|
};
|
|
21
|
-
__decorate([
|
|
13
|
+
tslib_1.__decorate([
|
|
22
14
|
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
23
15
|
(0, type_graphql_1.Field)(),
|
|
24
|
-
__metadata("design:type", String)
|
|
16
|
+
tslib_1.__metadata("design:type", String)
|
|
25
17
|
], Tote.prototype, "id", void 0);
|
|
26
|
-
__decorate([
|
|
18
|
+
tslib_1.__decorate([
|
|
27
19
|
(0, typeorm_1.ManyToOne)(type => shell_1.Domain),
|
|
28
20
|
(0, type_graphql_1.Field)(),
|
|
29
|
-
__metadata("design:type", typeof (_a = typeof shell_1.Domain !== "undefined" && shell_1.Domain) === "function" ? _a : Object)
|
|
21
|
+
tslib_1.__metadata("design:type", typeof (_a = typeof shell_1.Domain !== "undefined" && shell_1.Domain) === "function" ? _a : Object)
|
|
30
22
|
], Tote.prototype, "domain", void 0);
|
|
31
|
-
__decorate([
|
|
23
|
+
tslib_1.__decorate([
|
|
32
24
|
(0, typeorm_1.RelationId)((tote) => tote.domain),
|
|
33
|
-
__metadata("design:type", String)
|
|
25
|
+
tslib_1.__metadata("design:type", String)
|
|
34
26
|
], Tote.prototype, "domainId", void 0);
|
|
35
|
-
__decorate([
|
|
27
|
+
tslib_1.__decorate([
|
|
36
28
|
(0, typeorm_1.Column)(),
|
|
37
29
|
(0, type_graphql_1.Field)(),
|
|
38
|
-
__metadata("design:type", String)
|
|
30
|
+
tslib_1.__metadata("design:type", String)
|
|
39
31
|
], Tote.prototype, "name", void 0);
|
|
40
|
-
__decorate([
|
|
32
|
+
tslib_1.__decorate([
|
|
41
33
|
(0, typeorm_1.ManyToOne)(type => biz_base_1.Bizplace),
|
|
42
34
|
(0, typeorm_1.ManyToOne)(type => biz_base_1.Bizplace),
|
|
43
35
|
(0, type_graphql_1.Field)(type => biz_base_1.Bizplace),
|
|
44
|
-
__metadata("design:type", typeof (_b = typeof biz_base_1.Bizplace !== "undefined" && biz_base_1.Bizplace) === "function" ? _b : Object)
|
|
36
|
+
tslib_1.__metadata("design:type", typeof (_b = typeof biz_base_1.Bizplace !== "undefined" && biz_base_1.Bizplace) === "function" ? _b : Object)
|
|
45
37
|
], Tote.prototype, "bizplace", void 0);
|
|
46
|
-
__decorate([
|
|
38
|
+
tslib_1.__decorate([
|
|
47
39
|
(0, typeorm_1.RelationId)((tote) => tote.bizplace),
|
|
48
|
-
__metadata("design:type", String)
|
|
40
|
+
tslib_1.__metadata("design:type", String)
|
|
49
41
|
], Tote.prototype, "bizplaceId", void 0);
|
|
50
|
-
__decorate([
|
|
42
|
+
tslib_1.__decorate([
|
|
51
43
|
(0, typeorm_1.Column)(),
|
|
52
44
|
(0, type_graphql_1.Field)(),
|
|
53
|
-
__metadata("design:type", String)
|
|
45
|
+
tslib_1.__metadata("design:type", String)
|
|
54
46
|
], Tote.prototype, "status", void 0);
|
|
55
|
-
__decorate([
|
|
47
|
+
tslib_1.__decorate([
|
|
56
48
|
(0, typeorm_1.CreateDateColumn)(),
|
|
57
49
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
58
|
-
__metadata("design:type", Date)
|
|
50
|
+
tslib_1.__metadata("design:type", Date)
|
|
59
51
|
], Tote.prototype, "createdAt", void 0);
|
|
60
|
-
__decorate([
|
|
52
|
+
tslib_1.__decorate([
|
|
61
53
|
(0, typeorm_1.UpdateDateColumn)(),
|
|
62
54
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
63
|
-
__metadata("design:type", Date)
|
|
55
|
+
tslib_1.__metadata("design:type", Date)
|
|
64
56
|
], Tote.prototype, "updatedAt", void 0);
|
|
65
|
-
__decorate([
|
|
57
|
+
tslib_1.__decorate([
|
|
66
58
|
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
|
|
67
59
|
nullable: true
|
|
68
60
|
}),
|
|
69
61
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
70
|
-
__metadata("design:type", typeof (_c = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _c : Object)
|
|
62
|
+
tslib_1.__metadata("design:type", typeof (_c = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _c : Object)
|
|
71
63
|
], Tote.prototype, "creator", void 0);
|
|
72
|
-
__decorate([
|
|
64
|
+
tslib_1.__decorate([
|
|
73
65
|
(0, typeorm_1.RelationId)((tote) => tote.creator),
|
|
74
|
-
__metadata("design:type", String)
|
|
66
|
+
tslib_1.__metadata("design:type", String)
|
|
75
67
|
], Tote.prototype, "creatorId", void 0);
|
|
76
|
-
__decorate([
|
|
68
|
+
tslib_1.__decorate([
|
|
77
69
|
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
|
|
78
70
|
nullable: true
|
|
79
71
|
}),
|
|
80
72
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
81
|
-
__metadata("design:type", typeof (_d = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _d : Object)
|
|
73
|
+
tslib_1.__metadata("design:type", typeof (_d = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _d : Object)
|
|
82
74
|
], Tote.prototype, "updater", void 0);
|
|
83
|
-
__decorate([
|
|
75
|
+
tslib_1.__decorate([
|
|
84
76
|
(0, typeorm_1.RelationId)((tote) => tote.updater),
|
|
85
|
-
__metadata("design:type", String)
|
|
77
|
+
tslib_1.__metadata("design:type", String)
|
|
86
78
|
], Tote.prototype, "updaterId", void 0);
|
|
87
|
-
__decorate([
|
|
79
|
+
tslib_1.__decorate([
|
|
88
80
|
(0, typeorm_1.Column)({ nullable: true }),
|
|
89
81
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
90
|
-
__metadata("design:type", Date)
|
|
82
|
+
tslib_1.__metadata("design:type", Date)
|
|
91
83
|
], Tote.prototype, "deletedAt", void 0);
|
|
92
|
-
Tote = __decorate([
|
|
84
|
+
Tote = tslib_1.__decorate([
|
|
93
85
|
(0, typeorm_1.Entity)(),
|
|
94
86
|
(0, typeorm_1.Index)('ix_tote_0', (tote) => [tote.bizplace, tote.name], { unique: true }),
|
|
95
87
|
(0, type_graphql_1.ObjectType)()
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tote.js","sourceRoot":"","sources":["../../../server/service/tote/tote.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tote.js","sourceRoot":"","sources":["../../../server/service/tote/tote.ts"],"names":[],"mappings":";;;;;AAAA,+CAAgD;AAChD,qCASgB;AAEhB,yDAAgD;AAChD,uDAAmD;AACnD,iDAA8C;AAK9C,IAAa,IAAI,GAAjB,MAAa,IAAI;CAyDhB,CAAA;AAtDC;IAFC,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,GAAE;;gCACE;AAIV;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IACzB,IAAA,oBAAK,GAAE;0DACA,cAAM,oBAAN,cAAM;oCAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,IAAU,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC;;sCACxB;AAIhB;IAFC,IAAA,gBAAM,GAAE;IACR,IAAA,oBAAK,GAAE;;kCACI;AAKZ;IAHC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,mBAAQ,CAAC;IAC3B,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,mBAAQ,CAAC;IAC3B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,mBAAQ,CAAC;0DACd,mBAAQ,oBAAR,mBAAQ;sCAAA;AAGlB;IADC,IAAA,oBAAU,EAAC,CAAC,IAAU,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC;;wCACxB;AAIl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AC;IAChF,IAAA,yBAAU,GAAE;GACA,IAAI,CAyDhB;AAzDY,oBAAI","sourcesContent":["import { Field, ObjectType } from 'type-graphql'\nimport {\n Column,\n CreateDateColumn,\n Entity,\n Index,\n ManyToOne,\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\n@Entity()\n@Index('ix_tote_0', (tote: Tote) => [tote.bizplace, tote.name], { unique: true })\n@ObjectType()\nexport class Tote {\n @PrimaryGeneratedColumn('uuid')\n @Field()\n id: string\n\n @ManyToOne(type => Domain)\n @Field()\n domain: Domain\n\n @RelationId((tote: Tote) => tote.domain)\n domainId: string\n\n @Column()\n @Field()\n name: string\n\n @ManyToOne(type => Bizplace)\n @ManyToOne(type => Bizplace)\n @Field(type => Bizplace)\n bizplace: Bizplace\n\n @RelationId((tote: Tote) => tote.bizplace)\n bizplaceId: 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((tote: Tote) => tote.creator)\n creatorId: string\n\n @ManyToOne(type => User, {\n nullable: true\n })\n @Field({ nullable: true })\n updater: User\n\n @RelationId((tote: Tote) => tote.updater)\n updaterId: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n deletedAt: Date\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/warehouse/index.ts"],"names":[],"mappings":";;;AAAA,2CAAuC;AACvC,6DAAwD;AACxD,uDAAkD;AAErC,QAAA,QAAQ,GAAG,CAAC,qBAAS,CAAC,CAAA;AACtB,QAAA,SAAS,GAAG,CAAC,gCAAc,EAAE,sCAAiB,CAAC,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/warehouse/index.ts"],"names":[],"mappings":";;;AAAA,2CAAuC;AACvC,6DAAwD;AACxD,uDAAkD;AAErC,QAAA,QAAQ,GAAG,CAAC,qBAAS,CAAC,CAAA;AACtB,QAAA,SAAS,GAAG,CAAC,gCAAc,EAAE,sCAAiB,CAAC,CAAA","sourcesContent":["import { Warehouse } from './warehouse'\nimport { WarehouseMutation } from './warehouse-mutation'\nimport { WarehouseQuery } from './warehouse-query'\n\nexport const entities = [Warehouse]\nexport const resolvers = [WarehouseQuery, WarehouseMutation]\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.deleteWarehouses = exports.deleteWarehouse = exports.updateWarehouse = exports.createWarehouse = exports.WarehouseMutation = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
16
5
|
const type_graphql_1 = require("type-graphql");
|
|
17
6
|
const warehouse_1 = require("./warehouse");
|
|
18
7
|
const warehouse_types_1 = require("./warehouse-types");
|
|
@@ -50,58 +39,58 @@ let WarehouseMutation = class WarehouseMutation {
|
|
|
50
39
|
return await deleteWarehouses(ids, context);
|
|
51
40
|
}
|
|
52
41
|
};
|
|
53
|
-
__decorate([
|
|
42
|
+
tslib_1.__decorate([
|
|
54
43
|
(0, type_graphql_1.Directive)('@privilege(category: "warehouse", privilege: "mutation")'),
|
|
55
44
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
56
45
|
(0, type_graphql_1.Mutation)(returns => warehouse_1.Warehouse),
|
|
57
|
-
__param(0, (0, type_graphql_1.Arg)('warehouse')),
|
|
58
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
|
59
|
-
__metadata("design:type", Function),
|
|
60
|
-
__metadata("design:paramtypes", [warehouse_types_1.NewWarehouse, Object]),
|
|
61
|
-
__metadata("design:returntype", Promise)
|
|
46
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('warehouse')),
|
|
47
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
48
|
+
tslib_1.__metadata("design:type", Function),
|
|
49
|
+
tslib_1.__metadata("design:paramtypes", [warehouse_types_1.NewWarehouse, Object]),
|
|
50
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
62
51
|
], WarehouseMutation.prototype, "createWarehouse", null);
|
|
63
|
-
__decorate([
|
|
52
|
+
tslib_1.__decorate([
|
|
64
53
|
(0, type_graphql_1.Directive)('@privilege(category: "warehouse", privilege: "mutation")'),
|
|
65
54
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
66
55
|
(0, type_graphql_1.Mutation)(returns => warehouse_1.Warehouse),
|
|
67
|
-
__param(0, (0, type_graphql_1.Arg)('id')),
|
|
68
|
-
__param(1, (0, type_graphql_1.Arg)('patch')),
|
|
69
|
-
__param(2, (0, type_graphql_1.Ctx)()),
|
|
70
|
-
__metadata("design:type", Function),
|
|
71
|
-
__metadata("design:paramtypes", [String, warehouse_types_1.WarehousePatch, Object]),
|
|
72
|
-
__metadata("design:returntype", Promise)
|
|
56
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
57
|
+
tslib_1.__param(1, (0, type_graphql_1.Arg)('patch')),
|
|
58
|
+
tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
|
|
59
|
+
tslib_1.__metadata("design:type", Function),
|
|
60
|
+
tslib_1.__metadata("design:paramtypes", [String, warehouse_types_1.WarehousePatch, Object]),
|
|
61
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
73
62
|
], WarehouseMutation.prototype, "updateWarehouse", null);
|
|
74
|
-
__decorate([
|
|
63
|
+
tslib_1.__decorate([
|
|
75
64
|
(0, type_graphql_1.Directive)('@privilege(category: "warehouse", privilege: "mutation")'),
|
|
76
65
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
77
66
|
(0, type_graphql_1.Mutation)(returns => [warehouse_1.Warehouse]),
|
|
78
|
-
__param(0, (0, type_graphql_1.Arg)('patches', type => [warehouse_types_1.WarehousePatch])),
|
|
79
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
|
80
|
-
__metadata("design:type", Function),
|
|
81
|
-
__metadata("design:paramtypes", [Array, Object]),
|
|
82
|
-
__metadata("design:returntype", Promise)
|
|
67
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('patches', type => [warehouse_types_1.WarehousePatch])),
|
|
68
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
69
|
+
tslib_1.__metadata("design:type", Function),
|
|
70
|
+
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
71
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
83
72
|
], WarehouseMutation.prototype, "updateMultipleWarehouse", null);
|
|
84
|
-
__decorate([
|
|
73
|
+
tslib_1.__decorate([
|
|
85
74
|
(0, type_graphql_1.Directive)('@privilege(category: "warehouse", privilege: "mutation")'),
|
|
86
75
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
87
76
|
(0, type_graphql_1.Mutation)(returns => Boolean),
|
|
88
|
-
__param(0, (0, type_graphql_1.Arg)('id')),
|
|
89
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
|
90
|
-
__metadata("design:type", Function),
|
|
91
|
-
__metadata("design:paramtypes", [String, Object]),
|
|
92
|
-
__metadata("design:returntype", Promise)
|
|
77
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
78
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
79
|
+
tslib_1.__metadata("design:type", Function),
|
|
80
|
+
tslib_1.__metadata("design:paramtypes", [String, Object]),
|
|
81
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
93
82
|
], WarehouseMutation.prototype, "deleteWarehouse", null);
|
|
94
|
-
__decorate([
|
|
83
|
+
tslib_1.__decorate([
|
|
95
84
|
(0, type_graphql_1.Directive)('@privilege(category: "warehouse", privilege: "mutation")'),
|
|
96
85
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
97
86
|
(0, type_graphql_1.Mutation)(returns => Boolean),
|
|
98
|
-
__param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
|
|
99
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
|
100
|
-
__metadata("design:type", Function),
|
|
101
|
-
__metadata("design:paramtypes", [Array, Object]),
|
|
102
|
-
__metadata("design:returntype", Promise)
|
|
87
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
|
|
88
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
89
|
+
tslib_1.__metadata("design:type", Function),
|
|
90
|
+
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
91
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
103
92
|
], WarehouseMutation.prototype, "deleteWarehouses", null);
|
|
104
|
-
WarehouseMutation = __decorate([
|
|
93
|
+
WarehouseMutation = tslib_1.__decorate([
|
|
105
94
|
(0, type_graphql_1.Resolver)(warehouse_1.Warehouse)
|
|
106
95
|
], WarehouseMutation);
|
|
107
96
|
exports.WarehouseMutation = WarehouseMutation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"warehouse-mutation.js","sourceRoot":"","sources":["../../../server/service/warehouse/warehouse-mutation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"warehouse-mutation.js","sourceRoot":"","sources":["../../../server/service/warehouse/warehouse-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AAMtE,2CAAuC;AACvC,uDAAgE;AAGhE,IAAa,iBAAiB,GAA9B,MAAa,iBAAiB;IAI5B,KAAK,CAAC,eAAe,CAAmB,SAAuB,EAAS,OAAY;QAClF,OAAO,MAAM,eAAe,CAAC,SAAS,EAAE,OAAO,CAAC,CAAA;IAClD,CAAC;IAKD,KAAK,CAAC,eAAe,CACR,EAAU,EACP,KAAqB,EAC5B,OAAY;QAEnB,OAAO,MAAM,eAAe,CAAC,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,CAAA;IAClD,CAAC;IAKD,KAAK,CAAC,uBAAuB,CACe,OAAyB,EAC5D,OAAY;QAEnB,IAAI,OAAO,GAAG,EAAE,CAAA;QAChB,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,KAAU,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,KAAK,GAAG,CAAC,CAAA;QAC3E,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,KAAU,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,GAAG,CAAC,CAAA;QAEzF,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE;YAC7B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,cAAc,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBAC9C,MAAM,KAAK,GAAG,cAAc,CAAC,CAAC,CAAC,CAAA;gBAC/B,MAAM,M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, Mutation, Resolver } from 'type-graphql'\nimport { EntityManager, Repository } from 'typeorm'\n\nimport { User } from '@things-factory/auth-base'\nimport { Domain } from '@things-factory/shell'\n\nimport { Warehouse } from './warehouse'\nimport { NewWarehouse, WarehousePatch } from './warehouse-types'\n\n@Resolver(Warehouse)\nexport class WarehouseMutation {\n @Directive('@privilege(category: \"warehouse\", privilege: \"mutation\")')\n @Directive('@transaction')\n @Mutation(returns => Warehouse)\n async createWarehouse(@Arg('warehouse') warehouse: NewWarehouse, @Ctx() context: any): Promise<Warehouse> {\n return await createWarehouse(warehouse, context)\n }\n\n @Directive('@privilege(category: \"warehouse\", privilege: \"mutation\")')\n @Directive('@transaction')\n @Mutation(returns => Warehouse)\n async updateWarehouse(\n @Arg('id') id: string,\n @Arg('patch') patch: WarehousePatch,\n @Ctx() context: any\n ): Promise<Warehouse> {\n return await updateWarehouse(id, patch, context)\n }\n\n @Directive('@privilege(category: \"warehouse\", privilege: \"mutation\")')\n @Directive('@transaction')\n @Mutation(returns => [Warehouse])\n async updateMultipleWarehouse(\n @Arg('patches', type => [WarehousePatch]) patches: WarehousePatch[],\n @Ctx() context: any\n ): Promise<Warehouse[]> {\n let results = []\n const _createRecords = patches.filter((patch: any) => patch.cuFlag === '+')\n const _updateRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === 'M')\n\n if (_createRecords.length > 0) {\n for (let i = 0; i < _createRecords.length; i++) {\n const patch = _createRecords[i]\n const result = await createWarehouse(patch as NewWarehouse, context)\n results.push({ ...result, cuFlag: '+' })\n }\n }\n\n if (_updateRecords.length > 0) {\n for (let i = 0; i < _updateRecords.length; i++) {\n const patch: WarehousePatch = _updateRecords[i]\n const result = await updateWarehouse(patch.id, patch, context)\n results.push({ ...result, cuFlag: 'M' })\n }\n }\n\n return results\n }\n\n @Directive('@privilege(category: \"warehouse\", privilege: \"mutation\")')\n @Directive('@transaction')\n @Mutation(returns => Boolean)\n async deleteWarehouse(@Arg('id') id: string, @Ctx() context: any): Promise<Boolean> {\n return await deleteWarehouse(id, context)\n }\n\n @Directive('@privilege(category: \"warehouse\", privilege: \"mutation\")')\n @Directive('@transaction')\n @Mutation(returns => Boolean)\n async deleteWarehouses(@Arg('ids', type => [String]) ids: string[], @Ctx() context: any): Promise<Boolean> {\n return await deleteWarehouses(ids, context)\n }\n}\n\nexport async function createWarehouse(warehouse: NewWarehouse, context: any) {\n const { domain, user, tx }: { domain: Domain; user: User; tx: EntityManager } = context.state\n\n const repository: Repository<Warehouse> = tx.getRepository(Warehouse)\n return await repository.save({\n ...warehouse,\n domain,\n creator: user,\n updater: user\n })\n}\n\nexport async function updateWarehouse(id: string, patch: WarehousePatch, context: any) {\n const { domain, user, tx }: { domain: Domain; user: User; tx: EntityManager } = context.state\n\n const repository: Repository<Warehouse> = tx.getRepository(Warehouse)\n const warehouse = await repository.findOne(id)\n\n return await repository.save({\n ...warehouse,\n ...patch,\n updater: user\n })\n}\n\nexport async function deleteWarehouse(id: string, context) {\n const { tx }: { tx: EntityManager } = context.state\n\n const repository: Repository<Warehouse> = tx.getRepository(Warehouse)\n await repository.delete(id)\n return true\n}\n\nexport async function deleteWarehouses(ids: string[], context: any) {\n const { tx }: { tx: EntityManager } = context.state\n\n const repository: Repository<Warehouse> = tx.getRepository(Warehouse)\n await repository.delete(ids)\n return true\n}\n"]}
|