@things-factory/biz-base 4.3.671 → 4.3.673

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 (73) hide show
  1. package/dist-server/index.js +20 -0
  2. package/dist-server/index.js.map +1 -0
  3. package/dist-server/middlewares/index.js +1 -0
  4. package/dist-server/middlewares/index.js.map +1 -0
  5. package/dist-server/migrations/index.js +12 -0
  6. package/dist-server/migrations/index.js.map +1 -0
  7. package/dist-server/service/biz-option/biz-option-mutation.js +80 -0
  8. package/dist-server/service/biz-option/biz-option-mutation.js.map +1 -0
  9. package/dist-server/service/biz-option/biz-option-query.js +55 -0
  10. package/dist-server/service/biz-option/biz-option-query.js.map +1 -0
  11. package/dist-server/service/biz-option/biz-option-types.js +75 -0
  12. package/dist-server/service/biz-option/biz-option-types.js.map +1 -0
  13. package/dist-server/service/biz-option/biz-option.js +86 -0
  14. package/dist-server/service/biz-option/biz-option.js.map +1 -0
  15. package/dist-server/service/biz-option/index.js +9 -0
  16. package/dist-server/service/biz-option/index.js.map +1 -0
  17. package/dist-server/service/biz-option-detail/biz-option-detail-mutation.js +80 -0
  18. package/dist-server/service/biz-option-detail/biz-option-detail-mutation.js.map +1 -0
  19. package/dist-server/service/biz-option-detail/biz-option-detail-query.js +54 -0
  20. package/dist-server/service/biz-option-detail/biz-option-detail-query.js.map +1 -0
  21. package/dist-server/service/biz-option-detail/biz-option-detail-types.js +67 -0
  22. package/dist-server/service/biz-option-detail/biz-option-detail-types.js.map +1 -0
  23. package/dist-server/service/biz-option-detail/biz-option-detail.js +82 -0
  24. package/dist-server/service/biz-option-detail/biz-option-detail.js.map +1 -0
  25. package/dist-server/service/biz-option-detail/index.js +9 -0
  26. package/dist-server/service/biz-option-detail/index.js.map +1 -0
  27. package/dist-server/service/bizplace/bizplace-mutation.js +144 -0
  28. package/dist-server/service/bizplace/bizplace-mutation.js.map +1 -0
  29. package/dist-server/service/bizplace/bizplace-query.js +284 -0
  30. package/dist-server/service/bizplace/bizplace-query.js.map +1 -0
  31. package/dist-server/service/bizplace/bizplace-types.js +189 -0
  32. package/dist-server/service/bizplace/bizplace-types.js.map +1 -0
  33. package/dist-server/service/bizplace/bizplace.js +194 -0
  34. package/dist-server/service/bizplace/bizplace.js.map +1 -0
  35. package/dist-server/service/bizplace/index.js +9 -0
  36. package/dist-server/service/bizplace/index.js.map +1 -0
  37. package/dist-server/service/company/company-mutation.js +141 -0
  38. package/dist-server/service/company/company-mutation.js.map +1 -0
  39. package/dist-server/service/company/company-query.js +102 -0
  40. package/dist-server/service/company/company-query.js.map +1 -0
  41. package/dist-server/service/company/company-types.js +109 -0
  42. package/dist-server/service/company/company-types.js.map +1 -0
  43. package/dist-server/service/company/company.js +135 -0
  44. package/dist-server/service/company/company.js.map +1 -0
  45. package/dist-server/service/company/index.js +9 -0
  46. package/dist-server/service/company/index.js.map +1 -0
  47. package/dist-server/service/contact-point/contact-point-mutation.js +164 -0
  48. package/dist-server/service/contact-point/contact-point-mutation.js.map +1 -0
  49. package/dist-server/service/contact-point/contact-point-query.js +63 -0
  50. package/dist-server/service/contact-point/contact-point-query.js.map +1 -0
  51. package/dist-server/service/contact-point/contact-point-types.js +171 -0
  52. package/dist-server/service/contact-point/contact-point-types.js.map +1 -0
  53. package/dist-server/service/contact-point/contact-point.js +139 -0
  54. package/dist-server/service/contact-point/contact-point.js.map +1 -0
  55. package/dist-server/service/contact-point/index.js +9 -0
  56. package/dist-server/service/contact-point/index.js.map +1 -0
  57. package/dist-server/service/index.js +67 -0
  58. package/dist-server/service/index.js.map +1 -0
  59. package/dist-server/service/worker/index.js +9 -0
  60. package/dist-server/service/worker/index.js.map +1 -0
  61. package/dist-server/service/worker/worker-mutation.js +134 -0
  62. package/dist-server/service/worker/worker-mutation.js.map +1 -0
  63. package/dist-server/service/worker/worker-query.js +63 -0
  64. package/dist-server/service/worker/worker-query.js.map +1 -0
  65. package/dist-server/service/worker/worker-types.js +83 -0
  66. package/dist-server/service/worker/worker-types.js.map +1 -0
  67. package/dist-server/service/worker/worker.js +83 -0
  68. package/dist-server/service/worker/worker.js.map +1 -0
  69. package/dist-server/utils/get-permitted-bizplaces.js +285 -0
  70. package/dist-server/utils/get-permitted-bizplaces.js.map +1 -0
  71. package/dist-server/utils/index.js +18 -0
  72. package/dist-server/utils/index.js.map +1 -0
  73. package/package.json +3 -3
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var _a, _b, _c;
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.BizOptionDetail = void 0;
14
+ const type_graphql_1 = require("type-graphql");
15
+ const typeorm_1 = require("typeorm");
16
+ const auth_base_1 = require("@things-factory/auth-base");
17
+ const shell_1 = require("@things-factory/shell");
18
+ const biz_option_1 = require("../biz-option/biz-option");
19
+ let BizOptionDetail = class BizOptionDetail {
20
+ };
21
+ __decorate([
22
+ (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
23
+ (0, type_graphql_1.Field)(type => type_graphql_1.ID),
24
+ __metadata("design:type", String)
25
+ ], BizOptionDetail.prototype, "id", void 0);
26
+ __decorate([
27
+ (0, typeorm_1.ManyToOne)(type => shell_1.Domain, { nullable: true }),
28
+ (0, type_graphql_1.Field)({ nullable: true }),
29
+ __metadata("design:type", typeof (_a = typeof shell_1.Domain !== "undefined" && shell_1.Domain) === "function" ? _a : Object)
30
+ ], BizOptionDetail.prototype, "domain", void 0);
31
+ __decorate([
32
+ (0, typeorm_1.Column)(),
33
+ (0, type_graphql_1.Field)(),
34
+ __metadata("design:type", String)
35
+ ], BizOptionDetail.prototype, "name", void 0);
36
+ __decorate([
37
+ (0, typeorm_1.ManyToOne)(type => biz_option_1.BizOption, bizOption => bizOption.bizOptionDetails, {
38
+ nullable: false
39
+ }),
40
+ (0, type_graphql_1.Field)(type => biz_option_1.BizOption, { nullable: true }),
41
+ __metadata("design:type", biz_option_1.BizOption)
42
+ ], BizOptionDetail.prototype, "bizOption", void 0);
43
+ __decorate([
44
+ (0, typeorm_1.Column)({
45
+ nullable: true
46
+ }),
47
+ (0, type_graphql_1.Field)({ nullable: true }),
48
+ __metadata("design:type", String)
49
+ ], BizOptionDetail.prototype, "description", void 0);
50
+ __decorate([
51
+ (0, typeorm_1.CreateDateColumn)(),
52
+ (0, type_graphql_1.Field)({ nullable: true }),
53
+ __metadata("design:type", Date)
54
+ ], BizOptionDetail.prototype, "createdAt", void 0);
55
+ __decorate([
56
+ (0, typeorm_1.UpdateDateColumn)(),
57
+ (0, type_graphql_1.Field)({ nullable: true }),
58
+ __metadata("design:type", Date)
59
+ ], BizOptionDetail.prototype, "updatedAt", void 0);
60
+ __decorate([
61
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
62
+ nullable: true
63
+ }),
64
+ (0, type_graphql_1.Field)({ nullable: true }),
65
+ __metadata("design:type", typeof (_b = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _b : Object)
66
+ ], BizOptionDetail.prototype, "creator", void 0);
67
+ __decorate([
68
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
69
+ nullable: true
70
+ }),
71
+ (0, type_graphql_1.Field)({ nullable: true }),
72
+ __metadata("design:type", typeof (_c = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _c : Object)
73
+ ], BizOptionDetail.prototype, "updater", void 0);
74
+ BizOptionDetail = __decorate([
75
+ (0, typeorm_1.Entity)(),
76
+ (0, typeorm_1.Index)('ix_biz-option-detail_0', (bizOptionDetail) => [bizOptionDetail.bizOption, bizOptionDetail.name], {
77
+ unique: true
78
+ }),
79
+ (0, type_graphql_1.ObjectType)()
80
+ ], BizOptionDetail);
81
+ exports.BizOptionDetail = BizOptionDetail;
82
+ //# sourceMappingURL=biz-option-detail.js.map
@@ -0,0 +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;kDAClB,cAAM,oBAAN,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;8BAClC,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;8BACf,IAAI;kDAAA;AAEf;IAAC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACf,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;kDACjB,gBAAI,oBAAJ,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;kDACjB,gBAAI,oBAAJ,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"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.resolvers = exports.entities = void 0;
4
+ const biz_option_detail_1 = require("./biz-option-detail");
5
+ const biz_option_detail_mutation_1 = require("./biz-option-detail-mutation");
6
+ const biz_option_detail_query_1 = require("./biz-option-detail-query");
7
+ exports.entities = [biz_option_detail_1.BizOptionDetail];
8
+ exports.resolvers = [biz_option_detail_query_1.BizOptionDetailQuery, biz_option_detail_mutation_1.BizOptionDetailMutation];
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/biz-option-detail/index.ts"],"names":[],"mappings":";;;AAAA,2DAAqD;AACrD,6EAAsE;AACtE,uEAAgE;AAEnD,QAAA,QAAQ,GAAG,CAAC,mCAAe,CAAC,CAAA;AAC5B,QAAA,SAAS,GAAG,CAAC,8CAAoB,EAAE,oDAAuB,CAAC,CAAA"}
@@ -0,0 +1,144 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.BizplaceMutation = void 0;
16
+ const type_graphql_1 = require("type-graphql");
17
+ const typeorm_1 = require("typeorm");
18
+ const shell_1 = require("@things-factory/shell");
19
+ const utils_1 = require("@things-factory/utils");
20
+ const company_1 = require("../company/company");
21
+ const bizplace_1 = require("./bizplace");
22
+ const bizplace_types_1 = require("./bizplace-types");
23
+ let BizplaceMutation = class BizplaceMutation {
24
+ async createBizplace(bizplace, context) {
25
+ const { domain, user } = context.state;
26
+ if (bizplace.company && bizplace.company.id) {
27
+ bizplace.company = await (0, typeorm_1.getRepository)(company_1.Company).findOne(bizplace.company.id);
28
+ }
29
+ return await (0, typeorm_1.getRepository)(bizplace_1.Bizplace).save(Object.assign(Object.assign({}, bizplace), { domain, creator: user, updater: user }));
30
+ }
31
+ async updateBizplace(name, patch, context) {
32
+ const bizplace = await (0, typeorm_1.getRepository)(bizplace_1.Bizplace).findOne({ domain: context.state.domain, name });
33
+ if (patch.company && patch.company.id) {
34
+ patch.company = await (0, typeorm_1.getRepository)(company_1.Company).findOne(patch.company.id);
35
+ }
36
+ return await (0, typeorm_1.getRepository)(bizplace_1.Bizplace).save(Object.assign(Object.assign(Object.assign({}, bizplace), patch), { updater: context.state.user }));
37
+ }
38
+ async updateMultipleBizplace(patches, context) {
39
+ let results = [];
40
+ const _createRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === '+');
41
+ const _updateRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === 'M');
42
+ const bizplaceRepo = (0, typeorm_1.getRepository)(bizplace_1.Bizplace);
43
+ const companyRepo = (0, typeorm_1.getRepository)(company_1.Company);
44
+ if (_createRecords.length > 0) {
45
+ for (let i = 0; i < _createRecords.length; i++) {
46
+ const newRecord = _createRecords[i];
47
+ if (newRecord.company && newRecord.company.id) {
48
+ newRecord.company = await companyRepo.findOne(newRecord.company.id);
49
+ }
50
+ const result = await bizplaceRepo.save(Object.assign({ domain: context.state.domain, creator: context.state.user, updater: context.state.user }, newRecord));
51
+ results.push(Object.assign(Object.assign({}, result), { cuFlag: '+' }));
52
+ }
53
+ }
54
+ if (_updateRecords.length > 0) {
55
+ for (let i = 0; i < _updateRecords.length; i++) {
56
+ const newRecord = _updateRecords[i];
57
+ const bizplace = await bizplaceRepo.findOne(newRecord.id);
58
+ if (newRecord.company && newRecord.company.id) {
59
+ newRecord.company = await companyRepo.findOne(newRecord.company.id);
60
+ }
61
+ const result = await bizplaceRepo.save(Object.assign(Object.assign(Object.assign({}, bizplace), newRecord), { updater: context.state.user }));
62
+ results.push(Object.assign(Object.assign({}, result), { cuFlag: 'M' }));
63
+ }
64
+ }
65
+ return results;
66
+ }
67
+ async updateBizplaceCheckDomain(name, patch, context) {
68
+ let bizplace = await (0, typeorm_1.getRepository)(bizplace_1.Bizplace).findOne({ where: { name }, relations: ['domain'] });
69
+ let domain = bizplace.domain;
70
+ if (domain) {
71
+ if (bizplace.name !== patch.name) {
72
+ domain = await (0, typeorm_1.getRepository)(shell_1.Domain).save(Object.assign(Object.assign({}, domain), { name: patch.name, subdomain: (0, utils_1.slugger)(patch.name) }));
73
+ }
74
+ }
75
+ return await (0, typeorm_1.getRepository)(bizplace_1.Bizplace).save(Object.assign(Object.assign(Object.assign({}, bizplace), patch), { updater: context.state.user }));
76
+ }
77
+ async deleteBizplace(id) {
78
+ await (0, typeorm_1.getRepository)(bizplace_1.Bizplace).delete(id);
79
+ return true;
80
+ }
81
+ async deleteBizplaces(ids) {
82
+ await (0, typeorm_1.getRepository)(bizplace_1.Bizplace).delete(ids);
83
+ return true;
84
+ }
85
+ };
86
+ __decorate([
87
+ (0, type_graphql_1.Directive)('@privilege(category: "bizplace", privilege: "mutation")'),
88
+ (0, type_graphql_1.Mutation)(returns => bizplace_1.Bizplace),
89
+ __param(0, (0, type_graphql_1.Arg)('bizplace')),
90
+ __param(1, (0, type_graphql_1.Ctx)()),
91
+ __metadata("design:type", Function),
92
+ __metadata("design:paramtypes", [bizplace_types_1.NewBizplace, Object]),
93
+ __metadata("design:returntype", Promise)
94
+ ], BizplaceMutation.prototype, "createBizplace", null);
95
+ __decorate([
96
+ (0, type_graphql_1.Directive)('@privilege(category: "bizplace", privilege: "mutation")'),
97
+ (0, type_graphql_1.Mutation)(returns => bizplace_1.Bizplace),
98
+ __param(0, (0, type_graphql_1.Arg)('name')),
99
+ __param(1, (0, type_graphql_1.Arg)('patch')),
100
+ __param(2, (0, type_graphql_1.Ctx)()),
101
+ __metadata("design:type", Function),
102
+ __metadata("design:paramtypes", [String, bizplace_types_1.BizplacePatch, Object]),
103
+ __metadata("design:returntype", Promise)
104
+ ], BizplaceMutation.prototype, "updateBizplace", null);
105
+ __decorate([
106
+ (0, type_graphql_1.Directive)('@privilege(category: "bizplace", privilege: "mutation")'),
107
+ (0, type_graphql_1.Mutation)(returns => [bizplace_1.Bizplace]),
108
+ __param(0, (0, type_graphql_1.Arg)('patches', type => [bizplace_types_1.BizplacePatch])),
109
+ __param(1, (0, type_graphql_1.Ctx)()),
110
+ __metadata("design:type", Function),
111
+ __metadata("design:paramtypes", [Array, Object]),
112
+ __metadata("design:returntype", Promise)
113
+ ], BizplaceMutation.prototype, "updateMultipleBizplace", null);
114
+ __decorate([
115
+ (0, type_graphql_1.Directive)('@privilege(category: "bizplace", privilege: "mutation")'),
116
+ (0, type_graphql_1.Mutation)(returns => bizplace_1.Bizplace),
117
+ __param(0, (0, type_graphql_1.Arg)('name')),
118
+ __param(1, (0, type_graphql_1.Arg)('patch')),
119
+ __param(2, (0, type_graphql_1.Ctx)()),
120
+ __metadata("design:type", Function),
121
+ __metadata("design:paramtypes", [String, bizplace_types_1.BizplacePatch, Object]),
122
+ __metadata("design:returntype", Promise)
123
+ ], BizplaceMutation.prototype, "updateBizplaceCheckDomain", null);
124
+ __decorate([
125
+ (0, type_graphql_1.Directive)('@privilege(category: "bizplace", privilege: "mutation")'),
126
+ (0, type_graphql_1.Mutation)(returns => Boolean),
127
+ __param(0, (0, type_graphql_1.Arg)('id')),
128
+ __metadata("design:type", Function),
129
+ __metadata("design:paramtypes", [String]),
130
+ __metadata("design:returntype", Promise)
131
+ ], BizplaceMutation.prototype, "deleteBizplace", null);
132
+ __decorate([
133
+ (0, type_graphql_1.Directive)('@privilege(category: "bizplace", privilege: "mutation")'),
134
+ (0, type_graphql_1.Mutation)(returns => Boolean),
135
+ __param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
136
+ __metadata("design:type", Function),
137
+ __metadata("design:paramtypes", [Array]),
138
+ __metadata("design:returntype", Promise)
139
+ ], BizplaceMutation.prototype, "deleteBizplaces", null);
140
+ BizplaceMutation = __decorate([
141
+ (0, type_graphql_1.Resolver)(bizplace_1.Bizplace)
142
+ ], BizplaceMutation);
143
+ exports.BizplaceMutation = BizplaceMutation;
144
+ //# sourceMappingURL=bizplace-mutation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bizplace-mutation.js","sourceRoot":"","sources":["../../../server/service/bizplace/bizplace-mutation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+CAAsE;AACtE,qCAAuC;AAEvC,iDAA8C;AAC9C,iDAA+C;AAE/C,gDAA4C;AAC5C,yCAAqC;AACrC,qDAA6D;AAGtD,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAGrB,AAAN,KAAK,CAAC,cAAc,CAAkB,QAAqB,EAAS,OAAY;QAC9E,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,uBAAa,EAAC,iBAAO,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;SAC7E;QAED,OAAO,MAAM,IAAA,uBAAa,EAAC,mBAAQ,CAAC,CAAC,IAAI,iCACpC,QAAQ,KACX,MAAM,EACN,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,IAAI,IACb,CAAA;IACJ,CAAC;IAIK,AAAN,KAAK,CAAC,cAAc,CACL,IAAY,EACX,KAAoB,EAC3B,OAAY;QAEnB,MAAM,QAAQ,GAAG,MAAM,IAAA,uBAAa,EAAC,mBAAQ,CAAC,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAA;QAE9F,IAAI,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC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: 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, _b, _c, _d, _e;
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.bizplaceUsers = exports.BizplaceQuery = void 0;
17
+ const type_graphql_1 = require("type-graphql");
18
+ const typeorm_1 = require("typeorm");
19
+ const auth_base_1 = require("@things-factory/auth-base");
20
+ const shell_1 = require("@things-factory/shell");
21
+ const utils_1 = require("../../utils");
22
+ const bizplace_1 = require("./bizplace");
23
+ const bizplace_types_1 = require("./bizplace-types");
24
+ let BizplaceQuery = class BizplaceQuery {
25
+ async customerBizplaces(context) {
26
+ const { domain, user } = context.state;
27
+ return await (0, typeorm_1.getRepository)(bizplace_1.Bizplace).find({
28
+ where: {
29
+ domain,
30
+ id: (0, typeorm_1.Not)((0, typeorm_1.In)([await (0, utils_1.getMyBizplace)(domain, user)]))
31
+ },
32
+ relations: ['domain', 'creator', 'updater']
33
+ });
34
+ }
35
+ async businessBizplace(context) {
36
+ const { domain, user } = context.state;
37
+ const myBizplace = await (0, utils_1.getMyBizplace)(domain, user);
38
+ return await (0, typeorm_1.getRepository)(bizplace_1.Bizplace).findOne({
39
+ where: { id: myBizplace.id },
40
+ relations: ['company', 'domain', 'users', 'creator', 'updater']
41
+ });
42
+ }
43
+ async userBizplaces(email, context) {
44
+ const user = await (0, typeorm_1.getRepository)(auth_base_1.User).findOne({
45
+ domain: context.state.domain,
46
+ email: email != '' ? email : context.state.user.email
47
+ }, {
48
+ relations: ['bizplaces']
49
+ });
50
+ const bizplaces = await (0, typeorm_1.getRepository)(bizplace_1.Bizplace).find({ domain: context.state.domain });
51
+ const userBizplaces = user.bizplaces;
52
+ return bizplaces.map((bizplace) => {
53
+ return {
54
+ id: bizplace.id,
55
+ name: bizplace.name,
56
+ description: bizplace.description,
57
+ userBizplaceId: userBizplaces
58
+ .map(userBiz => userBiz.bizplace.id)
59
+ .slice(0, 1)
60
+ .shift(),
61
+ assigned: userBizplaces.filter((userBizplace) => userBizplace.id === bizplace.id).length > 0
62
+ };
63
+ });
64
+ }
65
+ async bizplaces(params, context) {
66
+ let bizplace_ids = [];
67
+ let bizplaceIndex = params.filters.findIndex(x => x.name === 'bizplace');
68
+ if (bizplaceIndex > -1) {
69
+ bizplace_ids = params.filters
70
+ .filter(x => x.name === 'bizplace')
71
+ .map(item => {
72
+ return item.value;
73
+ });
74
+ params.filters.splice(bizplaceIndex, 1);
75
+ }
76
+ const convertedParams = (0, shell_1.convertListParams)(params);
77
+ let domainIndex = params.filters.findIndex(x => x.name === 'domain');
78
+ if (domainIndex > -1) {
79
+ convertedParams.where.id = (0, typeorm_1.In)(await (0, utils_1.getPartnerBizplaceIds)(context.state.domain, context.state.user));
80
+ }
81
+ else {
82
+ if (!(bizplace_ids.length > 0))
83
+ convertedParams.where.id = (0, typeorm_1.In)(await (0, utils_1.getPermittedBizplaceIds)(context.state.domain, context.state.user));
84
+ else
85
+ convertedParams.where.id = (0, typeorm_1.In)(bizplace_ids);
86
+ }
87
+ const [items, total] = await (0, typeorm_1.getRepository)(bizplace_1.Bizplace).findAndCount(Object.assign(Object.assign({}, convertedParams), { relations: ['domain', 'company', 'users', 'creator', 'updater'] }));
88
+ return { items, total };
89
+ }
90
+ async bizplace(id) {
91
+ return await (0, typeorm_1.getRepository)(bizplace_1.Bizplace).findOne({
92
+ where: { id },
93
+ relations: ['company', 'domain', 'users', 'users.roles', 'creator', 'updater']
94
+ });
95
+ }
96
+ async bizplaceUsers(params, context) {
97
+ const { domain, user } = context.state;
98
+ const myBizplace = await (0, utils_1.getMyBizplace)(domain, user);
99
+ return await bizplaceUsers(myBizplace, Object.assign(Object.assign({}, (await (0, shell_1.convertListParams)(params))), { relations: ['domain', 'domains', 'roles', 'roles.privileges', 'roles.users'] }));
100
+ }
101
+ async partnersBizplaces(params, context) {
102
+ let partnersBizplaceIds = [];
103
+ let bizplaceIndex = params.filters.findIndex(x => x.name === 'bizplace');
104
+ if (bizplaceIndex > -1) {
105
+ partnersBizplaceIds = params.filters
106
+ .filter(x => x.name === 'bizplace')
107
+ .map(item => {
108
+ return item.value;
109
+ });
110
+ params.filters.splice(bizplaceIndex, 1);
111
+ }
112
+ const convertedParams = (0, shell_1.convertListParams)(params);
113
+ if (!(partnersBizplaceIds.length > 0)) {
114
+ const partnersBizplaces = await (0, utils_1.getPartnersBizplaces)(context.state.domain, context.state.user);
115
+ partnersBizplaceIds = partnersBizplaces.map((bizplace) => bizplace.id || null);
116
+ convertedParams.where.id = (0, typeorm_1.In)(partnersBizplaceIds);
117
+ }
118
+ else {
119
+ convertedParams.where.id = (0, typeorm_1.In)(partnersBizplaceIds);
120
+ }
121
+ const [items, total] = await (0, typeorm_1.getRepository)(bizplace_1.Bizplace).findAndCount(Object.assign(Object.assign({}, convertedParams), { relations: ['domain', 'company', 'users', 'creator', 'updater'] }));
122
+ return { items, total };
123
+ }
124
+ async permittedPartnersCompanyBizplaces(params, context) {
125
+ let partnersBizplaceIds = [];
126
+ let bizplaceIndex = params.filters.findIndex(x => x.name === 'bizplace');
127
+ if (bizplaceIndex > -1) {
128
+ partnersBizplaceIds = params.filters
129
+ .filter(x => x.name === 'bizplace')
130
+ .map(item => {
131
+ return item.value;
132
+ });
133
+ params.filters.splice(bizplaceIndex, 1);
134
+ }
135
+ const convertedParams = (0, shell_1.convertListParams)(params);
136
+ if (!(partnersBizplaceIds.length > 0)) {
137
+ const partnersBizplaces = await (0, utils_1.getPartnersCompanyBizplaces)(context.state.domain, context.state.user, true);
138
+ partnersBizplaceIds = partnersBizplaces.map((bizplace) => bizplace.id || null);
139
+ convertedParams.where.id = (0, typeorm_1.In)(partnersBizplaceIds);
140
+ }
141
+ else {
142
+ convertedParams.where.id = (0, typeorm_1.In)(partnersBizplaceIds);
143
+ }
144
+ const [items, total] = await (0, typeorm_1.getRepository)(bizplace_1.Bizplace).findAndCount(Object.assign(Object.assign({}, convertedParams), { relations: ['domain', 'company', 'users', 'creator', 'updater'] }));
145
+ return { items, total };
146
+ }
147
+ async lmdBizplaces(params, context) {
148
+ var _a;
149
+ let partnersBizplaceIds = [];
150
+ let bizplaceIndex = params.filters.findIndex(x => x.name === 'bizplace');
151
+ let bizplaceNameFilter = params.filters.filter(x => x.name === 'name').map(item => item.value)[0] || '';
152
+ if (bizplaceIndex > -1) {
153
+ partnersBizplaceIds = params.filters
154
+ .filter(x => x.name === 'bizplace')
155
+ .map(item => {
156
+ return item.value;
157
+ });
158
+ params.filters.splice(bizplaceIndex, 1);
159
+ }
160
+ //filter popup for lmd
161
+ let lmdBizplaceFilter = params.filters.reduce(item => item.name == 'lmdBizplaceIds');
162
+ if (lmdBizplaceFilter) {
163
+ params.filters = params.filters.filter(param => param.name !== 'lmdBizplaceIds');
164
+ }
165
+ const convertedParams = (0, shell_1.convertListParams)(params);
166
+ if (!(partnersBizplaceIds.length > 0)) {
167
+ const partnersBizplaces = await (0, utils_1.getPartnersBizplaces)(context.state.domain, context.state.user);
168
+ partnersBizplaceIds = partnersBizplaces.map((bizplace) => bizplace.id || null);
169
+ convertedParams.where.id = (0, typeorm_1.In)(partnersBizplaceIds);
170
+ }
171
+ else {
172
+ convertedParams.where.id = (0, typeorm_1.In)(partnersBizplaceIds);
173
+ }
174
+ const qb = (0, typeorm_1.getRepository)(bizplace_1.Bizplace).createQueryBuilder('b');
175
+ (0, shell_1.buildQuery)(qb, params, context);
176
+ qb.leftJoinAndSelect('domains', 'd', 'd.id = b.domain_id');
177
+ qb.leftJoinAndSelect('companies', 'c', 'c.id = b.company_id');
178
+ qb.where('b.id IN (:...partnersBizplaceIds)', { partnersBizplaceIds: partnersBizplaceIds });
179
+ if (((_a = lmdBizplaceFilter === null || lmdBizplaceFilter === void 0 ? void 0 : lmdBizplaceFilter.value) === null || _a === void 0 ? void 0 : _a.length) > 0) {
180
+ qb.andWhere('b.id NOT IN (:...lmdBizplaceIds)', { lmdBizplaceIds: lmdBizplaceFilter.value });
181
+ }
182
+ if (bizplaceNameFilter) {
183
+ qb.andWhere('b.name ilike :name', { name: bizplaceNameFilter });
184
+ }
185
+ qb.orderBy('b.name', 'ASC');
186
+ const [items, total] = await qb.getManyAndCount();
187
+ return { items, total };
188
+ }
189
+ };
190
+ __decorate([
191
+ (0, type_graphql_1.Directive)('@privilege(category: "bizplace", privilege: "query")'),
192
+ (0, type_graphql_1.Query)(returns => [bizplace_1.Bizplace]),
193
+ __param(0, (0, type_graphql_1.Ctx)()),
194
+ __metadata("design:type", Function),
195
+ __metadata("design:paramtypes", [Object]),
196
+ __metadata("design:returntype", Promise)
197
+ ], BizplaceQuery.prototype, "customerBizplaces", null);
198
+ __decorate([
199
+ (0, type_graphql_1.Directive)('@privilege(category: "bizplace", privilege: "query", domainOwnerGranted: true)'),
200
+ (0, type_graphql_1.Query)(returns => bizplace_1.Bizplace),
201
+ __param(0, (0, type_graphql_1.Ctx)()),
202
+ __metadata("design:type", Function),
203
+ __metadata("design:paramtypes", [Object]),
204
+ __metadata("design:returntype", Promise)
205
+ ], BizplaceQuery.prototype, "businessBizplace", null);
206
+ __decorate([
207
+ (0, type_graphql_1.Directive)('@privilege(category: "bizplace", privilege: "query", domainOwnerGranted: true)'),
208
+ (0, type_graphql_1.Query)(returns => [bizplace_types_1.UserBizplace]),
209
+ __param(0, (0, type_graphql_1.Arg)('email')),
210
+ __param(1, (0, type_graphql_1.Ctx)()),
211
+ __metadata("design:type", Function),
212
+ __metadata("design:paramtypes", [String, Object]),
213
+ __metadata("design:returntype", Promise)
214
+ ], BizplaceQuery.prototype, "userBizplaces", null);
215
+ __decorate([
216
+ (0, type_graphql_1.Directive)('@privilege(category: "bizplace", privilege: "query", domainOwnerGranted: true)'),
217
+ (0, type_graphql_1.Query)(returns => bizplace_types_1.BizplaceList),
218
+ __param(0, (0, type_graphql_1.Args)()),
219
+ __param(1, (0, type_graphql_1.Ctx)()),
220
+ __metadata("design:type", Function),
221
+ __metadata("design:paramtypes", [typeof (_a = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _a : Object, Object]),
222
+ __metadata("design:returntype", Promise)
223
+ ], BizplaceQuery.prototype, "bizplaces", null);
224
+ __decorate([
225
+ (0, type_graphql_1.Directive)('@privilege(category: "bizplace", privilege: "query", domainOwnerGranted: true)'),
226
+ (0, type_graphql_1.Query)(returns => bizplace_1.Bizplace),
227
+ __param(0, (0, type_graphql_1.Arg)('id')),
228
+ __metadata("design:type", Function),
229
+ __metadata("design:paramtypes", [String]),
230
+ __metadata("design:returntype", Promise)
231
+ ], BizplaceQuery.prototype, "bizplace", null);
232
+ __decorate([
233
+ (0, type_graphql_1.Query)(returns => auth_base_1.UserList),
234
+ __param(0, (0, type_graphql_1.Args)()),
235
+ __param(1, (0, type_graphql_1.Ctx)()),
236
+ __metadata("design:type", Function),
237
+ __metadata("design:paramtypes", [typeof (_b = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _b : Object, Object]),
238
+ __metadata("design:returntype", Promise)
239
+ ], BizplaceQuery.prototype, "bizplaceUsers", null);
240
+ __decorate([
241
+ (0, type_graphql_1.Query)(returns => bizplace_types_1.BizplaceList),
242
+ __param(0, (0, type_graphql_1.Args)()),
243
+ __param(1, (0, type_graphql_1.Ctx)()),
244
+ __metadata("design:type", Function),
245
+ __metadata("design:paramtypes", [typeof (_c = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _c : Object, Object]),
246
+ __metadata("design:returntype", Promise)
247
+ ], BizplaceQuery.prototype, "partnersBizplaces", null);
248
+ __decorate([
249
+ (0, type_graphql_1.Query)(returns => bizplace_types_1.BizplaceList),
250
+ __param(0, (0, type_graphql_1.Args)()),
251
+ __param(1, (0, type_graphql_1.Ctx)()),
252
+ __metadata("design:type", Function),
253
+ __metadata("design:paramtypes", [typeof (_d = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _d : Object, Object]),
254
+ __metadata("design:returntype", Promise)
255
+ ], BizplaceQuery.prototype, "permittedPartnersCompanyBizplaces", null);
256
+ __decorate([
257
+ (0, type_graphql_1.Query)(returns => bizplace_types_1.BizplaceList),
258
+ __param(0, (0, type_graphql_1.Args)()),
259
+ __param(1, (0, type_graphql_1.Ctx)()),
260
+ __metadata("design:type", Function),
261
+ __metadata("design:paramtypes", [typeof (_e = typeof shell_1.ListParam !== "undefined" && shell_1.ListParam) === "function" ? _e : Object, Object]),
262
+ __metadata("design:returntype", Promise)
263
+ ], BizplaceQuery.prototype, "lmdBizplaces", null);
264
+ BizplaceQuery = __decorate([
265
+ (0, type_graphql_1.Resolver)(bizplace_1.Bizplace)
266
+ ], BizplaceQuery);
267
+ exports.BizplaceQuery = BizplaceQuery;
268
+ async function bizplaceUsers(bizplace, params, trxMgr) {
269
+ var _a;
270
+ const bizplaceRepo = (trxMgr === null || trxMgr === void 0 ? void 0 : trxMgr.getRepository(bizplace_1.Bizplace)) || (0, typeorm_1.getRepository)(bizplace_1.Bizplace);
271
+ const userRepo = (trxMgr === null || trxMgr === void 0 ? void 0 : trxMgr.getRepository(auth_base_1.User)) || (0, typeorm_1.getRepository)(auth_base_1.User);
272
+ if (!((_a = bizplace === null || bizplace === void 0 ? void 0 : bizplace.users) === null || _a === void 0 ? void 0 : _a.length)) {
273
+ bizplace = await bizplaceRepo.findOne(bizplace, { relations: ['users'] });
274
+ }
275
+ const users = bizplace.users;
276
+ const userIds = users.map((user) => user.id);
277
+ const [items, total] = await userRepo.findAndCount(Object.assign(Object.assign({}, params), { where: Object.assign(Object.assign({}, params.where), { id: (0, typeorm_1.In)(userIds) }) }));
278
+ return {
279
+ items,
280
+ total
281
+ };
282
+ }
283
+ exports.bizplaceUsers = bizplaceUsers;
284
+ //# sourceMappingURL=bizplace-query.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bizplace-query.js","sourceRoot":"","sources":["../../../server/service/bizplace/bizplace-query.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAAyE;AACzE,qCAAgH;AAEhH,yDAA0D;AAC1D,iDAAgF;AAEhF,uCAMoB;AACpB,yCAAqC;AACrC,qDAA6D;AAGtD,IAAM,aAAa,GAAnB,MAAM,aAAa;IAGlB,AAAN,KAAK,CAAC,iBAAiB,CAAQ,OAAY;QACzC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QACtC,OAAO,MAAM,IAAA,uBAAa,EAAC,mBAAQ,CAAC,CAAC,IAAI,CAAC;YACxC,KAAK,EAAE;gBACL,MAAM;gBACN,EAAE,EAAE,IAAA,aAAG,EAAC,IAAA,YAAE,EAAC,CAAC,MAAM,IAAA,qBAAa,EAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;aACjD;YACD,SAAS,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,CAAC;SAC5C,CAAC,CAAA;IACJ,CAAC;IAIK,AAAN,KAAK,CAAC,gBAAgB,CAAQ,OAAY;QACxC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QACtC,MAAM,UAAU,GAAG,MAAM,IAAA,qBAAa,EAAC,MAAM,EAAE,IAAI,CAAC,CAAA;QACpD,OAAO,MAAM,IAAA,uBAAa,EAAC,mBAAQ,CAAC,CAAC,OAAO,CAAC;YAC3C,KAAK,EAAE,EAAE,EAAE,EAAE,UAAU,CAAC,EAAE,EAAE;YAC5B,SAAS,EAAE,CAA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