feat: soft delete junior

This commit is contained in:
Abdalhameed Ahmad
2025-09-15 09:02:56 +03:00
parent df4d2e3c1f
commit f1484e125b
8 changed files with 73 additions and 3 deletions

View File

@ -1,4 +1,16 @@
import { Body, Controller, Get, Param, Patch, Post, Query, UseGuards } from '@nestjs/common';
import {
Body,
Controller,
Delete,
Get,
HttpCode,
HttpStatus,
Param,
Patch,
Post,
Query,
UseGuards,
} from '@nestjs/common';
import { ApiBearerAuth, ApiTags } from '@nestjs/swagger';
import { Roles } from '~/auth/enums';
import { IJwtPayload } from '~/auth/interfaces';
@ -83,6 +95,14 @@ export class JuniorController {
return ResponseFactory.data(new JuniorResponseDto(junior));
}
@Delete(':juniorId')
@UseGuards(RolesGuard)
@AllowedRoles(Roles.GUARDIAN)
@HttpCode(HttpStatus.NO_CONTENT)
async deleteJunior(@AuthenticatedUser() user: IJwtPayload, @Param('juniorId', CustomParseUUIDPipe) juniorId: string) {
await this.juniorService.deleteJunior(juniorId, user.sub);
}
@Post('set-theme')
@UseGuards(RolesGuard)
@AllowedRoles(Roles.JUNIOR)