@things-factory/biz-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.
Files changed (79) hide show
  1. package/dist-server/index.js +4 -17
  2. package/dist-server/index.js.map +1 -1
  3. package/dist-server/middlewares/index.js.map +1 -1
  4. package/dist-server/migrations/index.js.map +1 -1
  5. package/dist-server/service/biz-option/biz-option-mutation.js +38 -45
  6. package/dist-server/service/biz-option/biz-option-mutation.js.map +1 -1
  7. package/dist-server/service/biz-option/biz-option-query.js +17 -30
  8. package/dist-server/service/biz-option/biz-option-query.js.map +1 -1
  9. package/dist-server/service/biz-option/biz-option-types.js +24 -33
  10. package/dist-server/service/biz-option/biz-option-types.js.map +1 -1
  11. package/dist-server/service/biz-option/biz-option.js +22 -31
  12. package/dist-server/service/biz-option/biz-option.js.map +1 -1
  13. package/dist-server/service/biz-option/index.js.map +1 -1
  14. package/dist-server/service/biz-option-detail/biz-option-detail-mutation.js +34 -44
  15. package/dist-server/service/biz-option-detail/biz-option-detail-mutation.js.map +1 -1
  16. package/dist-server/service/biz-option-detail/biz-option-detail-query.js +16 -29
  17. package/dist-server/service/biz-option-detail/biz-option-detail-query.js.map +1 -1
  18. package/dist-server/service/biz-option-detail/biz-option-detail-types.js +20 -29
  19. package/dist-server/service/biz-option-detail/biz-option-detail-types.js.map +1 -1
  20. package/dist-server/service/biz-option-detail/biz-option-detail.js +20 -29
  21. package/dist-server/service/biz-option-detail/biz-option-detail.js.map +1 -1
  22. package/dist-server/service/biz-option-detail/index.js.map +1 -1
  23. package/dist-server/service/bizplace/bizplace-mutation.js +53 -65
  24. package/dist-server/service/bizplace/bizplace-mutation.js.map +1 -1
  25. package/dist-server/service/bizplace/bizplace-query.js +79 -88
  26. package/dist-server/service/bizplace/bizplace-query.js.map +1 -1
  27. package/dist-server/service/bizplace/bizplace-types.js +53 -62
  28. package/dist-server/service/bizplace/bizplace-types.js.map +1 -1
  29. package/dist-server/service/bizplace/bizplace.js +33 -42
  30. package/dist-server/service/bizplace/bizplace.js.map +1 -1
  31. package/dist-server/service/bizplace/index.js.map +1 -1
  32. package/dist-server/service/company/company-mutation.js +40 -51
  33. package/dist-server/service/company/company-mutation.js.map +1 -1
  34. package/dist-server/service/company/company-query.js +28 -44
  35. package/dist-server/service/company/company-query.js.map +1 -1
  36. package/dist-server/service/company/company-types.js +42 -50
  37. package/dist-server/service/company/company-types.js.map +1 -1
  38. package/dist-server/service/company/company.js +38 -47
  39. package/dist-server/service/company/company.js.map +1 -1
  40. package/dist-server/service/company/index.js.map +1 -1
  41. package/dist-server/service/contact-point/contact-point-mutation.js +45 -56
  42. package/dist-server/service/contact-point/contact-point-mutation.js.map +1 -1
  43. package/dist-server/service/contact-point/contact-point-query.js +17 -30
  44. package/dist-server/service/contact-point/contact-point-query.js.map +1 -1
  45. package/dist-server/service/contact-point/contact-point-types.js +80 -89
  46. package/dist-server/service/contact-point/contact-point-types.js.map +1 -1
  47. package/dist-server/service/contact-point/contact-point.js +48 -57
  48. package/dist-server/service/contact-point/contact-point.js.map +1 -1
  49. package/dist-server/service/contact-point/index.js.map +1 -1
  50. package/dist-server/service/index.js +13 -26
  51. package/dist-server/service/index.js.map +1 -1
  52. package/dist-server/service/worker/index.js.map +1 -1
  53. package/dist-server/service/worker/worker-mutation.js +40 -50
  54. package/dist-server/service/worker/worker-mutation.js.map +1 -1
  55. package/dist-server/service/worker/worker-query.js +16 -28
  56. package/dist-server/service/worker/worker-query.js.map +1 -1
  57. package/dist-server/service/worker/worker-types.js +28 -37
  58. package/dist-server/service/worker/worker-types.js.map +1 -1
  59. package/dist-server/service/worker/worker.js +22 -31
  60. package/dist-server/service/worker/worker.js.map +1 -1
  61. package/dist-server/tsconfig.tsbuildinfo +1 -0
  62. package/dist-server/utils/get-permitted-bizplaces.js +30 -24
  63. package/dist-server/utils/get-permitted-bizplaces.js.map +1 -1
  64. package/dist-server/utils/index.js +2 -15
  65. package/dist-server/utils/index.js.map +1 -1
  66. package/package.json +3 -3
  67. package/server/service/biz-option/biz-option-mutation.ts +26 -12
  68. package/server/service/biz-option/biz-option-query.ts +4 -5
  69. package/server/service/biz-option-detail/biz-option-detail-mutation.ts +13 -8
  70. package/server/service/biz-option-detail/biz-option-detail-query.ts +3 -4
  71. package/server/service/bizplace/bizplace-mutation.ts +11 -12
  72. package/server/service/bizplace/bizplace-query.ts +44 -37
  73. package/server/service/company/company-mutation.ts +15 -9
  74. package/server/service/company/company-query.ts +9 -14
  75. package/server/service/contact-point/contact-point-mutation.ts +18 -16
  76. package/server/service/contact-point/contact-point-query.ts +4 -5
  77. package/server/service/worker/worker-mutation.ts +10 -10
  78. package/server/service/worker/worker-query.ts +4 -4
  79. package/server/utils/get-permitted-bizplaces.ts +15 -9
