rez_core 2.1.132 → 2.2.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 (116) hide show
  1. package/dist/module/enterprise/controller/organization.controller.d.ts +1 -1
  2. package/dist/module/enterprise/controller/organization.controller.js +1 -1
  3. package/dist/module/enterprise/controller/organization.controller.js.map +1 -1
  4. package/dist/module/enterprise/enterprise.module.js +6 -27
  5. package/dist/module/enterprise/enterprise.module.js.map +1 -1
  6. package/dist/module/enterprise/entity/organization.entity.d.ts +1 -0
  7. package/dist/module/enterprise/entity/organization.entity.js +4 -0
  8. package/dist/module/enterprise/entity/organization.entity.js.map +1 -1
  9. package/dist/module/enterprise/repository/school.repository.d.ts +4 -6
  10. package/dist/module/enterprise/repository/school.repository.js +35 -33
  11. package/dist/module/enterprise/repository/school.repository.js.map +1 -1
  12. package/dist/module/enterprise/service/brand.service.d.ts +2 -1
  13. package/dist/module/enterprise/service/brand.service.js +2 -1
  14. package/dist/module/enterprise/service/brand.service.js.map +1 -1
  15. package/dist/module/enterprise/service/organization.service.d.ts +5 -7
  16. package/dist/module/enterprise/service/organization.service.js +48 -12
  17. package/dist/module/enterprise/service/organization.service.js.map +1 -1
  18. package/dist/module/filter/service/filter.service.js +1 -1
  19. package/dist/module/layout_preference/entity/layout_preference.entity.js +1 -1
  20. package/dist/module/layout_preference/entity/layout_preference.entity.js.map +1 -1
  21. package/dist/module/lead/controller/lead.controller.d.ts +7 -7
  22. package/dist/module/lead/lead.module.js +1 -5
  23. package/dist/module/lead/lead.module.js.map +1 -1
  24. package/dist/module/lead/repository/lead.repository.d.ts +5 -8
  25. package/dist/module/lead/repository/lead.repository.js +16 -15
  26. package/dist/module/lead/repository/lead.repository.js.map +1 -1
  27. package/dist/module/lead/service/lead.service.d.ts +7 -7
  28. package/dist/module/meta/entity/brand-profile.entity.d.ts +3 -0
  29. package/dist/module/{enterprise/entity/brand.entity.js → meta/entity/brand-profile.entity.js} +8 -15
  30. package/dist/module/meta/entity/brand-profile.entity.js.map +1 -0
  31. package/dist/module/meta/entity/field-group.entity.d.ts +0 -9
  32. package/dist/module/meta/entity/field-group.entity.js +0 -46
  33. package/dist/module/meta/entity/field-group.entity.js.map +1 -1
  34. package/dist/module/meta/entity/section-master.entity.d.ts +0 -10
  35. package/dist/module/meta/entity/section-master.entity.js +0 -50
  36. package/dist/module/meta/entity/section-master.entity.js.map +1 -1
  37. package/dist/module/meta/entity/user-app-mapping.entity.d.ts +0 -7
  38. package/dist/module/meta/entity/user-app-mapping.entity.js +0 -40
  39. package/dist/module/meta/entity/user-app-mapping.entity.js.map +1 -1
  40. package/dist/module/meta/entity.module.js +2 -18
  41. package/dist/module/meta/entity.module.js.map +1 -1
  42. package/dist/module/meta/repository/user-app-mapping.repository.d.ts +0 -8
  43. package/dist/module/meta/repository/user-app-mapping.repository.js +0 -42
  44. package/dist/module/meta/repository/user-app-mapping.repository.js.map +1 -1
  45. package/dist/module/meta/service/user-app-mapping.service.d.ts +0 -7
  46. package/dist/module/meta/service/user-app-mapping.service.js +0 -30
  47. package/dist/module/meta/service/user-app-mapping.service.js.map +1 -1
  48. package/dist/module/meta/service/view-master.service.d.ts +1 -5
  49. package/dist/module/meta/service/view-master.service.js +2 -34
  50. package/dist/module/meta/service/view-master.service.js.map +1 -1
  51. package/dist/module/module/repository/menu.repository.js +1 -1
  52. package/dist/module/module/repository/module-access.repository.js +3 -1
  53. package/dist/module/module/repository/module-access.repository.js.map +1 -1
  54. package/dist/module/module/service/module-access.service.js +1 -1
  55. package/dist/module/module/service/module-access.service.js.map +1 -1
  56. package/dist/module/notification/entity/otp.entity.js +1 -1
  57. package/dist/module/notification/entity/otp.entity.js.map +1 -1
  58. package/dist/module/third-party-module/entity/third-party-api-registry.entity.js +1 -1
  59. package/dist/module/third-party-module/entity/third-party-api-registry.entity.js.map +1 -1
  60. package/dist/module/user/service/login.service.js +1 -1
  61. package/dist/module/user/service/login.service.js.map +1 -1
  62. package/dist/module/user/service/user-session.service.js +1 -1
  63. package/dist/module/user/service/user-session.service.js.map +1 -1
  64. package/dist/module/user/service/user.service.d.ts +1 -3
  65. package/dist/module/user/service/user.service.js +3 -6
  66. package/dist/module/user/service/user.service.js.map +1 -1
  67. package/dist/tsconfig.build.tsbuildinfo +1 -1
  68. package/dist/utils/service/wbsCodeGen.service.d.ts +3 -0
  69. package/dist/{module/enterprise/service/school.service.js → utils/service/wbsCodeGen.service.js} +9 -7
  70. package/dist/utils/service/wbsCodeGen.service.js.map +1 -0
  71. package/dist/utils/utils.module.js +15 -2
  72. package/dist/utils/utils.module.js.map +1 -1
  73. package/package.json +1 -1
  74. package/src/module/enterprise/controller/organization.controller.ts +1 -2
  75. package/src/module/enterprise/enterprise.module.ts +6 -27
  76. package/src/module/enterprise/entity/organization.entity.ts +3 -0
  77. package/src/module/enterprise/repository/school.repository.ts +44 -31
  78. package/src/module/enterprise/service/brand.service.ts +2 -1
  79. package/src/module/enterprise/service/organization.service.ts +63 -10
  80. package/src/module/filter/service/filter.service.ts +1 -1
  81. package/src/module/layout_preference/entity/layout_preference.entity.ts +1 -1
  82. package/src/module/lead/lead.module.ts +1 -5
  83. package/src/module/lead/repository/lead.repository.ts +19 -15
  84. package/src/module/meta/entity/brand-profile.entity.ts +5 -0
  85. package/src/module/meta/entity/field-group.entity.ts +20 -20
  86. package/src/module/meta/entity/section-master.entity.ts +22 -22
  87. package/src/module/meta/entity/user-app-mapping.entity.ts +16 -16
  88. package/src/module/meta/entity.module.ts +20 -18
  89. package/src/module/meta/repository/user-app-mapping.repository.ts +25 -26
  90. package/src/module/meta/service/user-app-mapping.service.ts +14 -14
  91. package/src/module/meta/service/view-master.service.ts +38 -38
  92. package/src/module/module/repository/menu.repository.ts +1 -1
  93. package/src/module/module/repository/module-access.repository.ts +23 -33
  94. package/src/module/module/service/module-access.service.ts +1 -1
  95. package/src/module/notification/entity/otp.entity.ts +3 -3
  96. package/src/module/third-party-module/entity/third-party-api-registry.entity.ts +2 -2
  97. package/src/module/user/service/login.service.ts +1 -1
  98. package/src/module/user/service/user-session.service.ts +1 -1
  99. package/src/module/user/service/user.service.ts +2 -2
  100. package/src/resources/dev.properties.yaml +3 -3
  101. package/src/utils/service/wbsCodeGen.service.ts +8 -0
  102. package/src/utils/utils.module.ts +15 -2
  103. package/dist/module/enterprise/entity/brand.entity.d.ts +0 -4
  104. package/dist/module/enterprise/entity/brand.entity.js.map +0 -1
  105. package/dist/module/enterprise/entity/school.entity.d.ts +0 -7
  106. package/dist/module/enterprise/entity/school.entity.js +0 -37
  107. package/dist/module/enterprise/entity/school.entity.js.map +0 -1
  108. package/dist/module/enterprise/repository/brand.repository.d.ts +0 -8
  109. package/dist/module/enterprise/repository/brand.repository.js +0 -39
  110. package/dist/module/enterprise/repository/brand.repository.js.map +0 -1
  111. package/dist/module/enterprise/service/school.service.d.ts +0 -3
  112. package/dist/module/enterprise/service/school.service.js.map +0 -1
  113. package/src/module/enterprise/entity/brand.entity.ts +0 -8
  114. package/src/module/enterprise/entity/school.entity.ts +0 -17
  115. package/src/module/enterprise/repository/brand.repository.ts +0 -23
  116. package/src/module/enterprise/service/school.service.ts +0 -5
