@things-factory/biz-base 7.0.0-alpha.9 → 7.0.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 (99) hide show
  1. package/dist-server/index.d.ts +3 -0
  2. package/dist-server/middlewares/index.d.ts +0 -0
  3. package/dist-server/migrations/index.d.ts +1 -0
  4. package/dist-server/service/biz-option/biz-option-mutation.d.ts +8 -0
  5. package/dist-server/service/biz-option/biz-option-mutation.js +2 -2
  6. package/dist-server/service/biz-option/biz-option-mutation.js.map +1 -1
  7. package/dist-server/service/biz-option/biz-option-query.d.ts +7 -0
  8. package/dist-server/service/biz-option/biz-option-query.js +3 -3
  9. package/dist-server/service/biz-option/biz-option-query.js.map +1 -1
  10. package/dist-server/service/biz-option/biz-option-types.d.ts +18 -0
  11. package/dist-server/service/biz-option/biz-option-types.js +6 -6
  12. package/dist-server/service/biz-option/biz-option-types.js.map +1 -1
  13. package/dist-server/service/biz-option/biz-option.d.ts +16 -0
  14. package/dist-server/service/biz-option/biz-option.js +2 -2
  15. package/dist-server/service/biz-option/biz-option.js.map +1 -1
  16. package/dist-server/service/biz-option/index.d.ts +5 -0
  17. package/dist-server/service/biz-option-detail/biz-option-detail-mutation.d.ts +8 -0
  18. package/dist-server/service/biz-option-detail/biz-option-detail-mutation.js +2 -2
  19. package/dist-server/service/biz-option-detail/biz-option-detail-mutation.js.map +1 -1
  20. package/dist-server/service/biz-option-detail/biz-option-detail-query.d.ts +7 -0
  21. package/dist-server/service/biz-option-detail/biz-option-detail-query.js +3 -3
  22. package/dist-server/service/biz-option-detail/biz-option-detail-query.js.map +1 -1
  23. package/dist-server/service/biz-option-detail/biz-option-detail-types.d.ts +16 -0
  24. package/dist-server/service/biz-option-detail/biz-option-detail-types.js +6 -6
  25. package/dist-server/service/biz-option-detail/biz-option-detail-types.js.map +1 -1
  26. package/dist-server/service/biz-option-detail/biz-option-detail.d.ts +14 -0
  27. package/dist-server/service/biz-option-detail/biz-option-detail.js +2 -2
  28. package/dist-server/service/biz-option-detail/biz-option-detail.js.map +1 -1
  29. package/dist-server/service/biz-option-detail/index.d.ts +5 -0
  30. package/dist-server/service/bizplace/bizplace-mutation.d.ts +10 -0
  31. package/dist-server/service/bizplace/bizplace-mutation.js +2 -2
  32. package/dist-server/service/bizplace/bizplace-mutation.js.map +1 -1
  33. package/dist-server/service/bizplace/bizplace-query.d.ts +19 -0
  34. package/dist-server/service/bizplace/bizplace-query.js +8 -8
  35. package/dist-server/service/bizplace/bizplace-query.js.map +1 -1
  36. package/dist-server/service/bizplace/bizplace-types.d.ts +34 -0
  37. package/dist-server/service/bizplace/bizplace-types.js +8 -8
  38. package/dist-server/service/bizplace/bizplace-types.js.map +1 -1
  39. package/dist-server/service/bizplace/bizplace.d.ts +22 -0
  40. package/dist-server/service/bizplace/bizplace.js +3 -3
  41. package/dist-server/service/bizplace/bizplace.js.map +1 -1
  42. package/dist-server/service/bizplace/index.d.ts +5 -0
  43. package/dist-server/service/company/company-mutation.d.ts +48 -0
  44. package/dist-server/service/company/company-mutation.js +7 -7
  45. package/dist-server/service/company/company-mutation.js.map +1 -1
  46. package/dist-server/service/company/company-query.d.ts +11 -0
  47. package/dist-server/service/company/company-query.js +3 -3
  48. package/dist-server/service/company/company-query.js.map +1 -1
  49. package/dist-server/service/company/company-types.d.ts +26 -0
  50. package/dist-server/service/company/company-types.js +6 -6
  51. package/dist-server/service/company/company-types.js.map +1 -1
  52. package/dist-server/service/company/company.d.ts +23 -0
  53. package/dist-server/service/company/company.js +2 -2
  54. package/dist-server/service/company/company.js.map +1 -1
  55. package/dist-server/service/company/index.d.ts +5 -0
  56. package/dist-server/service/contact-point/contact-point-mutation.d.ts +13 -0
  57. package/dist-server/service/contact-point/contact-point-mutation.js +6 -6
  58. package/dist-server/service/contact-point/contact-point-mutation.js.map +1 -1
  59. package/dist-server/service/contact-point/contact-point-query.d.ts +7 -0
  60. package/dist-server/service/contact-point/contact-point-query.js +3 -3
  61. package/dist-server/service/contact-point/contact-point-query.js.map +1 -1
  62. package/dist-server/service/contact-point/contact-point-types.d.ts +54 -0
  63. package/dist-server/service/contact-point/contact-point-types.js +14 -6
  64. package/dist-server/service/contact-point/contact-point-types.js.map +1 -1
  65. package/dist-server/service/contact-point/contact-point.d.ts +32 -0
  66. package/dist-server/service/contact-point/contact-point.js +9 -7
  67. package/dist-server/service/contact-point/contact-point.js.map +1 -1
  68. package/dist-server/service/contact-point/index.d.ts +5 -0
  69. package/dist-server/service/index.d.ts +18 -0
  70. package/dist-server/service/worker/index.d.ts +5 -0
  71. package/dist-server/service/worker/worker-mutation.d.ts +37 -0
  72. package/dist-server/service/worker/worker-mutation.js +7 -7
  73. package/dist-server/service/worker/worker-mutation.js.map +1 -1
  74. package/dist-server/service/worker/worker-query.d.ts +7 -0
  75. package/dist-server/service/worker/worker-query.js +3 -3
  76. package/dist-server/service/worker/worker-query.js.map +1 -1
  77. package/dist-server/service/worker/worker-types.d.ts +20 -0
  78. package/dist-server/service/worker/worker-types.js +6 -6
  79. package/dist-server/service/worker/worker-types.js.map +1 -1
  80. package/dist-server/service/worker/worker.d.ts +15 -0
  81. package/dist-server/service/worker/worker.js +2 -2
  82. package/dist-server/service/worker/worker.js.map +1 -1
  83. package/dist-server/tsconfig.tsbuildinfo +1 -1
  84. package/dist-server/utils/get-permitted-bizplaces.d.ts +24 -0
  85. package/dist-server/utils/get-permitted-bizplaces.js +13 -14
  86. package/dist-server/utils/get-permitted-bizplaces.js.map +1 -1
  87. package/dist-server/utils/index.d.ts +1 -0
  88. package/package.json +3 -3
  89. package/server/service/biz-option/biz-option-query.ts +4 -1
  90. package/server/service/biz-option-detail/biz-option-detail-query.ts +1 -1
  91. package/server/service/bizplace/bizplace-query.ts +7 -4
  92. package/server/service/bizplace/bizplace.ts +2 -2
  93. package/server/service/company/company-query.ts +1 -1
  94. package/server/service/company/company.ts +1 -1
  95. package/server/service/contact-point/contact-point-query.ts +4 -1
  96. package/server/service/contact-point/contact-point-types.ts +6 -0
  97. package/server/service/contact-point/contact-point.ts +7 -10
  98. package/server/service/worker/worker-query.ts +1 -1
  99. package/server/service/worker/worker.ts +1 -1
@@ -0,0 +1,3 @@
1
+ export * from './service';
2
+ export * from './migrations';
3
+ export * from './utils';
File without changes
@@ -0,0 +1 @@
1
+ export declare var migrations: any[];
@@ -0,0 +1,8 @@
1
+ import { BizOption } from './biz-option';
2
+ import { BizOptionPatch, NewBizOption } from './biz-option-types';
3
+ export declare class BizOptionMutation {
4
+ createBizOption(bizOption: NewBizOption, context: ResolverContext): Promise<BizOption>;
5
+ updateBizOption(name: string, patch: BizOptionPatch, context: ResolverContext): Promise<BizOption>;
6
+ deleteBizOption(name: string, context: ResolverContext): Promise<Boolean>;
7
+ deleteBizOptions(names: string[], context: ResolverContext): Promise<Boolean>;
8
+ }
@@ -33,6 +33,7 @@ let BizOptionMutation = class BizOptionMutation {
33
33
  return true;
34
34
  }
35
35
  };
