feat: add more metadata for payment

This commit is contained in:
Methapon2001 2025-09-11 09:17:23 +07:00
parent 4042cbcea4
commit 710382d544
2 changed files with 14 additions and 3 deletions

View file

@ -1524,8 +1524,11 @@ model Payment {
paymentStatus PaymentStatus paymentStatus PaymentStatus
amount Float amount Float
date DateTime? date DateTime?
channel String?
account String?
reference String?
createdAt DateTime @default(now()) createdAt DateTime @default(now())
createdBy User? @relation(name: "PaymentCreatedByUser", fields: [createdByUserId], references: [id], onDelete: SetNull) createdBy User? @relation(name: "PaymentCreatedByUser", fields: [createdByUserId], references: [id], onDelete: SetNull)

View file

@ -113,7 +113,15 @@ export class QuotationPayment extends Controller {
@Security("keycloak", MANAGE_ROLES.concat(["head_of_sale", "sale"])) @Security("keycloak", MANAGE_ROLES.concat(["head_of_sale", "sale"]))
async updatePayment( async updatePayment(
@Path() paymentId: string, @Path() paymentId: string,
@Body() body: { amount?: number; date?: Date; paymentStatus?: PaymentStatus }, @Body()
body: {
amount?: number;
date?: Date;
paymentStatus?: PaymentStatus;
channel?: string | null;
account?: string | null;
reference?: string | null;
},
@Request() req: RequestWithUser, @Request() req: RequestWithUser,
) { ) {
const record = await prisma.payment.findUnique({ const record = await prisma.payment.findUnique({