@@ -27,10 +27,10 @@ import { ViewMaster } from './entity/view-master.entity';
27
27
  import { SchoolEntity } from './entity/school.entity';
28
28
  import { SchoolAddressEntity } from './entity/schoolAddress.entity';
29
29
  import { AttributeMasterService } from './service/attribute-master.service';
30
- import { SectionMasterService } from './service/section-master.service';
31
- import { SectionMaster } from './entity/section-master.entity';
32
- import { FieldGroup } from './entity/field-group.entity';
33
- import { FieldGroupService } from './service/field-group.service';
30
+ // import { SectionMasterService } from './service/section-master.service';
31
+ // import { SectionMaster } from './entity/section-master.entity';
32
+ // import { FieldGroup } from './entity/field-group.entity';
33
+ // import { FieldGroupService } from './service/field-group.service';
34
34
  import { ViewMasterService } from './service/view-master.service';
35
35
  import { ViewMasterController } from './controller/view-master.controller';
36
36
  import { ViewMaterRespository } from './repository/view-master.repository';
@@ -38,9 +38,9 @@ import { MetaController } from './controller/meta.controller';
38
38
  import { EntityValidationService } from './service/entity-validation.service';
39
39
  import { ListMasterModule } from '../listmaster/listmaster.module';
40
40
  import { FilterModule } from '../filter/filter.module';
