feat: Introduce new profile sections and fields with detailed configurations and validation rules.

This commit is contained in:
pradeepkumar
2026-01-24 15:32:54 +05:30
parent 43b422a81e
commit 7d7eb1ac31
4 changed files with 1010 additions and 13 deletions

View File

@@ -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);
}
}