update swagger
This commit is contained in:
@@ -23,9 +23,16 @@ import { FindReservesQueryDto } from './dto/find-reserves-query.dto';
|
||||
import { UpdateReserveDto } from './dto/update-reserve.dto';
|
||||
import { ReservesService } from './reserves.service';
|
||||
import { SWAGGER_JWT_AUTH } from '../swagger/swagger.setup';
|
||||
import {
|
||||
ApiStandardController,
|
||||
ApiStandardOkResponse,
|
||||
} from '../swagger/decorators/swagger-response.decorator';
|
||||
import { ReserveStatusHistory } from './entities/reserve-status-history.entity';
|
||||
import { Reserve } from './entities/reserve.entity';
|
||||
|
||||
@ApiTags('Reserves')
|
||||
@ApiBearerAuth(SWAGGER_JWT_AUTH)
|
||||
@ApiStandardController()
|
||||
@Controller('reserves')
|
||||
@UseGuards(RolesGuard, PermissionsGuard)
|
||||
export class ReservesController {
|
||||
@@ -33,6 +40,7 @@ export class ReservesController {
|
||||
|
||||
@Roles(UserRole.ADMIN, UserRole.SALON, UserRole.CUSTOMER)
|
||||
@Permissions(PermissionCode.RESERVES_WRITE)
|
||||
@ApiStandardOkResponse(Reserve)
|
||||
@Post()
|
||||
create(
|
||||
@Body() createReserveDto: CreateReserveDto,
|
||||
@@ -43,6 +51,7 @@ export class ReservesController {
|
||||
|
||||
@Roles(UserRole.ADMIN, UserRole.SALON, UserRole.CUSTOMER)
|
||||
@Permissions(PermissionCode.RESERVES_READ)
|
||||
@ApiStandardOkResponse(Reserve, { isArray: true })
|
||||
@Get()
|
||||
findAll(
|
||||
@Query() query: FindReservesQueryDto,
|
||||
@@ -53,6 +62,7 @@ export class ReservesController {
|
||||
|
||||
@Roles(UserRole.ADMIN, UserRole.SALON, UserRole.CUSTOMER)
|
||||
@Permissions(PermissionCode.RESERVES_READ)
|
||||
@ApiStandardOkResponse(ReserveStatusHistory, { isArray: true })
|
||||
@Get(':id/status-history')
|
||||
findStatusHistory(
|
||||
@Param('id', ParseUUIDPipe) id: string,
|
||||
@@ -63,6 +73,7 @@ export class ReservesController {
|
||||
|
||||
@Roles(UserRole.ADMIN, UserRole.SALON, UserRole.CUSTOMER)
|
||||
@Permissions(PermissionCode.RESERVES_READ)
|
||||
@ApiStandardOkResponse(Reserve)
|
||||
@Get(':id')
|
||||
findOne(
|
||||
@Param('id', ParseUUIDPipe) id: string,
|
||||
@@ -73,6 +84,7 @@ export class ReservesController {
|
||||
|
||||
@Roles(UserRole.ADMIN, UserRole.SALON, UserRole.CUSTOMER)
|
||||
@Permissions(PermissionCode.RESERVES_WRITE)
|
||||
@ApiStandardOkResponse(Reserve)
|
||||
@Patch(':id')
|
||||
update(
|
||||
@Param('id', ParseUUIDPipe) id: string,
|
||||
|
||||
Reference in New Issue
Block a user