rez_core 2.2.41 → 2.2.42
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/meta/controller/attribute-master.controller.d.ts +7 -1
- package/dist/module/meta/controller/attribute-master.controller.js +16 -1
- package/dist/module/meta/controller/attribute-master.controller.js.map +1 -1
- package/dist/module/meta/entity.module.js +2 -0
- package/dist/module/meta/entity.module.js.map +1 -1
- package/dist/module/meta/repository/attribute-master.repository.d.ts +4 -0
- package/dist/module/meta/repository/attribute-master.repository.js +12 -0
- package/dist/module/meta/repository/attribute-master.repository.js.map +1 -1
- package/dist/module/meta/service/attribute-master.service.d.ts +4 -0
- package/dist/module/meta/service/attribute-master.service.js +3 -0
- package/dist/module/meta/service/attribute-master.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/module/meta/controller/attribute-master.controller.ts +20 -3
- package/src/module/meta/entity.module.ts +2 -0
- package/src/module/meta/repository/attribute-master.repository.ts +18 -0
- package/src/module/meta/service/attribute-master.service.ts +11 -0
package/package.json
CHANGED
|
@@ -4,11 +4,15 @@ import {
|
|
|
4
4
|
Body,
|
|
5
5
|
Param,
|
|
6
6
|
Req,
|
|
7
|
+
UseGuards,
|
|
8
|
+
Get,
|
|
7
9
|
} from '@nestjs/common';
|
|
8
10
|
import { Request } from 'express';
|
|
9
11
|
import { AttributeMasterService } from '../service/attribute-master.service';
|
|
12
|
+
import { JwtAuthGuard } from 'src/module/auth/guards/jwt.guard';
|
|
10
13
|
|
|
11
|
-
|
|
14
|
+
@Controller('attribute-master')
|
|
15
|
+
@UseGuards(JwtAuthGuard)
|
|
12
16
|
export class AttributeMasterController {
|
|
13
17
|
constructor(
|
|
14
18
|
private readonly attributeMasterService: AttributeMasterService,
|
|
@@ -40,12 +44,25 @@ import {
|
|
|
40
44
|
);
|
|
41
45
|
}
|
|
42
46
|
|
|
43
|
-
@
|
|
47
|
+
@Get('getById/:id')
|
|
44
48
|
async getAttributeById(
|
|
45
49
|
@Param('id') id: number,
|
|
46
50
|
@Req() req: Request & { user: any },
|
|
47
51
|
) {
|
|
48
|
-
|
|
52
|
+
return await this.attributeMasterService.getAttributeById(id);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
@Get('getDropdownList/:entityType')
|
|
57
|
+
async getAttributesDropdownList(
|
|
58
|
+
@Param('entityType') entityType: string,
|
|
59
|
+
@Req() req: Request & { user: any },
|
|
60
|
+
) {
|
|
61
|
+
let loggedInUser = req.user.userData;
|
|
62
|
+
return await this.attributeMasterService.getAttributesDropdownList(
|
|
63
|
+
entityType,
|
|
64
|
+
loggedInUser,
|
|
65
|
+
);
|
|
49
66
|
}
|
|
50
67
|
}
|
|
51
68
|
|
|
@@ -46,6 +46,7 @@ import { AppMasterService } from './service/app-master.service';
|
|
|
46
46
|
import { AppMasterRespository } from './repository/app-master.repository';
|
|
47
47
|
import { AppMaster } from './entity/app-master.entity';
|
|
48
48
|
import { PopulateMetaService } from './service/populate-meta.service';
|
|
49
|
+
import { AttributeMasterController } from './controller/attribute-master.controller';
|
|
49
50
|
|
|
50
51
|
@Module({
|
|
51
52
|
imports: [
|
|
@@ -117,6 +118,7 @@ import { PopulateMetaService } from './service/populate-meta.service';
|
|
|
117
118
|
ViewMasterController,
|
|
118
119
|
MetaController,
|
|
119
120
|
AppMasterController,
|
|
121
|
+
AttributeMasterController,
|
|
120
122
|
],
|
|
121
123
|
})
|
|
122
124
|
export class EntityModule {}
|
|
@@ -61,4 +61,22 @@ export class AttributeMasterRepository {
|
|
|
61
61
|
return await this.attributeMasterRepository.findOne({ where: { id } });
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
+
async getAttributesDropdownList(
|
|
65
|
+
entityType: string,
|
|
66
|
+
loggedInUser: UserData,
|
|
67
|
+
): Promise<{ label: string; value: number }[]> {
|
|
68
|
+
const data = await this.attributeMasterRepository.find({
|
|
69
|
+
where: {
|
|
70
|
+
mapped_entity_type: entityType,
|
|
71
|
+
organization_id: loggedInUser.organization_id,
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
return data.map((item) => ({
|
|
76
|
+
label: item.name,
|
|
77
|
+
value: item.id,
|
|
78
|
+
}));
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
|
|
64
82
|
}
|
|
@@ -56,4 +56,15 @@ export class AttributeMasterService {
|
|
|
56
56
|
loggedInUser,
|
|
57
57
|
);
|
|
58
58
|
}
|
|
59
|
+
|
|
60
|
+
async getAttributesDropdownList(
|
|
61
|
+
entityType: string,
|
|
62
|
+
loggedInUser: UserData,
|
|
63
|
+
): Promise<{ label: string; value: number }[]> {
|
|
64
|
+
return await this.attributeMasterRepository.getAttributesDropdownList(
|
|
65
|
+
entityType,
|
|
66
|
+
loggedInUser,
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
59
70
|
}
|