payment method
This commit is contained in:
@@ -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 { RestaurantPaymentMethodService } from '../services/restaurant-payment-method.service';
|
||||||
import { CreateRestaurantPaymentMethodDto } from '../dto/create-restaurant-payment-method.dto';
|
import { CreateRestaurantPaymentMethodDto } from '../dto/create-restaurant-payment-method.dto';
|
||||||
import { UpdateRestaurantPaymentMethodDto } from '../dto/update-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 {
|
import {
|
||||||
ApiTags,
|
ApiTags,
|
||||||
ApiOperation,
|
ApiOperation,
|
||||||
ApiResponse,
|
|
||||||
ApiCreatedResponse,
|
ApiCreatedResponse,
|
||||||
ApiOkResponse,
|
ApiOkResponse,
|
||||||
ApiNotFoundResponse,
|
ApiNotFoundResponse,
|
||||||
ApiBody,
|
ApiBody,
|
||||||
ApiParam,
|
ApiParam,
|
||||||
ApiQuery,
|
|
||||||
ApiBearerAuth,
|
ApiBearerAuth,
|
||||||
} from '@nestjs/swagger';
|
} from '@nestjs/swagger';
|
||||||
import { AdminAuthGuard } from 'src/modules/auth/guards/adminAuth.guard';
|
import { AdminAuthGuard } from 'src/modules/auth/guards/adminAuth.guard';
|
||||||
@@ -32,21 +30,6 @@ export class RestaurantPaymentMethodController {
|
|||||||
return this.restaurantPaymentMethodService.create(restId, createRestaurantPaymentMethodDto);
|
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')
|
@Get('by-payment-method/:paymentMethodId')
|
||||||
@ApiOperation({ summary: 'Get restaurant payment methods by payment method ID' })
|
@ApiOperation({ summary: 'Get restaurant payment methods by payment method ID' })
|
||||||
@ApiParam({ name: 'paymentMethodId', type: 'string', description: 'Payment method ID' })
|
@ApiParam({ name: 'paymentMethodId', type: 'string', description: 'Payment method ID' })
|
||||||
@@ -55,13 +38,12 @@ export class RestaurantPaymentMethodController {
|
|||||||
return this.restaurantPaymentMethodService.findByPaymentMethod(paymentMethodId);
|
return this.restaurantPaymentMethodService.findByPaymentMethod(paymentMethodId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Get(':id')
|
@Get()
|
||||||
@ApiOperation({ summary: 'Get a restaurant payment method by ID' })
|
@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' })
|
@ApiOkResponse({ description: 'Restaurant payment method found' })
|
||||||
@ApiNotFoundResponse({ description: 'Restaurant payment method not found' })
|
@ApiNotFoundResponse({ description: 'Restaurant payment method not found' })
|
||||||
findOne(@Param('id') id: string) {
|
findByRestaurant(@RestId() restId: string) {
|
||||||
return this.restaurantPaymentMethodService.findOne(id);
|
return this.restaurantPaymentMethodService.findByRestaurant(restId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Patch(':id')
|
@Patch(':id')
|
||||||
@@ -83,4 +65,3 @@ export class RestaurantPaymentMethodController {
|
|||||||
return this.restaurantPaymentMethodService.remove(id);
|
return this.restaurantPaymentMethodService.remove(id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user