@things-factory/routing-base 4.3.671 → 4.3.672
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/controllers/index.js +1 -0
- package/dist-server/controllers/index.js.map +1 -0
- package/dist-server/index.js +21 -0
- package/dist-server/index.js.map +1 -0
- package/dist-server/middlewares/index.js +8 -0
- package/dist-server/middlewares/index.js.map +1 -0
- package/dist-server/migrations/index.js +12 -0
- package/dist-server/migrations/index.js.map +1 -0
- package/dist-server/routes.js +25 -0
- package/dist-server/routes.js.map +1 -0
- package/dist-server/service/index.js +46 -0
- package/dist-server/service/index.js.map +1 -0
- package/dist-server/service/operation/index.js +25 -0
- package/dist-server/service/operation/index.js.map +1 -0
- package/dist-server/service/operation/operation-mutation.js +159 -0
- package/dist-server/service/operation/operation-mutation.js.map +1 -0
- package/dist-server/service/operation/operation-query.js +104 -0
- package/dist-server/service/operation/operation-query.js.map +1 -0
- package/dist-server/service/operation/operation-type.js +107 -0
- package/dist-server/service/operation/operation-type.js.map +1 -0
- package/dist-server/service/operation/operation.js +131 -0
- package/dist-server/service/operation/operation.js.map +1 -0
- package/dist-server/service/routing/index.js +25 -0
- package/dist-server/service/routing/index.js.map +1 -0
- package/dist-server/service/routing/routing-mutation.js +120 -0
- package/dist-server/service/routing/routing-mutation.js.map +1 -0
- package/dist-server/service/routing/routing-query.js +233 -0
- package/dist-server/service/routing/routing-query.js.map +1 -0
- package/dist-server/service/routing/routing-type.js +81 -0
- package/dist-server/service/routing/routing-type.js.map +1 -0
- package/dist-server/service/routing/routing.js +107 -0
- package/dist-server/service/routing/routing.js.map +1 -0
- package/dist-server/service/routing-item/index.js +25 -0
- package/dist-server/service/routing-item/index.js.map +1 -0
- package/dist-server/service/routing-item/routing-item-mutation.js +120 -0
- package/dist-server/service/routing-item/routing-item-mutation.js.map +1 -0
- package/dist-server/service/routing-item/routing-item-query.js +88 -0
- package/dist-server/service/routing-item/routing-item-query.js.map +1 -0
- package/dist-server/service/routing-item/routing-item-type.js +107 -0
- package/dist-server/service/routing-item/routing-item-type.js.map +1 -0
- package/dist-server/service/routing-item/routing-item.js +136 -0
- package/dist-server/service/routing-item/routing-item.js.map +1 -0
- package/package.json +5 -5
|
@@ -0,0 +1,131 @@
|
|
|
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 _a, _b, _c;
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.Operation = exports.OperationStatus = void 0;
|
|
14
|
+
const type_graphql_1 = require("type-graphql");
|
|
15
|
+
const typeorm_1 = require("typeorm");
|
|
16
|
+
const auth_base_1 = require("@things-factory/auth-base");
|
|
17
|
+
const shell_1 = require("@things-factory/shell");
|
|
18
|
+
var OperationStatus;
|
|
19
|
+
(function (OperationStatus) {
|
|
20
|
+
OperationStatus["STATUS_A"] = "STATUS_A";
|
|
21
|
+
OperationStatus["STATUS_B"] = "STATUS_B";
|
|
22
|
+
OperationStatus["ASSY"] = "Assembly";
|
|
23
|
+
OperationStatus["INV"] = "Inventory";
|
|
24
|
+
OperationStatus["PACK"] = "Packing";
|
|
25
|
+
OperationStatus["SMT"] = "SMT";
|
|
26
|
+
OperationStatus["STD"] = "Standard";
|
|
27
|
+
OperationStatus["TEST"] = "Test";
|
|
28
|
+
})(OperationStatus = exports.OperationStatus || (exports.OperationStatus = {}));
|
|
29
|
+
(0, type_graphql_1.registerEnumType)(OperationStatus, {
|
|
30
|
+
name: 'OperationStatus',
|
|
31
|
+
description: 'state enumeration of a operation'
|
|
32
|
+
});
|
|
33
|
+
let Operation = class Operation {
|
|
34
|
+
};
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
37
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: false }),
|
|
38
|
+
__metadata("design:type", String)
|
|
39
|
+
], Operation.prototype, "id", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, typeorm_1.ManyToOne)(type => shell_1.Domain),
|
|
42
|
+
(0, type_graphql_1.Field)(type => shell_1.Domain, { nullable: false }),
|
|
43
|
+
__metadata("design:type", typeof (_a = typeof shell_1.Domain !== "undefined" && shell_1.Domain) === "function" ? _a : Object)
|
|
44
|
+
], Operation.prototype, "domain", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, typeorm_1.RelationId)((operation) => operation.domain),
|
|
47
|
+
__metadata("design:type", String)
|
|
48
|
+
], Operation.prototype, "domainId", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, typeorm_1.Column)(),
|
|
51
|
+
(0, type_graphql_1.Field)({ nullable: false }),
|
|
52
|
+
__metadata("design:type", String)
|
|
53
|
+
], Operation.prototype, "name", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, typeorm_1.Column)({
|
|
56
|
+
nullable: true
|
|
57
|
+
}),
|
|
58
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
59
|
+
__metadata("design:type", String)
|
|
60
|
+
], Operation.prototype, "description", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, typeorm_1.Column)({
|
|
63
|
+
nullable: true
|
|
64
|
+
}),
|
|
65
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
66
|
+
__metadata("design:type", String)
|
|
67
|
+
], Operation.prototype, "type", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, typeorm_1.Column)({
|
|
70
|
+
nullable: true
|
|
71
|
+
}),
|
|
72
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
73
|
+
__metadata("design:type", String)
|
|
74
|
+
], Operation.prototype, "operationStdChart", void 0);
|
|
75
|
+
__decorate([
|
|
76
|
+
(0, typeorm_1.Column)({
|
|
77
|
+
nullable: true
|
|
78
|
+
}),
|
|
79
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
80
|
+
__metadata("design:type", String)
|
|
81
|
+
], Operation.prototype, "operationStdTime", void 0);
|
|
82
|
+
__decorate([
|
|
83
|
+
(0, typeorm_1.Column)({
|
|
84
|
+
nullable: true
|
|
85
|
+
}),
|
|
86
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
87
|
+
__metadata("design:type", Boolean)
|
|
88
|
+
], Operation.prototype, "active", void 0);
|
|
89
|
+
__decorate([
|
|
90
|
+
(0, type_graphql_1.Field)(type => String, { nullable: true }),
|
|
91
|
+
__metadata("design:type", String)
|
|
92
|
+
], Operation.prototype, "thumbnail", void 0);
|
|
93
|
+
__decorate([
|
|
94
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
|
|
95
|
+
nullable: true
|
|
96
|
+
}),
|
|
97
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
|
|
98
|
+
__metadata("design:type", typeof (_b = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _b : Object)
|
|
99
|
+
], Operation.prototype, "creator", void 0);
|
|
100
|
+
__decorate([
|
|
101
|
+
(0, typeorm_1.RelationId)((operation) => operation.creator),
|
|
102
|
+
__metadata("design:type", String)
|
|
103
|
+
], Operation.prototype, "creatorId", void 0);
|
|
104
|
+
__decorate([
|
|
105
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
|
|
106
|
+
nullable: true
|
|
107
|
+
}),
|
|
108
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
|
|
109
|
+
__metadata("design:type", typeof (_c = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _c : Object)
|
|
110
|
+
], Operation.prototype, "updater", void 0);
|
|
111
|
+
__decorate([
|
|
112
|
+
(0, typeorm_1.RelationId)((operation) => operation.creator),
|
|
113
|
+
__metadata("design:type", String)
|
|
114
|
+
], Operation.prototype, "updaterId", void 0);
|
|
115
|
+
__decorate([
|
|
116
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
117
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
118
|
+
__metadata("design:type", Date)
|
|
119
|
+
], Operation.prototype, "createdAt", void 0);
|
|
120
|
+
__decorate([
|
|
121
|
+
(0, typeorm_1.UpdateDateColumn)(),
|
|
122
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
123
|
+
__metadata("design:type", Date)
|
|
124
|
+
], Operation.prototype, "updatedAt", void 0);
|
|
125
|
+
Operation = __decorate([
|
|
126
|
+
(0, typeorm_1.Entity)(),
|
|
127
|
+
(0, typeorm_1.Index)('ix_operation_0', (operation) => [operation.domain, operation.name], { unique: true }),
|
|
128
|
+
(0, type_graphql_1.ObjectType)({ description: 'Entity for Operation' })
|
|
129
|
+
], Operation);
|
|
130
|
+
exports.Operation = Operation;
|
|
131
|
+
//# sourceMappingURL=operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operation.js","sourceRoot":"","sources":["../../../server/service/operation/operation.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,+CAAsE;AACtE,qCASgB;AAEhB,yDAAgD;AAChD,iDAA8C;AAE9C,IAAY,eASX;AATD,WAAY,eAAe;IACzB,wCAAqB,CAAA;IACrB,wCAAqB,CAAA;IACrB,oCAAiB,CAAA;IACjB,oCAAiB,CAAA;IACjB,mC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BAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACd,IAAI;4CAAA;AAzEL,SAAS;IAHrB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,gBAAgB,EAAE,CAAC,SAAoB,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACvG,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,sBAAsB,EAAE,CAAC;GACvC,SAAS,CA0ErB;AA1EY,8BAAS"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.resolvers = exports.entities = void 0;
|
|
18
|
+
const routing_1 = require("./routing");
|
|
19
|
+
const routing_mutation_1 = require("./routing-mutation");
|
|
20
|
+
const routing_query_1 = require("./routing-query");
|
|
21
|
+
exports.entities = [routing_1.Routing];
|
|
22
|
+
exports.resolvers = [routing_query_1.RoutingQuery, routing_mutation_1.RoutingMutation];
|
|
23
|
+
__exportStar(require("./routing-query"), exports);
|
|
24
|
+
__exportStar(require("./routing-mutation"), exports);
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/routing/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,uCAAmC;AACnC,yDAAoD;AACpD,mDAA8C;AAEjC,QAAA,QAAQ,GAAG,CAAC,iBAAO,CAAC,CAAA;AACpB,QAAA,SAAS,GAAG,CAAC,4BAAY,EAAE,kCAAe,CAAC,CAAA;AAExD,kDAA+B;AAC/B,qDAAkC"}
|
|
@@ -0,0 +1,120 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.RoutingMutation = void 0;
|
|
16
|
+
const type_graphql_1 = require("type-graphql");
|
|
17
|
+
const typeorm_1 = require("typeorm");
|
|
18
|
+
const routing_1 = require("./routing");
|
|
19
|
+
const routing_type_1 = require("./routing-type");
|
|
20
|
+
let RoutingMutation = class RoutingMutation {
|
|
21
|
+
async createRouting(routing, context) {
|
|
22
|
+
const { domain, user, tx } = context.state;
|
|
23
|
+
return await tx.getRepository(routing_1.Routing).save(Object.assign(Object.assign({}, routing), { domain, creator: user, updater: user }));
|
|
24
|
+
}
|
|
25
|
+
async updateRouting(id, patch, context) {
|
|
26
|
+
const { domain, user, tx } = context.state;
|
|
27
|
+
const repository = tx.getRepository(routing_1.Routing);
|
|
28
|
+
const routing = await repository.findOne({
|
|
29
|
+
where: { domain, id }
|
|
30
|
+
});
|
|
31
|
+
return await repository.save(Object.assign(Object.assign(Object.assign({}, routing), patch), { updater: user }));
|
|
32
|
+
}
|
|
33
|
+
async updateMultipleRouting(patches, context) {
|
|
34
|
+
const { domain, user, tx } = context.state;
|
|
35
|
+
let results = [];
|
|
36
|
+
const _createRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === '+');
|
|
37
|
+
const _updateRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === 'M');
|
|
38
|
+
const routingRepo = tx.getRepository(routing_1.Routing);
|
|
39
|
+
if (_createRecords.length > 0) {
|
|
40
|
+
for (let i = 0; i < _createRecords.length; i++) {
|
|
41
|
+
const newRecord = _createRecords[i];
|
|
42
|
+
const result = await routingRepo.save(Object.assign(Object.assign({}, newRecord), { domain, creator: user, updater: user }));
|
|
43
|
+
results.push(Object.assign(Object.assign({}, result), { cuFlag: '+' }));
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
if (_updateRecords.length > 0) {
|
|
47
|
+
for (let i = 0; i < _updateRecords.length; i++) {
|
|
48
|
+
const newRecord = _updateRecords[i];
|
|
49
|
+
const routing = await routingRepo.findOne(newRecord.id);
|
|
50
|
+
const result = await routingRepo.save(Object.assign(Object.assign(Object.assign({}, routing), newRecord), { updater: user }));
|
|
51
|
+
results.push(Object.assign(Object.assign({}, result), { cuFlag: 'M' }));
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return results;
|
|
55
|
+
}
|
|
56
|
+
async deleteRouting(id, context) {
|
|
57
|
+
const { domain, tx } = context.state;
|
|
58
|
+
await tx.getRepository(routing_1.Routing).delete({ domain, id });
|
|
59
|
+
return true;
|
|
60
|
+
}
|
|
61
|
+
async deleteRoutings(ids, context) {
|
|
62
|
+
const { domain, tx } = context.state;
|
|
63
|
+
await tx.getRepository(routing_1.Routing).delete({
|
|
64
|
+
domain,
|
|
65
|
+
id: (0, typeorm_1.In)(ids)
|
|
66
|
+
});
|
|
67
|
+
return true;
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
__decorate([
|
|
71
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
72
|
+
(0, type_graphql_1.Mutation)(returns => routing_1.Routing, { description: 'To create new Routing' }),
|
|
73
|
+
__param(0, (0, type_graphql_1.Arg)('routing')),
|
|
74
|
+
__param(1, (0, type_graphql_1.Ctx)()),
|
|
75
|
+
__metadata("design:type", Function),
|
|
76
|
+
__metadata("design:paramtypes", [routing_type_1.NewRouting, Object]),
|
|
77
|
+
__metadata("design:returntype", Promise)
|
|
78
|
+
], RoutingMutation.prototype, "createRouting", null);
|
|
79
|
+
__decorate([
|
|
80
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
81
|
+
(0, type_graphql_1.Mutation)(returns => routing_1.Routing, { description: 'To modify Routing information' }),
|
|
82
|
+
__param(0, (0, type_graphql_1.Arg)('id')),
|
|
83
|
+
__param(1, (0, type_graphql_1.Arg)('patch')),
|
|
84
|
+
__param(2, (0, type_graphql_1.Ctx)()),
|
|
85
|
+
__metadata("design:type", Function),
|
|
86
|
+
__metadata("design:paramtypes", [String, routing_type_1.RoutingPatch, Object]),
|
|
87
|
+
__metadata("design:returntype", Promise)
|
|
88
|
+
], RoutingMutation.prototype, "updateRouting", null);
|
|
89
|
+
__decorate([
|
|
90
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
91
|
+
(0, type_graphql_1.Mutation)(returns => [routing_1.Routing], { description: "To modify multiple Routings' information" }),
|
|
92
|
+
__param(0, (0, type_graphql_1.Arg)('patches', type => [routing_type_1.RoutingPatch])),
|
|
93
|
+
__param(1, (0, type_graphql_1.Ctx)()),
|
|
94
|
+
__metadata("design:type", Function),
|
|
95
|
+
__metadata("design:paramtypes", [Array, Object]),
|
|
96
|
+
__metadata("design:returntype", Promise)
|
|
97
|
+
], RoutingMutation.prototype, "updateMultipleRouting", null);
|
|
98
|
+
__decorate([
|
|
99
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
100
|
+
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete Routing' }),
|
|
101
|
+
__param(0, (0, type_graphql_1.Arg)('id')),
|
|
102
|
+
__param(1, (0, type_graphql_1.Ctx)()),
|
|
103
|
+
__metadata("design:type", Function),
|
|
104
|
+
__metadata("design:paramtypes", [String, Object]),
|
|
105
|
+
__metadata("design:returntype", Promise)
|
|
106
|
+
], RoutingMutation.prototype, "deleteRouting", null);
|
|
107
|
+
__decorate([
|
|
108
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
109
|
+
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete multiple routings' }),
|
|
110
|
+
__param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
|
|
111
|
+
__param(1, (0, type_graphql_1.Ctx)()),
|
|
112
|
+
__metadata("design:type", Function),
|
|
113
|
+
__metadata("design:paramtypes", [Array, Object]),
|
|
114
|
+
__metadata("design:returntype", Promise)
|
|
115
|
+
], RoutingMutation.prototype, "deleteRoutings", null);
|
|
116
|
+
RoutingMutation = __decorate([
|
|
117
|
+
(0, type_graphql_1.Resolver)(routing_1.Routing)
|
|
118
|
+
], RoutingMutation);
|
|
119
|
+
exports.RoutingMutation = RoutingMutation;
|
|
120
|
+
//# sourceMappingURL=routing-mutation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routing-mutation.js","sourceRoot":"","sources":["../../../server/service/routing/routing-m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S,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,2BAAY,CAAC,CAAC,CAAA;IACtC,WAAA,IAAA,kBAAG,GAAE,CAAA;;;;4DAwCP;AAIK;IAFL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,mBAAmB,EAAE,CAAC;IAC9C,WAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;IAAc,WAAA,IAAA,kBAAG,GAAE,CAAA;;;;oDAKhD;AAIK;IAFL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,6BAA6B,EAAE,CAAC;IAE1E,WAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAC5B,WAAA,IAAA,kBAAG,GAAE,CAAA;;;;qDAUP;AAxGU,eAAe;IAD3B,IAAA,uBAAQ,EAAC,iBAAO,CAAC;GACL,eAAe,CAyG3B;AAzGY,0CAAe"}
|
|
@@ -0,0 +1,233 @@
|
|
|
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
|
+
var _a;
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.lastOperation = exports.prevOperation = exports.nextOperation = exports.firstOperation = exports.RoutingQuery = void 0;
|
|
17
|
+
const type_graphql_1 = require("type-graphql");
|
|
18
|
+
const typeorm_1 = require("typeorm");
|
|
19
|
+
const auth_base_1 = require("@things-factory/auth-base");
|
|
20
|
+
const shell_1 = require("@things-factory/shell");
|
|
21
|
+
const operation_1 = require("../operation/operation");
|
|
22
|
+
const routing_1 = require("./routing");
|
|
23
|
+
const routing_type_1 = require("./routing-type");
|
|
24
|
+
let RoutingQuery = class RoutingQuery {
|
|
25
|
+
async routing(id, context) {
|
|
26
|
+
const { domain } = context.state;
|
|
27
|
+
return await (0, typeorm_1.getRepository)(routing_1.Routing).findOne({
|
|
28
|
+
where: { domain, name }
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
async routings(params, context) {
|
|
32
|
+
const { domain } = context.state;
|
|
33
|
+
const convertedParams = (0, shell_1.convertListParams)(params, domain.id);
|
|
34
|
+
const [items, total] = await (0, typeorm_1.getRepository)(routing_1.Routing).findAndCount(convertedParams);
|
|
35
|
+
return { items, total };
|
|
36
|
+
}
|
|
37
|
+
async domain(routing) {
|
|
38
|
+
return await (0, typeorm_1.getRepository)(shell_1.Domain).findOne(routing.domainId);
|
|
39
|
+
}
|
|
40
|
+
async updater(routing) {
|
|
41
|
+
return await (0, typeorm_1.getRepository)(auth_base_1.User).findOne(routing.updaterId);
|
|
42
|
+
}
|
|
43
|
+
async creator(routing) {
|
|
44
|
+
return await (0, typeorm_1.getRepository)(auth_base_1.User).findOne(routing.creatorId);
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, type_graphql_1.Query)(returns => routing_1.Routing, { description: 'To fetch a Routing' }),
|
|
49
|
+
__param(0, (0, type_graphql_1.Arg)('id')),
|
|
50
|
+
__param(1, (0, type_graphql_1.Ctx)()),
|
|
51
|
+
__metadata("design:type", Function),
|
|
52
|
+
__metadata("design:paramtypes", [String, Object]),
|
|
53
|
+
__metadata("design:returntype", Promise)
|
|
54
|
+
], RoutingQuery.prototype, "routing", null);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, type_graphql_1.Query)(returns => routing_type_1.RoutingList, { description: 'To fetch multiple Routings' }),
|
|
57
|
+
__param(0, (0, type_graphql_1.Args)()),
|
|
58
|
+
__param(1, (0, type_graphql_1.Ctx)()),
|
|
59
|
+
__metadata("design:type", Function),
|
|
60
|
+
__metadata("design:paramtypes", [typeof (_a = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _a : Object, Object]),
|
|
61
|
+
__metadata("design:returntype", Promise)
|
|
62
|
+
], RoutingQuery.prototype, "routings", null);
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, type_graphql_1.FieldResolver)(type => shell_1.Domain),
|
|
65
|
+
__param(0, (0, type_graphql_1.Root)()),
|
|
66
|
+
__metadata("design:type", Function),
|
|
67
|
+
__metadata("design:paramtypes", [routing_1.Routing]),
|
|
68
|
+
__metadata("design:returntype", Promise)
|
|
69
|
+
], RoutingQuery.prototype, "domain", null);
|
|
70
|
+
__decorate([
|
|
71
|
+
(0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
|
|
72
|
+
__param(0, (0, type_graphql_1.Root)()),
|
|
73
|
+
__metadata("design:type", Function),
|
|
74
|
+
__metadata("design:paramtypes", [routing_1.Routing]),
|
|
75
|
+
__metadata("design:returntype", Promise)
|
|
76
|
+
], RoutingQuery.prototype, "updater", null);
|
|
77
|
+
__decorate([
|
|
78
|
+
(0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
|
|
79
|
+
__param(0, (0, type_graphql_1.Root)()),
|
|
80
|
+
__metadata("design:type", Function),
|
|
81
|
+
__metadata("design:paramtypes", [routing_1.Routing]),
|
|
82
|
+
__metadata("design:returntype", Promise)
|
|
83
|
+
], RoutingQuery.prototype, "creator", null);
|
|
84
|
+
RoutingQuery = __decorate([
|
|
85
|
+
(0, type_graphql_1.Resolver)(routing_1.Routing)
|
|
86
|
+
], RoutingQuery);
|
|
87
|
+
exports.RoutingQuery = RoutingQuery;
|
|
88
|
+
async function firstOperation(routingId, context) {
|
|
89
|
+
const { domain, user, tx } = context.state;
|
|
90
|
+
const operation = await tx.getRepository(operation_1.Operation).query(`
|
|
91
|
+
select
|
|
92
|
+
*
|
|
93
|
+
from
|
|
94
|
+
operations
|
|
95
|
+
where
|
|
96
|
+
id =
|
|
97
|
+
(
|
|
98
|
+
select
|
|
99
|
+
operation_id
|
|
100
|
+
from
|
|
101
|
+
routing_items
|
|
102
|
+
where
|
|
103
|
+
routing_id = '${routingId}'
|
|
104
|
+
and
|
|
105
|
+
rank =
|
|
106
|
+
(
|
|
107
|
+
select
|
|
108
|
+
min(rank)
|
|
109
|
+
from
|
|
110
|
+
routing_items
|
|
111
|
+
where
|
|
112
|
+
routing_id = '${routingId}'
|
|
113
|
+
)
|
|
114
|
+
)
|
|
115
|
+
`);
|
|
116
|
+
return operation;
|
|
117
|
+
}
|
|
118
|
+
exports.firstOperation = firstOperation;
|
|
119
|
+
async function nextOperation(operationId, routingId, context) {
|
|
120
|
+
const operation = await (0, typeorm_1.getRepository)(operation_1.Operation).query(`
|
|
121
|
+
select
|
|
122
|
+
*
|
|
123
|
+
from
|
|
124
|
+
operations
|
|
125
|
+
where
|
|
126
|
+
id =
|
|
127
|
+
(
|
|
128
|
+
select
|
|
129
|
+
operation_id
|
|
130
|
+
from
|
|
131
|
+
routing_items
|
|
132
|
+
where
|
|
133
|
+
routing_id = '${routingId}'
|
|
134
|
+
and
|
|
135
|
+
rank =
|
|
136
|
+
(
|
|
137
|
+
select
|
|
138
|
+
min(rank)
|
|
139
|
+
from
|
|
140
|
+
routing_items
|
|
141
|
+
where
|
|
142
|
+
routing_id = '${routingId}'
|
|
143
|
+
and
|
|
144
|
+
rank >
|
|
145
|
+
(
|
|
146
|
+
select
|
|
147
|
+
rank
|
|
148
|
+
from
|
|
149
|
+
routing_items
|
|
150
|
+
where
|
|
151
|
+
routing_id = '${routingId}'
|
|
152
|
+
and
|
|
153
|
+
operation_id = '${operationId}'
|
|
154
|
+
)
|
|
155
|
+
)
|
|
156
|
+
)
|
|
157
|
+
`);
|
|
158
|
+
return operation;
|
|
159
|
+
}
|
|
160
|
+
exports.nextOperation = nextOperation;
|
|
161
|
+
async function prevOperation(operationId, routingId, context) {
|
|
162
|
+
const operation = await (0, typeorm_1.getRepository)(operation_1.Operation).query(`
|
|
163
|
+
select
|
|
164
|
+
*
|
|
165
|
+
from
|
|
166
|
+
operations
|
|
167
|
+
where
|
|
168
|
+
id =
|
|
169
|
+
(
|
|
170
|
+
select
|
|
171
|
+
operation_id
|
|
172
|
+
from
|
|
173
|
+
routing_items
|
|
174
|
+
where
|
|
175
|
+
routing_id = '${routingId}'
|
|
176
|
+
and
|
|
177
|
+
rank =
|
|
178
|
+
(
|
|
179
|
+
select
|
|
180
|
+
max(rank)
|
|
181
|
+
from
|
|
182
|
+
routing_items
|
|
183
|
+
where
|
|
184
|
+
routing_id = '${routingId}'
|
|
185
|
+
and
|
|
186
|
+
rank <
|
|
187
|
+
(
|
|
188
|
+
select
|
|
189
|
+
rank
|
|
190
|
+
from
|
|
191
|
+
routing_items
|
|
192
|
+
where
|
|
193
|
+
routing_id = '${routingId}'
|
|
194
|
+
and
|
|
195
|
+
operation_id = '${operationId}'
|
|
196
|
+
)
|
|
197
|
+
)
|
|
198
|
+
)
|
|
199
|
+
`);
|
|
200
|
+
return operation;
|
|
201
|
+
}
|
|
202
|
+
exports.prevOperation = prevOperation;
|
|
203
|
+
async function lastOperation(routingId, context) {
|
|
204
|
+
const operation = await (0, typeorm_1.getRepository)(operation_1.Operation).query(`
|
|
205
|
+
select
|
|
206
|
+
*
|
|
207
|
+
from
|
|
208
|
+
operations
|
|
209
|
+
where
|
|
210
|
+
id =
|
|
211
|
+
(
|
|
212
|
+
select
|
|
213
|
+
operation_id
|
|
214
|
+
from
|
|
215
|
+
routing_items
|
|
216
|
+
where
|
|
217
|
+
routing_id = '${routingId}'
|
|
218
|
+
and
|
|
219
|
+
rank =
|
|
220
|
+
(
|
|
221
|
+
select
|
|
222
|
+
max(rank)
|
|
223
|
+
from
|
|
224
|
+
routing_items
|
|
225
|
+
where
|
|
226
|
+
routing_id = '${routingId}'
|
|
227
|
+
)
|
|
228
|
+
)
|
|
229
|
+
`);
|
|
230
|
+
return operation;
|
|
231
|
+
}
|
|
232
|
+
exports.lastOperation = lastOperation;
|
|
233
|
+
//# sourceMappingURL=routing-query.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routing-query.js","sourceRoot":"","sources":["../../../server/service/routing/routing-query.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAQqB;AACrB,qCAAuC;AAEvC,yDAAgD;AAChD,iDAI8B;AAE9B,sDAAkD;AAClD,uCAAmC;AACnC,iDAA4C;AAGrC,IAAM,YAAY,GAAlB,MAAM,YAAY;IAEjB,AAAN,KAAK,CAAC,OAAO,CAAY,EAAU,EAAS,OAAY;QACtD,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,OAAO,MAAM,IAAA,uBAAa,EAAC,iBAAO,CAAC,CAAC,OAAO,CAAC;YAC1C,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;SACxB,CAAC,CAAA;IACJ,CAAC;IAGK,AAAN,KAAK,CAAC,QAAQ,CAAS,MAAiB,EAAS,OAAY;QAC3D,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,MAAM,eAAe,GAAG,IAAA,yBAAiB,EAAC,MAAM,EAAE,MAAM,CAA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AIlD,CACJ,CAAA;IAED,OAAO,SAAS,CAAA;AAClB,CAAC;AA3CD,sCA2CC;AAEM,KAAK,UAAU,aAAa,CAAC,SAAiB,EAAE,OAAY;IACjE,MAAM,SAAS,GAAG,MAAM,IAAA,uBAAa,EAAC,qBAAS,CAAC,CAAC,KAAK,CACpD;;;;;;;;;;;;;gCAa4B,SAAS;;;;;;;;;sCASH,SAAS;;;OAGxC,CACJ,CAAA;IACD,OAAO,SAAS,CAAA;AAClB,CAAC;AA9BD,sCA8BC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.RoutingList = exports.RoutingPatch = exports.NewRouting = void 0;
|
|
13
|
+
const type_graphql_1 = require("type-graphql");
|
|
14
|
+
const routing_1 = require("./routing");
|
|
15
|
+
let NewRouting = class NewRouting {
|
|
16
|
+
};
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, type_graphql_1.Field)({ nullable: false }),
|
|
19
|
+
__metadata("design:type", String)
|
|
20
|
+
], NewRouting.prototype, "name", void 0);
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
23
|
+
__metadata("design:type", String)
|
|
24
|
+
], NewRouting.prototype, "description", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
27
|
+
__metadata("design:type", Boolean)
|
|
28
|
+
], NewRouting.prototype, "createdLot", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
31
|
+
__metadata("design:type", Boolean)
|
|
32
|
+
], NewRouting.prototype, "active", void 0);
|
|
33
|
+
NewRouting = __decorate([
|
|
34
|
+
(0, type_graphql_1.InputType)()
|
|
35
|
+
], NewRouting);
|
|
36
|
+
exports.NewRouting = NewRouting;
|
|
37
|
+
let RoutingPatch = class RoutingPatch {
|
|
38
|
+
};
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
|
|
41
|
+
__metadata("design:type", String)
|
|
42
|
+
], RoutingPatch.prototype, "id", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
45
|
+
__metadata("design:type", String)
|
|
46
|
+
], RoutingPatch.prototype, "name", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
49
|
+
__metadata("design:type", String)
|
|
50
|
+
], RoutingPatch.prototype, "description", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
53
|
+
__metadata("design:type", Boolean)
|
|
54
|
+
], RoutingPatch.prototype, "createdLot", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
57
|
+
__metadata("design:type", Boolean)
|
|
58
|
+
], RoutingPatch.prototype, "active", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, type_graphql_1.Field)(),
|
|
61
|
+
__metadata("design:type", String)
|
|
62
|
+
], RoutingPatch.prototype, "cuFlag", void 0);
|
|
63
|
+
RoutingPatch = __decorate([
|
|
64
|
+
(0, type_graphql_1.InputType)()
|
|
65
|
+
], RoutingPatch);
|
|
66
|
+
exports.RoutingPatch = RoutingPatch;
|
|
67
|
+
let RoutingList = class RoutingList {
|
|
68
|
+
};
|
|
69
|
+
__decorate([
|
|
70
|
+
(0, type_graphql_1.Field)(type => [routing_1.Routing]),
|
|
71
|
+
__metadata("design:type", Array)
|
|
72
|
+
], RoutingList.prototype, "items", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int),
|
|
75
|
+
__metadata("design:type", Number)
|
|
76
|
+
], RoutingList.prototype, "total", void 0);
|
|
77
|
+
RoutingList = __decorate([
|
|
78
|
+
(0, type_graphql_1.ObjectType)()
|
|
79
|
+
], RoutingList);
|
|
80
|
+
exports.RoutingList = RoutingList;
|
|
81
|
+
//# sourceMappingURL=routing-type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routing-type.js","sourceRoot":"","sources":["../../../server/service/routing/routing-type.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAAsF;AAEtF,uCAAmC;AAG5B,IAAM,UAAU,GAAhB,MAAM,UAAU;CAYtB,CAAA;AAXC;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;wCACf;AAEZ;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACN;AAEpB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CACN;AAEpB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0CACV;AAXL,UAAU;IADtB,IAAA,wBAAS,GAAE;GACC,UAAU,CAYtB;AAZY,gCAAU;AAehB,IAAM,YAAY,GAAlB,MAAM,YAAY;CAkBxB,CAAA;AAjB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