rez_core 1.0.60 → 1.0.62

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 (70) hide show
  1. package/dist/module/enterprise/entity/enterprise.entity.d.ts +7 -7
  2. package/dist/module/enterprise/entity/enterprise.entity.js +7 -7
  3. package/dist/module/enterprise/entity/enterprise.entity.js.map +1 -1
  4. package/dist/module/enterprise/repository/enterprise.repository.d.ts +8 -0
  5. package/dist/module/enterprise/repository/enterprise.repository.js +48 -0
  6. package/dist/module/enterprise/repository/enterprise.repository.js.map +1 -0
  7. package/dist/module/enterprise/service/enterprise.service.d.ts +8 -0
  8. package/dist/module/enterprise/service/enterprise.service.js +31 -0
  9. package/dist/module/enterprise/service/enterprise.service.js.map +1 -0
  10. package/dist/module/meta/controller/view-master.controller.d.ts +7 -0
  11. package/dist/module/meta/controller/view-master.controller.js +62 -0
  12. package/dist/module/meta/controller/view-master.controller.js.map +1 -0
  13. package/dist/module/meta/entity/view-master.entity.d.ts +2 -0
  14. package/dist/module/meta/entity/view-master.entity.js +8 -0
  15. package/dist/module/meta/entity/view-master.entity.js.map +1 -1
  16. package/dist/module/meta/entity.module.js +4 -1
  17. package/dist/module/meta/entity.module.js.map +1 -1
  18. package/dist/module/meta/repository/view-master.repository.d.ts +7 -0
  19. package/dist/module/meta/repository/view-master.repository.js +38 -0
  20. package/dist/module/meta/repository/view-master.repository.js.map +1 -0
  21. package/dist/module/meta/service/entity-list.service.d.ts +1 -1
  22. package/dist/module/meta/service/entity-list.service.js.map +1 -1
  23. package/dist/module/meta/service/entity-master.service.d.ts +1 -1
  24. package/dist/module/meta/service/entity-master.service.js +11 -6
  25. package/dist/module/meta/service/entity-master.service.js.map +1 -1
  26. package/dist/module/meta/service/view-master.service.d.ts +13 -2
  27. package/dist/module/meta/service/view-master.service.js +41 -22
  28. package/dist/module/meta/service/view-master.service.js.map +1 -1
  29. package/dist/module/module/controller/module-access.controller.d.ts +1 -37
  30. package/dist/module/module/controller/module-access.controller.js +2 -34
  31. package/dist/module/module/controller/module-access.controller.js.map +1 -1
  32. package/dist/module/module/repository/module-access.repository.d.ts +1 -35
  33. package/dist/module/module/repository/module-access.repository.js +2 -104
  34. package/dist/module/module/repository/module-access.repository.js.map +1 -1
  35. package/dist/module/module/service/module-access.service.d.ts +1 -36
  36. package/dist/module/module/service/module-access.service.js +2 -44
  37. package/dist/module/module/service/module-access.service.js.map +1 -1
  38. package/dist/module/user/controller/role.controller.d.ts +41 -0
  39. package/dist/module/user/controller/role.controller.js +63 -0
  40. package/dist/module/user/controller/role.controller.js.map +1 -0
  41. package/dist/module/user/repository/role.repository.d.ts +35 -1
  42. package/dist/module/user/repository/role.repository.js +105 -2
  43. package/dist/module/user/repository/role.repository.js.map +1 -1
  44. package/dist/module/user/service/role.service.d.ts +35 -1
  45. package/dist/module/user/service/role.service.js +39 -2
  46. package/dist/module/user/service/role.service.js.map +1 -1
  47. package/dist/module/user/service/user.service.js +2 -1
  48. package/dist/module/user/service/user.service.js.map +1 -1
  49. package/dist/module/user/user.module.js +4 -2
  50. package/dist/module/user/user.module.js.map +1 -1
  51. package/dist/tsconfig.build.tsbuildinfo +1 -1
  52. package/package.json +1 -1
  53. package/src/module/enterprise/entity/enterprise.entity.ts +7 -7
  54. package/src/module/enterprise/repository/enterprise.repository.ts +31 -0
  55. package/src/module/enterprise/service/enterprise.service.ts +16 -0
  56. package/src/module/meta/controller/view-master.controller.ts +48 -0
  57. package/src/module/meta/entity/view-master.entity.ts +6 -0
  58. package/src/module/meta/entity.module.ts +4 -1
  59. package/src/module/meta/repository/view-master.repository.ts +24 -0
  60. package/src/module/meta/service/entity-list.service.ts +2 -2
  61. package/src/module/meta/service/entity-master.service.ts +15 -11
  62. package/src/module/meta/service/view-master.service.ts +51 -28
  63. package/src/module/module/controller/module-access.controller.ts +2 -36
  64. package/src/module/module/repository/module-access.repository.ts +0 -151
  65. package/src/module/module/service/module-access.service.ts +1 -62
  66. package/src/module/user/controller/role.controller.ts +55 -0
  67. package/src/module/user/repository/role.repository.ts +157 -1
  68. package/src/module/user/service/role.service.ts +70 -2
  69. package/src/module/user/service/user.service.ts +6 -3
  70. package/src/module/user/user.module.ts +4 -2
@@ -1,13 +1,13 @@
1
1
  export declare class EnterpriseData {
2
2
  id: number;
3
- entityType: string;
3
+ entity_type: string;
4
4
  code: string;
5
5
  name: string;
6
6
  status: string;
7
- createdBy: number;
8
- modifiedBy: number;
9
- createdDate: Date;
10
- modifiedDate: Date;
11
- appCode: string;
12
- appUrlName: string;
7
+ created_by: number;
8
+ modified_by: number;
9
+ created_date: Date;
10
+ modified_date: Date;
11
+ app_code: string;
12
+ app_url_name: string;
13
13
  }
