payment
This commit is contained in:
@@ -6,7 +6,7 @@ import { PaymentMethodService } from '../services/payment-method.service';
|
|||||||
import { CreatePaymentMethodDto } from '../dto/create-payment-method.dto';
|
import { CreatePaymentMethodDto } from '../dto/create-payment-method.dto';
|
||||||
import { UpdatePaymentMethodDto } from '../dto/update-payment-method.dto';
|
import { UpdatePaymentMethodDto } from '../dto/update-payment-method.dto';
|
||||||
import { VerifyPaymentDto } from '../dto/verify-payment.dto';
|
import { VerifyPaymentDto } from '../dto/verify-payment.dto';
|
||||||
import { RestId } from 'src/common/decorators';
|
import { RestId, UserId } from 'src/common/decorators';
|
||||||
import { AuthGuard } from 'src/modules/auth/guards/auth.guard';
|
import { AuthGuard } from 'src/modules/auth/guards/auth.guard';
|
||||||
|
|
||||||
@ApiTags('payments')
|
@ApiTags('payments')
|
||||||
@@ -26,16 +26,13 @@ export class PaymentsController {
|
|||||||
return this.paymentMethodService.findByRestaurant(restId);
|
return this.paymentMethodService.findByRestaurant(restId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@UseGuards(AuthGuard)
|
||||||
|
@ApiBearerAuth()
|
||||||
// @UseGuards(AdminAuthGuard)
|
@Get('public/payments')
|
||||||
// @ApiBearerAuth()
|
@ApiOperation({ summary: 'Get all the restaurant payments for user' })
|
||||||
// @Get('admin/payments')
|
findAllByRestaurant(@UserId() userId: string, @RestId() restId: string) {
|
||||||
// @ApiOperation({ summary: 'Get all payments' })
|
return this.paymentsService.findAllByRestaurantId(restId, userId);
|
||||||
// @ApiOkResponse({ description: 'List of all payments' })
|
}
|
||||||
// findAllPayments() {
|
|
||||||
// return this.paymentsService.findAll();
|
|
||||||
// }
|
|
||||||
// @UseGuards(AdminAuthGuard)
|
// @UseGuards(AdminAuthGuard)
|
||||||
// @ApiBearerAuth()
|
// @ApiBearerAuth()
|
||||||
// @Get('admin/payments/:id')
|
// @Get('admin/payments/:id')
|
||||||
|
|||||||
@@ -293,9 +293,13 @@ export class PaymentsService {
|
|||||||
// return `This action updates a #${_id} payment`;
|
// return `This action updates a #${_id} payment`;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// findAll() {
|
findAllByRestaurantId(restId: string, userId: string) {
|
||||||
// return this.em.find(Payment, {});
|
return this.em.find(
|
||||||
// }
|
Payment,
|
||||||
|
{ order: { restaurant: { id: restId }, user: { id: userId } } },
|
||||||
|
{ populate: ['order', 'order.paymentMethod'] },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// remove(id: number) {
|
// remove(id: number) {
|
||||||
// return `This action removes a #${id} payment`;
|
// return `This action removes a #${id} payment`;
|
||||||
|
|||||||
Reference in New Issue
Block a user