Add payments management features including summary and listing, and integrate with the dashboard

This commit is contained in:
Marshal
2026-06-17 04:35:43 +00:00
parent 648f4f2ee4
commit 2de3f78fb0
10 changed files with 559 additions and 4 deletions

View File

@@ -17,7 +17,7 @@ import {
} from "@nestjs/swagger";
import { Response } from "express";
import { Public } from "@edr/api-common";
import { FreightAdmin } from "../../common/booking-guards";
import { BookingView, FreightAdmin } from "../../common/booking-guards";
import { PaymentService } from "./payment.service";
import {
InitiatePaymentDto,
@@ -33,9 +33,16 @@ import {
export class PaymentController {
constructor(private readonly paymentService: PaymentService) { }
@Get("summary")
@BookingView()
@ApiOperation({ summary: "Payment count/amount summary for dashboard cards" })
getSummary() {
return this.paymentService.getSummary();
}
@Get("all")
@FreightAdmin()
@ApiOperation({ summary: "Get all payments with filters (staff/admin only)" })
@BookingView()
@ApiOperation({ summary: "Get all payments with filters (view-only, any staff)" })
@ApiQuery({ name: "search", required: false })
@ApiQuery({ name: "status", required: false })
@ApiQuery({ name: "method", required: false })