41
- import { UserAppMappingService } from './service/user-app-mapping.service';
42
- import { UserAppMappingRepository } from './repository/user-app-mapping.repository';
43
- import { UserAppMapping } from './entity/user-app-mapping.entity';
41
+ // import { UserAppMappingService } from './service/user-app-mapping.service';
42
+ // import { UserAppMappingRepository } from './repository/user-app-mapping.repository';
43
+ // import { UserAppMapping } from './entity/user-app-mapping.entity';
44
44
  import { AppMasterController } from './controller/app-master.controller';
45
45
  import { UserRoleMappingRepository } from '../user/repository/user-role-mapping.repository';
46
46
  import { UserRoleMapping } from '../user/entity/user-role-mapping.entity';
@@ -48,6 +48,7 @@ import { AppMasterService } from './service/app-master.service';
48
48
  import { AppMasterRespository } from './repository/app-master.repository';
49
49
  import { AppMaster } from './entity/app-master.entity';
50
50
  import { PopulateMetaService } from './service/populate-meta.service';
51
+ import { BrandProfile } from './entity/brand-profile.entity';
51
52
 
52
53
  @Module({
53
54
  imports: [
@@ -61,9 +62,10 @@ import { PopulateMetaService } from './service/populate-meta.service';
61
62
  ViewMaster,
62
63
  SchoolEntity,
63
64
  SchoolAddressEntity,
64
- SectionMaster,
65
- FieldGroup,
66
- UserAppMapping,
65
+ // SectionMaster,
66
+ // FieldGroup,
67
+ // UserAppMapping,
68
+ BrandProfile,
67
69
  UserRoleMapping,
68
70
  AppMaster,
69
71
  ]),
@@ -87,13 +89,13 @@ import { PopulateMetaService } from './service/populate-meta.service';
87
89
  MediaDataRepository,
88
90
  MediaDataService,
89
91
  AttributeMasterService,
90
- SectionMasterService,
91
- FieldGroupService,
92
+ // SectionMasterService,
93
+ // FieldGroupService,
92
94
  ViewMaterRespository,
93
95
  EntityValidationService,
94
96
  { provide: 'ViewMasterService', useClass: ViewMasterService },
95
- UserAppMappingService,
96
- UserAppMappingRepository,
97
+ // UserAppMappingService,
98
+ // UserAppMappingRepository,
97
99
  UserRoleMappingRepository,
98
100
  AppMasterRespository,
99
101
  AppMasterService,
@@ -108,12 +110,12 @@ import { PopulateMetaService } from './service/populate-meta.service';
108
110
  PopulateMetaService,
109
111
  EntityTableColumnService,
110
112
  MediaDataService,
111
- SectionMasterService,
112
- FieldGroupService,
113
+ // SectionMasterService,
114
+ // FieldGroupService,
113
115
  'ViewMasterService',
114
116
  AttributeMasterService,
115
- UserAppMappingService,
116
- UserAppMappingRepository,
117
+ // UserAppMappingService,
118
+ // UserAppMappingRepository,
117
119
  AppMasterService,
118
120
  MasterService,
119
121
  ],
@@ -1,29 +1,28 @@
1
- import { Injectable } from '@nestjs/common';
2
- import { InjectRepository } from '@nestjs/typeorm';
3
- import { Repository } from 'typeorm';
4
- import { UserAppMapping } from '../entity/user-app-mapping.entity';
1
+ // import { Injectable } from '@nestjs/common';
2
+ // import { InjectRepository } from '@nestjs/typeorm';
3
+ // import { Repository } from 'typeorm';
5
4
 
