Atualização repositorio
This commit is contained in:
40
src/orders-payment/orders-payment.controller.ts
Normal file
40
src/orders-payment/orders-payment.controller.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
/* eslint-disable prettier/prettier */
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||
|
||||
/*
|
||||
https://docs.nestjs.com/controllers#controllers
|
||||
*/
|
||||
|
||||
import { Body, Controller, Get, Param, Post } from '@nestjs/common';
|
||||
import { OrdersPaymentService } from './orders-payment.service';
|
||||
|
||||
@Controller('api/v1/orders-payment')
|
||||
export class OrdersPaymentController {
|
||||
|
||||
constructor(private readonly orderPaymentService: OrdersPaymentService){}
|
||||
|
||||
@Get('orders/:id')
|
||||
findOrders(@Param('id') storeId: string) {
|
||||
return this.orderPaymentService.findOrders(storeId, 0);
|
||||
}
|
||||
|
||||
@Get('orders/:id/:orderId')
|
||||
findOrder(@Param('id') storeId: string,
|
||||
@Param('orderId') orderId: number) {
|
||||
return this.orderPaymentService.findOrders(storeId, orderId);
|
||||
}
|
||||
|
||||
@Get('payments/:id')
|
||||
findPayments(@Param('id') orderId: number) {
|
||||
return this.orderPaymentService.findPayments(orderId);
|
||||
}
|
||||
@Post('payments/create')
|
||||
createPayment(@Body() data: any) {
|
||||
return this.orderPaymentService.createPayment(data);
|
||||
}
|
||||
|
||||
@Post('invoice/create')
|
||||
createInvoice(@Body() data: any) {
|
||||
return this.orderPaymentService.createInvoice(data);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user