41 lines
1.2 KiB
TypeScript
41 lines
1.2 KiB
TypeScript
/* 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);
|
|
}
|
|
}
|