@@ -1,20 +1,7 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
2
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./service"), exports);
18
- __exportStar(require("./migrations"), exports);
19
- __exportStar(require("./utils"), exports);
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./service"), exports);
5
+ tslib_1.__exportStar(require("./migrations"), exports);
6
+ tslib_1.__exportStar(require("./utils"), exports);
20
7
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../server/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAAyB;AACzB,+CAA4B;AAC5B,0CAAuB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../server/index.ts"],"names":[],"mappings":";;;AAAA,oDAAyB;AACzB,uDAA4B;AAC5B,kDAAuB","sourcesContent":["export * from './service'\nexport * from './migrations'\nexport * from './utils'\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/middlewares/index.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/middlewares/index.ts"],"names":[],"mappings":"","sourcesContent":[""]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/migrations/index.ts"],"names":[],"mappings":";;;AAAA,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;AAC5B,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;AAEjB,QAAA,UAAU,GAAG,EAAE,CAAA;AAE1B,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,UAAS,IAAI;IACzE,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QAAE,OAAM;IAC3C,kBAAU,GAAG,kBAAU,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAA;AAClF,CAAC,CAAC,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/migrations/index.ts"],"names":[],"mappings":";;;AAAA,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;AAC5B,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;AAEjB,QAAA,UAAU,GAAG,EAAE,CAAA;AAE1B,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,UAAS,IAAI;IACzE,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QAAE,OAAM;IAC3C,kBAAU,GAAG,kBAAU,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAA;AAClF,CAAC,CAAC,CAAA","sourcesContent":["const glob = require('glob')\nconst path = require('path')\n\nexport var migrations = []\n\nglob.sync(path.resolve(__dirname, '.', '**', '*.js')).forEach(function(file) {\n if (file.indexOf('index.js') !== -1) return\n migrations = migrations.concat(Object.values(require(path.resolve(file))) || [])\n})\n"]}
@@ -1,79 +1,72 @@
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.BizOptionMutation = void 0;
4
+ const tslib_1 = require("tslib");
16
5
  const type_graphql_1 = require("type-graphql");
17
6
  const typeorm_1 = require("typeorm");
7
+ const shell_1 = require("@things-factory/shell");
18
8
  const biz_option_1 = require("./biz-option");
19
9
  const biz_option_types_1 = require("./biz-option-types");
