lint
This commit is contained in:
@@ -29,7 +29,14 @@ export class PaymentsController {
|
||||
@ApiBearerAuth()
|
||||
@Get('public/payments/methods/restaurant')
|
||||
@ApiOperation({ summary: 'Get the restaurant payment methods' })
|
||||
@ApiHeader({ name: 'X-Slug', required: true, description: 'Restaurant slug identifier', example: 'zhivan' })
|
||||
@ApiHeader({
|
||||
name: 'X-Slug',
|
||||
required: true,
|
||||
schema: {
|
||||
type: 'string',
|
||||
default: 'zhivan',
|
||||
},
|
||||
})
|
||||
@ApiNotFoundResponse({ description: 'Restaurant payment methods not found' })
|
||||
getTheRestaurantPaymentMethods(@RestId() restId: string) {
|
||||
return this.paymentMethodService.findByRestaurant(restId);
|
||||
@@ -39,7 +46,14 @@ export class PaymentsController {
|
||||
@ApiBearerAuth()
|
||||
@Get('public/payments')
|
||||
@ApiOperation({ summary: 'Get all the restaurant payments for user' })
|
||||
@ApiHeader({ name: 'X-Slug', required: true, description: 'Restaurant slug identifier', example: 'zhivan' })
|
||||
@ApiHeader({
|
||||
name: 'X-Slug',
|
||||
required: true,
|
||||
schema: {
|
||||
type: 'string',
|
||||
default: 'zhivan',
|
||||
},
|
||||
})
|
||||
findAllByRestaurant(@UserId() userId: string, @RestId() restId: string) {
|
||||
return this.paymentsService.findAllByRestaurantId(restId, userId);
|
||||
}
|
||||
@@ -127,7 +141,14 @@ export class PaymentsController {
|
||||
|
||||
@Post('public/payments/verify')
|
||||
@ApiOperation({ summary: 'Verify a payment' })
|
||||
@ApiHeader({ name: 'X-Slug', required: true, description: 'Restaurant slug identifier', example: 'zhivan' })
|
||||
@ApiHeader({
|
||||
name: 'X-Slug',
|
||||
required: true,
|
||||
schema: {
|
||||
type: 'string',
|
||||
default: 'zhivan',
|
||||
},
|
||||
})
|
||||
@ApiBody({ type: VerifyPaymentDto })
|
||||
@ApiNotFoundResponse({ description: 'Payment not found' })
|
||||
verifyPayment(@Body() verifyPaymentDto: VerifyPaymentDto) {
|
||||
|
||||
@@ -2,4 +2,3 @@ import { PartialType } from '@nestjs/mapped-types';
|
||||
import { CreatePaymentMethodDto } from './create-payment-method.dto';
|
||||
|
||||
export class UpdatePaymentMethodDto extends PartialType(CreatePaymentMethodDto) {}
|
||||
|
||||
|
||||
@@ -42,10 +42,7 @@ export class PaymentMethodService {
|
||||
}
|
||||
|
||||
async findByRestaurant(restaurantId: string): Promise<PaymentMethod[]> {
|
||||
return this.paymentMethodRepository.find(
|
||||
{ restaurant: { id: restaurantId } },
|
||||
{ populate: ['restaurant'] },
|
||||
);
|
||||
return this.paymentMethodRepository.find({ restaurant: { id: restaurantId } }, { populate: ['restaurant'] });
|
||||
}
|
||||
|
||||
async update(id: string, updatePaymentMethodDto: UpdatePaymentMethodDto): Promise<PaymentMethod> {
|
||||
|
||||
Reference in New Issue
Block a user