From fd69dc391ad8a1bfe230e3f9d956247b9e4d37a8 Mon Sep 17 00:00:00 2001 From: morteza-mortezai Date: Sun, 23 Nov 2025 10:15:56 +0330 Subject: [PATCH] payment method --- .../restaurant-payment-method.controller.ts | 27 +++---------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/src/modules/payments/controllers/restaurant-payment-method.controller.ts b/src/modules/payments/controllers/restaurant-payment-method.controller.ts index a219983..9a79932 100644 --- a/src/modules/payments/controllers/restaurant-payment-method.controller.ts +++ b/src/modules/payments/controllers/restaurant-payment-method.controller.ts @@ -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); } } -