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/dist/module/enterprise/enterprise.module.js +11 -1
- package/dist/module/enterprise/enterprise.module.js.map +1 -1
- package/dist/module/enterprise/entity/brand.entity.d.ts +3 -0
- package/dist/module/enterprise/entity/brand.entity.js +18 -0
- package/dist/module/enterprise/entity/brand.entity.js.map +1 -0
- package/dist/module/enterprise/entity/school.entity.d.ts +5 -0
- package/dist/module/enterprise/entity/school.entity.js +18 -0
- package/dist/module/enterprise/entity/school.entity.js.map +1 -0
- package/dist/module/meta/controller/entity.controller.js +5 -0
- package/dist/module/meta/controller/entity.controller.js.map +1 -1
- package/dist/module/meta/service/entity-service-impl.service.js +3 -1
- package/dist/module/meta/service/entity-service-impl.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/module/enterprise/enterprise.module.ts +11 -1
- package/src/module/enterprise/entity/brand.entity.ts +5 -0
- package/src/module/enterprise/entity/school.entity.ts +9 -0
- package/src/module/meta/controller/entity.controller.ts +5 -0
- package/src/module/meta/service/entity-service-impl.service.ts +3 -1
package/package.json
CHANGED
|
@@ -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: [
|
|
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],
|
|
@@ -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
|
|
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;
|