update swagger

This commit is contained in:
2026-07-02 20:21:12 +03:30
parent 8e2e43e12b
commit 1f06b378e6
18 changed files with 346 additions and 34 deletions
+11
View File
@@ -20,9 +20,16 @@ import { UserRole } from '../users/enums/user-role.enum';
import { CustomersService } from './customers.service';
import { UpdateCustomerDto } from './dto/update-customer.dto';
import { SWAGGER_JWT_AUTH } from '../swagger/swagger.setup';
import {
ApiStandardController,
ApiStandardEmptyResponse,
ApiStandardOkResponse,
} from '../swagger/decorators/swagger-response.decorator';
import { Customer } from './entities/customer.entity';
@ApiTags('Customers')
@ApiBearerAuth(SWAGGER_JWT_AUTH)
@ApiStandardController()
@Controller('customers')
@UseGuards(RolesGuard, PermissionsGuard)
export class CustomersController {
@@ -30,11 +37,13 @@ export class CustomersController {
@Roles(UserRole.ADMIN)
@Permissions(PermissionCode.CUSTOMERS_READ)
@ApiStandardOkResponse(Customer, { isArray: true })
@Get()
findAll() {
return this.customersService.findAll();
}
@ApiStandardOkResponse(Customer)
@Get(':id')
findOne(
@Param('id', ParseUUIDPipe) id: string,
@@ -43,6 +52,7 @@ export class CustomersController {
return this.customersService.findOne(id, user);
}
@ApiStandardOkResponse(Customer)
@Patch(':id')
update(
@Param('id', ParseUUIDPipe) id: string,
@@ -54,6 +64,7 @@ export class CustomersController {
@Roles(UserRole.ADMIN)
@Permissions(PermissionCode.CUSTOMERS_DELETE)
@ApiStandardEmptyResponse()
@Delete(':id')
remove(@Param('id', ParseUUIDPipe) id: string) {
return this.customersService.remove(id);