mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-28 09:00:57 +00:00
chore: updating billing logic
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Controller, Get, Param, ParseUUIDPipe } from "@nestjs/common";
|
||||
import { Controller, Get, Param, ParseUUIDPipe, Post } from "@nestjs/common";
|
||||
import { ApiOperation, ApiTags } from "@nestjs/swagger";
|
||||
|
||||
import { FreightAdmin } from "../../common/booking-guards";
|
||||
@@ -21,4 +21,16 @@ export class BillingController {
|
||||
findByBooking(@Param("bookingId", ParseUUIDPipe) bookingId: string) {
|
||||
return this.billingService.findByBooking(bookingId);
|
||||
}
|
||||
|
||||
@Get("invoices/:id")
|
||||
@ApiOperation({ summary: "Get an invoice with its line items" })
|
||||
findById(@Param("id", ParseUUIDPipe) id: string) {
|
||||
return this.billingService.findById(id);
|
||||
}
|
||||
|
||||
@Post("invoices/generate/:bookingId")
|
||||
@ApiOperation({ summary: "Generate (or return the existing) invoice for a booking" })
|
||||
generate(@Param("bookingId", ParseUUIDPipe) bookingId: string) {
|
||||
return this.billingService.generateForBooking(bookingId);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user