36
+ exports.BizOptionMutation = BizOptionMutation;
36
37
  tslib_1.__decorate([
37
38
  (0, type_graphql_1.Mutation)(returns => biz_option_1.BizOption),
38
39
  tslib_1.__param(0, (0, type_graphql_1.Arg)('bizOption')),
@@ -66,8 +67,7 @@ tslib_1.__decorate([
66
67
  tslib_1.__metadata("design:paramtypes", [Array, Object]),
67
68
  tslib_1.__metadata("design:returntype", Promise)
68
69
  ], BizOptionMutation.prototype, "deleteBizOptions", null);
69
- BizOptionMutation = tslib_1.__decorate([
70
+ exports.BizOptionMutation = BizOptionMutation = tslib_1.__decorate([
70
71
  (0, type_graphql_1.Resolver)(biz_option_1.BizOption)
71
72
  ], BizOptionMutation);
72
- exports.BizOptionMutation = BizOptionMutation;
73
73
  //# sourceMappingURL=biz-option-mutation.js.map
@@ -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,qCAA4B;AAE5B,iDAAqD;AAErD,6CA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,EAAC,sBAAS,CAAC,CAAC,MAAM,CAAC;YACpC,MAAM,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,EAAE;YACvC,IAAI,EAAE,IAAA,YAAE,EAAC,KAAK,CAAC;SAChB,CAAC,CAAA;QACF,OAAO,IAAI,CAAA;IACb,CAAC;CACF,CAAA;AArDO;IADL,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,sBAAS,CAAC;IAE5B,mBAAA,IAAA,kBAAG,EAAC,WAAW,CAAC,CAAA;IAChB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;6CADuB,+BAAY;;wDAW1C;AAGK;IADL,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,sBAAS,CAAC;IAE5B,mBAAA,IAAA,kBAAG,EAAC,MAAM,CAAC,CAAA;IACX,mBAAA,IAAA,kBAAG,EAAC,OAAO,CAAC,CAAA;IACZ,mBAAA,IAAA,kBAAG,GAAE,CAAA;;qDADe,iCAAc;;wDAepC;AAGK;IADL,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC;IACN,mBAAA,IAAA,kBAAG,EAAC,MAAM,CAAC,CAAA;IAAgB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;wDAKtD;AAGK;IADL,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
+ {"version":3,"file":"biz-option-mutation.js","sourceRoot":"","sources":["../../../server/service/biz-option/biz-option-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAA2D;AAC3D,qCAA4B;AAE5B,iDAAqD;AAErD,6CAAwC;AACxC,yDAAiE;AAG1D,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAEtB,AAAN,KAAK,CAAC,eAAe,CACD,SAAuB,EAClC,OAAwB;QAE/B,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEtC,OAAO,MAAM,IAAA,qBAAa,EAAC,sBAAS,CAAC,CAAC,IAAI,iCACrC,SAAS,KACZ,M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AAC,OAAO,CAAC,EAAE,CAAC,sBAAS,CAAC;IAE5B,mBAAA,IAAA,kBAAG,EAAC,WAAW,CAAC,CAAA;IAChB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;6CADuB,+BAAY;;wDAW1C;AAGK;IADL,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,sBAAS,CAAC;IAE5B,mBAAA,IAAA,kBAAG,EAAC,MAAM,CAAC,CAAA;IACX,mBAAA,IAAA,kBAAG,EAAC,OAAO,CAAC,CAAA;IACZ,mBAAA,IAAA,kBAAG,GAAE,CAAA;;qDADe,iCAAc;;wDAepC;AAGK;IADL,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC;IACN,mBAAA,IAAA,kBAAG,EAAC,MAAM,CAAC,CAAA;IAAgB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;wDAKtD;AAGK;IADL,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;4BAtDU,iBAAiB;IAD7B,IAAA,uBAAQ,EAAC,sBAAS,CAAC;GACP,iBAAiB,CAuD7B","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"]}
@@ -0,0 +1,7 @@
1
+ import { ListParam } from '@things-factory/shell';
2
+ import { BizOption } from './biz-option';
3
+ import { BizOptionList } from './biz-option-types';
4
+ export declare class BizOptionQuery {
5
+ bizOption(name: string, context: ResolverContext): Promise<BizOption>;
6
+ bizOptions(params: ListParam, context: ResolverContext): Promise<BizOptionList>;
7
+ }
@@ -19,6 +19,7 @@ let BizOptionQuery = class BizOptionQuery {
19
19
  return { items, total };
20
20
  }
21
21
  };
22
+ exports.BizOptionQuery = BizOptionQuery;
22
23
  tslib_1.__decorate([
23
24
  (0, type_graphql_1.Query)(returns => biz_option_1.BizOption),
24
25
  tslib_1.__param(0, (0, type_graphql_1.Arg)('name')),
@@ -29,14 +30,13 @@ tslib_1.__decorate([
29
30
  ], BizOptionQuery.prototype, "bizOption", null);
30
31
  tslib_1.__decorate([
31
32
  (0, type_graphql_1.Query)(returns => biz_option_types_1.BizOptionList),
32
- tslib_1.__param(0, (0, type_graphql_1.Args)()),
33
+ tslib_1.__param(0, (0, type_graphql_1.Args)(type => shell_1.ListParam)),
33
34
  tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
34
35
  tslib_1.__metadata("design:type", Function),
35
36
  tslib_1.__metadata("design:paramtypes", [shell_1.ListParam, Object]),
36
37
  tslib_1.__metadata("design:returntype", Promise)
37
38
  ], BizOptionQuery.prototype, "bizOptions", null);
38
- BizOptionQuery = tslib_1.__decorate([
39
+ exports.BizOptionQuery = BizOptionQuery = tslib_1.__decorate([
39
40
  (0, type_graphql_1.Resolver)(biz_option_1.BizOption)
40
41
  ], BizOptionQuery);
41
- exports.BizOptionQuery = BizOptionQuery;
42
42
  //# sourceMappingURL=biz-option-query.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"biz-option-query.js","sourceRoot":"","sources":["../../../server/service/biz-option/biz-option-query.ts"],"names":[],"mappings":";;;;AAAA,+CAA8D;AAE9D,iDAAmF;AAEnF,6CAAwC;AACxC,yDAAkD;AAG3C,IAAM,cAAc,GAApB,MAAM,cAAc;IAEnB,AAAN,KAAK,CAAC,SAAS,CAAc,IAAY,EAAS,OAAwB;QACxE,OAAO,MAAM,IAAA,qBAAa,EAAC,sBAAS,CAAC,CAAC,OAAO,CAAC;YAC5C,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE;YACxD,SAAS,EAAE,CAAC,QAAQ,EAAE,UAAU,EAAE,kBAAkB,EAAE,SAAS,EAAE,SAAS,CAAC;SAC5E,CAAC,CAAA;IACJ,CAAC;IAGK,AAAN,KAAK,CAAC,UAAU,CAAS,MAAiB,EAAS,OAAwB;QACzE,MAAM,eAAe,GAAG,IAAA,yBAAiB,EAAC,MAAM,CAAC,CAAA;QACjD,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,IAAA,qBAAa,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;AAhBO;IADL,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,sBAAS,CAAC;IACX,mBAAA,IAAA,kBAAG,EAAC,MAAM,CAAC,CAAA;IAAgB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;+CAKhD;AAGK;IADL,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
+ {"version":3,"file":"biz-option-query.js","sourceRoot":"","sources":["../../../server/service/biz-option/biz-option-query.ts"],"names":[],"mappings":";;;;AAAA,+CAA8D;AAE9D,iDAAmF;AAEnF,6CAAwC;AACxC,yDAAkD;AAG3C,IAAM,cAAc,G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GACP,cAAc,CAqB1B","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(\n @Args(type => ListParam) params: ListParam,\n @Ctx() context: ResolverContext\n ): 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"]}
@@ -0,0 +1,18 @@
1
+ import { ObjectRef } from '@things-factory/shell';
2
+ import { BizOption } from './biz-option';
3
+ export declare class BizOptionList {
4
+ items?: BizOption[];
5
+ total?: number;
6
+ }
7
+ export declare class BizOptionPatch {
8
+ id?: string;
9
+ name?: string;
10
+ description?: string;
11
+ bizplace?: ObjectRef;
12
+ bizOptionDetails?: ObjectRef[];
13
+ cuFlag?: string;
14
+ }
15
+ export declare class NewBizOption {
16
+ name: string;
17
+ description?: string;
18
+ }
@@ -7,6 +7,7 @@ const shell_1 = require("@things-factory/shell");
7
7
  const biz_option_1 = require("./biz-option");
8
8
  let BizOptionList = class BizOptionList {
9
9
  };
10
+ exports.BizOptionList = BizOptionList;
10
11
  tslib_1.__decorate([
11
12
  (0, type_graphql_1.Field)(type => [biz_option_1.BizOption], { nullable: true }),
12
13
  tslib_1.__metadata("design:type", Array)
@@ -15,12 +16,12 @@ tslib_1.__decorate([
15
16
  (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
16
17
  tslib_1.__metadata("design:type", Number)
17
18
  ], BizOptionList.prototype, "total", void 0);
18
- BizOptionList = tslib_1.__decorate([
19
+ exports.BizOptionList = BizOptionList = tslib_1.__decorate([
19
20
  (0, type_graphql_1.ObjectType)()
20
21
  ], BizOptionList);
21
- exports.BizOptionList = BizOptionList;
22
22
  let BizOptionPatch = class BizOptionPatch {
23
23
  };
24
+ exports.BizOptionPatch = BizOptionPatch;
24
25
  tslib_1.__decorate([
25
26
  (0, type_graphql_1.Field)({ nullable: true }),
26
27
  tslib_1.__metadata("design:type", String)
@@ -45,12 +46,12 @@ tslib_1.__decorate([
45
46
  (0, type_graphql_1.Field)({ nullable: true }),
46
47
  tslib_1.__metadata("design:type", String)
47
48
  ], BizOptionPatch.prototype, "cuFlag", void 0);
48
- BizOptionPatch = tslib_1.__decorate([
49
+ exports.BizOptionPatch = BizOptionPatch = tslib_1.__decorate([
49
50
  (0, type_graphql_1.InputType)()
50
51
  ], BizOptionPatch);
51
- exports.BizOptionPatch = BizOptionPatch;
52
52
  let NewBizOption = class NewBizOption {
53
53
  };
54
+ exports.NewBizOption = NewBizOption;
54
55
  tslib_1.__decorate([
55
56
  (0, type_graphql_1.Field)(),
56
57
  tslib_1.__metadata("design:type", String)
@@ -59,8 +60,7 @@ tslib_1.__decorate([
59
60
  (0, type_graphql_1.Field)({ nullable: true }),
60
61
  tslib_1.__metadata("design:type", String)
61
62
  ], NewBizOption.prototype, "description", void 0);
62
- NewBizOption = tslib_1.__decorate([
63
+ exports.NewBizOption = NewBizOption = tslib_1.__decorate([
63
64
  (0, type_graphql_1.InputType)()
64
65
  ], NewBizOption);
65
- exports.NewBizOption = NewBizOption;
66
66
  //# sourceMappingURL=biz-option-types.js.map
@@ -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;AAGjC,IAAM,aAAa,GAAnB,M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,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
+ {"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;AAGjC,IAAM,aAAa,GAAnB,MAAM,aAAa;CAMzB,CAAA;AANY,sCAAa;AAExB;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;wBALH,aAAa;IADzB,IAAA,yBAAU,GAAE;GACA,aAAa,CAMzB;AAGM,IAAM,cAAc,GAApB,MAAM,cAAc;CAkB1B,CAAA;AAlBY,wCAAc;AAEzB;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;sCAClC,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;yBAjBJ,cAAc;IAD1B,IAAA,wBAAS,GAAE;GACC,cAAc,CAkB1B;AAGM,IAAM,YAAY,GAAlB,MAAM,YAAY;CAMxB,CAAA;AANY,oCAAY;AAEvB;IADC,IAAA,oBAAK,GAAE;;0CACI;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDACN;uBALT,YAAY;IADxB,IAAA,wBAAS,GAAE;GACC,YAAY,CAMxB","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"]}
@@ -0,0 +1,16 @@
1
+ import { User } from '@things-factory/auth-base';
2
+ import { Domain } from '@things-factory/shell';
3
+ import { BizOptionDetail } from '../biz-option-detail/biz-option-detail';
4
+ import { Bizplace } from '../bizplace/bizplace';
5
+ export declare class BizOption {
6
+ id: string;
7
+ domain: Domain;
8
+ name: string;
9
+ bizplace: Bizplace;
10
+ bizOptionDetails: BizOptionDetail[];
11
+ description: string;
12
+ createdAt: Date;
13
+ updatedAt: Date;
14
+ creator: User;
15
+ updater: User;
16
+ }
@@ -10,6 +10,7 @@ const biz_option_detail_1 = require("../biz-option-detail/biz-option-detail");
10
10
  const bizplace_1 = require("../bizplace/bizplace");
11
11
  let BizOption = class BizOption {
12
12
  };
13
+ exports.BizOption = BizOption;
13
14
  tslib_1.__decorate([
14
15
  (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
15
16
  (0, type_graphql_1.Field)(type => type_graphql_1.ID),
@@ -68,10 +69,9 @@ tslib_1.__decorate([
68
69
  (0, type_graphql_1.Field)({ nullable: true }),
69
70
  tslib_1.__metadata("design:type", auth_base_1.User)
70
71
  ], BizOption.prototype, "updater", void 0);
71
- BizOption = tslib_1.__decorate([
72
+ exports.BizOption = BizOption = tslib_1.__decorate([
72
73
  (0, typeorm_1.Entity)(),
73
74
  (0, typeorm_1.Index)('ix_biz-option_0', (bizOption) => [bizOption.bizplace, bizOption.name], { unique: true }),
74
75
  (0, type_graphql_1.ObjectType)()
75
76
  ], BizOption);
76
- exports.BizOption = BizOption;
77
77
  //# sourceMappingURL=biz-option.js.map
@@ -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;AAKxC,IAAM,SAAS,GAAf,MAAM,SAAS;CAgDrB,CAAA;AA/CC;IAAC,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAA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IACD,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACjB,gBAAI;0CAAA;AAEb;IAAC,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
+ {"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;AAKxC,IAAM,SAAS,GAAf,MAAM,SAAS;CAgDrB,CAAA;AAhDY,8BAAS;AAGpB;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;sCAClB,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;sCAClC,mBAAQ;2CAAA;AAIlB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,mCAAe,EAAE,eAAe,CAAC,EAAE,CAAC,eAAe,CAAC,SAAS,CAAC;IAChF,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,mCAAe,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDAChB;AAMnC;IAJC,IAAA,gBAAM,EAAC;QACN,QAAQ,EAAE,IAAI;KACf,CAAC;IACD,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;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;oBA/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","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"]}
@@ -0,0 +1,5 @@
1
+ import { BizOption } from './biz-option';
2
+ import { BizOptionMutation } from './biz-option-mutation';
3
+ import { BizOptionQuery } from './biz-option-query';
4
+ export declare const entities: (typeof BizOption)[];
5
+ export declare const resolvers: (typeof BizOptionMutation | typeof BizOptionQuery)[];
@@ -0,0 +1,8 @@
1
+ import { BizOptionDetail } from './biz-option-detail';
2
+ import { BizOptionDetailPatch, NewBizOptionDetail } from './biz-option-detail-types';
3
+ export declare class BizOptionDetailMutation {
4
+ createBizOptionDetail(bizOptionDetail: NewBizOptionDetail, context: ResolverContext): Promise<BizOptionDetail>;
5
+ updateBizOptionDetail(name: string, patch: BizOptionDetailPatch, context: ResolverContext): Promise<BizOptionDetail>;
6
+ deleteBizOptionDetail(name: string, context: ResolverContext): Promise<Boolean>;
7
+ deleteBizOptionDetails(names: string[], context: ResolverContext): Promise<Boolean>;
8
+ }
@@ -30,6 +30,7 @@ let BizOptionDetailMutation = class BizOptionDetailMutation {
30
30
  return true;
31
31
  }
32
32
  };
33
+ exports.BizOptionDetailMutation = BizOptionDetailMutation;
33
34
  tslib_1.__decorate([
34
35
  (0, type_graphql_1.Mutation)(returns => biz_option_detail_1.BizOptionDetail),
35
36
  tslib_1.__param(0, (0, type_graphql_1.Arg)('bizOptionDetail')),
@@ -63,8 +64,7 @@ tslib_1.__decorate([
63
64
  tslib_1.__metadata("design:paramtypes", [Array, Object]),
64
65
  tslib_1.__metadata("design:returntype", Promise)
65
66
  ], BizOptionDetailMutation.prototype, "deleteBizOptionDetails", null);
66
- BizOptionDetailMutation = tslib_1.__decorate([
67
+ exports.BizOptionDetailMutation = BizOptionDetailMutation = tslib_1.__decorate([
67
68
  (0, type_graphql_1.Resolver)(biz_option_detail_1.BizOptionDetail)
68
69
  ], BizOptionDetailMutation);
69
- exports.BizOptionDetailMutation = BizOptionDetailMutation;
70
70
  //# sourceMappingURL=biz-option-detail-mutation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"biz-option-detail-mutation.js","sourceRoot":"","sources":["../../../server/service/biz-option-detail/biz-option-detail-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAA2D;AAC3D,qCAA4B;AAE5B,iDAAqD;AAErD,2DAAqD;AACrD,uEAAoF;AAG7E,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAE5B,AAAN,KAAK,CAAC,qBAAqB,CACD,eAAmC,EACpD,OAAwB;QAE/B,OAAO,MAAM,IAAA,qBAAa,EAAC,mCAAe,CAAC,CAAC,IAAI,iCAC3C,eAAe,KAClB,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,CAA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S5D;AAGK;IADL,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,mCAAe,CAAC;IAElC,mBAAA,IAAA,kBAAG,EAAC,MAAM,CAAC,CAAA;IACX,mBAAA,IAAA,kBAAG,EAAC,OAAO,CAAC,CAAA;IACZ,mBAAA,IAAA,kBAAG,GAAE,CAAA;;qDADe,8CAAoB;;oEAa1C;AAGK;IADL,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC;IACA,mBAAA,IAAA,kBAAG,EAAC,MAAM,CAAC,CAAA;IAAgB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;oEAG5D;AAGK;IADL,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;;;;qEAOP;AAhDU,uBAAuB;IADnC,IAAA,uBAAQ,EAAC,mCAAe,CAAC;GACb,uBAAuB,CAiDnC;AAjDY,0DAAuB","sourcesContent":["import { Arg, Ctx, Mutation, Resolver } from 'type-graphql'\nimport { In } from 'typeorm'\n\nimport { getRepository } from '@things-factory/shell'\n\nimport { BizOptionDetail } from './biz-option-detail'\nimport { BizOptionDetailPatch, NewBizOptionDetail } from './biz-option-detail-types'\n\n@Resolver(BizOptionDetail)\nexport class BizOptionDetailMutation {\n @Mutation(returns => BizOptionDetail)\n async createBizOptionDetail(\n @Arg('bizOptionDetail') bizOptionDetail: NewBizOptionDetail,\n @Ctx() context: ResolverContext\n ): Promise<BizOptionDetail> {\n return await getRepository(BizOptionDetail).save({\n ...bizOptionDetail,\n domain: context.state.domain,\n creator: context.state.user,\n updater: context.state.user\n })\n }\n\n @Mutation(returns => BizOptionDetail)\n async updateBizOptionDetail(\n @Arg('name') name: string,\n @Arg('patch') patch: BizOptionDetailPatch,\n @Ctx() context: ResolverContext\n ): Promise<BizOptionDetail> {\n const repository = getRepository(BizOptionDetail)\n const bizOptionDetail = await repository.findOne({\n where: { domain: { id: context.state.domain.id }, name }\n })\n\n return await repository.save({\n ...bizOptionDetail,\n ...patch,\n updater: context.state.user\n })\n }\n\n @Mutation(returns => Boolean)\n async deleteBizOptionDetail(@Arg('name') name: string, @Ctx() context: ResolverContext): Promise<Boolean> {\n await getRepository(BizOptionDetail).delete({ domain: { id: context.state.domain.id }, name })\n return true\n }\n\n @Mutation(returns => Boolean)\n async deleteBizOptionDetails(\n @Arg('names', type => [String]) names: string[],\n @Ctx() context: ResolverContext\n ): Promise<Boolean> {\n await getRepository(BizOptionDetail).delete({\n domain: { id: context.state.domain.id },\n name: In(names)\n })\n return true\n }\n}\n"]}
1
+ {"version":3,"file":"biz-option-detail-mutation.js","sourceRoot":"","sources":["../../../server/service/biz-option-detail/biz-option-detail-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAA2D;AAC3D,qCAA4B;AAE5B,iDAAqD;AAErD,2DAAqD;AACrD,uEAAoF;AAG7E,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAE5B,AAAN,KAAK,CAAC,qBAAqB,CACD,eAAmC,EACpD,OAAwB;QAE/B,OAAO,MAAM,IAAA,qBAAa,EAAC,mCAAe,CAAC,CAAC,IAAI,iCAC3C,eAAe,KAClB,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;IAGK,AAAN,KAAK,CAAC,qBAAqB,CACZ,IAAY,EACX,KAA2B,EAClC,OAAwB;QAE/B,MAAM,UAAU,GAAG,IAAA,qBAAa,EAAC,mCAAe,CAAC,CAAA;QACjD,MAAM,eAAe,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC;YAC/C,KAAK,EAAE,EAAE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,GAAE,CAAA;;qDADe,8CAAoB;;oEAa1C;AAGK;IADL,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC;IACA,mBAAA,IAAA,kBAAG,EAAC,MAAM,CAAC,CAAA;IAAgB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;oEAG5D;AAGK;IADL,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;;;;qEAOP;kCAhDU,uBAAuB;IADnC,IAAA,uBAAQ,EAAC,mCAAe,CAAC;GACb,uBAAuB,CAiDnC","sourcesContent":["import { Arg, Ctx, Mutation, Resolver } from 'type-graphql'\nimport { In } from 'typeorm'\n\nimport { getRepository } from '@things-factory/shell'\n\nimport { BizOptionDetail } from './biz-option-detail'\nimport { BizOptionDetailPatch, NewBizOptionDetail } from './biz-option-detail-types'\n\n@Resolver(BizOptionDetail)\nexport class BizOptionDetailMutation {\n @Mutation(returns => BizOptionDetail)\n async createBizOptionDetail(\n @Arg('bizOptionDetail') bizOptionDetail: NewBizOptionDetail,\n @Ctx() context: ResolverContext\n ): Promise<BizOptionDetail> {\n return await getRepository(BizOptionDetail).save({\n ...bizOptionDetail,\n domain: context.state.domain,\n creator: context.state.user,\n updater: context.state.user\n })\n }\n\n @Mutation(returns => BizOptionDetail)\n async updateBizOptionDetail(\n @Arg('name') name: string,\n @Arg('patch') patch: BizOptionDetailPatch,\n @Ctx() context: ResolverContext\n ): Promise<BizOptionDetail> {\n const repository = getRepository(BizOptionDetail)\n const bizOptionDetail = await repository.findOne({\n where: { domain: { id: context.state.domain.id }, name }\n })\n\n return await repository.save({\n ...bizOptionDetail,\n ...patch,\n updater: context.state.user\n })\n }\n\n @Mutation(returns => Boolean)\n async deleteBizOptionDetail(@Arg('name') name: string, @Ctx() context: ResolverContext): Promise<Boolean> {\n await getRepository(BizOptionDetail).delete({ domain: { id: context.state.domain.id }, name })\n return true\n }\n\n @Mutation(returns => Boolean)\n async deleteBizOptionDetails(\n @Arg('names', type => [String]) names: string[],\n @Ctx() context: ResolverContext\n ): Promise<Boolean> {\n await getRepository(BizOptionDetail).delete({\n domain: { id: context.state.domain.id },\n name: In(names)\n })\n return true\n }\n}\n"]}
@@ -0,0 +1,7 @@
1
+ import { ListParam } from '@things-factory/shell';
2
+ import { BizOptionDetail } from './biz-option-detail';
3
+ import { BizOptionDetailList } from './biz-option-detail-types';
4
+ export declare class BizOptionDetailQuery {
5
+ bizOptionDetail(name: string, context: ResolverContext): Promise<BizOptionDetail>;
6
+ bizOptionDetails(params: ListParam): Promise<BizOptionDetailList>;
7
+ }
@@ -19,6 +19,7 @@ let BizOptionDetailQuery = class BizOptionDetailQuery {
19
19
  return { items, total };
20
20
  }
21
21
  };
22
+ exports.BizOptionDetailQuery = BizOptionDetailQuery;
22
23
  tslib_1.__decorate([
23
24
  (0, type_graphql_1.Query)(returns => biz_option_detail_1.BizOptionDetail),
24
25
  tslib_1.__param(0, (0, type_graphql_1.Arg)('name')),
@@ -29,13 +30,12 @@ tslib_1.__decorate([
29
30
  ], BizOptionDetailQuery.prototype, "bizOptionDetail", null);
30
31
  tslib_1.__decorate([
31
32
  (0, type_graphql_1.Query)(returns => biz_option_detail_types_1.BizOptionDetailList),
32
- tslib_1.__param(0, (0, type_graphql_1.Args)()),
33
+ tslib_1.__param(0, (0, type_graphql_1.Args)(type => shell_1.ListParam)),
33
34
  tslib_1.__metadata("design:type", Function),
34
35
  tslib_1.__metadata("design:paramtypes", [shell_1.ListParam]),
35
36
  tslib_1.__metadata("design:returntype", Promise)
36
37
  ], BizOptionDetailQuery.prototype, "bizOptionDetails", null);
37
- BizOptionDetailQuery = tslib_1.__decorate([
38
+ exports.BizOptionDetailQuery = BizOptionDetailQuery = tslib_1.__decorate([
38
39
  (0, type_graphql_1.Resolver)(biz_option_detail_1.BizOptionDetail)
39
40
  ], BizOptionDetailQuery);
40
- exports.BizOptionDetailQuery = BizOptionDetailQuery;
41
41
  //# sourceMappingURL=biz-option-detail-query.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"biz-option-detail-query.js","sourceRoot":"","sources":["../../../server/service/biz-option-detail/biz-option-detail-query.ts"],"names":[],"mappings":";;;;AAAA,+CAA8D;AAE9D,iDAAmF;AAEnF,2DAAqD;AACrD,uEAA+D;AAGxD,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAEzB,AAAN,KAAK,CAAC,eAAe,CAAc,IAAY,EAAS,OAAwB;QAC9E,OAAO,MAAM,IAAA,qBAAa,EAAC,mCAAe,CAAC,CAAC,OAAO,CAAC;YAClD,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE;YACxD,SAAS,EAAE,CAAC,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,CAAC;SACzD,CAAC,CAAA;IACJ,CAAC;IAGK,AAAN,KAAK,CAAC,gBAAgB,CAAS,MAAiB;QAC9C,MAAM,eAAe,GAAG,IAAA,yBAAiB,EAAC,MAAM,CAAC,CAAA;QACjD,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,IAAA,qBAAa,EAAC,mCAAe,CAAC,CAAC,YAAY,iCACnE,eAAe,KAClB,SAAS,EAAE,CAAC,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,CAAC,IACxD,CAAA;QACF,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;IACzB,CAAC;CACF,CAAA;AAhBO;IADL,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,mCAAe,CAAC;IACX,mBAAA,IAAA,kBAAG,EAAC,MAAM,CAAC,CAAA;IAAgB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;2DAKtD;AAGK;IADL,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,6CAAmB,CAAC;IACd,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAS,iBAAS;;4DAO/C;AAjBU,oBAAoB;IADhC,IAAA,uBAAQ,EAAC,mCAAe,CAAC;GACb,oBAAoB,CAkBhC;AAlBY,oDAAoB","sourcesContent":["import { Arg, Args, Ctx, Query, Resolver } from 'type-graphql'\n\nimport { convertListParams, getRepository, ListParam } from '@things-factory/shell'\n\nimport { BizOptionDetail } from './biz-option-detail'\nimport { BizOptionDetailList } from './biz-option-detail-types'\n\n@Resolver(BizOptionDetail)\nexport class BizOptionDetailQuery {\n @Query(returns => BizOptionDetail)\n async bizOptionDetail(@Arg('name') name: string, @Ctx() context: ResolverContext): Promise<BizOptionDetail> {\n return await getRepository(BizOptionDetail).findOne({\n where: { domain: { id: context.state.domain.id }, name },\n relations: ['domain', 'bizOption', 'creator', 'updater']\n })\n }\n\n @Query(returns => BizOptionDetailList)\n async bizOptionDetails(@Args() params: ListParam): Promise<BizOptionDetailList> {\n const convertedParams = convertListParams(params)\n const [items, total] = await getRepository(BizOptionDetail).findAndCount({\n ...convertedParams,\n relations: ['domain', 'bizOption', 'creator', 'updater']\n })\n return { items, total }\n }\n}\n"]}
1
+ {"version":3,"file":"biz-option-detail-query.js","sourceRoot":"","sources":["../../../server/service/biz-option-detail/biz-option-detail-query.ts"],"names":[],"mappings":";;;;AAAA,+CAA8D;AAE9D,iDAAmF;AAEnF,2DAAqD;AACrD,uEAA+D;AAGxD,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAEzB,AAAN,KAAK,CAAC,eAAe,CAAc,IAAY,EAAS,OAAwB;QAC9E,OAAO,MAAM,IAAA,qBAAa,EAAC,mCAAe,CAAC,CAAC,OAAO,CAAC;YAClD,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE;YACxD,SAAS,EAAE,CAAC,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,CAAC;SACzD,CAAC,CAAA;IACJ,CAAC;IAGK,AAAN,KAAK,CAAC,gBAAgB,CAA0B,MAAiB;QAC/D,MAAM,eAAe,GAAG,IAAA,yBAAiB,EAAC,MAAM,CAAC,CAAA;QACjD,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,IAAA,qBAAa,EAAC,mCAAe,CAAC,CAAC,YAAY,iCACnE,eAAe,KAClB,SAAS,EAAE,CAAC,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,CAAC,IACxD,CAAA;QACF,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;IACzB,CAAC;CACF,CAAA;AAlBY,oDAAoB;AAEzB;IADL,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,mCAAe,CAAC;IACX,mBAAA,IAAA,kBAAG,EAAC,MAAM,CAAC,CAAA;IAAgB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;2DAKtD;AAGK;IADL,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,6CAAmB,CAAC;IACd,mBAAA,IAAA,mBAAI,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAS,CAAC,CAAA;;6CAAS,iBAAS;;4DAOhE;+BAjBU,oBAAoB;IADhC,IAAA,uBAAQ,EAAC,mCAAe,CAAC;GACb,oBAAoB,CAkBhC","sourcesContent":["import { Arg, Args, Ctx, Query, Resolver } from 'type-graphql'\n\nimport { convertListParams, getRepository, ListParam } from '@things-factory/shell'\n\nimport { BizOptionDetail } from './biz-option-detail'\nimport { BizOptionDetailList } from './biz-option-detail-types'\n\n@Resolver(BizOptionDetail)\nexport class BizOptionDetailQuery {\n @Query(returns => BizOptionDetail)\n async bizOptionDetail(@Arg('name') name: string, @Ctx() context: ResolverContext): Promise<BizOptionDetail> {\n return await getRepository(BizOptionDetail).findOne({\n where: { domain: { id: context.state.domain.id }, name },\n relations: ['domain', 'bizOption', 'creator', 'updater']\n })\n }\n\n @Query(returns => BizOptionDetailList)\n async bizOptionDetails(@Args(type => ListParam) params: ListParam): Promise<BizOptionDetailList> {\n const convertedParams = convertListParams(params)\n const [items, total] = await getRepository(BizOptionDetail).findAndCount({\n ...convertedParams,\n relations: ['domain', 'bizOption', 'creator', 'updater']\n })\n return { items, total }\n }\n}\n"]}
@@ -0,0 +1,16 @@
1
+ import { ObjectRef } from '@things-factory/shell';
2
+ import { BizOptionDetail } from './biz-option-detail';
3
+ export declare class BizOptionDetailList {
4
+ items?: BizOptionDetail[];
5
+ total?: number;
6
+ }
7
+ export declare class NewBizOptionDetail {
8
+ name: string;
9
+ description?: string;
10
+ }
11
+ export declare class BizOptionDetailPatch {
12
+ id?: string;
13
+ name?: string;
14
+ description?: string;
15
+ bizOption?: ObjectRef;
16
+ }
@@ -7,6 +7,7 @@ const shell_1 = require("@things-factory/shell");
7
7
  const biz_option_detail_1 = require("./biz-option-detail");
8
8
  let BizOptionDetailList = class BizOptionDetailList {
9
9
  };
10
+ exports.BizOptionDetailList = BizOptionDetailList;
10
11
  tslib_1.__decorate([
11
12
  (0, type_graphql_1.Field)(type => [biz_option_detail_1.BizOptionDetail], { nullable: true }),
12
13
  tslib_1.__metadata("design:type", Array)
@@ -15,12 +16,12 @@ tslib_1.__decorate([
15
16
  (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
16
17
  tslib_1.__metadata("design:type", Number)
17
18
  ], BizOptionDetailList.prototype, "total", void 0);
18
- BizOptionDetailList = tslib_1.__decorate([
19
+ exports.BizOptionDetailList = BizOptionDetailList = tslib_1.__decorate([
19
20
  (0, type_graphql_1.ObjectType)()
20
21
  ], BizOptionDetailList);
21
- exports.BizOptionDetailList = BizOptionDetailList;
22
22
  let NewBizOptionDetail = class NewBizOptionDetail {
23
23
  };
24
+ exports.NewBizOptionDetail = NewBizOptionDetail;
24
25
  tslib_1.__decorate([
25
26
  (0, type_graphql_1.Field)(),
26
27
  tslib_1.__metadata("design:type", String)
@@ -29,12 +30,12 @@ tslib_1.__decorate([
29
30
  (0, type_graphql_1.Field)({ nullable: true }),
30
31
  tslib_1.__metadata("design:type", String)
31
32
  ], NewBizOptionDetail.prototype, "description", void 0);
32
- NewBizOptionDetail = tslib_1.__decorate([
33
+ exports.NewBizOptionDetail = NewBizOptionDetail = tslib_1.__decorate([
33
34
  (0, type_graphql_1.InputType)()
34
35
  ], NewBizOptionDetail);
35
- exports.NewBizOptionDetail = NewBizOptionDetail;
36
36
  let BizOptionDetailPatch = class BizOptionDetailPatch {
37
37
  };
38
+ exports.BizOptionDetailPatch = BizOptionDetailPatch;
38
39
  tslib_1.__decorate([
39
40
  (0, type_graphql_1.Field)({ nullable: true }),
40
41
  tslib_1.__metadata("design:type", String)
@@ -51,8 +52,7 @@ tslib_1.__decorate([
51
52
  (0, type_graphql_1.Field)({ nullable: true }),
52
53
  tslib_1.__metadata("design:type", shell_1.ObjectRef)
53
54
  ], BizOptionDetailPatch.prototype, "bizOption", void 0);
54
- BizOptionDetailPatch = tslib_1.__decorate([
55
+ exports.BizOptionDetailPatch = BizOptionDetailPatch = tslib_1.__decorate([
55
56
  (0, type_graphql_1.InputType)()
56
57
  ], BizOptionDetailPatch);
57
- exports.BizOptionDetailPatch = BizOptionDetailPatch;
58
58
  //# sourceMappingURL=biz-option-detail-types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"biz-option-detail-types.js","sourceRoot":"","sources":["../../../server/service/biz-option-detail/biz-option-detail-types.ts"],"names":[],"mappings":";;;;AAAA,+CAAgE;AAEhE,iDAAiD;AAEjD,2DAAqD;AAG9C,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;CAM/B,CAAA;AALC;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,mCAAe,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDAC5B;AAEzB;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACzB;AALH,mBAAmB;IAD/B,IAAA,yBAAU,GAAE;GACA,mBAAmB,CAM/B;AANY,kDAAmB;AASzB,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;CAM9B,CAAA;AALC;IAAC,IAAA,oBAAK,GAAE;;gDACI;AAEZ;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uDACN;AALT,kBAAkB;IAD9B,IAAA,wBAAS,GAAE;GACC,kBAAkB,CAM9B;AANY,gDAAkB;AASxB,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;CAYhC,CAAA;AAXC;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDACf;AAEX;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACb;AAEb;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yDACN;AAEpB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACd,iBAAS;uDAAA;AAXV,oBAAoB;IADhC,IAAA,wBAAS,GAAE;GACC,oBAAoB,CAYhC;AAZY,oDAAoB","sourcesContent":["import { Field, InputType, Int, ObjectType } from 'type-graphql'\n\nimport { ObjectRef } from '@things-factory/shell'\n\nimport { BizOptionDetail } from './biz-option-detail'\n\n@ObjectType()\nexport class BizOptionDetailList {\n @Field(type => [BizOptionDetail], { nullable: true })\n items?: BizOptionDetail[]\n\n @Field(type => Int, { nullable: true })\n total?: number\n}\n\n@InputType()\nexport class NewBizOptionDetail {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n}\n\n@InputType()\nexport class BizOptionDetailPatch {\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({ nullable: true })\n bizOption?: ObjectRef\n}\n"]}
1
+ {"version":3,"file":"biz-option-detail-types.js","sourceRoot":"","sources":["../../../server/service/biz-option-detail/biz-option-detail-types.ts"],"names":[],"mappings":";;;;AAAA,+CAAgE;AAEhE,iDAAiD;AAEjD,2DAAqD;AAG9C,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;CAM/B,CAAA;AANY,kDAAmB;AAE9B;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,mCAAe,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDAC5B;AAGzB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACzB;8BALH,mBAAmB;IAD/B,IAAA,yBAAU,GAAE;GACA,mBAAmB,CAM/B;AAGM,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;CAM9B,CAAA;AANY,gDAAkB;AAE7B;IADC,IAAA,oBAAK,GAAE;;gDACI;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uDACN;6BALT,kBAAkB;IAD9B,IAAA,wBAAS,GAAE;GACC,kBAAkB,CAM9B;AAGM,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;CAYhC,CAAA;AAZY,oDAAoB;AAE/B;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDACf;AAGX;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACb;AAGb;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yDACN;AAGpB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACd,iBAAS;uDAAA;+BAXV,oBAAoB;IADhC,IAAA,wBAAS,GAAE;GACC,oBAAoB,CAYhC","sourcesContent":["import { Field, InputType, Int, ObjectType } from 'type-graphql'\n\nimport { ObjectRef } from '@things-factory/shell'\n\nimport { BizOptionDetail } from './biz-option-detail'\n\n@ObjectType()\nexport class BizOptionDetailList {\n @Field(type => [BizOptionDetail], { nullable: true })\n items?: BizOptionDetail[]\n\n @Field(type => Int, { nullable: true })\n total?: number\n}\n\n@InputType()\nexport class NewBizOptionDetail {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n}\n\n@InputType()\nexport class BizOptionDetailPatch {\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({ nullable: true })\n bizOption?: ObjectRef\n}\n"]}
@@ -0,0 +1,14 @@
1
+ import { User } from '@things-factory/auth-base';
2
+ import { Domain } from '@things-factory/shell';
3
+ import { BizOption } from '../biz-option/biz-option';
4
+ export declare class BizOptionDetail {
5
+ id: string;
6
+ domain: Domain;
7
+ name: string;
8
+ bizOption: BizOption;
9
+ description: string;
10
+ createdAt: Date;
11
+ updatedAt: Date;
12
+ creator: User;
13
+ updater: User;
14
+ }
@@ -9,6 +9,7 @@ const shell_1 = require("@things-factory/shell");
9
9
  const biz_option_1 = require("../biz-option/biz-option");
10
10
  let BizOptionDetail = class BizOptionDetail {
11
11
  };
12
+ exports.BizOptionDetail = BizOptionDetail;
12
13
  tslib_1.__decorate([
13
14
  (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
14
15
  (0, type_graphql_1.Field)(type => type_graphql_1.ID),
@@ -62,12 +63,11 @@ tslib_1.__decorate([
62
63
  (0, type_graphql_1.Field)({ nullable: true }),
63
64
  tslib_1.__metadata("design:type", auth_base_1.User)
64
65
  ], BizOptionDetail.prototype, "updater", void 0);
65
- BizOptionDetail = tslib_1.__decorate([
66
+ exports.BizOptionDetail = BizOptionDetail = tslib_1.__decorate([
66
67
  (0, typeorm_1.Entity)(),
67
68
  (0, typeorm_1.Index)('ix_biz-option-detail_0', (bizOptionDetail) => [bizOptionDetail.bizOption, bizOptionDetail.name], {
68
69
  unique: true
69
70
  }),
70
71
  (0, type_graphql_1.ObjectType)()
71
72
  ], BizOptionDetail);
72
- exports.BizOptionDetail = BizOptionDetail;
73
73
  //# sourceMappingURL=biz-option-detail.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"biz-option-detail.js","sourceRoot":"","sources":["../../../server/service/biz-option-detail/biz-option-detail.ts"],"names":[],"mappings":";;;;AAAA,+CAAoD;AACpD,qCAAsH;AAEtH,yDAAgD;AAChD,iDAA8C;AAE9C,yDAAoD;AAW7C,IAAM,eAAe,GAArB,MAAM,eAAe;CA4C3B,CAAA;AA3CC;IAAC,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;2CACR;AAEV;IAAC,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;sCAClB,cAAM;+CAAA;AAEd;IAAC,IAAA,gBAAM,GAAE;IACR,IAAA,oBAAK,GAAE;;6CACI;AAEZ;IAAC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,sBAAS,EAAE,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,gBAAgB,EAAE;QACrE,QAAQ,EAAE,KAAK;KAChB,CAAC;IACD,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,sBAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCAClC,sBAAS;kDAAA;AAEpB;IAAC,IAAA,gBAAM,EAAC;QACN,QAAQ,EAAE,IAAI;KACf,CAAC;IACD,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDACP;AAEnB;IAAC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACf,IAAI;kDAAA;AAEf;IAAC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACf,IAAI;kDAAA;AAEf;IAAC,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;gDAAA;AAEb;IAAC,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;gDAAA;AA3CF,eAAe;IAT3B,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EACJ,wBAAwB,EACxB,CAAC,eAAgC,EAAE,EAAE,CAAC,CAAC,eAAe,CAAC,SAAS,EAAE,eAAe,CAAC,IAAI,CAAC,EACvF;QACE,MAAM,EAAE,IAAI;KACb,CACF;IACA,IAAA,yBAAU,GAAE;GACA,eAAe,CA4C3B;AA5CY,0CAAe","sourcesContent":["import { Field, ID, ObjectType } from 'type-graphql'\nimport { Column, CreateDateColumn, Entity, Index, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm'\n\nimport { User } from '@things-factory/auth-base'\nimport { Domain } from '@things-factory/shell'\n\nimport { BizOption } from '../biz-option/biz-option'\n\n@Entity()\n@Index(\n 'ix_biz-option-detail_0',\n (bizOptionDetail: BizOptionDetail) => [bizOptionDetail.bizOption, bizOptionDetail.name],\n {\n unique: true\n }\n)\n@ObjectType()\nexport class BizOptionDetail {\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 => BizOption, bizOption => bizOption.bizOptionDetails, {\n nullable: false\n })\n @Field(type => BizOption, { nullable: true })\n bizOption: BizOption\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
+ {"version":3,"file":"biz-option-detail.js","sourceRoot":"","sources":["../../../server/service/biz-option-detail/biz-option-detail.ts"],"names":[],"mappings":";;;;AAAA,+CAAoD;AACpD,qCAAsH;AAEtH,yDAAgD;AAChD,iDAA8C;AAE9C,yDAAoD;AAW7C,IAAM,eAAe,GAArB,MAAM,eAAe;CA4C3B,CAAA;AA5CY,0CAAe;AAG1B;IAFC,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;2CACR;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;sCAClB,cAAM;+CAAA;AAId;IAFC,IAAA,gBAAM,GAAE;IACR,IAAA,oBAAK,GAAE;;6CACI;AAMZ;IAJC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,sBAAS,EAAE,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,gBAAgB,EAAE;QACrE,QAAQ,EAAE,KAAK;KAChB,CAAC;IACD,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,sBAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCAClC,sBAAS;kDAAA;AAMpB;IAJC,IAAA,gBAAM,EAAC;QACN,QAAQ,EAAE,IAAI;KACf,CAAC;IACD,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDACP;AAInB;IAFC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACf,IAAI;kDAAA;AAIf;IAFC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACf,IAAI;kDAAA;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;gDAAA;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;gDAAA;0BA3CF,eAAe;IAT3B,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EACJ,wBAAwB,EACxB,CAAC,eAAgC,EAAE,EAAE,CAAC,CAAC,eAAe,CAAC,SAAS,EAAE,eAAe,CAAC,IAAI,CAAC,EACvF;QACE,MAAM,EAAE,IAAI;KACb,CACF;IACA,IAAA,yBAAU,GAAE;GACA,eAAe,CA4C3B","sourcesContent":["import { Field, ID, ObjectType } from 'type-graphql'\nimport { Column, CreateDateColumn, Entity, Index, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm'\n\nimport { User } from '@things-factory/auth-base'\nimport { Domain } from '@things-factory/shell'\n\nimport { BizOption } from '../biz-option/biz-option'\n\n@Entity()\n@Index(\n 'ix_biz-option-detail_0',\n (bizOptionDetail: BizOptionDetail) => [bizOptionDetail.bizOption, bizOptionDetail.name],\n {\n unique: true\n }\n)\n@ObjectType()\nexport class BizOptionDetail {\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 => BizOption, bizOption => bizOption.bizOptionDetails, {\n nullable: false\n })\n @Field(type => BizOption, { nullable: true })\n bizOption: BizOption\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"]}
@@ -0,0 +1,5 @@
1
+ import { BizOptionDetail } from './biz-option-detail';
2
+ import { BizOptionDetailMutation } from './biz-option-detail-mutation';
3
+ import { BizOptionDetailQuery } from './biz-option-detail-query';
4
+ export declare const entities: (typeof BizOptionDetail)[];
5
+ export declare const resolvers: (typeof BizOptionDetailMutation | typeof BizOptionDetailQuery)[];
@@ -0,0 +1,10 @@
1
+ import { Bizplace } from './bizplace';
2
+ import { BizplacePatch, NewBizplace } from './bizplace-types';
3
+ export declare class BizplaceMutation {
4
+ createBizplace(bizplace: NewBizplace, context: ResolverContext): Promise<Bizplace>;
5
+ updateBizplace(name: string, patch: BizplacePatch, context: ResolverContext): Promise<Bizplace>;
6
+ updateMultipleBizplace(patches: BizplacePatch[], context: ResolverContext): Promise<Bizplace[]>;
7
+ updateBizplaceCheckDomain(name: string, patch: BizplacePatch, context: ResolverContext): Promise<Bizplace>;
8
+ deleteBizplace(id: string): Promise<Boolean>;
9
+ deleteBizplaces(ids: string[]): Promise<Boolean>;
10
+ }
@@ -72,6 +72,7 @@ let BizplaceMutation = class BizplaceMutation {
72
72
  return true;
73
73
  }
74
74
  };
75
+ exports.BizplaceMutation = BizplaceMutation;
75
76
  tslib_1.__decorate([
76
77
  (0, type_graphql_1.Directive)('@privilege(category: "bizplace", privilege: "mutation")'),
77
78
  (0, type_graphql_1.Mutation)(returns => bizplace_1.Bizplace),
@@ -126,8 +127,7 @@ tslib_1.__decorate([
126
127
  tslib_1.__metadata("design:paramtypes", [Array]),
127
128
  tslib_1.__metadata("design:returntype", Promise)
128
129
  ], BizplaceMutation.prototype, "deleteBizplaces", null);
129
- BizplaceMutation = tslib_1.__decorate([
130
+ exports.BizplaceMutation = BizplaceMutation = tslib_1.__decorate([
130
131
  (0, type_graphql_1.Resolver)(bizplace_1.Bizplace)
131
132
  ], BizplaceMutation);
132
- exports.BizplaceMutation = BizplaceMutation;
133
133
  //# sourceMappingURL=bizplace-mutation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"bizplace-mutation.js","sourceRoot":"","sources":["../../../server/service/bizplace/bizplace-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AAEtE,iDAA6D;AAC7D,iDAA+C;AAE/C,gDAA4C;AAC5C,yCAAqC;AACrC,qDAA6D;AAGtD,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAGrB,AAAN,KAAK,CAAC,cAAc,CAAkB,QAAqB,EAAS,OAAwB;QAC1F,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QACtC,IAAI,QAAQ,CAAC,OAAO,IAAI,QAAQ,CAAC,OAAO,CAAC,EAAE,EAAE;YAC3C,QAAQ,CAAC,OAAO,GAAG,MAAM,IAAA,qBAAa,EAAC,iBAAO,CAAC,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,QAAQ,CAAC,OAAO,CAAC,EA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,mBAAA,IAAA,kBAAG,GAAE,CAAA;;qDADe,8BAAa;;iEAqBnC;AAIK;IAFL,IAAA,wBAAS,EAAC,yDAAyD,CAAC;IACpE,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC;IACP,mBAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;;;;sDAI9B;AAIK;IAFL,IAAA,wBAAS,EAAC,yDAAyD,CAAC;IACpE,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC;IACN,mBAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;;;;uDAIlD;AApIU,gBAAgB;IAD5B,IAAA,uBAAQ,EAAC,mBAAQ,CAAC;GACN,gBAAgB,CAqI5B;AArIY,4CAAgB","sourcesContent":["import { Arg, Ctx, Directive, Mutation, Resolver } from 'type-graphql'\n\nimport { Domain, getRepository } from '@things-factory/shell'\nimport { slugger } from '@things-factory/utils'\n\nimport { Company } from '../company/company'\nimport { Bizplace } from './bizplace'\nimport { BizplacePatch, NewBizplace } from './bizplace-types'\n\n@Resolver(Bizplace)\nexport class BizplaceMutation {\n @Directive('@privilege(category: \"bizplace\", privilege: \"mutation\")')\n @Mutation(returns => Bizplace)\n async createBizplace(@Arg('bizplace') bizplace: NewBizplace, @Ctx() context: ResolverContext): Promise<Bizplace> {\n const { domain, user } = context.state\n if (bizplace.company && bizplace.company.id) {\n bizplace.company = await getRepository(Company).findOneBy({ id: bizplace.company.id })\n }\n\n return await getRepository(Bizplace).save({\n ...bizplace,\n domain,\n creator: user,\n updater: user\n })\n }\n\n @Directive('@privilege(category: \"bizplace\", privilege: \"mutation\")')\n @Mutation(returns => Bizplace)\n async updateBizplace(\n @Arg('name') name: string,\n @Arg('patch') patch: BizplacePatch,\n @Ctx() context: ResolverContext\n ): Promise<Bizplace> {\n const { domain, user } = context.state\n const bizplace = await getRepository(Bizplace).findOneBy({ domain: { id: domain.id }, name })\n\n if (patch.company && patch.company.id) {\n patch.company = await getRepository(Company).findOneBy({ id: patch.company.id })\n }\n\n return await getRepository(Bizplace).save({\n ...bizplace,\n ...patch,\n updater: user\n })\n }\n\n @Directive('@privilege(category: \"bizplace\", privilege: \"mutation\")')\n @Mutation(returns => [Bizplace])\n async updateMultipleBizplace(\n @Arg('patches', type => [BizplacePatch]) patches: BizplacePatch[],\n @Ctx() context: ResolverContext\n ): Promise<Bizplace[]> {\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 bizplaceRepo = getRepository(Bizplace)\n const companyRepo = getRepository(Company)\n\n if (_createRecords.length > 0) {\n for (let i = 0; i < _createRecords.length; i++) {\n const newRecord = _createRecords[i]\n\n if (newRecord.company && newRecord.company.id) {\n newRecord.company = await companyRepo.findOneBy({ id: newRecord.company.id })\n }\n\n const result = await bizplaceRepo.save({\n domain: context.state.domain,\n creator: context.state.user,\n updater: context.state.user,\n ...newRecord\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 bizplace = await bizplaceRepo.findOneBy({ id: newRecord.id })\n\n if (newRecord.company && newRecord.company.id) {\n newRecord.company = await companyRepo.findOneBy({ id: newRecord.company.id })\n }\n\n const result = await bizplaceRepo.save({\n ...bizplace,\n ...newRecord,\n updater: context.state.user\n })\n\n results.push({ ...result, cuFlag: 'M' })\n }\n }\n\n return results\n }\n\n @Directive('@privilege(category: \"bizplace\", privilege: \"mutation\")')\n @Mutation(returns => Bizplace)\n async updateBizplaceCheckDomain(\n @Arg('name') name: string,\n @Arg('patch') patch: BizplacePatch,\n @Ctx() context: ResolverContext\n ): Promise<Bizplace> {\n let bizplace: Bizplace = await getRepository(Bizplace).findOne({ where: { name }, relations: ['domain'] })\n let domain: Domain = bizplace.domain\n\n if (domain) {\n if (bizplace.name !== patch.name) {\n domain = await getRepository(Domain).save({\n ...domain,\n name: patch.name,\n subdomain: slugger(patch.name)\n })\n }\n }\n\n return await getRepository(Bizplace).save({\n ...bizplace,\n ...patch,\n updater: context.state.user\n })\n }\n\n @Directive('@privilege(category: \"bizplace\", privilege: \"mutation\")')\n @Mutation(returns => Boolean)\n async deleteBizplace(@Arg('id') id: string): Promise<Boolean> {\n await getRepository(Bizplace).delete(id)\n\n return true\n }\n\n @Directive('@privilege(category: \"bizplace\", privilege: \"mutation\")')\n @Mutation(returns => Boolean)\n async deleteBizplaces(@Arg('ids', type => [String]) ids: string[]): Promise<Boolean> {\n await getRepository(Bizplace).delete(ids)\n\n return true\n }\n}\n"]}
1
+ {"version":3,"file":"bizplace-mutation.js","sourceRoot":"","sources":["../../../server/service/bizplace/bizplace-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AAEtE,iDAA6D;AAC7D,iDAA+C;AAE/C,gDAA4C;AAC5C,yCAAqC;AACrC,qDAA6D;AAGtD,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAGrB,AAAN,KAAK,CAAC,cAAc,CAAkB,QAAqB,EAAS,OAAwB;QAC1F,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QACtC,IAAI,QAAQ,CAAC,OAAO,IAAI,QAAQ,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC;YAC5C,QAAQ,CAAC,OAAO,GAAG,MAAM,IAAA,qBAAa,EAAC,iBAAO,CAAC,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,CAAA;QACxF,CAAC;QAED,OAAO,MAAM,IAAA,qBAAa,EAAC,mBAAQ,CAAC,CAAC,IAAI,iCACpC,QAAQ,KACX,MAAM,EACN,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,IAAI,IACb,CA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8BAAa;;iEAqBnC;AAIK;IAFL,IAAA,wBAAS,EAAC,yDAAyD,CAAC;IACpE,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC;IACP,mBAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;;;;sDAI9B;AAIK;IAFL,IAAA,wBAAS,EAAC,yDAAyD,CAAC;IACpE,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC;IACN,mBAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;;;;uDAIlD;2BApIU,gBAAgB;IAD5B,IAAA,uBAAQ,EAAC,mBAAQ,CAAC;GACN,gBAAgB,CAqI5B","sourcesContent":["import { Arg, Ctx, Directive, Mutation, Resolver } from 'type-graphql'\n\nimport { Domain, getRepository } from '@things-factory/shell'\nimport { slugger } from '@things-factory/utils'\n\nimport { Company } from '../company/company'\nimport { Bizplace } from './bizplace'\nimport { BizplacePatch, NewBizplace } from './bizplace-types'\n\n@Resolver(Bizplace)\nexport class BizplaceMutation {\n @Directive('@privilege(category: \"bizplace\", privilege: \"mutation\")')\n @Mutation(returns => Bizplace)\n async createBizplace(@Arg('bizplace') bizplace: NewBizplace, @Ctx() context: ResolverContext): Promise<Bizplace> {\n const { domain, user } = context.state\n if (bizplace.company && bizplace.company.id) {\n bizplace.company = await getRepository(Company).findOneBy({ id: bizplace.company.id })\n }\n\n return await getRepository(Bizplace).save({\n ...bizplace,\n domain,\n creator: user,\n updater: user\n })\n }\n\n @Directive('@privilege(category: \"bizplace\", privilege: \"mutation\")')\n @Mutation(returns => Bizplace)\n async updateBizplace(\n @Arg('name') name: string,\n @Arg('patch') patch: BizplacePatch,\n @Ctx() context: ResolverContext\n ): Promise<Bizplace> {\n const { domain, user } = context.state\n const bizplace = await getRepository(Bizplace).findOneBy({ domain: { id: domain.id }, name })\n\n if (patch.company && patch.company.id) {\n patch.company = await getRepository(Company).findOneBy({ id: patch.company.id })\n }\n\n return await getRepository(Bizplace).save({\n ...bizplace,\n ...patch,\n updater: user\n })\n }\n\n @Directive('@privilege(category: \"bizplace\", privilege: \"mutation\")')\n @Mutation(returns => [Bizplace])\n async updateMultipleBizplace(\n @Arg('patches', type => [BizplacePatch]) patches: BizplacePatch[],\n @Ctx() context: ResolverContext\n ): Promise<Bizplace[]> {\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 bizplaceRepo = getRepository(Bizplace)\n const companyRepo = getRepository(Company)\n\n if (_createRecords.length > 0) {\n for (let i = 0; i < _createRecords.length; i++) {\n const newRecord = _createRecords[i]\n\n if (newRecord.company && newRecord.company.id) {\n newRecord.company = await companyRepo.findOneBy({ id: newRecord.company.id })\n }\n\n const result = await bizplaceRepo.save({\n domain: context.state.domain,\n creator: context.state.user,\n updater: context.state.user,\n ...newRecord\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 bizplace = await bizplaceRepo.findOneBy({ id: newRecord.id })\n\n if (newRecord.company && newRecord.company.id) {\n newRecord.company = await companyRepo.findOneBy({ id: newRecord.company.id })\n }\n\n const result = await bizplaceRepo.save({\n ...bizplace,\n ...newRecord,\n updater: context.state.user\n })\n\n results.push({ ...result, cuFlag: 'M' })\n }\n }\n\n return results\n }\n\n @Directive('@privilege(category: \"bizplace\", privilege: \"mutation\")')\n @Mutation(returns => Bizplace)\n async updateBizplaceCheckDomain(\n @Arg('name') name: string,\n @Arg('patch') patch: BizplacePatch,\n @Ctx() context: ResolverContext\n ): Promise<Bizplace> {\n let bizplace: Bizplace = await getRepository(Bizplace).findOne({ where: { name }, relations: ['domain'] })\n let domain: Domain = bizplace.domain\n\n if (domain) {\n if (bizplace.name !== patch.name) {\n domain = await getRepository(Domain).save({\n ...domain,\n name: patch.name,\n subdomain: slugger(patch.name)\n })\n }\n }\n\n return await getRepository(Bizplace).save({\n ...bizplace,\n ...patch,\n updater: context.state.user\n })\n }\n\n @Directive('@privilege(category: \"bizplace\", privilege: \"mutation\")')\n @Mutation(returns => Boolean)\n async deleteBizplace(@Arg('id') id: string): Promise<Boolean> {\n await getRepository(Bizplace).delete(id)\n\n return true\n }\n\n @Directive('@privilege(category: \"bizplace\", privilege: \"mutation\")')\n @Mutation(returns => Boolean)\n async deleteBizplaces(@Arg('ids', type => [String]) ids: string[]): Promise<Boolean> {\n await getRepository(Bizplace).delete(ids)\n\n return true\n }\n}\n"]}
@@ -0,0 +1,19 @@
1
+ import { EntityManager, FindManyOptions } from 'typeorm';
2
+ import { User, UserList } from '@things-factory/auth-base';
3
+ import { ListParam } from '@things-factory/shell';
4
+ import { Bizplace } from './bizplace';
5
+ import { BizplaceList } from './bizplace-types';
6
+ export declare class BizplaceQuery {
7
+ customerBizplaces(context: ResolverContext): Promise<Bizplace[]>;
8
+ businessBizplace(context: ResolverContext): Promise<Bizplace>;
9
+ userBizplaces(email: string, context: ResolverContext): Promise<Bizplace[]>;
10
+ bizplaces(params: ListParam, context: ResolverContext): Promise<BizplaceList>;
11
+ bizplace(id: string): Promise<Bizplace>;
12
+ bizplaceUsers(params: ListParam, context: ResolverContext): Promise<UserList>;
13
+ partnersBizplaces(params: ListParam, context: ResolverContext): Promise<BizplaceList>;
14
+ permittedPartnersCompanyBizplaces(params: ListParam, context: ResolverContext): Promise<BizplaceList>;
15
+ }
16
+ export declare function bizplaceUsers(bizplace: Bizplace, params: FindManyOptions<User>, trxMgr?: EntityManager): Promise<{
17
+ items: User[];
18
+ total: number;
19
+ }>;