@@ -21,7 +21,7 @@ __decorate([
21
21
  __decorate([
22
22
  (0, typeorm_1.Column)({ name: 'entity_type', type: 'varchar', nullable: true, length: 50 }),
23
23
  __metadata("design:type", String)
24
- ], EnterpriseData.prototype, "entityType", void 0);
24
+ ], EnterpriseData.prototype, "entity_type", void 0);
25
25
  __decorate([
26
26
  (0, typeorm_1.Column)({ name: 'code', type: 'varchar', nullable: true, length: 50 }),
27
27
  __metadata("design:type", String)
@@ -37,27 +37,27 @@ __decorate([
37
37
  __decorate([
38
38
  (0, typeorm_1.Column)({ name: 'created_by', type: 'int', nullable: true }),
39
39
  __metadata("design:type", Number)
40
- ], EnterpriseData.prototype, "createdBy", void 0);
40
+ ], EnterpriseData.prototype, "created_by", void 0);
41
41
  __decorate([
42
42
  (0, typeorm_1.Column)({ name: 'modified_by', type: 'int', nullable: true }),
43
43
  __metadata("design:type", Number)
44
- ], EnterpriseData.prototype, "modifiedBy", void 0);
44
+ ], EnterpriseData.prototype, "modified_by", void 0);
45
45
  __decorate([
46
46
  (0, typeorm_1.Column)({ name: 'created_date', type: 'datetime', nullable: true }),
47
47
  __metadata("design:type", Date)
48
- ], EnterpriseData.prototype, "createdDate", void 0);
48
+ ], EnterpriseData.prototype, "created_date", void 0);
49
49
  __decorate([
50
50
  (0, typeorm_1.Column)({ name: 'modified_date', type: 'datetime', nullable: true }),
51
51
  __metadata("design:type", Date)
52
- ], EnterpriseData.prototype, "modifiedDate", void 0);
52
+ ], EnterpriseData.prototype, "modified_date", void 0);
53
53
  __decorate([
54
54
  (0, typeorm_1.Column)({ name: 'app_code', type: 'varchar', nullable: true, length: 50 }),
55
55
  __metadata("design:type", String)
56
- ], EnterpriseData.prototype, "appCode", void 0);
56
+ ], EnterpriseData.prototype, "app_code", void 0);
57
57
  __decorate([
58
58
  (0, typeorm_1.Column)({ name: 'app_url_name', type: 'varchar', nullable: true, length: 50 }),
59
59
  __metadata("design:type", String)
60
- ], EnterpriseData.prototype, "appUrlName", void 0);
60
+ ], EnterpriseData.prototype, "app_url_name", void 0);
61
61
  exports.EnterpriseData = EnterpriseData = __decorate([
62
62
  (0, typeorm_1.Entity)({ name: 'cr_enterprise' })
63
63
  ], EnterpriseData);
