From 7a01dad5e7138ff2baaa3d676b53c6fb60e185a4 Mon Sep 17 00:00:00 2001 From: Knee Cola Date: Sun, 23 Nov 2025 21:58:04 +0100 Subject: [PATCH] (refactor) locationActions: add timestamp for utility bills proof of payment upload --- app/lib/actions/locationActions.ts | 5 ++++- app/lib/db-types.ts | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/lib/actions/locationActions.ts b/app/lib/actions/locationActions.ts index d9a5be9..1bb4f84 100644 --- a/app/lib/actions/locationActions.ts +++ b/app/lib/actions/locationActions.ts @@ -658,7 +658,10 @@ export const uploadUtilBillsProofOfPayment = async (locationID: string, formData await dbClient.collection("lokacije") .updateOne( { _id: locationID }, - { $set: { utilBillsProofOfPaymentAttachment: attachment } } + { $set: { + utilBillsProofOfPaymentAttachment: attachment, + utilBillsProofOfPaymentUploadedAt: new Date() + } } ); return { success: true }; diff --git a/app/lib/db-types.ts b/app/lib/db-types.ts index 7d8bebb..db92e21 100644 --- a/app/lib/db-types.ts +++ b/app/lib/db-types.ts @@ -71,6 +71,8 @@ export interface BillingLocation { seenByTenant?: boolean | null; /** (optional) utility bills proof of payment attachment */ utilBillsProofOfPaymentAttachment?: BillAttachment|null; + /** (optional) date when utility bills proof of payment was uploaded */ + utilBillsProofOfPaymentUploadedAt?: Date|null; }; export enum BilledTo {