payment method

This commit is contained in:
2025-11-23 10:15:56 +03:30
parent 4ea7c8d068
commit fd69dc391a
@@ -1,4 +1,4 @@
import { Controller, Get, Post, Body, Patch, Param, Delete, Query, UseGuards } from '@nestjs/common';
import { Controller, Get, Post, Body, Patch, Param, Delete, UseGuards } from '@nestjs/common';
import { RestaurantPaymentMethodService } from '../services/restaurant-payment-method.service';
import { CreateRestaurantPaymentMethodDto } from '../dto/create-restaurant-payment-method.dto';
import { UpdateRestaurantPaymentMethodDto } from '../dto/update-restaurant-payment-method.dto';
@@ -6,13 +6,11 @@ import { RestId } from 'src/common/decorators/rest-id.decorator';
import {
ApiTags,
ApiOperation,
ApiResponse,
ApiCreatedResponse,
ApiOkResponse,
ApiNotFoundResponse,
ApiBody,
ApiParam,
ApiQuery,
ApiBearerAuth,
} from '@nestjs/swagger';
import { AdminAuthGuard } from 'src/modules/auth/guards/adminAuth.guard';
@@ -32,21 +30,6 @@ export class RestaurantPaymentMethodController {
return this.restaurantPaymentMethodService.create(restId, createRestaurantPaymentMethodDto);
}
@Get()
@ApiOperation({ summary: 'Get all restaurant payment methods' })
@ApiOkResponse({ description: 'List of all restaurant payment methods' })
findAll() {
return this.restaurantPaymentMethodService.findAll();
}
@Get('by-restaurant/:restaurantId')
@ApiOperation({ summary: 'Get restaurant payment methods by restaurant ID' })
@ApiParam({ name: 'restaurantId', type: 'string', description: 'Restaurant ID' })
@ApiOkResponse({ description: 'List of restaurant payment methods for the restaurant' })
findByRestaurant(@Param('restaurantId') restaurantId: string) {
return this.restaurantPaymentMethodService.findByRestaurant(restaurantId);
}
@Get('by-payment-method/:paymentMethodId')
@ApiOperation({ summary: 'Get restaurant payment methods by payment method ID' })
@ApiParam({ name: 'paymentMethodId', type: 'string', description: 'Payment method ID' })
@@ -55,13 +38,12 @@ export class RestaurantPaymentMethodController {
return this.restaurantPaymentMethodService.findByPaymentMethod(paymentMethodId);
}
@Get(':id')
@Get()
@ApiOperation({ summary: 'Get a restaurant payment method by ID' })
@ApiParam({ name: 'id', type: 'string', description: 'Restaurant payment method ID' })
@ApiOkResponse({ description: 'Restaurant payment method found' })
@ApiNotFoundResponse({ description: 'Restaurant payment method not found' })
findOne(@Param('id') id: string) {
return this.restaurantPaymentMethodService.findOne(id);
findByRestaurant(@RestId() restId: string) {
return this.restaurantPaymentMethodService.findByRestaurant(restId);
}
@Patch(':id')
@@ -83,4 +65,3 @@ export class RestaurantPaymentMethodController {
return this.restaurantPaymentMethodService.remove(id);
}
}