@things-factory/code-base 5.0.7 → 6.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-server/index.js +3 -16
- package/dist-server/index.js.map +1 -1
- package/dist-server/migrations/index.js.map +1 -1
- package/dist-server/service/common-code/common-code-mutation.js +49 -57
- package/dist-server/service/common-code/common-code-mutation.js.map +1 -1
- package/dist-server/service/common-code/common-code-query.js +51 -64
- package/dist-server/service/common-code/common-code-query.js.map +1 -1
- package/dist-server/service/common-code/common-code-type.js +24 -32
- package/dist-server/service/common-code/common-code-type.js.map +1 -1
- package/dist-server/service/common-code/common-code.js +26 -35
- package/dist-server/service/common-code/common-code.js.map +1 -1
- package/dist-server/service/common-code/index.js.map +1 -1
- package/dist-server/service/common-code-detail/common-code-detail-mutation.js +47 -58
- package/dist-server/service/common-code-detail/common-code-detail-mutation.js.map +1 -1
- package/dist-server/service/common-code-detail/common-code-detail-query.js +40 -53
- package/dist-server/service/common-code-detail/common-code-detail-query.js.map +1 -1
- package/dist-server/service/common-code-detail/common-code-detail-type.js +28 -37
- package/dist-server/service/common-code-detail/common-code-detail-type.js.map +1 -1
- package/dist-server/service/common-code-detail/common-code-detail.js +30 -39
- package/dist-server/service/common-code-detail/common-code-detail.js.map +1 -1
- package/dist-server/service/common-code-detail/index.js.map +1 -1
- package/dist-server/service/index.js +3 -16
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -0
- package/package.json +3 -3
- package/server/service/common-code/common-code-mutation.ts +24 -14
- package/server/service/common-code/common-code-query.ts +11 -12
- package/server/service/common-code-detail/common-code-detail-mutation.ts +17 -14
- package/server/service/common-code-detail/common-code-detail-query.ts +8 -9
|
@@ -1,16 +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 _a, _b, _c;
|
|
12
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
3
|
exports.CommonCode = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
14
5
|
const type_graphql_1 = require("type-graphql");
|
|
15
6
|
const typeorm_1 = require("typeorm");
|
|
16
7
|
const auth_base_1 = require("@things-factory/auth-base");
|
|
@@ -18,69 +9,69 @@ const shell_1 = require("@things-factory/shell");
|
|
|
18
9
|
const common_code_detail_1 = require("../common-code-detail/common-code-detail");
|
|
19
10
|
let CommonCode = class CommonCode {
|
|
20
11
|
};
|
|
21
|
-
__decorate([
|
|
12
|
+
tslib_1.__decorate([
|
|
22
13
|
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
23
14
|
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
|
24
|
-
__metadata("design:type", String)
|
|
15
|
+
tslib_1.__metadata("design:type", String)
|
|
25
16
|
], CommonCode.prototype, "id", void 0);
|
|
26
|
-
__decorate([
|
|
17
|
+
tslib_1.__decorate([
|
|
27
18
|
(0, typeorm_1.ManyToOne)(type => shell_1.Domain),
|
|
28
19
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
29
|
-
__metadata("design:type",
|
|
20
|
+
tslib_1.__metadata("design:type", shell_1.Domain)
|
|
30
21
|
], CommonCode.prototype, "domain", void 0);
|
|
31
|
-
__decorate([
|
|
22
|
+
tslib_1.__decorate([
|
|
32
23
|
(0, typeorm_1.RelationId)((commonCode) => commonCode.domain),
|
|
33
|
-
__metadata("design:type", String)
|
|
24
|
+
tslib_1.__metadata("design:type", String)
|
|
34
25
|
], CommonCode.prototype, "domainId", void 0);
|
|
35
|
-
__decorate([
|
|
26
|
+
tslib_1.__decorate([
|
|
36
27
|
(0, typeorm_1.Column)(),
|
|
37
28
|
(0, type_graphql_1.Field)(),
|
|
38
|
-
__metadata("design:type", String)
|
|
29
|
+
tslib_1.__metadata("design:type", String)
|
|
39
30
|
], CommonCode.prototype, "name", void 0);
|
|
40
|
-
__decorate([
|
|
31
|
+
tslib_1.__decorate([
|
|
41
32
|
(0, typeorm_1.Column)({
|
|
42
33
|
nullable: true
|
|
43
34
|
}),
|
|
44
35
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
45
|
-
__metadata("design:type", String)
|
|
36
|
+
tslib_1.__metadata("design:type", String)
|
|
46
37
|
], CommonCode.prototype, "description", void 0);
|
|
47
|
-
__decorate([
|
|
38
|
+
tslib_1.__decorate([
|
|
48
39
|
(0, typeorm_1.OneToMany)(type => common_code_detail_1.CommonCodeDetail, commonCodeDetail => commonCodeDetail.commonCode),
|
|
49
|
-
__metadata("design:type", Array)
|
|
40
|
+
tslib_1.__metadata("design:type", Array)
|
|
50
41
|
], CommonCode.prototype, "details", void 0);
|
|
51
|
-
__decorate([
|
|
42
|
+
tslib_1.__decorate([
|
|
52
43
|
(0, typeorm_1.CreateDateColumn)(),
|
|
53
44
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
54
|
-
__metadata("design:type", Date)
|
|
45
|
+
tslib_1.__metadata("design:type", Date)
|
|
55
46
|
], CommonCode.prototype, "createdAt", void 0);
|
|
56
|
-
__decorate([
|
|
47
|
+
tslib_1.__decorate([
|
|
57
48
|
(0, typeorm_1.UpdateDateColumn)(),
|
|
58
49
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
59
|
-
__metadata("design:type", Date)
|
|
50
|
+
tslib_1.__metadata("design:type", Date)
|
|
60
51
|
], CommonCode.prototype, "updatedAt", void 0);
|
|
61
|
-
__decorate([
|
|
52
|
+
tslib_1.__decorate([
|
|
62
53
|
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
|
|
63
54
|
nullable: true
|
|
64
55
|
}),
|
|
65
56
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
66
|
-
__metadata("design:type",
|
|
57
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
67
58
|
], CommonCode.prototype, "creator", void 0);
|
|
68
|
-
__decorate([
|
|
59
|
+
tslib_1.__decorate([
|
|
69
60
|
(0, typeorm_1.RelationId)((commonCode) => commonCode.creator),
|
|
70
|
-
__metadata("design:type", String)
|
|
61
|
+
tslib_1.__metadata("design:type", String)
|
|
71
62
|
], CommonCode.prototype, "creatorId", void 0);
|
|
72
|
-
__decorate([
|
|
63
|
+
tslib_1.__decorate([
|
|
73
64
|
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
|
|
74
65
|
nullable: true
|
|
75
66
|
}),
|
|
76
67
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
77
|
-
__metadata("design:type",
|
|
68
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
78
69
|
], CommonCode.prototype, "updater", void 0);
|
|
79
|
-
__decorate([
|
|
70
|
+
tslib_1.__decorate([
|
|
80
71
|
(0, typeorm_1.RelationId)((commonCode) => commonCode.creator),
|
|
81
|
-
__metadata("design:type", String)
|
|
72
|
+
tslib_1.__metadata("design:type", String)
|
|
82
73
|
], CommonCode.prototype, "updaterId", void 0);
|
|
83
|
-
CommonCode = __decorate([
|
|
74
|
+
CommonCode = tslib_1.__decorate([
|
|
84
75
|
(0, typeorm_1.Entity)(),
|
|
85
76
|
(0, typeorm_1.Index)('ix_common_code_0', (commonCode) => [commonCode.domain, commonCode.name], { unique: true }),
|
|
86
77
|
(0, typeorm_1.Index)('ix_common_code_1', (commonCode) => [commonCode.domain]),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common-code.js","sourceRoot":"","sources":["../../../server/service/common-code/common-code.ts"],"names":[],"mappings":"
|
|
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;IAFC,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;sCACC;AAInB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IACzB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACjB,cAAM;0CAAA;AAGf;IADC,IAAA,oBAAU,EAAC,CAAC,UAAsB,EAAE,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;;4CACzC;AAIjB;IAFC,IAAA,gBAAM,GAAE;IACR,IAAA,oBAAK,GAAE;;wCACI;AAMZ;IAJC,IAAA,gBAAM,EAAC;QACN,QAAQ,EAAE,IAAI;KACf,CAAC;IACD,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACN;AAGpB;IADC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,qCAAgB,EAAE,gBAAgB,CAAC,EAAE,CAAC,gBAAgB,CAAC,UAAU,CAAC;;2CAC1D;AAI3B;IAFC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACd,IAAI;6CAAA;AAIhB;IAFC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACd,IAAI;6CAAA;AAMhB;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;sCAChB,gBAAI;2CAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,UAAsB,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC;;6CACzC;AAMlB;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;sCAChB,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","sourcesContent":["import { Field, ID, ObjectType } from 'type-graphql'\nimport {\n Column,\n CreateDateColumn,\n Entity,\n Index,\n ManyToOne,\n OneToMany,\n PrimaryGeneratedColumn,\n RelationId,\n UpdateDateColumn\n} from 'typeorm'\n\nimport { User } from '@things-factory/auth-base'\nimport { Domain } from '@things-factory/shell'\n\nimport { CommonCodeDetail } from '../common-code-detail/common-code-detail'\n\n@Entity()\n@Index('ix_common_code_0', (commonCode: CommonCode) => [commonCode.domain, commonCode.name], { unique: true })\n@Index('ix_common_code_1', (commonCode: CommonCode) => [commonCode.domain])\n@ObjectType({ description: 'Entity for CommonCode' })\nexport class CommonCode {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field({ nullable: true })\n domain?: Domain\n\n @RelationId((commonCode: CommonCode) => commonCode.domain)\n domainId?: string\n\n @Column()\n @Field()\n name: string\n\n @Column({\n nullable: true\n })\n @Field({ nullable: true })\n description?: string\n\n @OneToMany(type => CommonCodeDetail, commonCodeDetail => commonCodeDetail.commonCode)\n details: CommonCodeDetail[]\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((commonCode: CommonCode) => commonCode.creator)\n creatorId?: string\n\n @ManyToOne(type => User, {\n nullable: true\n })\n @Field({ nullable: true })\n updater?: User\n\n @RelationId((commonCode: CommonCode) => commonCode.creator)\n updaterId?: string\n}\n"]}
|
|
@@ -1 +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"}
|
|
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","sourcesContent":["import { CommonCode } from './common-code'\nimport { CommonCodeQuery } from './common-code-query'\nimport { CommonCodeMutation } from './common-code-mutation'\n\nexport const entities = [CommonCode]\nexport const resolvers = [CommonCodeQuery, CommonCodeMutation]\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.CommonCodeDetailMutation = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
16
5
|
const type_graphql_1 = require("type-graphql");
|
|
17
6
|
const typeorm_1 = require("typeorm");
|
|
18
7
|
const common_code_1 = require("../common-code/common-code");
|
|
@@ -22,7 +11,7 @@ let CommonCodeDetailMutation = class CommonCodeDetailMutation {
|
|
|
22
11
|
async createCommonCodeDetail(commonCodeDetail, context) {
|
|
23
12
|
const { domain, user, tx } = context.state;
|
|
24
13
|
if (commonCodeDetail && commonCodeDetail.commonCode.id) {
|
|
25
|
-
commonCodeDetail.commonCode = await tx.getRepository(common_code_1.CommonCode).
|
|
14
|
+
commonCodeDetail.commonCode = await tx.getRepository(common_code_1.CommonCode).findOneBy({ id: commonCodeDetail.commonCode.id });
|
|
26
15
|
}
|
|
27
16
|
return await tx.getRepository(common_code_detail_1.CommonCodeDetail).save(Object.assign(Object.assign({}, commonCodeDetail), { domain, creator: user, updater: user }));
|
|
28
17
|
}
|
|
@@ -30,10 +19,10 @@ let CommonCodeDetailMutation = class CommonCodeDetailMutation {
|
|
|
30
19
|
const { domain, user, tx } = context.state;
|
|
31
20
|
const repository = tx.getRepository(common_code_detail_1.CommonCodeDetail);
|
|
32
21
|
const commonCodeDetail = await repository.findOne({
|
|
33
|
-
where: { domain, id }
|
|
22
|
+
where: { domain: { id: domain.id }, id }
|
|
34
23
|
});
|
|
35
24
|
if (patch.commonCode && patch.commonCode.id) {
|
|
36
|
-
patch.commonCode = await tx.getRepository(common_code_1.CommonCode).
|
|
25
|
+
patch.commonCode = await tx.getRepository(common_code_1.CommonCode).findOneBy({ id: patch.commonCode.id });
|
|
37
26
|
}
|
|
38
27
|
return await repository.save(Object.assign(Object.assign(Object.assign({}, commonCodeDetail), patch), { updater: user }));
|
|
39
28
|
}
|
|
@@ -48,7 +37,7 @@ let CommonCodeDetailMutation = class CommonCodeDetailMutation {
|
|
|
48
37
|
for (let i = 0; i < _createRecords.length; i++) {
|
|
49
38
|
const newRecord = _createRecords[i];
|
|
50
39
|
if (newRecord.commonCode && newRecord.commonCode.id) {
|
|
51
|
-
newRecord.commonCode = await commonCodeRepo.
|
|
40
|
+
newRecord.commonCode = await commonCodeRepo.findOneBy({ id: newRecord.commonCode.id });
|
|
52
41
|
}
|
|
53
42
|
const result = await commonCodeDetailRepo.save(Object.assign(Object.assign({}, newRecord), { domain, creator: user, updater: user }));
|
|
54
43
|
results.push(Object.assign(Object.assign({}, result), { cuFlag: '+' }));
|
|
@@ -57,9 +46,9 @@ let CommonCodeDetailMutation = class CommonCodeDetailMutation {
|
|
|
57
46
|
if (_updateRecords.length > 0) {
|
|
58
47
|
for (let i = 0; i < _updateRecords.length; i++) {
|
|
59
48
|
const newRecord = _updateRecords[i];
|
|
60
|
-
const commonCodeDetail = await commonCodeDetailRepo.
|
|
49
|
+
const commonCodeDetail = await commonCodeDetailRepo.findOneBy({ id: newRecord.id });
|
|
61
50
|
if (newRecord.commonCode && newRecord.commonCode.id) {
|
|
62
|
-
newRecord.commonCode = await commonCodeRepo.
|
|
51
|
+
newRecord.commonCode = await commonCodeRepo.findOneBy({ id: newRecord.commonCode.id });
|
|
63
52
|
}
|
|
64
53
|
const result = await commonCodeDetailRepo.save(Object.assign(Object.assign(Object.assign({}, commonCodeDetail), newRecord), { updater: user }));
|
|
65
54
|
results.push(Object.assign(Object.assign({}, result), { cuFlag: 'M' }));
|
|
@@ -69,13 +58,13 @@ let CommonCodeDetailMutation = class CommonCodeDetailMutation {
|
|
|
69
58
|
}
|
|
70
59
|
async deleteCommonCodeDetail(id, context) {
|
|
71
60
|
const { domain, tx } = context.state;
|
|
72
|
-
await tx.getRepository(common_code_detail_1.CommonCodeDetail).delete({ domain, id });
|
|
61
|
+
await tx.getRepository(common_code_detail_1.CommonCodeDetail).delete({ domain: { id: domain.id }, id });
|
|
73
62
|
return true;
|
|
74
63
|
}
|
|
75
64
|
async deleteCommonCodeDetails(ids, context) {
|
|
76
65
|
const { domain, tx } = context.state;
|
|
77
66
|
await tx.getRepository(common_code_detail_1.CommonCodeDetail).delete({
|
|
78
|
-
domain,
|
|
67
|
+
domain: { id: domain.id },
|
|
79
68
|
id: (0, typeorm_1.In)(ids)
|
|
80
69
|
});
|
|
81
70
|
return true;
|
|
@@ -90,62 +79,62 @@ let CommonCodeDetailMutation = class CommonCodeDetailMutation {
|
|
|
90
79
|
return true;
|
|
91
80
|
}
|
|
92
81
|
};
|
|
93
|
-
__decorate([
|
|
82
|
+
tslib_1.__decorate([
|
|
94
83
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
95
84
|
(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)
|
|
85
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('commonCodeDetail')),
|
|
86
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
87
|
+
tslib_1.__metadata("design:type", Function),
|
|
88
|
+
tslib_1.__metadata("design:paramtypes", [common_code_detail_type_1.NewCommonCodeDetail, Object]),
|
|
89
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
101
90
|
], CommonCodeDetailMutation.prototype, "createCommonCodeDetail", null);
|
|
102
|
-
__decorate([
|
|
91
|
+
tslib_1.__decorate([
|
|
103
92
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
104
93
|
(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)
|
|
94
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
95
|
+
tslib_1.__param(1, (0, type_graphql_1.Arg)('patch')),
|
|
96
|
+
tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
|
|
97
|
+
tslib_1.__metadata("design:type", Function),
|
|
98
|
+
tslib_1.__metadata("design:paramtypes", [String, common_code_detail_type_1.CommonCodeDetailPatch, Object]),
|
|
99
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
111
100
|
], CommonCodeDetailMutation.prototype, "updateCommonCodeDetail", null);
|
|
112
|
-
__decorate([
|
|
101
|
+
tslib_1.__decorate([
|
|
113
102
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
114
103
|
(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)
|
|
104
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('patches', type => [common_code_detail_type_1.CommonCodeDetailPatch])),
|
|
105
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
106
|
+
tslib_1.__metadata("design:type", Function),
|
|
107
|
+
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
108
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
120
109
|
], CommonCodeDetailMutation.prototype, "updateMultipleCommonCodeDetail", null);
|
|
121
|
-
__decorate([
|
|
110
|
+
tslib_1.__decorate([
|
|
122
111
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
123
112
|
(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)
|
|
113
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
114
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
115
|
+
tslib_1.__metadata("design:type", Function),
|
|
116
|
+
tslib_1.__metadata("design:paramtypes", [String, Object]),
|
|
117
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
129
118
|
], CommonCodeDetailMutation.prototype, "deleteCommonCodeDetail", null);
|
|
130
|
-
__decorate([
|
|
119
|
+
tslib_1.__decorate([
|
|
131
120
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
132
121
|
(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)
|
|
122
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
|
|
123
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
124
|
+
tslib_1.__metadata("design:type", Function),
|
|
125
|
+
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
126
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
138
127
|
], CommonCodeDetailMutation.prototype, "deleteCommonCodeDetails", null);
|
|
139
|
-
__decorate([
|
|
128
|
+
tslib_1.__decorate([
|
|
140
129
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
141
130
|
(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)
|
|
131
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('commonCodeDetails', type => [common_code_detail_type_1.CommonCodeDetailPatch])),
|
|
132
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
133
|
+
tslib_1.__metadata("design:type", Function),
|
|
134
|
+
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
135
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
147
136
|
], CommonCodeDetailMutation.prototype, "importCommonCodeDetails", null);
|
|
148
|
-
CommonCodeDetailMutation = __decorate([
|
|
137
|
+
CommonCodeDetailMutation = tslib_1.__decorate([
|
|
149
138
|
(0, type_graphql_1.Resolver)(common_code_detail_1.CommonCodeDetail)
|
|
150
139
|
], CommonCodeDetailMutation);
|
|
151
140
|
exports.CommonCodeDetailMutation = CommonCodeDetailMutation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common-code-detail-mutation.js","sourceRoot":"","sources":["../../../server/service/common-code-detail/common-code-detail-mutation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+CAAsE;AACtE,qCAA4B;AAE5B,4DAAuD;AACvD,6DAAuD;AACvD,uEAAsF;AAGtF,IAAa,wBAAwB,GAArC,MAAa,wBAAwB;IAGnC,KAAK,CAAC,sBAAsB,CACD,gBAAqC,EACvD,OAAY;QAEnB,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,IAAI,gBAAgB,IAAI,gBAAgB,CAAC,UAAU,CAAC,EAAE,EAAE;YACtD,gBAAgB,CAAC,UAAU,GAAG,MAAM,EAAE,CAAC,aAAa,CAAC,wBAAU,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAAC,UAAU,CAAC,EAAE,CAAC,CAAA;SACzG;QAED,OAAO,MAAM,EAAE,CAAC,aAAa,CAAC,qCAAgB,CAAC,CAAC,IAAI,iCAC/C,gBAAgB,KACnB,MAAM,EACN,OAAO,EAAE,IAAI,EACb,OAAO,EA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CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAAiB,WAAA,IAAA,kBAAG,GAAE,CAAA;;;;uEAShF;AAID;IAFC,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,sCAAsC,EAAE,CAAC;IAEnF,WAAA,IAAA,kBAAG,EAAC,mBAAmB,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,+CAAqB,CAAC,CAAC,CAAA;IACzD,WAAA,IAAA,kBAAG,GAAE,CAAA;;;;uEAaP;AA5IU,wBAAwB;IADpC,IAAA,uBAAQ,EAAC,qCAAgB,CAAC;GACd,wBAAwB,CA6IpC;AA7IY,4DAAwB"}
|
|
1
|
+
{"version":3,"file":"common-code-detail-mutation.js","sourceRoot":"","sources":["../../../server/service/common-code-detail/common-code-detail-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAE5B,4DAAuD;AACvD,6DAAuD;AACvD,uEAAsF;AAGtF,IAAa,wBAAwB,GAArC,MAAa,wBAAwB;IAGnC,KAAK,CAAC,sBAAsB,CACD,gBAAqC,EACvD,OAAwB;QAE/B,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,IAAI,gBAAgB,IAAI,gBAAgB,CAAC,UAAU,CAAC,EAAE,EAAE;YACtD,gBAAgB,CAAC,UAAU,GAAG,MAAM,EAAE,CAAC,aAAa,CAAC,wBAAU,CAAC,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,gBAAgB,CAAC,UAAU,CAAC,EAAE,EAAE,CAAC,CAAA;SACnH;QAED,OAAO,MAAM,EAAE,CAAC,aAAa,CAAC,qCAAgB,CAAC,CAAC,IAAI,iCAC/C,gBAAgB,KACnB,MAAM,EACN,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,IAAI,IACb,CAAA;IACJ,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AAE,CAAA;;;;sEAKzD;AAID;IAFC,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,sCAAsC,EAAE,CAAC;IAEnF,mBAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAC5B,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;uEAUP;AAID;IAFC,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,sCAAsC,EAAE,CAAC;IAEnF,mBAAA,IAAA,kBAAG,EAAC,mBAAmB,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,+CAAqB,CAAC,CAAC,CAAA;IACzD,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;uEAaP;AA/IU,wBAAwB;IADpC,IAAA,uBAAQ,EAAC,qCAAgB,CAAC;GACd,wBAAwB,CAgJpC;AAhJY,4DAAwB","sourcesContent":["import { Arg, Ctx, Directive, Mutation, Resolver } from 'type-graphql'\nimport { In } from 'typeorm'\n\nimport { CommonCode } from '../common-code/common-code'\nimport { CommonCodeDetail } from './common-code-detail'\nimport { CommonCodeDetailPatch, NewCommonCodeDetail } from './common-code-detail-type'\n\n@Resolver(CommonCodeDetail)\nexport class CommonCodeDetailMutation {\n @Directive('@transaction')\n @Mutation(returns => CommonCodeDetail, { description: 'To create new CommonCodeDetail' })\n async createCommonCodeDetail(\n @Arg('commonCodeDetail') commonCodeDetail: NewCommonCodeDetail,\n @Ctx() context: ResolverContext\n ): Promise<CommonCodeDetail> {\n const { domain, user, tx } = context.state\n\n if (commonCodeDetail && commonCodeDetail.commonCode.id) {\n commonCodeDetail.commonCode = await tx.getRepository(CommonCode).findOneBy({ id: commonCodeDetail.commonCode.id })\n }\n\n return await tx.getRepository(CommonCodeDetail).save({\n ...commonCodeDetail,\n domain,\n creator: user,\n updater: user\n })\n }\n\n @Directive('@transaction')\n @Mutation(returns => CommonCodeDetail, { description: 'To modify CommonCodeDetail information' })\n async updateCommonCodeDetail(\n @Arg('id') id: string,\n @Arg('patch') patch: CommonCodeDetailPatch,\n @Ctx() context: ResolverContext\n ): Promise<CommonCodeDetail> {\n const { domain, user, tx } = context.state\n\n const repository = tx.getRepository(CommonCodeDetail)\n const commonCodeDetail = await repository.findOne({\n where: { domain: { id: domain.id }, id }\n })\n\n if (patch.commonCode && patch.commonCode.id) {\n patch.commonCode = await tx.getRepository(CommonCode).findOneBy({ id: patch.commonCode.id })\n }\n\n return await repository.save({\n ...commonCodeDetail,\n ...patch,\n updater: user\n })\n }\n\n @Directive('@transaction')\n @Mutation(returns => [CommonCodeDetail], { description: \"To modify multiple CommonCodeDetails' information\" })\n async updateMultipleCommonCodeDetail(\n @Arg('patches', type => [CommonCodeDetailPatch]) patches: CommonCodeDetailPatch[],\n @Ctx() context: ResolverContext\n ): Promise<CommonCodeDetail[]> {\n const { domain, user, tx } = context.state\n\n let results = []\n const _createRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === '+')\n const _updateRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === 'M')\n const commonCodeRepo = tx.getRepository(CommonCode)\n const commonCodeDetailRepo = tx.getRepository(CommonCodeDetail)\n\n if (_createRecords.length > 0) {\n for (let i = 0; i < _createRecords.length; i++) {\n const newRecord = _createRecords[i]\n\n if (newRecord.commonCode && newRecord.commonCode.id) {\n newRecord.commonCode = await commonCodeRepo.findOneBy({ id: newRecord.commonCode.id })\n }\n\n const result = await commonCodeDetailRepo.save({\n ...newRecord,\n domain,\n creator: user,\n updater: user\n })\n\n results.push({ ...result, cuFlag: '+' })\n }\n }\n\n if (_updateRecords.length > 0) {\n for (let i = 0; i < _updateRecords.length; i++) {\n const newRecord = _updateRecords[i]\n const commonCodeDetail = await commonCodeDetailRepo.findOneBy({ id: newRecord.id })\n\n if (newRecord.commonCode && newRecord.commonCode.id) {\n newRecord.commonCode = await commonCodeRepo.findOneBy({ id: newRecord.commonCode.id })\n }\n\n const result = await commonCodeDetailRepo.save({\n ...commonCodeDetail,\n ...newRecord,\n updater: user\n })\n\n results.push({ ...result, cuFlag: 'M' })\n }\n }\n\n return results\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete CommonCodeDetail' })\n async deleteCommonCodeDetail(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(CommonCodeDetail).delete({ domain: { id: domain.id }, id })\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete multiple CommonCodeDetails' })\n async deleteCommonCodeDetails(\n @Arg('ids', type => [String]) ids: string[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(CommonCodeDetail).delete({\n domain: { id: domain.id },\n id: In(ids)\n })\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To import multiple CommonCodeDetails' })\n async importCommonCodeDetails(\n @Arg('commonCodeDetails', type => [CommonCodeDetailPatch]) commonCodeDetails: CommonCodeDetailPatch[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { domain, tx } = context.state\n\n await Promise.all(\n commonCodeDetails.map(async (commonCodeDetail: CommonCodeDetailPatch) => {\n const createdCommonCodeDetail: CommonCodeDetail = await tx\n .getRepository(CommonCodeDetail)\n .save({ domain, ...commonCodeDetail })\n })\n )\n\n return true\n }\n}\n"]}
|
|
@@ -1,21 +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
|
-
var _a;
|
|
15
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
3
|
exports.CommonCodeDetailQuery = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
17
5
|
const type_graphql_1 = require("type-graphql");
|
|
18
|
-
const typeorm_1 = require("typeorm");
|
|
19
6
|
const auth_base_1 = require("@things-factory/auth-base");
|
|
20
7
|
const shell_1 = require("@things-factory/shell");
|
|
21
8
|
const common_code_1 = require("../common-code/common-code");
|
|
@@ -24,8 +11,8 @@ const common_code_detail_type_1 = require("./common-code-detail-type");
|
|
|
24
11
|
let CommonCodeDetailQuery = class CommonCodeDetailQuery {
|
|
25
12
|
async commonCodeDetail(id, context) {
|
|
26
13
|
const { domain } = context.state;
|
|
27
|
-
return await (0,
|
|
28
|
-
where: { domain, id }
|
|
14
|
+
return await (0, shell_1.getRepository)(common_code_detail_1.CommonCodeDetail).findOne({
|
|
15
|
+
where: { domain: { id: domain.id }, id }
|
|
29
16
|
});
|
|
30
17
|
}
|
|
31
18
|
async commonCodeDetails(params, context) {
|
|
@@ -33,7 +20,7 @@ let CommonCodeDetailQuery = class CommonCodeDetailQuery {
|
|
|
33
20
|
const queryBuilder = (0, shell_1.getQueryBuilderFromListParams)({
|
|
34
21
|
domain,
|
|
35
22
|
params,
|
|
36
|
-
repository: await (0,
|
|
23
|
+
repository: await (0, shell_1.getRepository)(common_code_detail_1.CommonCodeDetail),
|
|
37
24
|
alias: 'ccd',
|
|
38
25
|
searchables: ['name', 'description']
|
|
39
26
|
});
|
|
@@ -41,62 +28,62 @@ let CommonCodeDetailQuery = class CommonCodeDetailQuery {
|
|
|
41
28
|
return { items, total };
|
|
42
29
|
}
|
|
43
30
|
async commonCode(commonCodeDetail) {
|
|
44
|
-
return await (0,
|
|
31
|
+
return await (0, shell_1.getRepository)(common_code_1.CommonCode).findOneBy({ id: commonCodeDetail.commonCodeId });
|
|
45
32
|
}
|
|
46
33
|
async domain(commonCodeDetail) {
|
|
47
|
-
return await (0,
|
|
34
|
+
return await (0, shell_1.getRepository)(shell_1.Domain).findOneBy({ id: commonCodeDetail.domainId });
|
|
48
35
|
}
|
|
49
36
|
async updater(commonCodeDetail) {
|
|
50
|
-
return await (0,
|
|
37
|
+
return await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: commonCodeDetail.updaterId });
|
|
51
38
|
}
|
|
52
39
|
async creator(commonCodeDetail) {
|
|
53
|
-
return await (0,
|
|
40
|
+
return await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: commonCodeDetail.creatorId });
|
|
54
41
|
}
|
|
55
42
|
};
|
|
56
|
-
__decorate([
|
|
43
|
+
tslib_1.__decorate([
|
|
57
44
|
(0, type_graphql_1.Query)(returns => common_code_detail_1.CommonCodeDetail, { description: 'To fetch a CommonCodeDetail' }),
|
|
58
|
-
__param(0, (0, type_graphql_1.Arg)('id')),
|
|
59
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
|
60
|
-
__metadata("design:type", Function),
|
|
61
|
-
__metadata("design:paramtypes", [String, Object]),
|
|
62
|
-
__metadata("design:returntype", Promise)
|
|
45
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
46
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
47
|
+
tslib_1.__metadata("design:type", Function),
|
|
48
|
+
tslib_1.__metadata("design:paramtypes", [String, Object]),
|
|
49
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
63
50
|
], CommonCodeDetailQuery.prototype, "commonCodeDetail", null);
|
|
64
|
-
__decorate([
|
|
51
|
+
tslib_1.__decorate([
|
|
65
52
|
(0, type_graphql_1.Query)(returns => common_code_detail_type_1.CommonCodeDetailList, { description: 'To fetch multiple CommonCodeDetails' }),
|
|
66
|
-
__param(0, (0, type_graphql_1.Args)()),
|
|
67
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
|
68
|
-
__metadata("design:type", Function),
|
|
69
|
-
__metadata("design:paramtypes", [
|
|
70
|
-
__metadata("design:returntype", Promise)
|
|
53
|
+
tslib_1.__param(0, (0, type_graphql_1.Args)()),
|
|
54
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
55
|
+
tslib_1.__metadata("design:type", Function),
|
|
56
|
+
tslib_1.__metadata("design:paramtypes", [shell_1.ListParam, Object]),
|
|
57
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
71
58
|
], CommonCodeDetailQuery.prototype, "commonCodeDetails", null);
|
|
72
|
-
__decorate([
|
|
59
|
+
tslib_1.__decorate([
|
|
73
60
|
(0, type_graphql_1.FieldResolver)(type => common_code_1.CommonCode),
|
|
74
|
-
__metadata("design:type", Function),
|
|
75
|
-
__metadata("design:paramtypes", [Object]),
|
|
76
|
-
__metadata("design:returntype", Promise)
|
|
61
|
+
tslib_1.__metadata("design:type", Function),
|
|
62
|
+
tslib_1.__metadata("design:paramtypes", [Object]),
|
|
63
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
77
64
|
], CommonCodeDetailQuery.prototype, "commonCode", null);
|
|
78
|
-
__decorate([
|
|
65
|
+
tslib_1.__decorate([
|
|
79
66
|
(0, type_graphql_1.FieldResolver)(type => shell_1.Domain),
|
|
80
|
-
__param(0, (0, type_graphql_1.Root)()),
|
|
81
|
-
__metadata("design:type", Function),
|
|
82
|
-
__metadata("design:paramtypes", [common_code_detail_1.CommonCodeDetail]),
|
|
83
|
-
__metadata("design:returntype", Promise)
|
|
67
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
68
|
+
tslib_1.__metadata("design:type", Function),
|
|
69
|
+
tslib_1.__metadata("design:paramtypes", [common_code_detail_1.CommonCodeDetail]),
|
|
70
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
84
71
|
], CommonCodeDetailQuery.prototype, "domain", null);
|
|
85
|
-
__decorate([
|
|
72
|
+
tslib_1.__decorate([
|
|
86
73
|
(0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
|
|
87
|
-
__param(0, (0, type_graphql_1.Root)()),
|
|
88
|
-
__metadata("design:type", Function),
|
|
89
|
-
__metadata("design:paramtypes", [common_code_detail_1.CommonCodeDetail]),
|
|
90
|
-
__metadata("design:returntype", Promise)
|
|
74
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
75
|
+
tslib_1.__metadata("design:type", Function),
|
|
76
|
+
tslib_1.__metadata("design:paramtypes", [common_code_detail_1.CommonCodeDetail]),
|
|
77
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
91
78
|
], CommonCodeDetailQuery.prototype, "updater", null);
|
|
92
|
-
__decorate([
|
|
79
|
+
tslib_1.__decorate([
|
|
93
80
|
(0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
|
|
94
|
-
__param(0, (0, type_graphql_1.Root)()),
|
|
95
|
-
__metadata("design:type", Function),
|
|
96
|
-
__metadata("design:paramtypes", [common_code_detail_1.CommonCodeDetail]),
|
|
97
|
-
__metadata("design:returntype", Promise)
|
|
81
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
82
|
+
tslib_1.__metadata("design:type", Function),
|
|
83
|
+
tslib_1.__metadata("design:paramtypes", [common_code_detail_1.CommonCodeDetail]),
|
|
84
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
98
85
|
], CommonCodeDetailQuery.prototype, "creator", null);
|
|
99
|
-
CommonCodeDetailQuery = __decorate([
|
|
86
|
+
CommonCodeDetailQuery = tslib_1.__decorate([
|
|
100
87
|
(0, type_graphql_1.Resolver)(common_code_detail_1.CommonCodeDetail)
|
|
101
88
|
], CommonCodeDetailQuery);
|
|
102
89
|
exports.CommonCodeDetailQuery = CommonCodeDetailQuery;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common-code-detail-query.js","sourceRoot":"","sources":["../../../server/service/common-code-detail/common-code-detail-query.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"common-code-detail-query.js","sourceRoot":"","sources":["../../../server/service/common-code-detail/common-code-detail-query.ts"],"names":[],"mappings":";;;;AAAA,+CAAmF;AAEnF,yDAAgD;AAChD,iDAAuG;AAEvG,4DAAuD;AACvD,6DAAuD;AACvD,uEAAgE;AAGhE,IAAa,qBAAqB,GAAlC,MAAa,qBAAqB;IAEhC,KAAK,CAAC,gBAAgB,CAAY,EAAU,EAAS,OAAwB;QAC3E,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,OAAO,MAAM,IAAA,qBAAa,EAAC,qCAAgB,CAAC,CAAC,OAAO,CAAC;YACnD,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;SACzC,CAAC,CAAA;IACJ,CAAC;IAGD,KAAK,CAAC,iBAAiB,CAAS,MAAiB,EAAS,OAAwB;QAChF,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,qBAAa,EAAC,qCAAgB,CAAC;YACjD,KAAK,EAAE,KAAK;YACZ,WAAW,EAAE,CAAC,MAAM,EAAE,aAAa,CAAC;SACrC,CAAC,CAAA;QAEF,MAAM,C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AAE,CAAA;;6CAAjB,iBAAS;;8DAchD;AAGD;IADC,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,wBAAU,CAAC;;;;uDAGjC;AAGD;IADC,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IAChB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAmB,qCAAgB;;mDAEtD;AAGD;IADC,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAmB,qCAAgB;;oDAEvD;AAGD;IADC,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAmB,qCAAgB;;oDAEvD;AA7CU,qBAAqB;IADjC,IAAA,uBAAQ,EAAC,qCAAgB,CAAC;GACd,qBAAqB,CA8CjC;AA9CY,sDAAqB","sourcesContent":["import { Arg, Args, Ctx, FieldResolver, Query, Resolver, Root } from 'type-graphql'\n\nimport { User } from '@things-factory/auth-base'\nimport { Domain, getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'\n\nimport { CommonCode } from '../common-code/common-code'\nimport { CommonCodeDetail } from './common-code-detail'\nimport { CommonCodeDetailList } from './common-code-detail-type'\n\n@Resolver(CommonCodeDetail)\nexport class CommonCodeDetailQuery {\n @Query(returns => CommonCodeDetail, { description: 'To fetch a CommonCodeDetail' })\n async commonCodeDetail(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<CommonCodeDetail> {\n const { domain } = context.state\n\n return await getRepository(CommonCodeDetail).findOne({\n where: { domain: { id: domain.id }, id }\n })\n }\n\n @Query(returns => CommonCodeDetailList, { description: 'To fetch multiple CommonCodeDetails' })\n async commonCodeDetails(@Args() params: ListParam, @Ctx() context: ResolverContext): Promise<CommonCodeDetailList> {\n const { domain } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n domain,\n params,\n repository: await getRepository(CommonCodeDetail),\n alias: 'ccd',\n searchables: ['name', 'description']\n })\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n\n @FieldResolver(type => CommonCode)\n async commonCode(commonCodeDetail): Promise<CommonCode> {\n return await getRepository(CommonCode).findOneBy({ id: commonCodeDetail.commonCodeId })\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() commonCodeDetail: CommonCodeDetail): Promise<Domain> {\n return await getRepository(Domain).findOneBy({ id: commonCodeDetail.domainId })\n }\n\n @FieldResolver(type => User)\n async updater(@Root() commonCodeDetail: CommonCodeDetail): Promise<User> {\n return await getRepository(User).findOneBy({ id: commonCodeDetail.updaterId })\n }\n\n @FieldResolver(type => User)\n async creator(@Root() commonCodeDetail: CommonCodeDetail): Promise<User> {\n return await getRepository(User).findOneBy({ id: commonCodeDetail.creatorId })\n }\n}\n"]}
|
|
@@ -1,82 +1,73 @@
|
|
|
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 _a, _b;
|
|
12
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
3
|
exports.CommonCodeDetailList = exports.CommonCodeDetailPatch = exports.NewCommonCodeDetail = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
14
5
|
const type_graphql_1 = require("type-graphql");
|
|
15
6
|
const shell_1 = require("@things-factory/shell");
|
|
16
7
|
const common_code_detail_1 = require("./common-code-detail");
|
|
17
8
|
let NewCommonCodeDetail = class NewCommonCodeDetail {
|
|
18
9
|
};
|
|
19
|
-
__decorate([
|
|
10
|
+
tslib_1.__decorate([
|
|
20
11
|
(0, type_graphql_1.Field)(),
|
|
21
|
-
__metadata("design:type", String)
|
|
12
|
+
tslib_1.__metadata("design:type", String)
|
|
22
13
|
], NewCommonCodeDetail.prototype, "name", void 0);
|
|
23
|
-
__decorate([
|
|
14
|
+
tslib_1.__decorate([
|
|
24
15
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
25
|
-
__metadata("design:type", String)
|
|
16
|
+
tslib_1.__metadata("design:type", String)
|
|
26
17
|
], NewCommonCodeDetail.prototype, "description", void 0);
|
|
27
|
-
__decorate([
|
|
18
|
+
tslib_1.__decorate([
|
|
28
19
|
(0, type_graphql_1.Field)(type => shell_1.ObjectRef),
|
|
29
|
-
__metadata("design:type",
|
|
20
|
+
tslib_1.__metadata("design:type", shell_1.ObjectRef)
|
|
30
21
|
], NewCommonCodeDetail.prototype, "commonCode", void 0);
|
|
31
|
-
__decorate([
|
|
22
|
+
tslib_1.__decorate([
|
|
32
23
|
(0, type_graphql_1.Field)(),
|
|
33
|
-
__metadata("design:type", Number)
|
|
24
|
+
tslib_1.__metadata("design:type", Number)
|
|
34
25
|
], NewCommonCodeDetail.prototype, "rank", void 0);
|
|
35
|
-
NewCommonCodeDetail = __decorate([
|
|
26
|
+
NewCommonCodeDetail = tslib_1.__decorate([
|
|
36
27
|
(0, type_graphql_1.InputType)()
|
|
37
28
|
], NewCommonCodeDetail);
|
|
38
29
|
exports.NewCommonCodeDetail = NewCommonCodeDetail;
|
|
39
30
|
let CommonCodeDetailPatch = class CommonCodeDetailPatch {
|
|
40
31
|
};
|
|
41
|
-
__decorate([
|
|
32
|
+
tslib_1.__decorate([
|
|
42
33
|
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
|
|
43
|
-
__metadata("design:type", String)
|
|
34
|
+
tslib_1.__metadata("design:type", String)
|
|
44
35
|
], CommonCodeDetailPatch.prototype, "id", void 0);
|
|
45
|
-
__decorate([
|
|
36
|
+
tslib_1.__decorate([
|
|
46
37
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
47
|
-
__metadata("design:type", String)
|
|
38
|
+
tslib_1.__metadata("design:type", String)
|
|
48
39
|
], CommonCodeDetailPatch.prototype, "name", void 0);
|
|
49
|
-
__decorate([
|
|
40
|
+
tslib_1.__decorate([
|
|
50
41
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
51
|
-
__metadata("design:type", String)
|
|
42
|
+
tslib_1.__metadata("design:type", String)
|
|
52
43
|
], CommonCodeDetailPatch.prototype, "description", void 0);
|
|
53
|
-
__decorate([
|
|
44
|
+
tslib_1.__decorate([
|
|
54
45
|
(0, type_graphql_1.Field)(type => shell_1.ObjectRef),
|
|
55
|
-
__metadata("design:type",
|
|
46
|
+
tslib_1.__metadata("design:type", shell_1.ObjectRef)
|
|
56
47
|
], CommonCodeDetailPatch.prototype, "commonCode", void 0);
|
|
57
|
-
__decorate([
|
|
48
|
+
tslib_1.__decorate([
|
|
58
49
|
(0, type_graphql_1.Field)(),
|
|
59
|
-
__metadata("design:type", Number)
|
|
50
|
+
tslib_1.__metadata("design:type", Number)
|
|
60
51
|
], CommonCodeDetailPatch.prototype, "rank", void 0);
|
|
61
|
-
__decorate([
|
|
52
|
+
tslib_1.__decorate([
|
|
62
53
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
63
|
-
__metadata("design:type", String)
|
|
54
|
+
tslib_1.__metadata("design:type", String)
|
|
64
55
|
], CommonCodeDetailPatch.prototype, "cuFlag", void 0);
|
|
65
|
-
CommonCodeDetailPatch = __decorate([
|
|
56
|
+
CommonCodeDetailPatch = tslib_1.__decorate([
|
|
66
57
|
(0, type_graphql_1.InputType)()
|
|
67
58
|
], CommonCodeDetailPatch);
|
|
68
59
|
exports.CommonCodeDetailPatch = CommonCodeDetailPatch;
|
|
69
60
|
let CommonCodeDetailList = class CommonCodeDetailList {
|
|
70
61
|
};
|
|
71
|
-
__decorate([
|
|
62
|
+
tslib_1.__decorate([
|
|
72
63
|
(0, type_graphql_1.Field)(type => [common_code_detail_1.CommonCodeDetail]),
|
|
73
|
-
__metadata("design:type", Array)
|
|
64
|
+
tslib_1.__metadata("design:type", Array)
|
|
74
65
|
], CommonCodeDetailList.prototype, "items", void 0);
|
|
75
|
-
__decorate([
|
|
66
|
+
tslib_1.__decorate([
|
|
76
67
|
(0, type_graphql_1.Field)(type => type_graphql_1.Int),
|
|
77
|
-
__metadata("design:type", Number)
|
|
68
|
+
tslib_1.__metadata("design:type", Number)
|
|
78
69
|
], CommonCodeDetailList.prototype, "total", void 0);
|
|
79
|
-
CommonCodeDetailList = __decorate([
|
|
70
|
+
CommonCodeDetailList = tslib_1.__decorate([
|
|
80
71
|
(0, type_graphql_1.ObjectType)()
|
|
81
72
|
], CommonCodeDetailList);
|
|
82
73
|
exports.CommonCodeDetailList = CommonCodeDetailList;
|