6
- @Injectable()
7
- export class UserAppMappingRepository {
8
- constructor(
9
- @InjectRepository(UserAppMapping)
10
- private readonly userAppMappingRepository: Repository<UserAppMapping>,
11
- ) {}
5
+ // @Injectable()
6
+ // export class UserAppMappingRepository {
7
+ // constructor(
8
+ // @InjectRepository(UserAppMapping)
9
+ // private readonly userAppMappingRepository: Repository<UserAppMapping>,
10
+ // ) {}
12
11
 
13
- async save(userId: number, appCode: string): Promise<UserAppMapping | null> {
14
- const mapping = this.userAppMappingRepository.create({
15
- user_id: userId,
16
- appcode: appCode,
17
- });
18
- return await this.userAppMappingRepository.save(mapping);
19
- }
12
+ // async save(userId: number, appCode: string): Promise<UserAppMapping | null> {
13
+ // const mapping = this.userAppMappingRepository.create({
14
+ // user_id: userId,
15
+ // appcode: appCode,
16
+ // });
17
+ // return await this.userAppMappingRepository.save(mapping);
18
+ // }
20
19
 
21
- async findByUserIdAndAppCode(
22
- userId: number,
23
- appCode: string,
24
- ): Promise<UserAppMapping | null> {
25
- return await this.userAppMappingRepository.findOne({
26
- where: { user_id: userId, appcode: appCode },
27
- });
28
- }
29
- }
20
+ // async findByUserIdAndAppCode(
21
+ // userId: number,
22
+ // appCode: string,
23
+ // ): Promise<UserAppMapping | null> {
24
+ // return await this.userAppMappingRepository.findOne({
25
+ // where: { user_id: userId, appcode: appCode },
26
+ // });
27
+ // }
28
+ // }
@@ -1,17 +1,17 @@
1
- import { Injectable } from '@nestjs/common';
2
- import { UserAppMappingRepository } from '../repository/user-app-mapping.repository';
1
+ // import { Injectable } from '@nestjs/common';
2
+ // import { UserAppMappingRepository } from '../repository/user-app-mapping.repository';
3
3
 
4
- @Injectable()
5
- export class UserAppMappingService {
6
- constructor(
7
- private readonly userAppMappingRepository: UserAppMappingRepository,
8
- ) {}
4
+ // @Injectable()
5
+ // export class UserAppMappingService {
6
+ // constructor(
7
+ // private readonly userAppMappingRepository: UserAppMappingRepository,
8
+ // ) {}
9
9
 
10
- async assignUserAppMapping(userId: number, appCode: string) {
11
- return await this.userAppMappingRepository.save(userId, appCode);
12
- }
10
+ // async assignUserAppMapping(userId: number, appCode: string) {
11
+ // return await this.userAppMappingRepository.save(userId, appCode);
12
+ // }
13
13
 
14
- async getUserAppMappings(userId: number , appCode: string) {
15
- return await this.userAppMappingRepository.findByUserIdAndAppCode(userId, appCode);
16
- }
17
- }
14
+ // async getUserAppMappings(userId: number , appCode: string) {
15
+ // return await this.userAppMappingRepository.findByUserIdAndAppCode(userId, appCode);
16
+ // }
17
+ // }
@@ -4,16 +4,16 @@ import { BaseEntity } from '../entity/base-entity.entity';
4
4
  import { UserData } from '../../user/entity/user.entity';
5
5
  import { EntityManager } from 'typeorm';
6
6
  import { ViewMaster } from '../entity/view-master.entity';
7
- import { SectionMasterService } from './section-master.service';
8
- import { SectionMaster } from '../entity/section-master.entity';
9
- import { FieldGroup } from '../entity/field-group.entity';
10
- import { FieldGroupService } from './field-group.service';
7
+ // import { SectionMasterService } from './section-master.service';
8
+ // import { SectionMaster } from '../entity/section-master.entity';
9
+ // import { FieldGroup } from '../entity/field-group.entity';
10
+ // import { FieldGroupService } from './field-group.service';
11
11
  import { ViewMaterRespository } from '../repository/view-master.repository';
12
12
  @Injectable()