20
10
  let BizOptionMutation = class BizOptionMutation {
21
11
  async createBizOption(bizOption, context) {
22
- return await (0, typeorm_1.getRepository)(biz_option_1.BizOption).save(Object.assign(Object.assign({}, bizOption), { domain: context.state.domain, creator: context.state.user, updater: context.state.user }));
12
+ const { domain, user } = context.state;
13
+ return await (0, shell_1.getRepository)(biz_option_1.BizOption).save(Object.assign(Object.assign({}, bizOption), { domain: domain, creator: user, updater: user }));
23
14
  }
24
15
  async updateBizOption(name, patch, context) {
25
- const repository = (0, typeorm_1.getRepository)(biz_option_1.BizOption);
16
+ const { domain, user } = context.state;
17
+ const repository = (0, shell_1.getRepository)(biz_option_1.BizOption);
26
18
  const bizOption = await repository.findOne({
27
- where: { domain: context.state.domain, name }
19
+ where: { domain: { id: domain.id }, name }
28
20
  });
29
- return await repository.save(Object.assign(Object.assign(Object.assign({}, bizOption), patch), { updater: context.state.user }));
21
+ return await repository.save(Object.assign(Object.assign(Object.assign({}, bizOption), patch), { updater: user }));
30
22
  }
31
23
  async deleteBizOption(name, context) {
32
- await (0, typeorm_1.getRepository)(biz_option_1.BizOption).delete({ domain: context.state.domain, name });
24
+ const { domain } = context.state;
25
+ await (0, shell_1.getRepository)(biz_option_1.BizOption).delete({ domain: { id: domain.id }, name });
33
26
  return true;
34
27
  }
35
28
  async deleteBizOptions(names, context) {
36
- await (0, typeorm_1.getRepository)(biz_option_1.BizOption).delete({
37
- domain: context.state.domain,
29
+ await (0, shell_1.getRepository)(biz_option_1.BizOption).delete({
30
+ domain: { id: context.state.domain.id },
38
31
  name: (0, typeorm_1.In)(names)
39
32
  });
40
33
  return true;
41
34
  }
42
35
  };
43
- __decorate([
36
+ tslib_1.__decorate([
44
37
  (0, type_graphql_1.Mutation)(returns => biz_option_1.BizOption),
45
- __param(0, (0, type_graphql_1.Arg)('bizOption')),
46
- __param(1, (0, type_graphql_1.Ctx)()),
47
- __metadata("design:type", Function),
48
- __metadata("design:paramtypes", [biz_option_types_1.NewBizOption, Object]),
49
- __metadata("design:returntype", Promise)
38
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('bizOption')),
39
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
40
+ tslib_1.__metadata("design:type", Function),
41
+ tslib_1.__metadata("design:paramtypes", [biz_option_types_1.NewBizOption, Object]),
42
+ tslib_1.__metadata("design:returntype", Promise)
50
43
  ], BizOptionMutation.prototype, "createBizOption", null);
51
- __decorate([
44
+ tslib_1.__decorate([
52
45
  (0, type_graphql_1.Mutation)(returns => biz_option_1.BizOption),
53
- __param(0, (0, type_graphql_1.Arg)('name')),
54
- __param(1, (0, type_graphql_1.Arg)('patch')),
55
- __param(2, (0, type_graphql_1.Ctx)()),
56
- __metadata("design:type", Function),
57
- __metadata("design:paramtypes", [String, biz_option_types_1.BizOptionPatch, Object]),
58
- __metadata("design:returntype", Promise)
46
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('name')),
47
+ tslib_1.__param(1, (0, type_graphql_1.Arg)('patch')),
48
+ tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
49
+ tslib_1.__metadata("design:type", Function),
50
+ tslib_1.__metadata("design:paramtypes", [String, biz_option_types_1.BizOptionPatch, Object]),
51
+ tslib_1.__metadata("design:returntype", Promise)
59
52
  ], BizOptionMutation.prototype, "updateBizOption", null);
60
- __decorate([
53
+ tslib_1.__decorate([
61
54
  (0, type_graphql_1.Mutation)(returns => Boolean),
62
- __param(0, (0, type_graphql_1.Arg)('name')),
63
- __param(1, (0, type_graphql_1.Ctx)()),
64
- __metadata("design:type", Function),
65
- __metadata("design:paramtypes", [String, Object]),
66
- __metadata("design:returntype", Promise)
55
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('name')),
56
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
57
+ tslib_1.__metadata("design:type", Function),
58
+ tslib_1.__metadata("design:paramtypes", [String, Object]),
59
+ tslib_1.__metadata("design:returntype", Promise)
67
60
  ], BizOptionMutation.prototype, "deleteBizOption", null);
68
- __decorate([
61
+ tslib_1.__decorate([
69
62
  (0, type_graphql_1.Mutation)(returns => Boolean),
70
- __param(0, (0, type_graphql_1.Arg)('names', type => [String])),
71
- __param(1, (0, type_graphql_1.Ctx)()),
72
- __metadata("design:type", Function),
73
- __metadata("design:paramtypes", [Array, Object]),
74
- __metadata("design:returntype", Promise)
63
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('names', type => [String])),
64
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
65
+ tslib_1.__metadata("design:type", Function),
66
+ tslib_1.__metadata("design:paramtypes", [Array, Object]),
67
+ tslib_1.__metadata("design:returntype", Promise)
75
68
  ], BizOptionMutation.prototype, "deleteBizOptions", null);
76
- BizOptionMutation = __decorate([
69
+ BizOptionMutation = tslib_1.__decorate([
77
70
  (0, type_graphql_1.Resolver)(biz_option_1.BizOption)
78
71
  ], BizOptionMutation);
79
72
  exports.BizOptionMutation = BizOptionMutation;
@@ -1 +1 @@
1
- {"version":3,"file":"biz-option-mutation.js","sourceRoot":"","sources":["../../../server/service/biz-option/biz-option-mutation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+CAA2D;AAC3D,qCAA2C;AAE3C,6CAAwC;AACxC,yDAAiE;AAGjE,IAAa,iBAAiB,GAA9B,MAAa,iBAAiB;IAE5B,KAAK,CAAC,eAAe,CAAmB,SAAuB,EAAS,OAAY;QAClF,OAAO,MAAM,IAAA,uBAAa,EAAC,sBAAS,CAAC,CAAC,IAAI,iCACrC,SAAS,KACZ,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,MAAM,EAC5B,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,IAAI,EAC3B,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,IAAI,IAC3B,CAAA;IACJ,CAAC;IAGD,KAAK,CAAC,e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AG,EAAC,OAAO,CAAC,CAAA;IACZ,mBAAA,IAAA,kBAAG,GAAE,CAAA;;qDADe,iCAAc;;wDAepC;AAGD;IADC,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC;IACN,mBAAA,IAAA,kBAAG,EAAC,MAAM,CAAC,CAAA;IAAgB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;wDAKtD;AAGD;IADC,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC;IAE1B,mBAAA,IAAA,kBAAG,EAAC,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAC9B,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;yDAOP;AAtDU,iBAAiB;IAD7B,IAAA,uBAAQ,EAAC,sBAAS,CAAC;GACP,iBAAiB,CAuD7B;AAvDY,8CAAiB","sourcesContent":["import { Arg, Ctx, Mutation, Resolver } from 'type-graphql'\nimport { In } from 'typeorm'\n\nimport { getRepository } from '@things-factory/shell'\n\nimport { BizOption } from './biz-option'\nimport { BizOptionPatch, NewBizOption } from './biz-option-types'\n\n@Resolver(BizOption)\nexport class BizOptionMutation {\n @Mutation(returns => BizOption)\n async createBizOption(\n @Arg('bizOption') bizOption: NewBizOption,\n @Ctx() context: ResolverContext\n ): Promise<BizOption> {\n const { domain, user } = context.state\n\n return await getRepository(BizOption).save({\n ...bizOption,\n domain: domain,\n creator: user,\n updater: user\n })\n }\n\n @Mutation(returns => BizOption)\n async updateBizOption(\n @Arg('name') name: string,\n @Arg('patch') patch: BizOptionPatch,\n @Ctx() context: ResolverContext\n ): Promise<BizOption> {\n const { domain, user } = context.state\n\n const repository = getRepository(BizOption)\n const bizOption = await repository.findOne({\n where: { domain: { id: domain.id }, name }\n })\n\n return await repository.save({\n ...bizOption,\n ...patch,\n updater: user\n })\n }\n\n @Mutation(returns => Boolean)\n async deleteBizOption(@Arg('name') name: string, @Ctx() context: ResolverContext): Promise<Boolean> {\n const { domain } = context.state\n\n await getRepository(BizOption).delete({ domain: { id: domain.id }, name })\n return true\n }\n\n @Mutation(returns => Boolean)\n async deleteBizOptions(\n @Arg('names', type => [String]) names: string[],\n @Ctx() context: ResolverContext\n ): Promise<Boolean> {\n await getRepository(BizOption).delete({\n domain: { id: context.state.domain.id },\n name: In(names)\n })\n return true\n }\n}\n"]}
@@ -1,54 +1,41 @@
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.BizOptionQuery = 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 shell_1 = require("@things-factory/shell");
20
7
  const biz_option_1 = require("./biz-option");
21
8
  const biz_option_types_1 = require("./biz-option-types");
22
9
  let BizOptionQuery = class BizOptionQuery {
23
10
  async bizOption(name, context) {
24
- return await (0, typeorm_1.getRepository)(biz_option_1.BizOption).findOne({
25
- where: { domain: context.state.domain, name },
11
+ return await (0, shell_1.getRepository)(biz_option_1.BizOption).findOne({
12
+ where: { domain: { id: context.state.domain.id }, name },
26
13
  relations: ['domain', 'bizplace', 'bizOptionDetails', 'creator', 'updater']
27
14
  });
28
15
  }
29
16
  async bizOptions(params, context) {
30
17
  const convertedParams = (0, shell_1.convertListParams)(params);
31
- const [items, total] = await (0, typeorm_1.getRepository)(biz_option_1.BizOption).findAndCount(Object.assign(Object.assign({}, convertedParams), { relations: ['domain', 'bizplace', 'bizOptionDetails', 'creator', 'updater'] }));
18
+ const [items, total] = await (0, shell_1.getRepository)(biz_option_1.BizOption).findAndCount(Object.assign(Object.assign({}, convertedParams), { relations: ['domain', 'bizplace', 'bizOptionDetails', 'creator', 'updater'] }));
32
19
  return { items, total };
33
20
  }
34
21
  };
35
- __decorate([
22
+ tslib_1.__decorate([
36
23
  (0, type_graphql_1.Query)(returns => biz_option_1.BizOption),
37
- __param(0, (0, type_graphql_1.Arg)('name')),
38
- __param(1, (0, type_graphql_1.Ctx)()),
39
- __metadata("design:type", Function),
40
- __metadata("design:paramtypes", [String, Object]),
41
- __metadata("design:returntype", Promise)
24
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('name')),
25
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
26
+ tslib_1.__metadata("design:type", Function),
27
+ tslib_1.__metadata("design:paramtypes", [String, Object]),
28
+ tslib_1.__metadata("design:returntype", Promise)
42
29
  ], BizOptionQuery.prototype, "bizOption", null);
43
- __decorate([
30
+ tslib_1.__decorate([
44
31
  (0, type_graphql_1.Query)(returns => biz_option_types_1.BizOptionList),
45
- __param(0, (0, type_graphql_1.Args)()),
46
- __param(1, (0, type_graphql_1.Ctx)()),
47
- __metadata("design:type", Function),
48
- __metadata("design:paramtypes", [typeof (_a = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _a : Object, Object]),
49
- __metadata("design:returntype", Promise)
32
+ tslib_1.__param(0, (0, type_graphql_1.Args)()),
33
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
34
+ tslib_1.__metadata("design:type", Function),
35
+ tslib_1.__metadata("design:paramtypes", [shell_1.ListParam, Object]),
36
+ tslib_1.__metadata("design:returntype", Promise)
50
37
  ], BizOptionQuery.prototype, "bizOptions", null);
51
- BizOptionQuery = __decorate([
38
+ BizOptionQuery = tslib_1.__decorate([
52
39
  (0, type_graphql_1.Resolver)(biz_option_1.BizOption)
53
40
  ], BizOptionQuery);
54
41
  exports.BizOptionQuery = BizOptionQuery;
@@ -1 +1 @@
1
- {"version":3,"file":"biz-option-query.js","sourceRoot":"","sources":["../../../server/service/biz-option/biz-option-query.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA8D;AAC9D,qCAAuC;AAEvC,iDAAoE;AAEpE,6CAAwC;AACxC,yDAAkD;AAGlD,IAAa,cAAc,GAA3B,MAAa,cAAc;IAEzB,KAAK,CAAC,SAAS,CAAc,IAAY,EAAS,OAAY;QAC5D,OAAO,MAAM,IAAA,uBAAa,EAAC,sBAAS,CAAC,CAAC,OAAO,CAAC;YAC5C,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,EAAE;YAC7C,SAAS,EAAE,CAAC,QAAQ,EAAE,UAAU,EAAE,kBAAkB,EAAE,SAAS,EAAE,SAAS,CAAC;SAC5E,CAAC,CAAA;IACJ,CAAC;IAGD,KAAK,CAAC,UAAU,CAAS,MAAiB,EAAS,OAAY;QAC7D,MAAM,eAAe,GAAG,IAAA,yBAAiB,EAAC,MAAM,CAAC,CAAA;QACjD,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,IAAA,uBAAa,EAAC,sBAAS,CAAC,CAAC,YAAY,iCAC7D,eAAe,KAClB,SAAS,EAAE,CAAC,QAAQ,EAAE,UAAU,EAAE,kBAAkB,EAAE,SAAS,EAAE,SAAS,CAAC,IAC3E,CAAA;QACF,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;IACzB,CAAC;CACF,CAAA;AAhBC;IADC,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,sBAAS,CAAC;IAC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C3E,CAAA;QACF,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;IACzB,CAAC;CACF,CAAA;AAhBC;IADC,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,sBAAS,CAAC;IACX,mBAAA,IAAA,kBAAG,EAAC,MAAM,CAAC,CAAA;IAAgB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;+CAKhD;AAGD;IADC,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,gCAAa,CAAC;IACd,mBAAA,IAAA,mBAAI,GAAE,CAAA;IAAqB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;6CAAjB,iBAAS;;gDAOzC;AAjBU,cAAc;IAD1B,IAAA,uBAAQ,EAAC,sBAAS,CAAC;GACP,cAAc,CAkB1B;AAlBY,wCAAc","sourcesContent":["import { Arg, Args, Ctx, Query, Resolver } from 'type-graphql'\n\nimport { convertListParams, getRepository, ListParam } from '@things-factory/shell'\n\nimport { BizOption } from './biz-option'\nimport { BizOptionList } from './biz-option-types'\n\n@Resolver(BizOption)\nexport class BizOptionQuery {\n @Query(returns => BizOption)\n async bizOption(@Arg('name') name: string, @Ctx() context: ResolverContext): Promise<BizOption> {\n return await getRepository(BizOption).findOne({\n where: { domain: { id: context.state.domain.id }, name },\n relations: ['domain', 'bizplace', 'bizOptionDetails', 'creator', 'updater']\n })\n }\n\n @Query(returns => BizOptionList)\n async bizOptions(@Args() params: ListParam, @Ctx() context: ResolverContext): Promise<BizOptionList> {\n const convertedParams = convertListParams(params)\n const [items, total] = await getRepository(BizOption).findAndCount({\n ...convertedParams,\n relations: ['domain', 'bizplace', 'bizOptionDetails', 'creator', 'updater']\n })\n return { items, total }\n }\n}\n"]}
@@ -1,74 +1,65 @@
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;
12
2
  Object.defineProperty(exports, "__esModule", { value: true });
13
3
  exports.NewBizOption = exports.BizOptionPatch = exports.BizOptionList = 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 biz_option_1 = require("./biz-option");
17
8
  let BizOptionList = class BizOptionList {
18
9
  };
19
- __decorate([
10
+ tslib_1.__decorate([
20
11
  (0, type_graphql_1.Field)(type => [biz_option_1.BizOption], { nullable: true }),
21
- __metadata("design:type", Array)
12
+ tslib_1.__metadata("design:type", Array)
22
13
  ], BizOptionList.prototype, "items", void 0);
23
- __decorate([
14
+ tslib_1.__decorate([
24
15
  (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
25
- __metadata("design:type", Number)
16
+ tslib_1.__metadata("design:type", Number)
26
17
  ], BizOptionList.prototype, "total", void 0);
27
- BizOptionList = __decorate([
18
+ BizOptionList = tslib_1.__decorate([
28
19
  (0, type_graphql_1.ObjectType)()
29
20
  ], BizOptionList);
30
21
  exports.BizOptionList = BizOptionList;
31
22
  let BizOptionPatch = class BizOptionPatch {
32
23
  };
33
- __decorate([
24
+ tslib_1.__decorate([
34
25
  (0, type_graphql_1.Field)({ nullable: true }),
35
- __metadata("design:type", String)
26
+ tslib_1.__metadata("design:type", String)
36
27
  ], BizOptionPatch.prototype, "id", void 0);
37
- __decorate([
28
+ tslib_1.__decorate([
38
29
  (0, type_graphql_1.Field)({ nullable: true }),
39
- __metadata("design:type", String)
30
+ tslib_1.__metadata("design:type", String)
40
31
  ], BizOptionPatch.prototype, "name", void 0);
41
- __decorate([
32
+ tslib_1.__decorate([
42
33
  (0, type_graphql_1.Field)({ nullable: true }),
43
- __metadata("design:type", String)
34
+ tslib_1.__metadata("design:type", String)
44
35
  ], BizOptionPatch.prototype, "description", void 0);
45
- __decorate([
36
+ tslib_1.__decorate([
46
37
  (0, type_graphql_1.Field)(type => shell_1.ObjectRef, { nullable: true }),
47
- __metadata("design:type", typeof (_a = typeof shell_1.ObjectRef !== "undefined" && shell_1.ObjectRef) === "function" ? _a : Object)
38
+ tslib_1.__metadata("design:type", shell_1.ObjectRef)
48
39
  ], BizOptionPatch.prototype, "bizplace", void 0);
49
- __decorate([
40
+ tslib_1.__decorate([
50
41
  (0, type_graphql_1.Field)(type => [shell_1.ObjectRef], { nullable: true }),
51
- __metadata("design:type", Array)
42
+ tslib_1.__metadata("design:type", Array)
52
43
  ], BizOptionPatch.prototype, "bizOptionDetails", void 0);
53
- __decorate([
44
+ tslib_1.__decorate([
54
45
  (0, type_graphql_1.Field)({ nullable: true }),
55
- __metadata("design:type", String)
46
+ tslib_1.__metadata("design:type", String)
56
47
  ], BizOptionPatch.prototype, "cuFlag", void 0);
57
- BizOptionPatch = __decorate([
48
+ BizOptionPatch = tslib_1.__decorate([
58
49
  (0, type_graphql_1.InputType)()
59
50
  ], BizOptionPatch);
60
51
  exports.BizOptionPatch = BizOptionPatch;
61
52
  let NewBizOption = class NewBizOption {
62
53
  };
63
- __decorate([
54
+ tslib_1.__decorate([
64
55
  (0, type_graphql_1.Field)(),
65
- __metadata("design:type", String)
56
+ tslib_1.__metadata("design:type", String)
66
57
  ], NewBizOption.prototype, "name", void 0);
67
- __decorate([
58
+ tslib_1.__decorate([
68
59
  (0, type_graphql_1.Field)({ nullable: true }),
69
- __metadata("design:type", String)
60
+ tslib_1.__metadata("design:type", String)
70
61
  ], NewBizOption.prototype, "description", void 0);
71
- NewBizOption = __decorate([
62
+ NewBizOption = tslib_1.__decorate([
72
63
  (0, type_graphql_1.InputType)()
73
64
  ], NewBizOption);
74
65
  exports.NewBizOption = NewBizOption;
@@ -1 +1 @@
1
- {"version":3,"file":"biz-option-types.js","sourceRoot":"","sources":["../../../server/service/biz-option/biz-option-types.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,+CAAgE;AAEhE,iDAAiD;AAEjD,6CAAwC;AAGxC,IAAa,aAAa,GAA1B,MAAa,aAAa;CAMzB,CAAA;AAJC;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,sBAAS,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CAC5B;AAGnB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACzB;AALH,aAAa;IADzB,IAAA,yBAAU,GAAE;GACA,aAAa,CAMzB;AANY,sCAAa;AAS1B,IAAa,cAAc,GAA3B,MAAa,cAAc;CAkB1B,CAAA;AAhBC;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0CACf;AAGX;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACb;AAGb;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDACN;AAGpB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;kDAClC,iBAAS,oBAAT,iBAAS;gDAAA;AAGpB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,iBAAS,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wDACjB;AAG9B;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CACX;AAjBJ,cA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,CAAC,EAAE,CAAC,CAAC,iBAAS,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wDACjB;AAG9B;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CACX;AAjBJ,cAAc;IAD1B,IAAA,wBAAS,GAAE;GACC,cAAc,CAkB1B;AAlBY,wCAAc;AAqB3B,IAAa,YAAY,GAAzB,MAAa,YAAY;CAMxB,CAAA;AAJC;IADC,IAAA,oBAAK,GAAE;;0CACI;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDACN;AALT,YAAY;IADxB,IAAA,wBAAS,GAAE;GACC,YAAY,CAMxB;AANY,oCAAY","sourcesContent":["import { Field, InputType, Int, ObjectType } from 'type-graphql'\n\nimport { ObjectRef } from '@things-factory/shell'\n\nimport { BizOption } from './biz-option'\n\n@ObjectType()\nexport class BizOptionList {\n @Field(type => [BizOption], { nullable: true })\n items?: BizOption[]\n\n @Field(type => Int, { nullable: true })\n total?: number\n}\n\n@InputType()\nexport class BizOptionPatch {\n @Field({ nullable: true })\n id?: string\n\n @Field({ nullable: true })\n name?: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field(type => ObjectRef, { nullable: true })\n bizplace?: ObjectRef\n\n @Field(type => [ObjectRef], { nullable: true })\n bizOptionDetails?: ObjectRef[]\n\n @Field({ nullable: true })\n cuFlag?: string\n}\n\n@InputType()\nexport class NewBizOption {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n}\n"]}
@@ -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.BizOption = 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");
@@ -19,65 +10,65 @@ const biz_option_detail_1 = require("../biz-option-detail/biz-option-detail");
19
10
  const bizplace_1 = require("../bizplace/bizplace");
20
11
  let BizOption = class BizOption {
21
12
  };
22
- __decorate([
13
+ tslib_1.__decorate([
23
14
  (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
24
15
  (0, type_graphql_1.Field)(type => type_graphql_1.ID),
25
- __metadata("design:type", String)
16
+ tslib_1.__metadata("design:type", String)
26
17
  ], BizOption.prototype, "id", void 0);
27
- __decorate([
18
+ tslib_1.__decorate([
28
19
  (0, typeorm_1.ManyToOne)(type => shell_1.Domain, { nullable: true }),
29
20
  (0, type_graphql_1.Field)({ nullable: true }),
30
- __metadata("design:type", typeof (_a = typeof shell_1.Domain !== "undefined" && shell_1.Domain) === "function" ? _a : Object)
21
+ tslib_1.__metadata("design:type", shell_1.Domain)
31
22
  ], BizOption.prototype, "domain", void 0);
32
- __decorate([
23
+ tslib_1.__decorate([
33
24
  (0, typeorm_1.Column)(),
34
25
  (0, type_graphql_1.Field)(),
35
- __metadata("design:type", String)
26
+ tslib_1.__metadata("design:type", String)
36
27
  ], BizOption.prototype, "name", void 0);
37
- __decorate([
28
+ tslib_1.__decorate([
38
29
  (0, typeorm_1.ManyToOne)(type => bizplace_1.Bizplace, {
39
30
  nullable: false
40
31
  }),
41
32
  (0, type_graphql_1.Field)(type => bizplace_1.Bizplace, { nullable: true }),
42
- __metadata("design:type", bizplace_1.Bizplace)
33
+ tslib_1.__metadata("design:type", bizplace_1.Bizplace)
43
34
  ], BizOption.prototype, "bizplace", void 0);
44
- __decorate([
35
+ tslib_1.__decorate([
45
36
  (0, typeorm_1.OneToMany)(type => biz_option_detail_1.BizOptionDetail, bizOptionDetail => bizOptionDetail.bizOption),
46
37
  (0, type_graphql_1.Field)(type => biz_option_detail_1.BizOptionDetail, { nullable: true }),
47
- __metadata("design:type", Array)
38
+ tslib_1.__metadata("design:type", Array)
48
39
  ], BizOption.prototype, "bizOptionDetails", void 0);
49
- __decorate([
40
+ tslib_1.__decorate([
50
41
  (0, typeorm_1.Column)({
51
42
  nullable: true
52
43
  }),
53
44
  (0, type_graphql_1.Field)({ nullable: true }),
54
- __metadata("design:type", String)
45
+ tslib_1.__metadata("design:type", String)
55
46
  ], BizOption.prototype, "description", void 0);
56
- __decorate([
47
+ tslib_1.__decorate([
57
48
  (0, typeorm_1.CreateDateColumn)(),
58
49
  (0, type_graphql_1.Field)({ nullable: true }),
59
- __metadata("design:type", Date)
50
+ tslib_1.__metadata("design:type", Date)
60
51
  ], BizOption.prototype, "createdAt", void 0);
61
- __decorate([
52
+ tslib_1.__decorate([
62
53
  (0, typeorm_1.UpdateDateColumn)(),
63
54
  (0, type_graphql_1.Field)({ nullable: true }),
64
- __metadata("design:type", Date)
55
+ tslib_1.__metadata("design:type", Date)
65
56
  ], BizOption.prototype, "updatedAt", void 0);
66
- __decorate([
57
+ tslib_1.__decorate([
67
58
  (0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
68
59
  nullable: true
69
60
  }),
70
61
  (0, type_graphql_1.Field)({ nullable: true }),
71
- __metadata("design:type", typeof (_b = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _b : Object)
62
+ tslib_1.__metadata("design:type", auth_base_1.User)
72
63
  ], BizOption.prototype, "creator", void 0);
73
- __decorate([
64
+ tslib_1.__decorate([
74
65
  (0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
75
66
  nullable: true
76
67
  }),
77
68
  (0, type_graphql_1.Field)({ nullable: true }),
78
- __metadata("design:type", typeof (_c = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _c : Object)
69
+ tslib_1.__metadata("design:type", auth_base_1.User)
79
70
  ], BizOption.prototype, "updater", void 0);
80
- BizOption = __decorate([
71
+ BizOption = tslib_1.__decorate([
81
72
  (0, typeorm_1.Entity)(),
82
73
  (0, typeorm_1.Index)('ix_biz-option_0', (bizOption) => [bizOption.bizplace, bizOption.name], { unique: true }),
83
74
  (0, type_graphql_1.ObjectType)()
@@ -1 +1 @@
1
- {"version":3,"file":"biz-option.js","sourceRoot":"","sources":["../../../server/service/biz-option/biz-option.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,+CAAoD;AACpD,qCASgB;AAEhB,yDAAgD;AAChD,iDAA8C;AAE9C,8EAAwE;AACxE,mDAA+C;AAK/C,IAAa,SAAS,GAAtB,MAAa,SAAS;CAgDrB,CAAA;AA7CC;IAFC,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;qCACR;AAIV;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC7C,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;kDAClB,cAAM,oBAAN,cAAM;yCAAA;AAId;IAFC,IAAA,gBAAM,GAAE;IACR,IAAA,oBAAK,GAAE;;uCACI;AAMZ;IAJC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,mBAAQ,EAAE;QAC3B,QAAQ,EAAE,KAAK;KAChB,CAAC;IACD,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,mBAAQ,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC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AC;;8CACP;AAInB;IAFC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACf,IAAI;4CAAA;AAIf;IAFC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACf,IAAI;4CAAA;AAMf;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;sCACjB,gBAAI;0CAAA;AAMb;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;sCACjB,gBAAI;0CAAA;AA/CF,SAAS;IAHrB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,iBAAiB,EAAE,CAAC,SAAoB,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAC1G,IAAA,yBAAU,GAAE;GACA,SAAS,CAgDrB;AAhDY,8BAAS","sourcesContent":["import { Field, ID, ObjectType } from 'type-graphql'\nimport {\n Column,\n CreateDateColumn,\n Entity,\n Index,\n ManyToOne,\n OneToMany,\n PrimaryGeneratedColumn,\n UpdateDateColumn\n} from 'typeorm'\n\nimport { User } from '@things-factory/auth-base'\nimport { Domain } from '@things-factory/shell'\n\nimport { BizOptionDetail } from '../biz-option-detail/biz-option-detail'\nimport { Bizplace } from '../bizplace/bizplace'\n\n@Entity()\n@Index('ix_biz-option_0', (bizOption: BizOption) => [bizOption.bizplace, bizOption.name], { unique: true })\n@ObjectType()\nexport class BizOption {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n id: string\n\n @ManyToOne(type => Domain, { nullable: true })\n @Field({ nullable: true })\n domain: Domain\n\n @Column()\n @Field()\n name: string\n\n @ManyToOne(type => Bizplace, {\n nullable: false\n })\n @Field(type => Bizplace, { nullable: true })\n bizplace: Bizplace\n\n @OneToMany(type => BizOptionDetail, bizOptionDetail => bizOptionDetail.bizOption)\n @Field(type => BizOptionDetail, { nullable: true })\n bizOptionDetails: BizOptionDetail[]\n\n @Column({\n nullable: true\n })\n @Field({ nullable: true })\n description: string\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt: Date\n\n @ManyToOne(type => User, {\n nullable: true\n })\n @Field({ nullable: true })\n creator: User\n\n @ManyToOne(type => User, {\n nullable: true\n })\n @Field({ nullable: true })\n updater: User\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/biz-option/index.ts"],"names":[],"mappings":";;;AAAA,6CAAwC;AACxC,+DAAyD;AACzD,yDAAmD;AAEtC,QAAA,QAAQ,GAAG,CAAC,sBAAS,CAAC,CAAA;AACtB,QAAA,SAAS,GAAG,CAAC,iCAAc,EAAE,uCAAiB,CAAC,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/biz-option/index.ts"],"names":[],"mappings":";;;AAAA,6CAAwC;AACxC,+DAAyD;AACzD,yDAAmD;AAEtC,QAAA,QAAQ,GAAG,CAAC,sBAAS,CAAC,CAAA;AACtB,QAAA,SAAS,GAAG,CAAC,iCAAc,EAAE,uCAAiB,CAAC,CAAA","sourcesContent":["import { BizOption } from './biz-option'\nimport { BizOptionMutation } from './biz-option-mutation'\nimport { BizOptionQuery } from './biz-option-query'\n\nexport const entities = [BizOption]\nexport const resolvers = [BizOptionQuery, BizOptionMutation]\n"]}
@@ -1,79 +1,69 @@
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.BizOptionDetailMutation = void 0;
4
+ const tslib_1 = require("tslib");
16
5
  const type_graphql_1 = require("type-graphql");
17
6
  const typeorm_1 = require("typeorm");
7
+ const shell_1 = require("@things-factory/shell");
18
8
  const biz_option_detail_1 = require("./biz-option-detail");
19
9
  const biz_option_detail_types_1 = require("./biz-option-detail-types");
20
10
  let BizOptionDetailMutation = class BizOptionDetailMutation {
21
11
  async createBizOptionDetail(bizOptionDetail, context) {
22
- return await (0, typeorm_1.getRepository)(biz_option_detail_1.BizOptionDetail).save(Object.assign(Object.assign({}, bizOptionDetail), { domain: context.state.domain, creator: context.state.user, updater: context.state.user }));
12
+ return await (0, shell_1.getRepository)(biz_option_detail_1.BizOptionDetail).save(Object.assign(Object.assign({}, bizOptionDetail), { domain: context.state.domain, creator: context.state.user, updater: context.state.user }));
23
13
  }
24
14
  async updateBizOptionDetail(name, patch, context) {
25
- const repository = (0, typeorm_1.getRepository)(biz_option_detail_1.BizOptionDetail);
15
+ const repository = (0, shell_1.getRepository)(biz_option_detail_1.BizOptionDetail);
26
16
  const bizOptionDetail = await repository.findOne({
27
- where: { domain: context.state.domain, name }
17
+ where: { domain: { id: context.state.domain.id }, name }
28
18
  });
29
19
  return await repository.save(Object.assign(Object.assign(Object.assign({}, bizOptionDetail), patch), { updater: context.state.user }));
30
20
  }
31
21
  async deleteBizOptionDetail(name, context) {
32
- await (0, typeorm_1.getRepository)(biz_option_detail_1.BizOptionDetail).delete({ domain: context.state.domain, name });
22
+ await (0, shell_1.getRepository)(biz_option_detail_1.BizOptionDetail).delete({ domain: { id: context.state.domain.id }, name });
33
23
  return true;
34
24
  }
35
25
  async deleteBizOptionDetails(names, context) {
36
- await (0, typeorm_1.getRepository)(biz_option_detail_1.BizOptionDetail).delete({
37
- domain: context.state.domain,
26
+ await (0, shell_1.getRepository)(biz_option_detail_1.BizOptionDetail).delete({
27
+ domain: { id: context.state.domain.id },
38
28
  name: (0, typeorm_1.In)(names)
39
29
  });
40
30
  return true;
41
31
  }
42
32
  };
43
- __decorate([
33
+ tslib_1.__decorate([
44
34
  (0, type_graphql_1.Mutation)(returns => biz_option_detail_1.BizOptionDetail),
45
- __param(0, (0, type_graphql_1.Arg)('bizOptionDetail')),
46
- __param(1, (0, type_graphql_1.Ctx)()),
47
- __metadata("design:type", Function),
48
- __metadata("design:paramtypes", [biz_option_detail_types_1.NewBizOptionDetail, Object]),
49
- __metadata("design:returntype", Promise)
35
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('bizOptionDetail')),
36
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
37
+ tslib_1.__metadata("design:type", Function),
38
+ tslib_1.__metadata("design:paramtypes", [biz_option_detail_types_1.NewBizOptionDetail, Object]),
39
+ tslib_1.__metadata("design:returntype", Promise)
50
40
  ], BizOptionDetailMutation.prototype, "createBizOptionDetail", null);
51
- __decorate([
41
+ tslib_1.__decorate([
52
42
  (0, type_graphql_1.Mutation)(returns => biz_option_detail_1.BizOptionDetail),
53
- __param(0, (0, type_graphql_1.Arg)('name')),
54
- __param(1, (0, type_graphql_1.Arg)('patch')),
55
- __param(2, (0, type_graphql_1.Ctx)()),
56
- __metadata("design:type", Function),
57
- __metadata("design:paramtypes", [String, biz_option_detail_types_1.BizOptionDetailPatch, Object]),
58
- __metadata("design:returntype", Promise)
43
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('name')),
44
+ tslib_1.__param(1, (0, type_graphql_1.Arg)('patch')),
45
+ tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
46
+ tslib_1.__metadata("design:type", Function),
47
+ tslib_1.__metadata("design:paramtypes", [String, biz_option_detail_types_1.BizOptionDetailPatch, Object]),
48
+ tslib_1.__metadata("design:returntype", Promise)
59
49
  ], BizOptionDetailMutation.prototype, "updateBizOptionDetail", null);
60
- __decorate([
50
+ tslib_1.__decorate([
61
51
  (0, type_graphql_1.Mutation)(returns => Boolean),
62
- __param(0, (0, type_graphql_1.Arg)('name')),
63
- __param(1, (0, type_graphql_1.Ctx)()),
64
- __metadata("design:type", Function),
65
- __metadata("design:paramtypes", [String, Object]),
66
- __metadata("design:returntype", Promise)
52
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('name')),
53
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
54
+ tslib_1.__metadata("design:type", Function),
55
+ tslib_1.__metadata("design:paramtypes", [String, Object]),
56
+ tslib_1.__metadata("design:returntype", Promise)
67
57
  ], BizOptionDetailMutation.prototype, "deleteBizOptionDetail", null);
68
- __decorate([
58
+ tslib_1.__decorate([
69
59
  (0, type_graphql_1.Mutation)(returns => Boolean),
70
- __param(0, (0, type_graphql_1.Arg)('names', type => [String])),
71
- __param(1, (0, type_graphql_1.Ctx)()),
72
- __metadata("design:type", Function),
73
- __metadata("design:paramtypes", [Array, Object]),
74
- __metadata("design:returntype", Promise)
60
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('names', type => [String])),
61
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
62
+ tslib_1.__metadata("design:type", Function),
63
+ tslib_1.__metadata("design:paramtypes", [Array, Object]),
64
+ tslib_1.__metadata("design:returntype", Promise)
75
65
  ], BizOptionDetailMutation.prototype, "deleteBizOptionDetails", null);
76
- BizOptionDetailMutation = __decorate([
66
+ BizOptionDetailMutation = tslib_1.__decorate([
77
67
  (0, type_graphql_1.Resolver)(biz_option_detail_1.BizOptionDetail)
78
68
  ], BizOptionDetailMutation);
79
69
  exports.BizOptionDetailMutation = BizOptionDetailMutation;