diff --git a/src/controllers/05-payment-controller.ts b/src/controllers/05-payment-controller.ts index 5be16f4..1178f89 100644 --- a/src/controllers/05-payment-controller.ts +++ b/src/controllers/05-payment-controller.ts @@ -12,7 +12,6 @@ import { Security, Tags, } from "tsoa"; -import express from "express"; import { PaymentStatus, Prisma } from "@prisma/client"; import prisma from "../db"; import { notFoundError } from "../utils/error"; @@ -83,12 +82,27 @@ export class QuotationPayment extends Controller { return { result, page, pageSize, total }; } - @Get("{quotationId}") + @Get("{paymentId}") @Security("keycloak") - async getPayment(@Path() quotationId: string) { + async getPayment(@Path() paymentId: string) { const record = await prisma.payment.findFirst({ - where: { invoice: { quotationId } }, - include: { createdBy: true }, + where: { id: paymentId }, + include: { + invoice: { + include: { + productServiceList: { + include: { + worker: true, + service: true, + work: true, + product: true, + }, + }, + quotation: true, + createdBy: true, + }, + }, + }, }); return record; }