rez_core 2.0.35 → 2.0.36

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rez_core",
3
- "version": "2.0.35",
3
+ "version": "2.0.36",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -6,9 +6,19 @@ import { OrganizationController } from './controller/organization.controller';
6
6
  import { UserModule } from '../user/user.module';
7
7
  import { OrganizationAppMappingService } from './service/organization-app-mapping.service';
8
8
  import { OrganizationAppMapping } from './entity/organization-app-mapping.entity';
9
+ import { BrandData } from './entity/brand.entity';
10
+ import { SchoolData } from './entity/school.entity';
9
11
 
10
12
  @Module({
11
- imports: [TypeOrmModule.forFeature([OrganizationData , OrganizationAppMapping]), UserModule],
13
+ imports: [
14
+ TypeOrmModule.forFeature([
15
+ OrganizationData,
16
+ OrganizationAppMapping,
17
+ BrandData,
18
+ SchoolData,
19
+ ]),
20
+ UserModule,
21
+ ],
12
22
  controllers: [OrganizationController],
13
23
  providers: [OrganizationService, OrganizationAppMappingService],
14
24
  exports: [OrganizationService],
@@ -0,0 +1,5 @@
1
+ import { BaseEntity } from 'src/module/meta/entity/base-entity.entity';
2
+ import { Entity } from 'typeorm';
3
+
4
+ @Entity({ name: 'cr_brand' })
5
+ export class BrandData extends BaseEntity {}
@@ -0,0 +1,9 @@
1
+ import { BaseEntity } from 'src/module/meta/entity/base-entity.entity';
2
+ import { Entity } from 'typeorm';
3
+
4
+ @Entity({ name: 'cr_school' })
5
+ export class SchoolData extends BaseEntity {
6
+ brand_id: number;
7
+
8
+ brand_code: string;
9
+ }
@@ -110,6 +110,7 @@ export class EntityController {
110
110
  @Req() req: Request & { user: any },
111
111
  ) {
112
112
  let loggedInUser = req.user.userData;
113
+ console.log(loggedInUser," loggedInUser");
113
114
  // let loggedInUser = await this.entityService.getEntityData(
114
115
  // ENTITYTYPE_USER,
115
116
  // requestedUser.userId,
@@ -120,14 +121,18 @@ export class EntityController {
120
121
  );
121
122
  }
122
123
 
124
+ console.log(entityType,"entityType");
123
125
  const entityMaster =
124
126
  await this.entityMasterService.getEntityData(entityType);
127
+ console.log(entityMaster, "entityMaster");
125
128
  const entityService =
126
129
  await this.reflectionHelper.getBean<EntityServiceImpl>(
127
130
  entityMaster.entity_service,
128
131
  );
132
+ console.log(entityService, "entityService");
129
133
  if (entityService) {
130
134
  let existingEntity = await entityService.getEntityData(entityType, id);
135
+ console.log(existingEntity, "existingEntity");
131
136
  if (!existingEntity) {
132
137
  }
133
138
  // let mergeEntity = JsonUtil.merge(existingEntity, entityData);
@@ -117,10 +117,12 @@ export class EntityServiceImpl implements EntityService<BaseEntity> {
117
117
  id: number,
118
118
  ): Promise<BaseEntity | null> {
119
119
  const entityData = await this.entityMasterService.getEntityData(entityType);
120
+ console.log(entityData, 'entityData in getEntityData');
120
121
 
121
122
  const repoService = this.reflectionHelper.getRepoService(
122
123
  entityData.entity_data_class,
123
124
  );
125
+ console.log(repoService, 'repoService in getEntityData');
124
126
  if (!repoService) {
125
127
  throw new Error(
126
128
  `Repository service not found for entityType: ${entityType}`,
@@ -172,7 +174,7 @@ export class EntityServiceImpl implements EntityService<BaseEntity> {
172
174
  entityData.modified_date = new Date();
173
175
  if (loggedInUser) {
174
176
  entityData.modified_by = loggedInUser.id;
175
- if (!entityData?.organization_id && entityData.entity_type !== 'ORG')
177
+ if (!entityData.organization_id && entityData.parent_type !== 'ORG')
176
178
  entityData.organization_id = loggedInUser.organization_id;
177
179
  if (!entityData.enterprise_id)
178
180
  entityData.enterprise_id = loggedInUser.enterprise_id;