@@ -1 +1 @@
1
- {"version":3,"file":"enterprise.entity.js","sourceRoot":"","sources":["../../../../src/module/enterprise/entity/enterprise.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAiE;AAG1D,IAAM,cAAc,GAApB,MAAM,cAAc;CAiC1B,CAAA;AAjCY,wCAAc;AAEzB;IADC,IAAA,gCAAsB,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;;0CAC5C;AAGX;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;;kDAC1D;AAGnB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;;4CACzD;AAGb;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,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EAAE,eAAe,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACrD,IAAI;qDAAC;AAGpB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;;gDACzD;AAGjB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;;oDACzD;yBAhCV,cAAc;IAD1B,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,eAAe,EAAE,CAAC;GACrB,cAAc,CAiC1B"}
@@ -0,0 +1,8 @@
1
+ import { EnterpriseData } from '../entity/enterprise.entity';
2
+ import { Repository } from 'typeorm';
3
+ export declare class EnterpriseRepository {
4
+ private readonly enterpriseRepository;
5
+ constructor(enterpriseRepository: Repository<EnterpriseData>);
6
+ save(enterpriseData: EnterpriseData): Promise<EnterpriseData>;
7
+ update(enterpriseData: EnterpriseData): Promise<EnterpriseData | null>;
8
+ }
@@ -0,0 +1,48 @@
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.EnterpriseRepository = void 0;
16
+ const common_1 = require("@nestjs/common");
17
+ const typeorm_1 = require("@nestjs/typeorm");
18
+ const enterprise_entity_1 = require("../entity/enterprise.entity");
19
+ const typeorm_2 = require("typeorm");
20
+ let EnterpriseRepository = class EnterpriseRepository {
21
+ constructor(enterpriseRepository) {
22
+ this.enterpriseRepository = enterpriseRepository;
23
+ }
24
+ async save(enterpriseData) {
25
+ enterpriseData.created_date = new Date();
26
+ return await this.enterpriseRepository.save(enterpriseData);
27
+ }
28
+ async update(enterpriseData) {
29
+ const existingEnterprise = await this.enterpriseRepository.findOne({
30
+ where: { id: enterpriseData.id },
31
+ });
32
+ if (!existingEnterprise) {
33
+ throw new Error(`Enterprise with id ${enterpriseData.id} not found`);
34
+ }
35
+ enterpriseData.modified_date = new Date();
36
+ await this.enterpriseRepository.update(enterpriseData.id, enterpriseData);
37
+ return await this.enterpriseRepository.findOne({
38
+ where: { id: enterpriseData.id },
39
+ });
40
+ }
41
+ };
42
+ exports.EnterpriseRepository = EnterpriseRepository;
43
+ exports.EnterpriseRepository = EnterpriseRepository = __decorate([
44
+ (0, common_1.Injectable)(),
45
+ __param(0, (0, typeorm_1.InjectRepository)(enterprise_entity_1.EnterpriseData)),
46
+ __metadata("design:paramtypes", [typeorm_2.Repository])
47
+ ], EnterpriseRepository);
48
+ //# sourceMappingURL=enterprise.repository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enterprise.repository.js","sourceRoot":"","sources":["../../../../src/module/enterprise/repository/enterprise.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6CAAmD;AACnD,mEAA6D;AAC7D,qCAAqC;AAG9B,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAC/B,YAEmB,oBAAgD;QAAhD,yBAAoB,GAApB,oBAAoB,CAA4B;IAChE,CAAC;IAEJ,KAAK,CAAC,IAAI,CAAC,cAA8B;QACvC,cAAc,CAAC,YAAY,GAAG,IAAI,IAAI,EAAE,CAAC;QACzC,OAAO,MAAM,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAC9D,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,cAA8B;QACzC,MAAM,kBAAkB,GAAG,MAAM,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC;YACjE,KAAK,EAAE,EAAE,EAAE,EAAE,cAAc,CAAC,EAAE,EAAE;SACjC,CAAC,CAAC;QACH,IAAI,CAAC,kBAAkB,EAAE,CAAC;YACxB,MAAM,IAAI,KAAK,CAAC,sBAAsB,cAAc,CAAC,EAAE,YAAY,CAAC,CAAC;QACvE,CAAC;QACD,cAAc,CAAC,aAAa,GAAG,IAAI,IAAI,EAAE,CAAC;QAC1C,MAAM,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE,EAAE,cAAc,CAAC,CAAC;QAC1E,OAAO,MAAM,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC;YAC7C,KAAK,EAAE,EAAE,EAAE,EAAE,cAAc,CAAC,EAAE,EAAE;SACjC,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AAxBY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,0BAAgB,EAAC,kCAAc,CAAC,CAAA;qCACM,oBAAU;GAHxC,oBAAoB,CAwBhC"}
@@ -0,0 +1,8 @@
1
+ import { EnterpriseRepository } from '../repository/enterprise.repository';
2
+ import { EnterpriseData } from '../entity/enterprise.entity';
3
+ export declare class EnterpriseService {
4
+ private readonly enterpriseRepository;
5
+ constructor(enterpriseRepository: EnterpriseRepository);
6
+ create(enterpriseData: EnterpriseData): Promise<EnterpriseData>;
7
+ update(enterpriseData: EnterpriseData): Promise<EnterpriseData | null>;
8
+ }
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.EnterpriseService = void 0;
13
+ const common_1 = require("@nestjs/common");
14
+ const enterprise_repository_1 = require("../repository/enterprise.repository");
15
+ let EnterpriseService = class EnterpriseService {
16
+ constructor(enterpriseRepository) {
17
+ this.enterpriseRepository = enterpriseRepository;
18
+ }
19
+ async create(enterpriseData) {
20
+ return await this.enterpriseRepository.save(enterpriseData);
21
+ }
22
+ async update(enterpriseData) {
23
+ return await this.enterpriseRepository.update(enterpriseData);
24
+ }
25
+ };
26
+ exports.EnterpriseService = EnterpriseService;
27
+ exports.EnterpriseService = EnterpriseService = __decorate([
28
+ (0, common_1.Injectable)(),
29
+ __metadata("design:paramtypes", [enterprise_repository_1.EnterpriseRepository])
30
+ ], EnterpriseService);
31
+ //# sourceMappingURL=enterprise.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enterprise.service.js","sourceRoot":"","sources":["../../../../src/module/enterprise/service/enterprise.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,+EAA2E;AAIpE,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAC5B,YAA6B,oBAA0C;QAA1C,yBAAoB,GAApB,oBAAoB,CAAsB;IAAG,CAAC;IAE3E,KAAK,CAAC,MAAM,CAAC,cAA8B;QACzC,OAAO,MAAM,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAC9D,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,cAA8B;QACzC,OAAO,MAAM,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;IAChE,CAAC;CACF,CAAA;AAVY,8CAAiB;4BAAjB,iBAAiB;IAD7B,IAAA,mBAAU,GAAE;qCAEwC,4CAAoB;GAD5D,iBAAiB,CAU7B"}
@@ -0,0 +1,7 @@
1
+ import { Response } from 'express';
2
+ import { ViewMasterService } from '../service/view-master.service';
3
+ export declare class ViewMasterController {
4
+ private readonly viewMaster;
5
+ constructor(viewMaster: ViewMasterService);
6
+ getEntityJsonByType(entityType: string, type: string, res: Response): Promise<Response<any, Record<string, any>>>;
7
+ }
@@ -0,0 +1,62 @@
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.ViewMasterController = void 0;
16
+ const common_1 = require("@nestjs/common");
17
+ const jwt_guard_1 = require("../../auth/guards/jwt.guard");
18
+ const view_master_service_1 = require("../service/view-master.service");
19
+ let ViewMasterController = class ViewMasterController {
20
+ constructor(viewMaster) {
21
+ this.viewMaster = viewMaster;
22
+ }
23
+ async getEntityJsonByType(entityType, type, res) {
24
+ try {
25
+ if (!entityType || !type) {
26
+ return res.status(common_1.HttpStatus.BAD_REQUEST).json({
27
+ success: false,
28
+ message: 'Missing entity_type or type query parameter',
29
+ });
30
+ }
31
+ const result = await this.viewMaster.getEntityJson(entityType, type);
32
+ return res.status(common_1.HttpStatus.OK).json({
33
+ success: true,
34
+ message: 'Entity data fetched successfully',
35
+ data: result,
36
+ });
37
+ }
38
+ catch (error) {
39
+ return res.status(common_1.HttpStatus.INTERNAL_SERVER_ERROR).json({
40
+ success: false,
41
+ message: error.message || 'Error fetching entity data',
42
+ });
43
+ }
44
+ }
45
+ };
46
+ exports.ViewMasterController = ViewMasterController;
47
+ __decorate([
48
+ (0, common_1.Get)('viewMaster'),
49
+ __param(0, (0, common_1.Query)('entity_type')),
50
+ __param(1, (0, common_1.Query)('type')),
51
+ __param(2, (0, common_1.Res)()),
52
+ __metadata("design:type", Function),
53
+ __metadata("design:paramtypes", [String, String, Object]),
54
+ __metadata("design:returntype", Promise)
55
+ ], ViewMasterController.prototype, "getEntityJsonByType", null);
56
+ exports.ViewMasterController = ViewMasterController = __decorate([
57
+ (0, common_1.Controller)('entity'),
58
+ (0, common_1.UseGuards)(jwt_guard_1.JwtAuthGuard),
59
+ __param(0, (0, common_1.Inject)("ViewMasterService")),
60
+ __metadata("design:paramtypes", [view_master_service_1.ViewMasterService])
61
+ ], ViewMasterController);
62
+ //# sourceMappingURL=view-master.controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"view-master.controller.js","sourceRoot":"","sources":["../../../../src/module/meta/controller/view-master.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAQ0B;AACxB,2DAA2D;AAE7D,wEAAmE;AAI1D,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAC/B,YAA2D,UAA6B;QAA7B,eA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oB,CA+BhC"}
@@ -6,5 +6,7 @@ export declare class ViewMaster extends BaseEntity {
6
6
  description: string;
7
7
  published_form_layout: string;
8
8
  published_form_fields: string;
9
+ meta_json: string;
10
+ type: string;
9
11
  is_default: number;
10
12
  }
@@ -40,6 +40,14 @@ __decorate([
40
40
  (0, typeorm_1.Column)({ type: 'json', nullable: true }),
41
41
  __metadata("design:type", String)
42
42
  ], ViewMaster.prototype, "published_form_fields", void 0);
43
+ __decorate([
44
+ (0, typeorm_1.Column)({ type: 'json', nullable: true }),
45
+ __metadata("design:type", String)
46
+ ], ViewMaster.prototype, "meta_json", void 0);
47
+ __decorate([
48
+ (0, typeorm_1.Column)({ nullable: true }),
49
+ __metadata("design:type", String)
50
+ ], ViewMaster.prototype, "type", void 0);
43
51
  __decorate([
44
52
  (0, typeorm_1.Column)({ type: 'int' }),
45
53
  __metadata("design:type", Number)
@@ -1 +1 @@
1
- {"version":3,"file":"view-master.entity.js","sourceRoot":"","sources":["../../../../src/module/meta/entity/view-master.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6DAAkD;AAClD,qCAAyC;AACzC,uEAA0E;AAGnE,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,+BAAU;IACxC;QACE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,WAAW,GAAG,uCAAqB,CAAC;IAC3C,CAAC;CAmBF,CAAA;AAvBY,gCAAU;AAOrB;IADC,IAAA,gBAAM,EAAC,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sDACZ;AAG3B;IADC,IAAA,gBAAM,EAAC,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CACpB;AAGnB;IADC,IAAA,gBAAM,EAAC,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;;+CACL;AAGpB;IADC,IAAA,gBAAM,EAAC,EAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAA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AAI,EAAC,CAAC;;wCACZ;AAGb;IADC,IAAA,gBAAM,EAAC,EAAC,IAAI,EAAE,KAAK,EAAC,CAAC;;8CACH;qBA5BR,UAAU;IADtB,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,CAAC;;GACtB,UAAU,CA6BtB"}
@@ -41,6 +41,8 @@ const section_master_entity_1 = require("./entity/section-master.entity");
41
41
  const field_group_entity_1 = require("./entity/field-group.entity");
42
42
  const field_group_service_1 = require("./service/field-group.service");
43
43
  const view_master_service_1 = require("./service/view-master.service");
44
+ const view_master_controller_1 = require("./controller/view-master.controller");
45
+ const view_master_repository_1 = require("./repository/view-master.repository");
44
46
  let EntityModule = class EntityModule {
45
47
  };
46
48
  exports.EntityModule = EntityModule;
@@ -79,6 +81,7 @@ exports.EntityModule = EntityModule = __decorate([
79
81
  attribute_master_service_1.AttributeMasterService,
80
82
  section_master_service_1.SectionMasterService,
81
83
  field_group_service_1.FieldGroupService,
84
+ view_master_repository_1.ViewMaterRespository,
82
85
  { provide: 'ViewMasterService', useClass: view_master_service_1.ViewMasterService },
83
86
  ],
84
87
  exports: [
@@ -93,7 +96,7 @@ exports.EntityModule = EntityModule = __decorate([
93
96
  field_group_service_1.FieldGroupService,
94
97
  'ViewMasterService',
95
98
  ],
96
- controllers: [entity_controller_1.EntityController, master_controller_1.MasterController, media_controller_1.MediaController],
99
+ controllers: [entity_controller_1.EntityController, master_controller_1.MasterController, media_controller_1.MediaController, view_master_controller_1.ViewMasterController],
97
100
  })
98
101
  ], EntityModule);
99
102
  //# sourceMappingURL=entity.module.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"entity.module.js","sourceRoot":"","sources":["../../../src/module/meta/entity.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,2EAAsE;AACtE,uFAA0E;AAC1E,sEAAkE;AAClE,6CAAgD;AAChD,2DAAuD;AACvD,wEAA6D;AAC7D,8EAAmE;AACnE,0FAAqF;AACrF,qE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AAE,kCAAe,CAAC;KACnE,CAAC;GACW,YAAY,CAAG"}
1
+ {"version":3,"file":"entity.module.js","sourceRoot":"","sources":["../../../src/module/meta/entity.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,2EAAsE;AACtE,uFAA0E;AAC1E,sEAAkE;AAClE,6CAAgD;AAChD,2DAAuD;AACvD,wEAA6D;AAC7D,8EAAmE;AACnE,0FAAqF;AACrF,qEAAiE;AACjE,8EAA0E;AAC1E,kEAA8D;AAC9D,8EAA0E;AAC1E,qEAAiE;AACjE,sEAA2D;AAC3D,oFAAwE;AACxE,kFAA6E;AAC7E,yEAAoE;AACpE,gGAA0F;AAC1F,uFAAiF;AACjF,uEAAkE;AAClE,kEAAuD;AACvD,qEAAgE;AAChE,8EAAyE;AACzE,oEAAgE;AAChE,oEAAyD;AACzD,0DAAsD;AACtD,wEAAoE;AACpE,iFAA4E;AAC5E,6EAAwE;AACxE,0EAA+D;AAC/D,oEAAyD;AACzD,uEAAkE;AAClE,uEAAkE;AAClE,gFAA2E;AAC3E,gFAA2E;AAqDpE,IAAM,YAAY,GAAlB,MAAM,YAAY;CAAG,CAAA;AAAf,oCAAY;uBAAZ,YAAY;IAnDxB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,uBAAa,CAAC,UAAU,CAAC;gBACvB,mCAAY;gBACZ,yCAAe;gBACf,oCAAgB;gBAChB,iCAAW;gBACX,8CAAiB;gBACjB,6BAAS;gBACT,+BAAU;gBACV,4BAAY;gBACZ,0CAAmB;gBACnB,qCAAa;gBACb,+BAAU;aACX,CAAC;YACF,0BAAW;SACZ;QACD,SAAS,EAAE;YACT,2CAAmB;YACnB,+CAAiB;YACjB,uDAAyB;YACzB,sCAAiB;YACjB,4CAAoB;YACpB,8BAAa;YACb,+CAAqB;YACrB,yCAAkB;YAClB,4DAA2B;YAC3B,sDAAwB;YACxB,uCAAiB;YACjB,2CAAmB;YACnB,qCAAgB;YAChB,iDAAsB;YACtB,6CAAoB;YACpB,uCAAiB;YACjB,6CAAoB;YACpB,EAAE,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,uCAAiB,EAAE;SAC9D;QACD,OAAO,EAAE;YACP,2CAAmB;YACnB,+CAAiB;YACjB,sCAAiB;YACjB,uCAAiB;YACjB,yCAAkB;YAClB,sDAAwB;YACxB,qCAAgB;YAChB,6CAAoB;YACpB,uCAAiB;YACjB,mBAAmB;SACpB;QACD,WAAW,EAAE,CAAC,oCAAgB,EAAE,oCAAgB,EAAE,kCAAe,EAAE,6CAAoB,CAAC;KACzF,CAAC;GACW,YAAY,CAAG"}
@@ -0,0 +1,7 @@
1
+ import { Repository } from 'typeorm';
2
+ import { ViewMaster } from '../entity/view-master.entity';
3
+ export declare class ViewMaterRespository {
4
+ private readonly viewMasterRepository;
5
+ constructor(viewMasterRepository: Repository<ViewMaster>);
6
+ getEntityJson(entityType: string, type: string): Promise<ViewMaster | null>;
7
+ }
@@ -0,0 +1,38 @@
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.ViewMaterRespository = void 0;
16
+ const common_1 = require("@nestjs/common");
17
+ const typeorm_1 = require("@nestjs/typeorm");
18
+ const typeorm_2 = require("typeorm");
19
+ const view_master_entity_1 = require("../entity/view-master.entity");
20
+ let ViewMaterRespository = class ViewMaterRespository {
21
+ constructor(viewMasterRepository) {
22
+ this.viewMasterRepository = viewMasterRepository;
23
+ }
24
+ async getEntityJson(entityType, type) {
25
+ const viewMaster = await this.viewMasterRepository.findOneBy({
26
+ mapped_entity_type: entityType,
27
+ type: type,
28
+ });
29
+ return viewMaster;
30
+ }
31
+ };
32
+ exports.ViewMaterRespository = ViewMaterRespository;
33
+ exports.ViewMaterRespository = ViewMaterRespository = __decorate([
34
+ (0, common_1.Injectable)(),
35
+ __param(0, (0, typeorm_1.InjectRepository)(view_master_entity_1.ViewMaster)),
36
+ __metadata("design:paramtypes", [typeorm_2.Repository])
37
+ ], ViewMaterRespository);
38
+ //# sourceMappingURL=view-master.repository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"view-master.repository.js","sourceRoot":"","sources":["../../../../src/module/meta/repository/view-master.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6CAAmD;AACnD,qCAAiD;AACjD,qEAA0D;AAGnD,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAC/B,YAEmB,oBAA4C;QAA5C,yBAAoB,GAApB,oBAAoB,CAAwB;IAC5D,CAAC;IAEJ,KAAK,CAAC,aAAa,CACjB,UAAkB,EAClB,IAAY;QAEZ,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,oBAAoB,CAAC,SAAS,CAAC;YAC3D,kBAAkB,EAAE,UAAU;YAC9B,IAAI,EAAE,IAAI;SACX,CAAC,CAAC;QAEH,OAAO,UAAU,CAAC;IACpB,CAAC;CACF,CAAA;AAjBY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,0BAAgB,EAAC,+BAAU,CAAC,CAAA;qCACU,oBAAU;GAHxC,oBAAoB,CAiBhC"}
@@ -13,5 +13,5 @@ export declare class EntityListService {
13
13
  private getTotalCount;
14
14
  private getQuery;
15
15
  private getWhereClause;
16
- getMaxSequenceNumber(tableName: string, parentType: string, parentId: number): Promise<any>;
16
+ getMaxSequenceNumber(tableName: string, parentType: string | null, parentId: number | null): Promise<any>;
17
17
  }
@@ -1 +1 @@
1
- {"version":3,"file":"entity-list.service.js","sourceRoot":"","sources":["../../../../src/module/meta/service/entity-list.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,iEAA4D;AAC5D,sEAA6D;AAE7D,6CAAsD;AACtD,qCAAwC;AACxC,0DAAkD;AAClD,+EAAyE;AAGlE,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAC5B,YACU,kBAAsC,EACtC,wBAAkD,EAC3B,aAA4B;QAFnD,uBAAkB,GAAlB,kBAAkB,CAAoB;QACtC,6BAAwB,GAAxB,wBAAwB,CAA0B;QAC3B,kBAAa,GAAb,aAAa,CAAe;IAC1D,CAAC;IAEJ,KAAK,CAAC,qBAAqB,CACzB,UAAkB,EAClB,QAAgB,EAChB,OAA4B,EAC5B,UAA8B,EAC9B,SAA6B,EAC7B,UAAkB,EAClB,QAAgB;QAEhB,IAAI,cAAc,GAAG,IAAI,qCAAc,EAAE,CAAC;QAE1C,IAAI,WAAW,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,2BAA2B,CACzE,UAAU,EACV,QAAQ,CACT,CAAC;QAEF,IAAI,WAAW,EAAE,CAAC;YAChB,IAAI,CAAC,IAAI,WAAW,CAAC,OAAO,EAAE,CAAC;gBAC7B,IAAI,UAAU,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;gBAChE,cAAc,CAAC,WAAW,GAAG,UAAyB,CAAC;gBACvD,cAAc,CAAC,WAAW,GAAG,MAAM,IAAI,CAAC,eAAe,CACrD,WAAW,EACX,OAAO,EACP,UAAU,EACV,SAAS,EACT,UAAU,EACV,QAAQ,CACT,CAAC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C,UAAU,CAAC,CAAC;QAClC,CAAC;QAED,IAAI,MAAM,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC;QAEnE,OAAO,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IACvC,CAAC;CACF,CAAA;AA5JY,8CAAiB;4BAAjB,iBAAiB;IAD7B,IAAA,mBAAU,GAAE;IAKR,WAAA,IAAA,6BAAmB,GAAE,CAAA;qCAFM,yCAAkB;QACZ,sDAAwB;QACZ,uBAAa;GAJlD,iBAAiB,CA4J7B"}
1
+ {"version":3,"file":"entity-list.service.js","sourceRoot":"","sources":["../../../../src/module/meta/service/entity-list.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,iEAA4D;AAC5D,sEAA6D;AAE7D,6CAAsD;AACtD,qCAAwC;AACxC,0DAAkD;AAClD,+EAAyE;AAGlE,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAC5B,YACU,kBAAsC,EACtC,wBAAkD,EAC3B,aAA4B;QAFnD,uBAAkB,GAAlB,kBAAkB,CAAoB;QACtC,6BAAwB,GAAxB,wBAAwB,CAA0B;QAC3B,kBAAa,GAAb,aAAa,CAAe;IAC1D,CAAC;IAEJ,KAAK,CAAC,qBAAqB,CACzB,UAAkB,EAClB,QAAgB,EAChB,OAA4B,EAC5B,UAA8B,EAC9B,SAA6B,EAC7B,UAAkB,EAClB,QAAgB;QAEhB,IAAI,cAAc,GAAG,IAAI,qCAAc,EAAE,CAAC;QAE1C,IAAI,WAAW,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,2BAA2B,CACzE,UAAU,EACV,QAAQ,CACT,CAAC;QAEF,IAAI,WAAW,EAAE,CAAC;YAChB,IAAI,CAAC,IAAI,WAAW,CAAC,OAAO,EAAE,CAAC;gBAC7B,IAAI,UAAU,GAAG,MAA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AuB;QAEvB,IAAI,KAAK,GAAG;wBACQ,SAAS,aAAa,CAAC;QAC3C,MAAM,cAAc,GAAU,EAAE,CAAC;QACjC,IAAI,QAAQ,EAAE,CAAC;YACb,KAAK,IAAI,yCAAyC,CAAC;YACnD,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YAC9B,cAAc,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAClC,CAAC;QAED,IAAI,MAAM,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC;QAEnE,OAAO,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IACvC,CAAC;CACF,CAAA;AA5JY,8CAAiB;4BAAjB,iBAAiB;IAD7B,IAAA,mBAAU,GAAE;IAKR,WAAA,IAAA,6BAAmB,GAAE,CAAA;qCAFM,yCAAkB;QACZ,sDAAwB;QACZ,uBAAa;GAJlD,iBAAiB,CA4J7B"}
@@ -3,7 +3,7 @@ import { EntityMaster } from '../entity/entity-master.entity';
3
3
  export declare class EntityMasterService {
4
4
  private entityMasterRepository;
5
5
  constructor(entityMasterRepository: Repository<EntityMaster>);
6
- getEntityData(mappedEntityType: string): Promise<EntityMaster>;
6
+ getEntityData(mappedEntityType: string | null): Promise<EntityMaster>;
7
7
  getEntityByTableName(tableName: string): Promise<EntityMaster | null>;
8
8
  save(entityMaster: EntityMaster): Promise<EntityMaster>;
9
9
  update(id: number, entityMaster: EntityMaster): Promise<import("typeorm").UpdateResult>;
@@ -22,13 +22,18 @@ let EntityMasterService = class EntityMasterService {
22
22
  this.entityMasterRepository = entityMasterRepository;
23
23
  }
24
24
  async getEntityData(mappedEntityType) {
25
- const entityMaster = await this.entityMasterRepository.findOne({
26
- where: { mapped_entity_type: mappedEntityType },
27
- });
28
- if (!entityMaster) {
29
- throw new Error(`Entity with mappedEntityType "${mappedEntityType}" not found.`);
25
+ if (mappedEntityType) {
26
+ const entityMaster = await this.entityMasterRepository.findOne({
27
+ where: { mapped_entity_type: mappedEntityType },
28
+ });
29
+ if (!entityMaster) {
30
+ throw new Error(`Entity with mappedEntityType "${mappedEntityType}" not found.`);
31
+ }
32
+ return entityMaster;
33
+ }
34
+ else {
35
+ throw new Error();
30
36
  }
31
- return entityMaster;
32
37
  }
33
38
  async getEntityByTableName(tableName) {
34
39
  const entityMaster = await this.entityMasterRepository.findOne({
@@ -1 +1 @@
1
- {"version":3,"file":"entity-master.service.js","sourceRoot":"","sources":["../../../../src/module/meta/service/entity-master.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,qCAAqC;AACrC,6CAAmD;AACnD,yEAA8D;AAGvD,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAC9B,YAEU,sBAAgD;QAAhD,2BAAsB,GAAtB,sBAAsB,CAA0B;IACvD,CAAC;IAEJ,KAAK,CAAC,aAAa,CAAC,gBAAwB;QAC1C,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,sBAAsB,CAAC,OAAO,CAAC;YAC7D,KAAK,EAAE,EAAE,kBAAkB,EAAE,gBAAgB,EAAE;SAChD,CAAC,CAAC;QAEH,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,MAAM,IAAI,KAAK,CACb,iCAAiC,gBAAgB,cAAc,CAChE,CAAC;QACJ,CAAC;QAED,OAAO,YAAY,CAAC;IACtB,CAAC;IAED,KAAK,CAAC,oBAAoB,CAAC,SAAiB;QAC1C,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,sBAAsB,CAAC,OAAO,CAAC;YAC7D,KAAK,EAAE,EAAE,aAAa,EAAE,SAAS,EAAE;SACpC,CAAC,CAAC;QACH,OAAO,YAAY,CAAC;IACtB,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,YAA0B;QACnC,OAAO,MAAM,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAC9D,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAU,EAAE,YAA0B;QACjD,OAAO,MAAM,IAAI,CAAC,sBAAsB,CAAC,MAAM,CAAC,EAAE,EAAE,YAAY,CAAC,CAAC;IACpE,CAAC;IAED,KAAK,CAAC,sBAAsB,CAAC,gBAAwB;QACnD,OAAO,MAAM,IAAI,CAAC,sBAAsB,CAAC,OAAO,CAAC;YAC/C,KAAK,EAAE,EAAE,kBAAkB,EAAE,gBAAgB,EAAE;SAChD,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AAxCY,kDAAmB;8BAAnB,mBAAmB;IAD/B,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,0BAAgB,EAAC,mCAAY,CAAC,CAAA;qCACC,oBAAU;GAHjC,mBAAmB,CAwC/B"}
1
+ {"version":3,"file":"entity-master.service.js","sourceRoot":"","sources":["../../../../src/module/meta/service/entity-master.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,qCAAqC;AACrC,6CAAmD;AACnD,yEAA8D;AAGvD,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAC9B,YAEU,sBAAgD;QAAhD,2BAAsB,GAAtB,sBAAsB,CAA0B;IACvD,CAAC;IAEJ,KAAK,CAAC,aAAa,CAAC,gBAA6B;QAC/C,IAAI,gBAAgB,EAAE,CAAC;YACrB,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,sBAAsB,CAAC,OAAO,CAAC;gBAC7D,KAAK,EAAE,EAAE,kBAAkB,EAAE,gBAAgB,EAAE;aAChD,CAAC,CAAC;YAEH,IAAI,CAAC,YAAY,EAAE,CAAC;gBAClB,MAAM,IAAI,KAAK,CACb,iCAAiC,gBAAgB,cAAc,CAChE,CAAC;YACJ,CAAC;YAED,OAAO,YAAY,CAAC;QACtB,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,KAAK,EAAE,CAAC;QACpB,CAAC;IACH,CAAC;IAED,KAAK,CAAC,oBAAoB,CAAC,SAAiB;QAC1C,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,sBAAsB,CAAC,OAAO,CAAC;YAC7D,KAAK,EAAE,EAAE,aAAa,EAAE,SAAS,EAAE;SACpC,CAAC,CAAC;QACH,OAAO,YAAY,CAAC;IACtB,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,YAA0B;QACnC,OAAO,MAAM,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAC9D,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAU,EAAE,YAA0B;QACjD,OAAO,MAAM,IAAI,CAAC,sBAAsB,CAAC,MAAM,CAAC,EAAE,EAAE,YAAY,CAAC,CAAC;IACpE,CAAC;IAED,KAAK,CAAC,sBAAsB,CAAC,gBAAwB;QACnD,OAAO,MAAM,IAAI,CAAC,sBAAsB,CAAC,OAAO,CAAC;YAC/C,KAAK,EAAE,EAAE,kBAAkB,EAAE,gBAAgB,EAAE;SAChD,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AA5CY,kDAAmB;8BAAnB,mBAAmB;IAD/B,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,0BAAgB,EAAC,mCAAY,CAAC,CAAA;qCACC,oBAAU;GAHjC,mBAAmB,CA4C/B"}
@@ -5,10 +5,21 @@ import { EntityManager } from 'typeorm';
5
5
  import { ViewMaster } from '../entity/view-master.entity';
6
6
  import { SectionMasterService } from './section-master.service';
7
7
  import { FieldGroupService } from './field-group.service';
8
+ import { ViewMaterRespository } from '../repository/view-master.repository';
8
9
  export declare class ViewMasterService extends EntityServiceImpl {
9
10
  private readonly sectionMasterService;
10
11
  private readonly fieldGroupService;
11
- constructor(sectionMasterService: SectionMasterService, fieldGroupService: FieldGroupService);
12
- createEntity(entityData: BaseEntity, loggedInUser: UserData | null, manager?: EntityManager): Promise<BaseEntity>;
12
+ private readonly viewMasterRepoService;
13
+ constructor(sectionMasterService: SectionMasterService, fieldGroupService: FieldGroupService, viewMasterRepoService: ViewMaterRespository);
14
+ createEntity(entityData: ViewMaster, loggedInUser: UserData | null, manager?: EntityManager): Promise<BaseEntity>;
13
15
  updateEntity(entityData: ViewMaster, loggedInUserData: UserData | null): Promise<BaseEntity>;
16
+ getEntityJson(entityType: string, type: string): Promise<{
17
+ formLayoutJson: string | undefined;
18
+ formFieldJson: string | undefined;
19
+ metaJson?: undefined;
20
+ } | {
21
+ metaJson: string | undefined;
22
+ formLayoutJson?: undefined;
23
+ formFieldJson?: undefined;
24
+ }>;
14
25
  }
@@ -16,11 +16,13 @@ const section_master_service_1 = require("./section-master.service");
16
16
  const section_master_entity_1 = require("../entity/section-master.entity");
17
17
  const field_group_entity_1 = require("../entity/field-group.entity");
18
18
  const field_group_service_1 = require("./field-group.service");
19
+ const view_master_repository_1 = require("../repository/view-master.repository");
19
20
  let ViewMasterService = class ViewMasterService extends entity_service_impl_service_1.EntityServiceImpl {
20
- constructor(sectionMasterService, fieldGroupService) {
21
+ constructor(sectionMasterService, fieldGroupService, viewMasterRepoService) {
21
22
  super();
22
23
  this.sectionMasterService = sectionMasterService;
23
24
  this.fieldGroupService = fieldGroupService;
25
+ this.viewMasterRepoService = viewMasterRepoService;
24
26
  }
25
27
  async createEntity(entityData, loggedInUser, manager) {
26
28
  const entityMaster = await this.entityMasterService.getEntityData(entityData.entity_type);
@@ -28,26 +30,28 @@ let ViewMasterService = class ViewMasterService extends entity_service_impl_serv
28
30
  entityData.parent_type = entityMaster.entity_type;
29
31
  const savedEntity = await super.createEntity(entityData, loggedInUser, manager);
30
32
  let viewMaster = savedEntity;
31
- let layout = viewMaster.published_form_layout;
32
- const stepsData = this.sectionMasterService.parseLayout(layout);
33
- for (var step of stepsData) {
34
- let sectionMaster = new section_master_entity_1.SectionMaster();
35
- sectionMaster.name = step.stepLabel;
36
- sectionMaster.position = step.stepPosition;
37
- sectionMaster.description = step.stepLabel;
38
- sectionMaster.parent_id = viewMaster.id;
39
- sectionMaster.parent_type = viewMaster.entity_type;
40
- const savedSectionMaster = await this.sectionMasterService.createEntity(sectionMaster, loggedInUser, manager);
41
- const fieldGroups = step.fieldsGroup;
42
- console.log('fieldGroups', fieldGroups);
43
- for (var fieldGroup of fieldGroups) {
44
- let fieldsGroup = new field_group_entity_1.FieldGroup();
45
- fieldsGroup.view_id = viewMaster.id;
46
- fieldsGroup.parent_id = savedSectionMaster.id;
47
- fieldsGroup.field_type = fieldGroup.type;
48
- fieldsGroup.label = fieldGroup.label;
49
- fieldsGroup.description = fieldGroup.label;
50
- this.fieldGroupService.createEntity(fieldsGroup, loggedInUser, manager);
33
+ if (entityData.type === 'form') {
34
+ let layout = viewMaster.published_form_layout;
35
+ const stepsData = this.sectionMasterService.parseLayout(layout);
36
+ for (var step of stepsData) {
37
+ let sectionMaster = new section_master_entity_1.SectionMaster();
38
+ sectionMaster.name = step.stepLabel;
39
+ sectionMaster.position = step.stepPosition;
40
+ sectionMaster.description = step.stepLabel;
41
+ sectionMaster.parent_id = viewMaster.id;
42
+ sectionMaster.parent_type = viewMaster.entity_type;
43
+ const savedSectionMaster = await this.sectionMasterService.createEntity(sectionMaster, loggedInUser, manager);
44
+ const fieldGroups = step.fieldsGroup;
45
+ console.log('fieldGroups', fieldGroups);
46
+ for (var fieldGroup of fieldGroups) {
47
+ let fieldsGroup = new field_group_entity_1.FieldGroup();
48
+ fieldsGroup.view_id = viewMaster.id;
49
+ fieldsGroup.parent_id = savedSectionMaster.id;
50
+ fieldsGroup.field_type = fieldGroup.type;
51
+ fieldsGroup.label = fieldGroup.label;
52
+ fieldsGroup.description = fieldGroup.label;
53
+ this.fieldGroupService.createEntity(fieldsGroup, loggedInUser, manager);
54
+ }
51
55
  }
52
56
  }
53
57
  return savedEntity;
@@ -55,11 +59,26 @@ let ViewMasterService = class ViewMasterService extends entity_service_impl_serv
55
59
  async updateEntity(entityData, loggedInUserData) {
56
60
  return entityData;
57
61
  }
62
+ async getEntityJson(entityType, type) {
63
+ const res = await this.viewMasterRepoService.getEntityJson(entityType, type);
64
+ if (type == "form") {
65
+ return {
66
+ formLayoutJson: res?.published_form_layout,
67
+ formFieldJson: res?.published_form_fields
68
+ };
69
+ }
70
+ else {
71
+ return {
72
+ metaJson: res?.meta_json
73
+ };
74
+ }
75
+ }
58
76
  };
59
77
  exports.ViewMasterService = ViewMasterService;
60
78
  exports.ViewMasterService = ViewMasterService = __decorate([
61
79
  (0, common_1.Injectable)(),
62
80
  __metadata("design:paramtypes", [section_master_service_1.SectionMasterService,
63
- field_group_service_1.FieldGroupService])
81
+ field_group_service_1.FieldGroupService,
82
+ view_master_repository_1.ViewMaterRespository])
64
83
  ], ViewMasterService);
65
84
  //# sourceMappingURL=view-master.service.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"view-master.service.js","sourceRoot":"","sources":["../../../../src/module/meta/service/view-master.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,+EAAkE;AAKlE,qEAAgE;AAChE,2EAAgE;AAChE,qEAA0D;AAC1D,+DAA0D;AAEnD,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,+CAAiB;IACtD,YACmB,oBAA0C,EAC1C,iBAAoC;QAErD,KAAK,EAAE,CAAC;QAHS,yBAAoB,GAApB,oBAAoB,CAAsB;QAC1C,sBAAiB,GAAjB,iBAAiB,CAAmB;IAGvD,CAAC;IAED,KAAK,CAAC,YAAY,CAChB,UAAsB,EACtB,YAA6B,EAC7B,OAAuB;QAEvB,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,aAAa,CAC/D,UAAU,CAAC,WAAW,CACvB,CAAC;QACF,UAAU,CAAC,SAAS,GAAG,YAAY,CAAC,EAAE,CAAC;QACvC,UAAU,CAAC,WAAW,GAAG,YAAY,CAAC,WAAW,CAAC;QAElD,MAAM,WAAW,GAAG,MAAM,KAAK,CAAC,YAAY,CAC1C,UAAU,EACV,YAAY,EACZ,OAAO,CACR,CAAC;QACF,IAAI,UAAU,GAAG,W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AED,OAAO,WAAW,CAAC;IACrB,CAAC;IAED,KAAK,CAAC,YAAY,CAChB,UAAsB,EACtB,gBAAiC;QAEjC,OAAO,UAAU,CAAC;IACpB,CAAC;CACF,CAAA;AAnEY,8CAAiB;4BAAjB,iBAAiB;IAD7B,IAAA,mBAAU,GAAE;qCAG8B,6CAAoB;QACvB,uCAAiB;GAH5C,iBAAiB,CAmE7B"}
1
+ {"version":3,"file":"view-master.service.js","sourceRoot":"","sources":["../../../../src/module/meta/service/view-master.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,+EAAkE;AAKlE,qEAAgE;AAChE,2EAAgE;AAChE,qEAA0D;AAC1D,+DAA0D;AAC1D,iFAA4E;AAErE,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,+CAAiB;IACtD,YACmB,oBAA0C,EAC1C,iBAAoC,EACpC,qBAA2C;QAE5D,KAAK,EAAE,CAAC;QAJS,yBAAoB,GAApB,oBAAoB,CAAsB;QAC1C,sBAAiB,GAAjB,iBAAiB,CAAmB;QACpC,0BAAqB,GAArB,qBAAqB,CAAsB;IAG9D,CAAC;IAED,KAAK,CAAC,YAAY,CAChB,UAAsB,EACtB,YAA6B,EAC7B,OAAuB;QAEvB,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,aAAa,CAC/D,UAAU,CAAC,WAAW,CACvB,CAAC;QACF,UAAU,CAAC,SAAS,GAAG,YAAY,CAAC,EAAE,CAAC;QACvC,UAAU,CAAC,WAAW,GAAG,YAAY,CAAC,WAAW,CAAC;QAElD,MAAM,WAAW,GAAG,MAAM,KAAK,CAAC,YAAY,CAC1C,UAAU,EACV,YAAY,EACZ,OAAO,CACR,CAAC;QAEF,IAAI,UAAU,GAAG,WAAyB,CAAC;QAC3C,IAAI,UAAU,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;YAC/B,IAAI,MAAM,GAAG,UAAU,CAAC,qBAAqB,CAAC;YAE9C,MAAM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