feat: Introduce new profile sections and fields with detailed configurations and validation rules.
This commit is contained in:
@@ -108,4 +108,29 @@ export class ProfileSectionsController {
|
||||
) {
|
||||
return this.sectionsService.removeFromAgentType(id, agentTypeId);
|
||||
}
|
||||
|
||||
@Get('agent-type/:agentTypeId')
|
||||
@UseGuards(JwtAuthGuard, RolesGuard)
|
||||
@Roles(UserRole.ADMIN)
|
||||
@ApiBearerAuth()
|
||||
@ApiOperation({ summary: 'Get all sections for an agent type with ordering (Admin only)' })
|
||||
@ApiQuery({ name: 'includeFields', required: false, type: Boolean })
|
||||
getSectionsForAgentType(
|
||||
@Param('agentTypeId', ParseUUIDPipe) agentTypeId: string,
|
||||
@Query('includeFields') includeFields?: string,
|
||||
) {
|
||||
return this.sectionsService.getSectionsForAgentType(agentTypeId, includeFields !== 'false');
|
||||
}
|
||||
|
||||
@Patch('agent-type/:agentTypeId/order')
|
||||
@UseGuards(JwtAuthGuard, RolesGuard)
|
||||
@Roles(UserRole.ADMIN)
|
||||
@ApiBearerAuth()
|
||||
@ApiOperation({ summary: 'Update section ordering for an agent type (Admin only)' })
|
||||
updateSectionOrderForAgentType(
|
||||
@Param('agentTypeId', ParseUUIDPipe) agentTypeId: string,
|
||||
@Body() body: { sectionOrders: { sectionId: string; sortOrder: number; isRequired?: boolean }[] },
|
||||
) {
|
||||
return this.sectionsService.updateSectionOrderForAgentType(agentTypeId, body.sectionOrders);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user