From b44d5afca65e66a869ffe885c1d393a843891091 Mon Sep 17 00:00:00 2001 From: Knee Cola Date: Wed, 31 Dec 2025 10:03:12 +0100 Subject: [PATCH] fix: store rent amount as whole currency units instead of cents MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changed rent amount handling to use whole currency units throughout the application instead of storing in cents. This simplifies data entry and aligns with Zod validation requiring integer values. Changes: - Set rent input step to "1" (whole numbers only) - Remove cents-to-currency conversion (/ 100) when formatting for email 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- email-worker/src/lib/emailSenders.ts | 2 +- web-app/app/ui/LocationEditForm.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/email-worker/src/lib/emailSenders.ts b/email-worker/src/lib/emailSenders.ts index 583d5fb..e26c007 100644 --- a/email-worker/src/lib/emailSenders.ts +++ b/email-worker/src/lib/emailSenders.ts @@ -150,7 +150,7 @@ export async function sendRentDueNotifications(db: Db, budget: number): Promise< const rentDueDate = `${location.yearMonth.month}/${location.rentDueDay}/${location.yearMonth.year}`; // Format rent amount (convert from cents to display format) - const rentAmount = location.rentAmount ? (location.rentAmount / 100).toFixed(2) : '0.00'; + const rentAmount = location.rentAmount ? (location.rentAmount).toFixed(2) : '0.00'; const currency = userSettings?.currency || 'EUR'; const html = loadAndRender('rent-due', { diff --git a/web-app/app/ui/LocationEditForm.tsx b/web-app/app/ui/LocationEditForm.tsx index 03b974b..769dab6 100644 --- a/web-app/app/ui/LocationEditForm.tsx +++ b/web-app/app/ui/LocationEditForm.tsx @@ -336,7 +336,7 @@ export const LocationEditForm: FC = ({ location, yearMont name="rentAmount" type="number" min="1" - step="0.01" + step="1" placeholder={t("rent-amount-placeholder")} className="input input-bordered w-full placeholder:text-gray-600 text-right" defaultValue={formValues.rentAmount}