13
13
  export class ViewMasterService extends EntityServiceImpl {
14
14
  constructor(
15
- private readonly sectionMasterService: SectionMasterService,
16
- private readonly fieldGroupService: FieldGroupService,
15
+ // private readonly sectionMasterService: SectionMasterService,
16
+ // private readonly fieldGroupService: FieldGroupService,
17
17
  private readonly viewMasterRepoService: ViewMaterRespository,
18
18
  ) {
19
19
  super();
@@ -37,43 +37,43 @@ export class ViewMasterService extends EntityServiceImpl {
37
37
  manager,
38
38
  );
39
39
 
40
- let viewMaster = savedEntity as ViewMaster;
41
- if (entityData.type === 'form') {
42
- let layout = viewMaster.published_form_layout;
40
+ // let viewMaster = savedEntity as ViewMaster;
41
+ // if (entityData.type === 'form') {
42
+ // let layout = viewMaster.published_form_layout;
43
43
 
44
- const stepsData = this.sectionMasterService.parseLayout(layout);
45
- for (var step of stepsData) {
46
- let sectionMaster = new SectionMaster();
47
- sectionMaster.name = step.stepLabel;
48
- sectionMaster.position = step.stepPosition;
49
- sectionMaster.description = step.stepLabel;
50
- sectionMaster.parent_id = viewMaster.id;
51
- sectionMaster.parent_type = viewMaster.entity_type;
44
+ // const stepsData = this.sectionMasterService.parseLayout(layout);
45
+ // for (var step of stepsData) {
46
+ // let sectionMaster = new SectionMaster();
47
+ // sectionMaster.name = step.stepLabel;
48
+ // sectionMaster.position = step.stepPosition;
49
+ // sectionMaster.description = step.stepLabel;
50
+ // sectionMaster.parent_id = viewMaster.id;
51
+ // sectionMaster.parent_type = viewMaster.entity_type;
52
52
 
53
- const savedSectionMaster = await this.sectionMasterService.createEntity(
54
- sectionMaster,
55
- loggedInUser,
56
- manager,
57
- );
53
+ // const savedSectionMaster = await this.sectionMasterService.createEntity(
54
+ // sectionMaster,
55
+ // loggedInUser,
56
+ // manager,
57
+ // );
58
58
 
59
- const fieldGroups = step.fieldsGroup;
59
+ // const fieldGroups = step.fieldsGroup;
60
60
 
61
- for (var fieldGroup of fieldGroups) {
62
- let fieldsGroup = new FieldGroup();
63
- fieldsGroup.view_id = viewMaster.id;
64
- fieldsGroup.parent_id = savedSectionMaster.id;
65
- fieldsGroup.field_type = fieldGroup.type;
66
- fieldsGroup.label = fieldGroup.label;
67
- fieldsGroup.description = fieldGroup.label;
61
+ // for (var fieldGroup of fieldGroups) {
62
+ // let fieldsGroup = new FieldGroup();
63
+ // fieldsGroup.view_id = viewMaster.id;
64
+ // fieldsGroup.parent_id = savedSectionMaster.id;
65
+ // fieldsGroup.field_type = fieldGroup.type;
66
+ // fieldsGroup.label = fieldGroup.label;
67
+ // fieldsGroup.description = fieldGroup.label;
68
68
 
69
- this.fieldGroupService.createEntity(
70
- fieldsGroup,
71
- loggedInUser,
72
- manager,
73
- );
74
- }
75
- }
76
- }
69
+ // this.fieldGroupService.createEntity(
70
+ // fieldsGroup,
71
+ // loggedInUser,
72
+ // manager,
73
+ // );
74
+ // }
75
+ // }
76
+ // }
77
77
  return savedEntity;
78
78
  }
79
79
 
@@ -140,7 +140,7 @@ export class MenuRepository extends Repository<MenuData> {
140
140
  const [sch] = await this.dataSource.query(
141
141
  `
142
142
  SELECT s.brand_id, s.organization_id
143
- FROM cr_school s
143
+ FROM eth_school_profile s
144
144
  WHERE s.id = ?
145
145
  `,
146
146
  [levelId],
@@ -1,11 +1,10 @@
1
1
  import { BadRequestException, Injectable } from '@nestjs/common';
2
2
  import { InjectRepository } from '@nestjs/typeorm';
3
- import { In, Not, Repository , IsNull, DataSource} from 'typeorm';
3
+ import { In, Not, Repository, IsNull, DataSource } from 'typeorm';
4
4
  import { Role } from 'src/module/user/entity/role.entity';
5
5
  import { ModuleAccess } from '../entity/module-access.entity';
6
6
  import { ModuleAction } from '../entity/module-action.entity';
7
7
  import { ModuleData } from '../entity/module.entity';
8
- import { level } from 'winston';
9
8
 
10
9
  @Injectable()
11
10
  export class ModuleAccessRepository {
@@ -25,9 +24,6 @@ export class ModuleAccessRepository {
25
24
  private readonly dataSource: DataSource,
26
25
  ) {}
27
26
 
28
-
29
-
30
-
31
27
  async getRoles({
32
28
  appcode,
33
29
  level_type,
@@ -43,25 +39,24 @@ export class ModuleAccessRepository {
43
39
  .from('cr_role', 'role')
44
40
  .where('role.appcode = :appcode', { appcode })
45
41
  .andWhere('(role.is_factory IS NULL OR role.is_factory != 1)');
46
-
47
-
42
+
48
43
  if (level_type) {
49
44
  query.andWhere('role.level_type = :level_type', { level_type });
50
45
  }
51
-
46
+
52
47
  if (level_id !== undefined) {
53
- query.andWhere('role.level_id = :level_id', { level_id: String(level_id) });
48
+ query.andWhere('role.level_id = :level_id', {
49
+ level_id: String(level_id),
50
+ });
54
51
  }
55
-
52
+
56
53
  const roles = await query.getRawMany(); // use getRawMany since you're selecting from a raw table
57
-
54
+
58
55
  return roles.map((role) => ({
59
56
  label: role.name,
60
57
  value: role.id,
61
58
  }));
62
59
  }
63
-
64
-
65
60
 
66
61
  async getModules({ appcode }: { appcode: string }) {
67
62
  const modules = await this.moduleRepo.find({
@@ -84,7 +79,7 @@ export class ModuleAccessRepository {
84
79
  levelId?: number, // add levelId as input so we can fetch roles based on it
85
80
  ) {
86
81
  let roles;
87
-
82
+
88
83
  if (roleIds.length === 1 && roleIds[0] === -1) {
89
84
  // Internally call getRoles
90
85
  const fetchedRoles = await this.getRoles({
@@ -92,7 +87,7 @@ export class ModuleAccessRepository {
92
87
  level_type: levelType,
93
88
  level_id: levelId,
94
89
  });
95
-
90
+
96
91
  const fetchedRoleIds = fetchedRoles.map((r) => r.value);
97
92
  roles = await this.roleRepo.find({
98
93
  where: {
@@ -108,18 +103,18 @@ export class ModuleAccessRepository {
108
103
  },
109
104
  });
110
105
  }
111
-
106
+
112
107
  if (!roles.length) return [];
113
-
108
+
114
109
  const roleCodes = roles.map((role) => role.code);
115
-
110
+
116
111
  const moduleAccesses = await this.moduleAccessRepo.find({
117
112
  where: {
118
113
  role_code: In(roleCodes),
119
114
  appcode,
120
115
  },
121
116
  });
122
-
117
+
123
118
  return roles.map((role) => ({
124
119
  role_code: role.code,
125
120
  name: role.name,
@@ -134,7 +129,6 @@ export class ModuleAccessRepository {
134
129
  })),
135
130
  }));
136
131
  }
137
-
138
132
 
139
133
  async getAllModulesByLevel(mainModIds: string[], appcode: string, levelType) {
140
134
  const mainModules =
@@ -166,28 +160,27 @@ export class ModuleAccessRepository {
166
160
  const allActions = await this.moduleActionRepo.find({
167
161
  where: { module_code: In(moduleCodes) },
168
162
  });
169
-
163
+
170
164
  // Map actions by module_code with VIEW action first
171
165
  const actionMap = allActions.reduce(
172
166
  (acc, action) => {
173
167
  if (!acc[action.module_code]) acc[action.module_code] = [];
174
-
168
+
175
169
  const actionItem = {
176
170
  action: action.action_type,
177
171
  name: action.action_name,
178
172
  };
179
-
173
+
180
174
  if (action.action_type === 'VIEW') {
181
175
  acc[action.module_code].unshift(actionItem); // ➕ Add VIEW at start
182
176
  } else {
183
177
  acc[action.module_code].push(actionItem); // ➕ Add others at end
184
178
  }
185
-
179
+
186
180
  return acc;
187
181
  },
188
182
  {} as Record<string, { action: string; name: string }[]>,
189
183
  );
190
-
191
184
 
192
185
  const levelsToReturn = levelType === 'ORG' ? ['ORG', 'SCH'] : ['SCH'];
193
186
 
@@ -235,7 +228,7 @@ export class ModuleAccessRepository {
235
228
  access_flag: number;
236
229
  appcode: string;
237
230
  level_type: string;
238
- }[]
231
+ }[],
239
232
  ): Promise<boolean> {
240
233
  try {
241
234
  for (const access of accessList) {
@@ -254,7 +247,7 @@ export class ModuleAccessRepository {
254
247
  await this.moduleAccessRepo.save(existing);
255
248
  } else {
256
249
  await this.moduleAccessRepo.save(
257
- await this.moduleAccessRepo.create(access),
250
+ await this.moduleAccessRepo.create(access),
258
251
  );
259
252
  }
260
253
  }
@@ -301,10 +294,10 @@ export class ModuleAccessRepository {
301
294
  },
302
295
  select: ['id', 'code'],
303
296
  });
304
-
297
+
305
298
  const roleCodes = roles.map((r) => r.code);
306
299
  if (!roleCodes.length) return [];
307
-
300
+
308
301
  // Step 2: Fetch full access data
309
302
  const accessRecords = await this.moduleAccessRepo
310
303
  .createQueryBuilder('access')
@@ -318,7 +311,7 @@ export class ModuleAccessRepository {
318
311
  .where('access.role_code IN (:...roleCodes)', { roleCodes })
319
312
  .andWhere('access.appcode = :appcode', { appcode })
320
313
  .getRawMany();
321
-
314
+
322
315
  // Step 3: Format output
323
316
  return accessRecords.map((record) => ({
324
317
  action: record.action_type,
@@ -328,7 +321,4 @@ export class ModuleAccessRepository {
328
321
  appcode: record.appcode,
329
322
  }));
330
323
  }
331
-
332
-
333
324
  }
334
-
@@ -167,7 +167,7 @@ export class ModuleAccessService {
167
167
  // Step 3: If level_type is SCH, check school status using raw query
168
168
  if (level_type === 'SCH') {
169
169
  const result = await this.dataSource.query(
170
- `SELECT * FROM cr_school WHERE id = ${level_id}`,
170
+ `SELECT * FROM eth_school_profile WHERE id = ${level_id}`,
171
171
  [level_id],
172
172
  );
173
173
 
@@ -1,6 +1,6 @@
1
1
  import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
2
2
 
3
- @Entity({ name: 'cr_otp' })
3
+ @Entity({ name: 'cr_user_session_otp' })
4
4
  export class Otp {
5
5
  @PrimaryGeneratedColumn()
6
6
  id: number;
@@ -20,9 +20,9 @@ export class Otp {
20
20
  @Column({ name: 'created_date', nullable: true })
21
21
  created_date: Date;
22
22
 
23
- @Column({name: 'expiration_date'})
23
+ @Column({ name: 'expiration_date' })
24
24
  expiration_date: Date;
25
25
 
26
- @Column({name: 'verified', type: 'int', nullable: true})
26
+ @Column({ name: 'verified', type: 'int', nullable: true })
27
27
  verified: number;
28
28
  }
@@ -1,6 +1,6 @@
1
1
  import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
2
2
 
3
- @Entity({ name: 'third_party_api_registry' })
3
+ @Entity({ name: 'cr_list_master_api' })
4
4
  export class ThirdPartyApiRegistry {
5
5
  @PrimaryGeneratedColumn()
6
6
  id: number;
@@ -44,7 +44,7 @@ export class ThirdPartyApiRegistry {
44
44
  @Column({ nullable: true })
45
45
  modified_date: Date;
46
46
 
47
- @Column({ nullable: true})
47
+ @Column({ nullable: true })
48
48
  label: string;
49
49
 
50
50
  @Column({ nullable: true })
@@ -161,7 +161,7 @@ export class LoginService {
161
161
  const brandId = brnAccesses[0].level_id;
162
162
 
163
163
  const rows = await this.dataSource.query(
164
- `SELECT id FROM cr_school WHERE brand_id = ? ORDER BY id ASC LIMIT 1`,
164
+ `SELECT id FROM eth_school_profile WHERE brand_id = ? ORDER BY id ASC LIMIT 1`,
165
165
  [brandId],
166
166
  );
167
167
 
@@ -150,7 +150,7 @@ export class UserSessionService {
150
150
  //DONE
151
151
  // If BRN, resolve first SCH under this brand
152
152
  const schools = await this.dataSource.query(
153
- `SELECT id FROM cr_school WHERE brand_id = ? ORDER BY id ASC LIMIT 1`,
153
+ `SELECT id FROM eth_school_profile WHERE brand_id = ? ORDER BY id ASC LIMIT 1`,
154
154
  [mapping.level_id],
155
155
  );
156
156
 
@@ -17,7 +17,7 @@ import { UserRoleMapping } from '../entity/user-role-mapping.entity';
17
17
  import { EntityManager } from 'typeorm';
18
18
  import { UpdateUserDto } from '../dto/update-user.dto';
19
19
  import { ConfigService } from '@nestjs/config';
20
- import { UserAppMappingService } from 'src/module/meta/service/user-app-mapping.service';
20
+ // import { UserAppMappingService } from 'src/module/meta/service/user-app-mapping.service';
21
21
  import { ServiceResult } from 'src/dtos/response.dto';
22
22
  import { ListMasterService } from 'src/module/listmaster/service/list-master.service';
23
23
 
@@ -28,7 +28,7 @@ export class UserService extends EntityServiceImpl {
28
28
  private userRoleMappingService: UserRoleMappingService,
29
29
  private readonly clockIDGenService: ClockIDGenService,
30
30
  private configService: ConfigService,
31
- private readonly userAppMappingService: UserAppMappingService,
31
+ // private readonly userAppMappingService: UserAppMappingService,
32
32
  @Inject('RoleService') private readonly roleService: RoleService,
33
33
  @Inject('ListMasterService')
34
34
  private readonly listMasterService: ListMasterService,
@@ -1,9 +1,9 @@
1
1
  # DB_HOST: "13.234.25.234"
2
- DB_HOST: '13.234.25.234'
2
+ DB_HOST: 'localhost'
3
3
  DB_PORT: '3306'
4
4
  DB_USER: 'root'
5
- DB_PASS: 'Rezolut@123'
6
- DB_NAME: 'package_core'
5
+ DB_PASS: 'root'
6
+ DB_NAME: 'eth_core_local'
7
7
  MASTER_KEY: '0QZ2eRJv5oVILYnyBlC+FbSGVQiWKReh'
8
8
  MASTER_IV: 'heuUQf5uPVtkotrFAOKUVw=='
9
9
  SECRET_KEY: '1hard_to_guess_secret7890a'
@@ -0,0 +1,8 @@
1
+ import { Inject, Injectable } from '@nestjs/common';
2
+
3
+ @Injectable()
4
+ export class WBSCodeGenService {
5
+ padCode(num: number): string {
6
+ return num.toString().padStart(5, '0');
7
+ }
8
+ }
@@ -3,10 +3,23 @@ import { LoggingService } from './service/loggingUtil.service';
3
3
  import { ReflectionHelper } from './service/reflection-helper.service';
4
4
  import { ExcelUtil } from './service/excelUtil.service';
5
5
  import { ClockIDGenService } from './service/clockIDGenUtil.service';
6
+ import { WBSCodeGenService } from './service/wbsCodeGen.service';
6
7
 
7
8
  @Global()
8
9
  @Module({
9
- providers: [LoggingService, ReflectionHelper, ExcelUtil, ClockIDGenService],
10
- exports: [LoggingService, ReflectionHelper, ExcelUtil, ClockIDGenService],
10
+ providers: [
11
+ LoggingService,
12
+ ReflectionHelper,
13
+ ExcelUtil,
14
+ ClockIDGenService,
15
+ WBSCodeGenService,
16
+ ],
17
+ exports: [
18
+ LoggingService,
19
+ ReflectionHelper,
20
+ ExcelUtil,
21
+ ClockIDGenService,
22
+ WBSCodeGenService,
23
+ ],
11
24
  })
12
25
  export class UtilsModule {}
@@ -1,4 +0,0 @@
1
- import { BaseEntity } from 'src/module/meta/entity/base-entity.entity';
2
- export declare class BrandData extends BaseEntity {
3
- type: string;
4
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"brand.entity.js","sourceRoot":"","sources":["../../../../src/module/enterprise/entity/brand.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6EAAuE;AACvE,qCAAyC;AAGlC,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,+BAAU;CAGxC,CAAA;AAHY,8BAAS;AAEpB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uCAC5B;oBAFF,SAAS;IADrB,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;GAChB,SAAS,CAGrB"}
@@ -1,7 +0,0 @@
1
- import { BaseEntity } from 'src/module/meta/entity/base-entity.entity';
2
- export declare class SchoolData extends BaseEntity {
3
- brand_id: number;
4
- brand_code: string;
5
- location: string;
6
- type: string;
7
- }
@@ -1,37 +0,0 @@
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.SchoolData = void 0;
13
- const base_entity_entity_1 = require("../../meta/entity/base-entity.entity");
14
- const typeorm_1 = require("typeorm");
15
- let SchoolData = class SchoolData extends base_entity_entity_1.BaseEntity {
16
- };
17
- exports.SchoolData = SchoolData;
18
- __decorate([
19
- (0, typeorm_1.Column)({ name: 'brand_id', nullable: true }),
20
- __metadata("design:type", Number)
21
- ], SchoolData.prototype, "brand_id", void 0);
22
- __decorate([
23
- (0, typeorm_1.Column)({ name: 'brand_code', nullable: true }),
24
- __metadata("design:type", String)
25
- ], SchoolData.prototype, "brand_code", void 0);
26
- __decorate([
27
- (0, typeorm_1.Column)({ name: 'location', nullable: true }),
28
- __metadata("design:type", String)
29
- ], SchoolData.prototype, "location", void 0);
30
- __decorate([
31
- (0, typeorm_1.Column)({ name: 'type', nullable: true }),
32
- __metadata("design:type", String)
33
- ], SchoolData.prototype, "type", void 0);
34
- exports.SchoolData = SchoolData = __decorate([
35
- (0, typeorm_1.Entity)({ name: 'cr_school' })
36
- ], SchoolData);
37
- //# sourceMappingURL=school.entity.js.map