mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-27 23:40:56 +00:00
25 lines
765 B
TypeScript
25 lines
765 B
TypeScript
import { Controller, Get, Param, ParseUUIDPipe } from "@nestjs/common";
|
|
import { ApiOperation, ApiTags } from "@nestjs/swagger";
|
|
|
|
import { FreightAdmin } from "../../common/booking-guards";
|
|
import { BillingService } from "./billing.service";
|
|
|
|
@ApiTags("billing")
|
|
@Controller("billing")
|
|
@FreightAdmin()
|
|
export class BillingController {
|
|
constructor(private readonly billingService: BillingService) {}
|
|
|
|
@Get("invoices")
|
|
@ApiOperation({ summary: "List all invoices" })
|
|
findAll() {
|
|
return this.billingService.findAll();
|
|
}
|
|
|
|
@Get("invoices/booking/:bookingId")
|
|
@ApiOperation({ summary: "List invoices for a booking" })
|
|
findByBooking(@Param("bookingId", ParseUUIDPipe) bookingId: string) {
|
|
return this.billingService.findByBooking(bookingId);
|
|
}
|
|
}
|