@things-factory/code-base 5.0.0-zeta.8 → 5.0.1
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/index.js +1 -2
- package/dist-server/index.js.map +1 -1
- package/dist-server/service/common-code/common-code-mutation.js +148 -0
- package/dist-server/service/common-code/common-code-mutation.js.map +1 -0
- package/dist-server/service/common-code/common-code-query.js +119 -0
- package/dist-server/service/common-code/common-code-query.js.map +1 -0
- package/dist-server/service/common-code/common-code-type.js +73 -0
- package/dist-server/service/common-code/common-code-type.js.map +1 -0
- package/dist-server/service/common-code/common-code.js +90 -0
- package/dist-server/service/common-code/common-code.js.map +1 -0
- package/dist-server/service/common-code/index.js +9 -0
- package/dist-server/service/common-code/index.js.map +1 -0
- package/dist-server/service/common-code-detail/common-code-detail-mutation.js +152 -0
- package/dist-server/service/common-code-detail/common-code-detail-mutation.js.map +1 -0
- package/dist-server/service/common-code-detail/common-code-detail-query.js +103 -0
- package/dist-server/service/common-code-detail/common-code-detail-query.js.map +1 -0
- package/dist-server/service/common-code-detail/common-code-detail-type.js +83 -0
- package/dist-server/service/common-code-detail/common-code-detail-type.js.map +1 -0
- package/dist-server/service/common-code-detail/common-code-detail.js +100 -0
- package/dist-server/service/common-code-detail/common-code-detail.js.map +1 -0
- package/dist-server/service/common-code-detail/index.js +9 -0
- package/dist-server/service/common-code-detail/index.js.map +1 -0
- package/dist-server/service/index.js +36 -0
- package/dist-server/service/index.js.map +1 -0
- package/package.json +3 -3
- package/server/index.ts +1 -2
- package/server/service/common-code/common-code-mutation.ts +142 -0
- package/server/service/common-code/common-code-query.ts +70 -0
- package/server/service/common-code/common-code-type.ts +42 -0
- package/server/{entities → service/common-code}/common-code.ts +35 -13
- package/server/service/common-code/index.ts +6 -0
- package/server/service/common-code-detail/common-code-detail-mutation.ts +150 -0
- package/server/service/common-code-detail/common-code-detail-query.ts +58 -0
- package/server/service/common-code-detail/common-code-detail-type.ts +50 -0
- package/server/service/common-code-detail/common-code-detail.ts +88 -0
- package/server/service/common-code-detail/index.ts +6 -0
- package/server/service/index.ts +22 -0
- package/server/entities/common-code-detail.ts +0 -51
- package/server/entities/index.ts +0 -12
- package/server/graphql/index.ts +0 -9
- package/server/graphql/resolvers/common-code/common-code-query.ts +0 -42
- package/server/graphql/resolvers/common-code/create-common-code.ts +0 -17
- package/server/graphql/resolvers/common-code/delete-common-code.ts +0 -12
- package/server/graphql/resolvers/common-code/delete-common-codes.ts +0 -12
- package/server/graphql/resolvers/common-code/index.ts +0 -18
- package/server/graphql/resolvers/common-code/update-common-code.ts +0 -28
- package/server/graphql/resolvers/common-code/update-multiple-common-code.ts +0 -45
- package/server/graphql/resolvers/common-code-detail/common-code-detail-query.ts +0 -31
- package/server/graphql/resolvers/common-code-detail/create-common-code-detail.ts +0 -17
- package/server/graphql/resolvers/common-code-detail/delete-common-code-detail.ts +0 -12
- package/server/graphql/resolvers/common-code-detail/delete-common-code-details.ts +0 -12
- package/server/graphql/resolvers/common-code-detail/index.ts +0 -18
- package/server/graphql/resolvers/common-code-detail/update-common-code-detail.ts +0 -18
- package/server/graphql/resolvers/common-code-detail/update-multiple-common-code-detail.ts +0 -54
- package/server/graphql/resolvers/index.ts +0 -2
- package/server/graphql/types/common-code/common-code-list.ts +0 -8
- package/server/graphql/types/common-code/common-code-patch.ts +0 -11
- package/server/graphql/types/common-code/common-code.ts +0 -15
- package/server/graphql/types/common-code/index.ts +0 -22
- package/server/graphql/types/common-code/new-common-code.ts +0 -9
- package/server/graphql/types/common-code-detail/common-code-detail-list.ts +0 -8
- package/server/graphql/types/common-code-detail/common-code-detail-patch.ts +0 -12
- package/server/graphql/types/common-code-detail/common-code-detail.ts +0 -16
- package/server/graphql/types/common-code-detail/index.ts +0 -20
- package/server/graphql/types/common-code-detail/new-common-code-detail.ts +0 -10
- package/server/graphql/types/index.ts +0 -2
package/dist-server/index.js
CHANGED
|
@@ -14,7 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./entities"), exports);
|
|
18
17
|
__exportStar(require("./migrations"), exports);
|
|
19
|
-
__exportStar(require("./
|
|
18
|
+
__exportStar(require("./service"), exports);
|
|
20
19
|
//# sourceMappingURL=index.js.map
|
package/dist-server/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../server/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../server/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA4B;AAC5B,4CAAyB"}
|
|
@@ -0,0 +1,148 @@
|
|
|
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.CommonCodeMutation = void 0;
|
|
16
|
+
const type_graphql_1 = require("type-graphql");
|
|
17
|
+
const typeorm_1 = require("typeorm");
|
|
18
|
+
const common_code_detail_1 = require("../common-code-detail/common-code-detail");
|
|
19
|
+
const common_code_1 = require("./common-code");
|
|
20
|
+
const common_code_type_1 = require("./common-code-type");
|
|
21
|
+
let CommonCodeMutation = class CommonCodeMutation {
|
|
22
|
+
async createCommonCode(commonCode, context) {
|
|
23
|
+
const { domain, user, tx } = context.state;
|
|
24
|
+
const details = await (0, typeorm_1.getRepository)(common_code_detail_1.CommonCodeDetail).findByIds(commonCode.details || []);
|
|
25
|
+
return await tx.getRepository(common_code_1.CommonCode).save(Object.assign(Object.assign({}, commonCode), { details,
|
|
26
|
+
domain, creator: user, updater: user }));
|
|
27
|
+
}
|
|
28
|
+
async updateCommonCode(name, patch, context) {
|
|
29
|
+
const { domain, user, tx } = context.state;
|
|
30
|
+
const repository = tx.getRepository(common_code_1.CommonCode);
|
|
31
|
+
const commonCode = await repository.findOne({
|
|
32
|
+
where: { domain, name },
|
|
33
|
+
relations: ['details']
|
|
34
|
+
});
|
|
35
|
+
const detailIds = commonCode.details.map(detail => detail.id);
|
|
36
|
+
if (patch.details && patch.details.length) {
|
|
37
|
+
patch.details.forEach((detailId) => {
|
|
38
|
+
if (!detailIds.includes(detailId)) {
|
|
39
|
+
detailIds.push(detailId);
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
return await repository.save(Object.assign(Object.assign(Object.assign({}, commonCode), patch), { details: await (0, typeorm_1.getRepository)(common_code_detail_1.CommonCodeDetail).findByIds(detailIds), updater: user }));
|
|
44
|
+
}
|
|
45
|
+
async updateMultipleCommonCode(patches, context) {
|
|
46
|
+
const { domain, user, tx } = context.state;
|
|
47
|
+
let results = [];
|
|
48
|
+
const _createRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === '+');
|
|
49
|
+
const _updateRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === 'M');
|
|
50
|
+
const commonCodeRepo = tx.getRepository(common_code_1.CommonCode);
|
|
51
|
+
if (_createRecords.length > 0) {
|
|
52
|
+
for (let i = 0; i < _createRecords.length; i++) {
|
|
53
|
+
const newRecord = _createRecords[i];
|
|
54
|
+
const result = await commonCodeRepo.save(Object.assign(Object.assign({}, newRecord), { domain, creator: user, updater: user }));
|
|
55
|
+
results.push(Object.assign(Object.assign({}, result), { cuFlag: '+' }));
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
if (_updateRecords.length > 0) {
|
|
59
|
+
for (let i = 0; i < _updateRecords.length; i++) {
|
|
60
|
+
const newRecord = _updateRecords[i];
|
|
61
|
+
const commonCode = await commonCodeRepo.findOne(newRecord.id);
|
|
62
|
+
const result = await commonCodeRepo.save(Object.assign(Object.assign(Object.assign({}, commonCode), newRecord), { updater: user }));
|
|
63
|
+
results.push(Object.assign(Object.assign({}, result), { cuFlag: 'M' }));
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return results;
|
|
67
|
+
}
|
|
68
|
+
async deleteCommonCode(id, context) {
|
|
69
|
+
const { domain, tx } = context.state;
|
|
70
|
+
await tx.getRepository(common_code_1.CommonCode).delete({ domain, id });
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
async deleteCommonCodes(ids, context) {
|
|
74
|
+
const { domain, tx } = context.state;
|
|
75
|
+
await tx.getRepository(common_code_1.CommonCode).delete({
|
|
76
|
+
domain,
|
|
77
|
+
id: (0, typeorm_1.In)(ids)
|
|
78
|
+
});
|
|
79
|
+
return true;
|
|
80
|
+
}
|
|
81
|
+
async importCommonCodes(commonCodes, context) {
|
|
82
|
+
const { domain, tx } = context.state;
|
|
83
|
+
await Promise.all(commonCodes.map(async (commonCode) => {
|
|
84
|
+
const createdCommonCode = await tx.getRepository(common_code_1.CommonCode).save(Object.assign({ domain }, commonCode));
|
|
85
|
+
}));
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
__decorate([
|
|
90
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
91
|
+
(0, type_graphql_1.Mutation)(returns => common_code_1.CommonCode, { description: 'To create new CommonCode' }),
|
|
92
|
+
__param(0, (0, type_graphql_1.Arg)('commonCode')),
|
|
93
|
+
__param(1, (0, type_graphql_1.Ctx)()),
|
|
94
|
+
__metadata("design:type", Function),
|
|
95
|
+
__metadata("design:paramtypes", [common_code_type_1.NewCommonCode, Object]),
|
|
96
|
+
__metadata("design:returntype", Promise)
|
|
97
|
+
], CommonCodeMutation.prototype, "createCommonCode", null);
|
|
98
|
+
__decorate([
|
|
99
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
100
|
+
(0, type_graphql_1.Mutation)(returns => common_code_1.CommonCode, { description: 'To modify CommonCode information' }),
|
|
101
|
+
__param(0, (0, type_graphql_1.Arg)('name')),
|
|
102
|
+
__param(1, (0, type_graphql_1.Arg)('patch')),
|
|
103
|
+
__param(2, (0, type_graphql_1.Ctx)()),
|
|
104
|
+
__metadata("design:type", Function),
|
|
105
|
+
__metadata("design:paramtypes", [String, common_code_type_1.CommonCodePatch, Object]),
|
|
106
|
+
__metadata("design:returntype", Promise)
|
|
107
|
+
], CommonCodeMutation.prototype, "updateCommonCode", null);
|
|
108
|
+
__decorate([
|
|
109
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
110
|
+
(0, type_graphql_1.Mutation)(returns => [common_code_1.CommonCode], { description: "To modify multiple CommonCodes' information" }),
|
|
111
|
+
__param(0, (0, type_graphql_1.Arg)('patches', type => [common_code_type_1.CommonCodePatch])),
|
|
112
|
+
__param(1, (0, type_graphql_1.Ctx)()),
|
|
113
|
+
__metadata("design:type", Function),
|
|
114
|
+
__metadata("design:paramtypes", [Array, Object]),
|
|
115
|
+
__metadata("design:returntype", Promise)
|
|
116
|
+
], CommonCodeMutation.prototype, "updateMultipleCommonCode", null);
|
|
117
|
+
__decorate([
|
|
118
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
119
|
+
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete CommonCode' }),
|
|
120
|
+
__param(0, (0, type_graphql_1.Arg)('id')),
|
|
121
|
+
__param(1, (0, type_graphql_1.Ctx)()),
|
|
122
|
+
__metadata("design:type", Function),
|
|
123
|
+
__metadata("design:paramtypes", [String, Object]),
|
|
124
|
+
__metadata("design:returntype", Promise)
|
|
125
|
+
], CommonCodeMutation.prototype, "deleteCommonCode", null);
|
|
126
|
+
__decorate([
|
|
127
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
128
|
+
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete multiple CommonCodes' }),
|
|
129
|
+
__param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
|
|
130
|
+
__param(1, (0, type_graphql_1.Ctx)()),
|
|
131
|
+
__metadata("design:type", Function),
|
|
132
|
+
__metadata("design:paramtypes", [Array, Object]),
|
|
133
|
+
__metadata("design:returntype", Promise)
|
|
134
|
+
], CommonCodeMutation.prototype, "deleteCommonCodes", null);
|
|
135
|
+
__decorate([
|
|
136
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
137
|
+
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To import multiple CommonCodes' }),
|
|
138
|
+
__param(0, (0, type_graphql_1.Arg)('commonCodes', type => [common_code_type_1.CommonCodePatch])),
|
|
139
|
+
__param(1, (0, type_graphql_1.Ctx)()),
|
|
140
|
+
__metadata("design:type", Function),
|
|
141
|
+
__metadata("design:paramtypes", [Array, Object]),
|
|
142
|
+
__metadata("design:returntype", Promise)
|
|
143
|
+
], CommonCodeMutation.prototype, "importCommonCodes", null);
|
|
144
|
+
CommonCodeMutation = __decorate([
|
|
145
|
+
(0, type_graphql_1.Resolver)(common_code_1.CommonCode)
|
|
146
|
+
], CommonCodeMutation);
|
|
147
|
+
exports.CommonCodeMutation = CommonCodeMutation;
|
|
148
|
+
//# sourceMappingURL=common-code-mutation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common-code-mutation.js","sourceRoot":"","sources":["../../../server/service/common-code/common-code-mutation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+CAAsE;AACtE,qCAA2C;AAE3C,iFAA2E;AAC3E,+CAA0C;AAC1C,yDAAmE;AAGnE,IAAa,kBAAkB,GAA/B,MAAa,kBAAkB;IAG7B,KAAK,CAAC,gBAAgB,CAAoB,UAAyB,EAAS,OAAY;QACtF,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,MAAM,OAAO,GAAG,MAAM,IAAA,uBAAa,EAAC,qCAAgB,CAAC,CAAC,SAAS,CAAC,UAAU,CAAC,OAAO,IAAI,EAAE,CAAC,CAAA;QAEzF,OAAO,MAAM,EAAE,CAAC,aAAa,CAAC,wBAAU,CAAC,CAAC,IAAI,iCACzC,UAAU,KACb,OAAO;YACP,MAAM,EACN,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,IAAI,IACb,CAAA;IACJ,CAAC;IAID,KAAK,CAAC,gBAAgB,CACP,IAAY,EACX,KAAsB,EAC7B,OAAY;QAEnB,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,MAAM,UAAU,GAAG,EAAE,CAAC,aAAa,CAAC,wBAAU,CAAC,CAAA;QAC/C,MAAM,UAAU,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC;YAC1C,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;YACvB,SAAS,EAAE,CAAC,SAAS,CAAC;SACvB,CAAC,CAAA;QAEF,MAAM,SAAS,GAAG,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;QAC7D,IAAI,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,O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AAA,IAAA,kBAAG,GAAE,CAAA;;;;kEAwCP;AAID;IAFC,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,sBAAsB,EAAE,CAAC;IAC9C,WAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;IAAc,WAAA,IAAA,kBAAG,GAAE,CAAA;;;;0DAKnD;AAID;IAFC,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,gCAAgC,EAAE,CAAC;IACvD,WAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAAiB,WAAA,IAAA,kBAAG,GAAE,CAAA;;;;2DAS1E;AAID;IAFC,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,gCAAgC,EAAE,CAAC;IAE7E,WAAA,IAAA,kBAAG,EAAC,aAAa,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,kCAAe,CAAC,CAAC,CAAA;IAC7C,WAAA,IAAA,kBAAG,GAAE,CAAA;;;;2DAWP;AApIU,kBAAkB;IAD9B,IAAA,uBAAQ,EAAC,wBAAU,CAAC;GACR,kBAAkB,CAqI9B;AArIY,gDAAkB"}
|
|
@@ -0,0 +1,119 @@
|
|
|
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.CommonCodeQuery = 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 common_code_detail_1 = require("../common-code-detail/common-code-detail");
|
|
22
|
+
const common_code_1 = require("./common-code");
|
|
23
|
+
const common_code_type_1 = require("./common-code-type");
|
|
24
|
+
let CommonCodeQuery = class CommonCodeQuery {
|
|
25
|
+
async commonCode(name, context) {
|
|
26
|
+
const { domain } = context.state;
|
|
27
|
+
return await (0, typeorm_1.getRepository)(common_code_1.CommonCode).findOne({
|
|
28
|
+
where: { domain, name }
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
async commonCodes(params, context) {
|
|
32
|
+
const { domain } = context.state;
|
|
33
|
+
const queryBuilder = (0, shell_1.getQueryBuilderFromListParams)({
|
|
34
|
+
domain,
|
|
35
|
+
params,
|
|
36
|
+
repository: await (0, typeorm_1.getRepository)(common_code_1.CommonCode),
|
|
37
|
+
searchables: ['name', 'description']
|
|
38
|
+
});
|
|
39
|
+
const [items, total] = await queryBuilder.getManyAndCount();
|
|
40
|
+
return { items, total };
|
|
41
|
+
}
|
|
42
|
+
async partnerCommonCode(name, partnerDomainId, context) {
|
|
43
|
+
return await (0, typeorm_1.getRepository)(common_code_1.CommonCode).findOne({
|
|
44
|
+
where: { domain: partnerDomainId, name }
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
async details(commonCode) {
|
|
48
|
+
return await (0, typeorm_1.getRepository)(common_code_detail_1.CommonCodeDetail).find({
|
|
49
|
+
commonCode
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
async domain(commonCode) {
|
|
53
|
+
return await (0, typeorm_1.getRepository)(shell_1.Domain).findOne(commonCode.domainId);
|
|
54
|
+
}
|
|
55
|
+
async updater(commonCode) {
|
|
56
|
+
return await (0, typeorm_1.getRepository)(auth_base_1.User).findOne(commonCode.updaterId);
|
|
57
|
+
}
|
|
58
|
+
async creator(commonCode) {
|
|
59
|
+
return await (0, typeorm_1.getRepository)(auth_base_1.User).findOne(commonCode.creatorId);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, type_graphql_1.Query)(returns => common_code_1.CommonCode, { nullable: true, description: 'To fetch a CommonCode' }),
|
|
64
|
+
__param(0, (0, type_graphql_1.Arg)('name')),
|
|
65
|
+
__param(1, (0, type_graphql_1.Ctx)()),
|
|
66
|
+
__metadata("design:type", Function),
|
|
67
|
+
__metadata("design:paramtypes", [String, Object]),
|
|
68
|
+
__metadata("design:returntype", Promise)
|
|
69
|
+
], CommonCodeQuery.prototype, "commonCode", null);
|
|
70
|
+
__decorate([
|
|
71
|
+
(0, type_graphql_1.Query)(returns => common_code_type_1.CommonCodeList, { description: 'To fetch multiple CommonCodes' }),
|
|
72
|
+
__param(0, (0, type_graphql_1.Args)()),
|
|
73
|
+
__param(1, (0, type_graphql_1.Ctx)()),
|
|
74
|
+
__metadata("design:type", Function),
|
|
75
|
+
__metadata("design:paramtypes", [typeof (_a = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _a : Object, Object]),
|
|
76
|
+
__metadata("design:returntype", Promise)
|
|
77
|
+
], CommonCodeQuery.prototype, "commonCodes", null);
|
|
78
|
+
__decorate([
|
|
79
|
+
(0, type_graphql_1.Query)(returns => common_code_1.CommonCode, { description: "To fetch specific domain's CommonCodes by given name" }),
|
|
80
|
+
__param(0, (0, type_graphql_1.Arg)('name')),
|
|
81
|
+
__param(1, (0, type_graphql_1.Arg)('partnerDomainId')),
|
|
82
|
+
__param(2, (0, type_graphql_1.Ctx)()),
|
|
83
|
+
__metadata("design:type", Function),
|
|
84
|
+
__metadata("design:paramtypes", [String, String, Object]),
|
|
85
|
+
__metadata("design:returntype", Promise)
|
|
86
|
+
], CommonCodeQuery.prototype, "partnerCommonCode", null);
|
|
87
|
+
__decorate([
|
|
88
|
+
(0, type_graphql_1.FieldResolver)(type => [common_code_detail_1.CommonCodeDetail]),
|
|
89
|
+
__param(0, (0, type_graphql_1.Root)()),
|
|
90
|
+
__metadata("design:type", Function),
|
|
91
|
+
__metadata("design:paramtypes", [common_code_1.CommonCode]),
|
|
92
|
+
__metadata("design:returntype", Promise)
|
|
93
|
+
], CommonCodeQuery.prototype, "details", null);
|
|
94
|
+
__decorate([
|
|
95
|
+
(0, type_graphql_1.FieldResolver)(type => shell_1.Domain),
|
|
96
|
+
__param(0, (0, type_graphql_1.Root)()),
|
|
97
|
+
__metadata("design:type", Function),
|
|
98
|
+
__metadata("design:paramtypes", [common_code_1.CommonCode]),
|
|
99
|
+
__metadata("design:returntype", Promise)
|
|
100
|
+
], CommonCodeQuery.prototype, "domain", null);
|
|
101
|
+
__decorate([
|
|
102
|
+
(0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
|
|
103
|
+
__param(0, (0, type_graphql_1.Root)()),
|
|
104
|
+
__metadata("design:type", Function),
|
|
105
|
+
__metadata("design:paramtypes", [common_code_1.CommonCode]),
|
|
106
|
+
__metadata("design:returntype", Promise)
|
|
107
|
+
], CommonCodeQuery.prototype, "updater", null);
|
|
108
|
+
__decorate([
|
|
109
|
+
(0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
|
|
110
|
+
__param(0, (0, type_graphql_1.Root)()),
|
|
111
|
+
__metadata("design:type", Function),
|
|
112
|
+
__metadata("design:paramtypes", [common_code_1.CommonCode]),
|
|
113
|
+
__metadata("design:returntype", Promise)
|
|
114
|
+
], CommonCodeQuery.prototype, "creator", null);
|
|
115
|
+
CommonCodeQuery = __decorate([
|
|
116
|
+
(0, type_graphql_1.Resolver)(common_code_1.CommonCode)
|
|
117
|
+
], CommonCodeQuery);
|
|
118
|
+
exports.CommonCodeQuery = CommonCodeQuery;
|
|
119
|
+
//# sourceMappingURL=common-code-query.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common-code-query.js","sourceRoot":"","sources":["../../../server/service/common-code/common-code-query.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAAmF;AACnF,qCAAuC;AAEvC,yDAAgD;AAChD,iDAAwF;AAExF,iFAA2E;AAC3E,+CAA0C;AAC1C,yDAAmD;AAGnD,IAAa,eAAe,GAA5B,MAAa,eAAe;IAE1B,KAAK,CAAC,UAAU,CAAc,IAAY,EAAS,OAAY;QAC7D,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,OAAO,MAAM,IAAA,uBAAa,EAAC,wBAAU,CAAC,CAAC,OAAO,CAAC;YAC7C,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;SACxB,CAAC,CAAA;IACJ,CAAC;IAGD,KAAK,CAAC,WAAW,CAAS,MAAiB,EAAS,OAAY;QAC9D,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,MAAM,YAAY,GAAG,IAAA,qCAA6B,EAAC;YACjD,MAAM;YACN,MAAM;YACN,UAAU,EAAE,MAAM,IAAA,uBAAa,EAAC,wBAAU,CAAC;YAC3C,WAAW,EAAE,CAAC,MAAM,EAAE,aAAa,CAAC;SACrC,CAAC,CAAA;QA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C,OAAO,CAAC,EAAE,CAAC,iCAAc,EAAE,EAAE,WAAW,EAAE,+BAA+B,EAAE,CAAC;IAChE,WAAA,IAAA,mBAAI,GAAE,CAAA;IAAqB,WAAA,IAAA,kBAAG,GAAE,CAAA;;yDAAjB,iBAAS,oBAAT,iBAAS;;kDAa1C;AAGD;IADC,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,wBAAU,EAAE,EAAE,WAAW,EAAE,sDAAsD,EAAE,CAAC;IAEnG,WAAA,IAAA,kBAAG,EAAC,MAAM,CAAC,CAAA;IACX,WAAA,IAAA,kBAAG,EAAC,iBAAiB,CAAC,CAAA;IACtB,WAAA,IAAA,kBAAG,GAAE,CAAA;;;;wDAKP;AAGD;IADC,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,qCAAgB,CAAC,CAAC;IAC3B,WAAA,IAAA,mBAAI,GAAE,CAAA;;qCAAa,wBAAU;;8CAI3C;AAGD;IADC,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IAChB,WAAA,IAAA,mBAAI,GAAE,CAAA;;qCAAa,wBAAU;;6CAE1C;AAGD;IADC,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,WAAA,IAAA,mBAAI,GAAE,CAAA;;qCAAa,wBAAU;;8CAE3C;AAGD;IADC,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,WAAA,IAAA,mBAAI,GAAE,CAAA;;qCAAa,wBAAU;;8CAE3C;AAzDU,eAAe;IAD3B,IAAA,uBAAQ,EAAC,wBAAU,CAAC;GACR,eAAe,CA0D3B;AA1DY,0CAAe"}
|
|
@@ -0,0 +1,73 @@
|
|
|
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.CommonCodeList = exports.CommonCodePatch = exports.NewCommonCode = void 0;
|
|
13
|
+
const type_graphql_1 = require("type-graphql");
|
|
14
|
+
const common_code_1 = require("./common-code");
|
|
15
|
+
let NewCommonCode = class NewCommonCode {
|
|
16
|
+
};
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, type_graphql_1.Field)(),
|
|
19
|
+
__metadata("design:type", String)
|
|
20
|
+
], NewCommonCode.prototype, "name", void 0);
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
23
|
+
__metadata("design:type", String)
|
|
24
|
+
], NewCommonCode.prototype, "description", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, type_graphql_1.Field)(type => [String], { nullable: true }),
|
|
27
|
+
__metadata("design:type", Array)
|
|
28
|
+
], NewCommonCode.prototype, "details", void 0);
|
|
29
|
+
NewCommonCode = __decorate([
|
|
30
|
+
(0, type_graphql_1.InputType)()
|
|
31
|
+
], NewCommonCode);
|
|
32
|
+
exports.NewCommonCode = NewCommonCode;
|
|
33
|
+
let CommonCodePatch = class CommonCodePatch {
|
|
34
|
+
};
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
|
|
37
|
+
__metadata("design:type", String)
|
|
38
|
+
], CommonCodePatch.prototype, "id", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
41
|
+
__metadata("design:type", String)
|
|
42
|
+
], CommonCodePatch.prototype, "name", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
45
|
+
__metadata("design:type", String)
|
|
46
|
+
], CommonCodePatch.prototype, "description", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, type_graphql_1.Field)(type => [String], { nullable: true }),
|
|
49
|
+
__metadata("design:type", Array)
|
|
50
|
+
], CommonCodePatch.prototype, "details", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
53
|
+
__metadata("design:type", String)
|
|
54
|
+
], CommonCodePatch.prototype, "cuFlag", void 0);
|
|
55
|
+
CommonCodePatch = __decorate([
|
|
56
|
+
(0, type_graphql_1.InputType)()
|
|
57
|
+
], CommonCodePatch);
|
|
58
|
+
exports.CommonCodePatch = CommonCodePatch;
|
|
59
|
+
let CommonCodeList = class CommonCodeList {
|
|
60
|
+
};
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, type_graphql_1.Field)(type => [common_code_1.CommonCode]),
|
|
63
|
+
__metadata("design:type", Array)
|
|
64
|
+
], CommonCodeList.prototype, "items", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int),
|
|
67
|
+
__metadata("design:type", Number)
|
|
68
|
+
], CommonCodeList.prototype, "total", void 0);
|
|
69
|
+
CommonCodeList = __decorate([
|
|
70
|
+
(0, type_graphql_1.ObjectType)()
|
|
71
|
+
], CommonCodeList);
|
|
72
|
+
exports.CommonCodeList = CommonCodeList;
|
|
73
|
+
//# sourceMappingURL=common-code-type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common-code-type.js","sourceRoot":"","sources":["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;;6CACN;AALF,cAAc;IAD1B,IAAA,yBAAU,GAAE;GACA,cAAc,CAM1B;AANY,wCAAc"}
|
|
@@ -0,0 +1,90 @@
|
|
|
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.CommonCode = 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
|
+
const common_code_detail_1 = require("../common-code-detail/common-code-detail");
|
|
19
|
+
let CommonCode = class CommonCode {
|
|
20
|
+
};
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
23
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
|
24
|
+
__metadata("design:type", String)
|
|
25
|
+
], CommonCode.prototype, "id", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, typeorm_1.ManyToOne)(type => shell_1.Domain),
|
|
28
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
29
|
+
__metadata("design:type", typeof (_a = typeof shell_1.Domain !== "undefined" && shell_1.Domain) === "function" ? _a : Object)
|
|
30
|
+
], CommonCode.prototype, "domain", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, typeorm_1.RelationId)((commonCode) => commonCode.domain),
|
|
33
|
+
__metadata("design:type", String)
|
|
34
|
+
], CommonCode.prototype, "domainId", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, typeorm_1.Column)(),
|
|
37
|
+
(0, type_graphql_1.Field)(),
|
|
38
|
+
__metadata("design:type", String)
|
|
39
|
+
], CommonCode.prototype, "name", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, typeorm_1.Column)({
|
|
42
|
+
nullable: true
|
|
43
|
+
}),
|
|
44
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
45
|
+
__metadata("design:type", String)
|
|
46
|
+
], CommonCode.prototype, "description", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, typeorm_1.OneToMany)(type => common_code_detail_1.CommonCodeDetail, commonCodeDetail => commonCodeDetail.commonCode),
|
|
49
|
+
__metadata("design:type", Array)
|
|
50
|
+
], CommonCode.prototype, "details", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
53
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
54
|
+
__metadata("design:type", Date)
|
|
55
|
+
], CommonCode.prototype, "createdAt", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, typeorm_1.UpdateDateColumn)(),
|
|
58
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
59
|
+
__metadata("design:type", Date)
|
|
60
|
+
], CommonCode.prototype, "updatedAt", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
|
|
63
|
+
nullable: true
|
|
64
|
+
}),
|
|
65
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
66
|
+
__metadata("design:type", typeof (_b = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _b : Object)
|
|
67
|
+
], CommonCode.prototype, "creator", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, typeorm_1.RelationId)((commonCode) => commonCode.creator),
|
|
70
|
+
__metadata("design:type", String)
|
|
71
|
+
], CommonCode.prototype, "creatorId", void 0);
|
|
72
|
+
__decorate([
|
|
73
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
|
|
74
|
+
nullable: true
|
|
75
|
+
}),
|
|
76
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
77
|
+
__metadata("design:type", typeof (_c = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _c : Object)
|
|
78
|
+
], CommonCode.prototype, "updater", void 0);
|
|
79
|
+
__decorate([
|
|
80
|
+
(0, typeorm_1.RelationId)((commonCode) => commonCode.creator),
|
|
81
|
+
__metadata("design:type", String)
|
|
82
|
+
], CommonCode.prototype, "updaterId", void 0);
|
|
83
|
+
CommonCode = __decorate([
|
|
84
|
+
(0, typeorm_1.Entity)(),
|
|
85
|
+
(0, typeorm_1.Index)('ix_common_code_0', (commonCode) => [commonCode.domain, commonCode.name], { unique: true }),
|
|
86
|
+
(0, typeorm_1.Index)('ix_common_code_1', (commonCode) => [commonCode.domain]),
|
|
87
|
+
(0, type_graphql_1.ObjectType)({ description: 'Entity for CommonCode' })
|
|
88
|
+
], CommonCode);
|
|
89
|
+
exports.CommonCode = CommonCode;
|
|
90
|
+
//# sourceMappingURL=common-code.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common-code.js","sourceRoot":"","sources":["../../../server/service/common-code/common-code.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,+CAAoD;AACpD,qCAUgB;AAEhB,yDAAgD;AAChD,iDAA8C;AAE9C,iFAA2E;AAM3E,IAAa,UAAU,GAAvB,MAAa,UAAU;CAkDtB,CAAA;AA/CC;IA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;IAJC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE;QACvB,QAAQ,EAAE,IAAI;KACf,CAAC;IACD,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;kDAChB,gBAAI,oBAAJ,gBAAI;2CAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,UAAsB,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC;;6CACzC;AAjDP,UAAU;IAJtB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,kBAAkB,EAAE,CAAC,UAAsB,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,MAAM,EAAE,UAAU,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAC7G,IAAA,eAAK,EAAC,kBAAkB,EAAE,CAAC,UAAsB,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;IAC1E,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,uBAAuB,EAAE,CAAC;GACxC,UAAU,CAkDtB;AAlDY,gCAAU"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolvers = exports.entities = void 0;
|
|
4
|
+
const common_code_1 = require("./common-code");
|
|
5
|
+
const common_code_query_1 = require("./common-code-query");
|
|
6
|
+
const common_code_mutation_1 = require("./common-code-mutation");
|
|
7
|
+
exports.entities = [common_code_1.CommonCode];
|
|
8
|
+
exports.resolvers = [common_code_query_1.CommonCodeQuery, common_code_mutation_1.CommonCodeMutation];
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/common-code/index.ts"],"names":[],"mappings":";;;AAAA,+CAA0C;AAC1C,2DAAqD;AACrD,iEAA2D;AAE9C,QAAA,QAAQ,GAAG,CAAC,wBAAU,CAAC,CAAA;AACvB,QAAA,SAAS,GAAG,CAAC,mCAAe,EAAE,yCAAkB,CAAC,CAAA"}
|
|
@@ -0,0 +1,152 @@
|
|
|
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.CommonCodeDetailMutation = void 0;
|
|
16
|
+
const type_graphql_1 = require("type-graphql");
|
|
17
|
+
const typeorm_1 = require("typeorm");
|
|
18
|
+
const common_code_1 = require("../common-code/common-code");
|
|
19
|
+
const common_code_detail_1 = require("./common-code-detail");
|
|
20
|
+
const common_code_detail_type_1 = require("./common-code-detail-type");
|
|
21
|
+
let CommonCodeDetailMutation = class CommonCodeDetailMutation {
|
|
22
|
+
async createCommonCodeDetail(commonCodeDetail, context) {
|
|
23
|
+
const { domain, user, tx } = context.state;
|
|
24
|
+
if (commonCodeDetail && commonCodeDetail.commonCode.id) {
|
|
25
|
+
commonCodeDetail.commonCode = await tx.getRepository(common_code_1.CommonCode).findOne(commonCodeDetail.commonCode.id);
|
|
26
|
+
}
|
|
27
|
+
return await tx.getRepository(common_code_detail_1.CommonCodeDetail).save(Object.assign(Object.assign({}, commonCodeDetail), { domain, creator: user, updater: user }));
|
|
28
|
+
}
|
|
29
|
+
async updateCommonCodeDetail(id, patch, context) {
|
|
30
|
+
const { domain, user, tx } = context.state;
|
|
31
|
+
const repository = tx.getRepository(common_code_detail_1.CommonCodeDetail);
|
|
32
|
+
const commonCodeDetail = await repository.findOne({
|
|
33
|
+
where: { domain, id }
|
|
34
|
+
});
|
|
35
|
+
if (patch.commonCode && patch.commonCode.id) {
|
|
36
|
+
patch.commonCode = await tx.getRepository(common_code_1.CommonCode).findOne(patch.commonCode.id);
|
|
37
|
+
}
|
|
38
|
+
return await repository.save(Object.assign(Object.assign(Object.assign({}, commonCodeDetail), patch), { updater: user }));
|
|
39
|
+
}
|
|
40
|
+
async updateMultipleCommonCodeDetail(patches, context) {
|
|
41
|
+
const { domain, user, tx } = context.state;
|
|
42
|
+
let results = [];
|
|
43
|
+
const _createRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === '+');
|
|
44
|
+
const _updateRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === 'M');
|
|
45
|
+
const commonCodeRepo = tx.getRepository(common_code_1.CommonCode);
|
|
46
|
+
const commonCodeDetailRepo = tx.getRepository(common_code_detail_1.CommonCodeDetail);
|
|
47
|
+
if (_createRecords.length > 0) {
|
|
48
|
+
for (let i = 0; i < _createRecords.length; i++) {
|
|
49
|
+
const newRecord = _createRecords[i];
|
|
50
|
+
if (newRecord.commonCode && newRecord.commonCode.id) {
|
|
51
|
+
newRecord.commonCode = await commonCodeRepo.findOne(newRecord.commonCode.id);
|
|
52
|
+
}
|
|
53
|
+
const result = await commonCodeDetailRepo.save(Object.assign(Object.assign({}, newRecord), { domain, creator: user, updater: user }));
|
|
54
|
+
results.push(Object.assign(Object.assign({}, result), { cuFlag: '+' }));
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
if (_updateRecords.length > 0) {
|
|
58
|
+
for (let i = 0; i < _updateRecords.length; i++) {
|
|
59
|
+
const newRecord = _updateRecords[i];
|
|
60
|
+
const commonCodeDetail = await commonCodeDetailRepo.findOne(newRecord.id);
|
|
61
|
+
if (newRecord.commonCode && newRecord.commonCode.id) {
|
|
62
|
+
newRecord.commonCode = await commonCodeRepo.findOne(newRecord.commonCode.id);
|
|
63
|
+
}
|
|
64
|
+
const result = await commonCodeDetailRepo.save(Object.assign(Object.assign(Object.assign({}, commonCodeDetail), newRecord), { updater: user }));
|
|
65
|
+
results.push(Object.assign(Object.assign({}, result), { cuFlag: 'M' }));
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return results;
|
|
69
|
+
}
|
|
70
|
+
async deleteCommonCodeDetail(id, context) {
|
|
71
|
+
const { domain, tx } = context.state;
|
|
72
|
+
await tx.getRepository(common_code_detail_1.CommonCodeDetail).delete({ domain, id });
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
async deleteCommonCodeDetails(ids, context) {
|
|
76
|
+
const { domain, tx } = context.state;
|
|
77
|
+
await tx.getRepository(common_code_detail_1.CommonCodeDetail).delete({
|
|
78
|
+
domain,
|
|
79
|
+
id: (0, typeorm_1.In)(ids)
|
|
80
|
+
});
|
|
81
|
+
return true;
|
|
82
|
+
}
|
|
83
|
+
async importCommonCodeDetails(commonCodeDetails, context) {
|
|
84
|
+
const { domain, tx } = context.state;
|
|
85
|
+
await Promise.all(commonCodeDetails.map(async (commonCodeDetail) => {
|
|
86
|
+
const createdCommonCodeDetail = await tx
|
|
87
|
+
.getRepository(common_code_detail_1.CommonCodeDetail)
|
|
88
|
+
.save(Object.assign({ domain }, commonCodeDetail));
|
|
89
|
+
}));
|
|
90
|
+
return true;
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
__decorate([
|
|
94
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
95
|
+
(0, type_graphql_1.Mutation)(returns => common_code_detail_1.CommonCodeDetail, { description: 'To create new CommonCodeDetail' }),
|
|
96
|
+
__param(0, (0, type_graphql_1.Arg)('commonCodeDetail')),
|
|
97
|
+
__param(1, (0, type_graphql_1.Ctx)()),
|
|
98
|
+
__metadata("design:type", Function),
|
|
99
|
+
__metadata("design:paramtypes", [common_code_detail_type_1.NewCommonCodeDetail, Object]),
|
|
100
|
+
__metadata("design:returntype", Promise)
|
|
101
|
+
], CommonCodeDetailMutation.prototype, "createCommonCodeDetail", null);
|
|
102
|
+
__decorate([
|
|
103
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
104
|
+
(0, type_graphql_1.Mutation)(returns => common_code_detail_1.CommonCodeDetail, { description: 'To modify CommonCodeDetail information' }),
|
|
105
|
+
__param(0, (0, type_graphql_1.Arg)('id')),
|
|
106
|
+
__param(1, (0, type_graphql_1.Arg)('patch')),
|
|
107
|
+
__param(2, (0, type_graphql_1.Ctx)()),
|
|
108
|
+
__metadata("design:type", Function),
|
|
109
|
+
__metadata("design:paramtypes", [String, common_code_detail_type_1.CommonCodeDetailPatch, Object]),
|
|
110
|
+
__metadata("design:returntype", Promise)
|
|
111
|
+
], CommonCodeDetailMutation.prototype, "updateCommonCodeDetail", null);
|
|
112
|
+
__decorate([
|
|
113
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
114
|
+
(0, type_graphql_1.Mutation)(returns => [common_code_detail_1.CommonCodeDetail], { description: "To modify multiple CommonCodeDetails' information" }),
|
|
115
|
+
__param(0, (0, type_graphql_1.Arg)('patches', type => [common_code_detail_type_1.CommonCodeDetailPatch])),
|
|
116
|
+
__param(1, (0, type_graphql_1.Ctx)()),
|
|
117
|
+
__metadata("design:type", Function),
|
|
118
|
+
__metadata("design:paramtypes", [Array, Object]),
|
|
119
|
+
__metadata("design:returntype", Promise)
|
|
120
|
+
], CommonCodeDetailMutation.prototype, "updateMultipleCommonCodeDetail", null);
|
|
121
|
+
__decorate([
|
|
122
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
123
|
+
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete CommonCodeDetail' }),
|
|
124
|
+
__param(0, (0, type_graphql_1.Arg)('id')),
|
|
125
|
+
__param(1, (0, type_graphql_1.Ctx)()),
|
|
126
|
+
__metadata("design:type", Function),
|
|
127
|
+
__metadata("design:paramtypes", [String, Object]),
|
|
128
|
+
__metadata("design:returntype", Promise)
|
|
129
|
+
], CommonCodeDetailMutation.prototype, "deleteCommonCodeDetail", null);
|
|
130
|
+
__decorate([
|
|
131
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
132
|
+
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete multiple CommonCodeDetails' }),
|
|
133
|
+
__param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
|
|
134
|
+
__param(1, (0, type_graphql_1.Ctx)()),
|
|
135
|
+
__metadata("design:type", Function),
|
|
136
|
+
__metadata("design:paramtypes", [Array, Object]),
|
|
137
|
+
__metadata("design:returntype", Promise)
|
|
138
|
+
], CommonCodeDetailMutation.prototype, "deleteCommonCodeDetails", null);
|
|
139
|
+
__decorate([
|
|
140
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
141
|
+
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To import multiple CommonCodeDetails' }),
|
|
142
|
+
__param(0, (0, type_graphql_1.Arg)('commonCodeDetails', type => [common_code_detail_type_1.CommonCodeDetailPatch])),
|
|
143
|
+
__param(1, (0, type_graphql_1.Ctx)()),
|
|
144
|
+
__metadata("design:type", Function),
|
|
145
|
+
__metadata("design:paramtypes", [Array, Object]),
|
|
146
|
+
__metadata("design:returntype", Promise)
|
|
147
|
+
], CommonCodeDetailMutation.prototype, "importCommonCodeDetails", null);
|
|
148
|
+
CommonCodeDetailMutation = __decorate([
|
|
149
|
+
(0, type_graphql_1.Resolver)(common_code_detail_1.CommonCodeDetail)
|
|
150
|
+
], CommonCodeDetailMutation);
|
|
151
|
+
exports.CommonCodeDetailMutation = CommonCodeDetailMutation;
|
|
152
|
+
//# sourceMappingURL=common-code-detail-mutation.js.map
|