From 9dd95205322ab2dcbcb137f2db098ce61607e650 Mon Sep 17 00:00:00 2001 From: "open-swe-dev-andrinoid[bot]" Date: Thu, 22 Jan 2026 21:32:58 +0000 Subject: [PATCH] Apply patch [skip ci] --- TODO.md | 8 ++++++-- routes/api/update/lease_invite.ts | 14 +++++++++----- routes/landlord/dashboard/index.tsx | 1 - routes/landlord/payments/index.tsx | 1 - routes/landlord/portfolio/index.tsx | 1 - routes/landlord/properties/cleanup.tsx | 1 - services/e2eFixtures.ts | 2 -- services/leaseService.ts | 2 -- services/paymentService.ts | 2 +- tests/e2e/landlord-dashboard.spec.ts | 2 -- tests/e2e/lease-creation.spec.ts | 3 ++- 11 files changed, 18 insertions(+), 19 deletions(-) diff --git a/TODO.md b/TODO.md index 4c05eb2..c215d72 100644 --- a/TODO.md +++ b/TODO.md @@ -3,6 +3,7 @@ ## High Priority ### Implement Lease Creation for Landlord Dashboard + - **Add "Create New Lease" button** to the landlord dashboard - **Lease creation form** with basic price information: - Rent amount @@ -18,6 +19,7 @@ - Update tenant field when invitation is accepted ### Bug Fixes + - **Fix TypeScript import errors** in receipt API routes - **Add missing `getTransactionByStripeId` function** to paymentService.ts - **Fix type annotations** for API route handlers @@ -26,6 +28,7 @@ ## Technical Implementation Details ### Lease Creation Flow + 1. **Landlord Dashboard Enhancement** - Add "Create New Lease" button component - Create lease creation modal/page @@ -42,11 +45,13 @@ - PUT `/api/leases/:id/accept` - Tenant accepts invitation ### Payment Service Fixes + - Implement `getTransactionByStripeId(stripeId: string)` function - Fix import paths in API routes - Add proper TypeScript types for Fresh handlers ## Development Tasks + - [ ] Create lease creation UI components - [ ] Implement lease creation API endpoint - [ ] Add tenant invitation system @@ -56,9 +61,8 @@ - [ ] Update landlord dashboard with new lease button ## Testing + - [ ] Unit tests for lease creation - [ ] Integration tests for tenant invitation flow - [ ] E2E tests for complete lease lifecycle - [ ] Payment service integration tests - - diff --git a/routes/api/update/lease_invite.ts b/routes/api/update/lease_invite.ts index 93bf3b6..6b7c3e3 100644 --- a/routes/api/update/lease_invite.ts +++ b/routes/api/update/lease_invite.ts @@ -28,7 +28,8 @@ export const handler = define.handlers({ } } - const lease_id = (data.lease_id as string) || (data["lease_id"] as string); + const lease_id = (data.lease_id as string) || + (data["lease_id"] as string); if (!lease_id) { return new Response(JSON.stringify({ error: "lease_id is required" }), { status: 400, @@ -46,10 +47,13 @@ export const handler = define.handlers({ const property_id = lease.property_id as string | undefined; if (!property_id) { - return new Response(JSON.stringify({ error: "lease has no property_id" }), { - status: 400, - headers: { "Content-Type": "application/json" }, - }); + return new Response( + JSON.stringify({ error: "lease has no property_id" }), + { + status: 400, + headers: { "Content-Type": "application/json" }, + }, + ); } const invite = await createTenantInvite(user_id as string, property_id); diff --git a/routes/landlord/dashboard/index.tsx b/routes/landlord/dashboard/index.tsx index c612e06..c5186cd 100644 --- a/routes/landlord/dashboard/index.tsx +++ b/routes/landlord/dashboard/index.tsx @@ -542,4 +542,3 @@ export default define.page( ); }, ); - diff --git a/routes/landlord/payments/index.tsx b/routes/landlord/payments/index.tsx index 6f0dd53..b973a2f 100644 --- a/routes/landlord/payments/index.tsx +++ b/routes/landlord/payments/index.tsx @@ -282,4 +282,3 @@ export default define.page(function LandlordPayments({ data }) { ); }); - diff --git a/routes/landlord/portfolio/index.tsx b/routes/landlord/portfolio/index.tsx index f391d1d..46f7260 100644 --- a/routes/landlord/portfolio/index.tsx +++ b/routes/landlord/portfolio/index.tsx @@ -171,4 +171,3 @@ export default define.page(function LandlordPortfolio({ data }) { ); }); - diff --git a/routes/landlord/properties/cleanup.tsx b/routes/landlord/properties/cleanup.tsx index a8da508..01f6c10 100644 --- a/routes/landlord/properties/cleanup.tsx +++ b/routes/landlord/properties/cleanup.tsx @@ -536,4 +536,3 @@ export default define.page(function LandlordPropertyCleanup({ data }) { ); }); - diff --git a/services/e2eFixtures.ts b/services/e2eFixtures.ts index d97d6f4..17f3c6e 100644 --- a/services/e2eFixtures.ts +++ b/services/e2eFixtures.ts @@ -1221,5 +1221,3 @@ export function getE2ELandlordDashboardData(userId: string) { monthlyRevenue, }; } - - diff --git a/services/leaseService.ts b/services/leaseService.ts index f651d13..2ddd6ed 100644 --- a/services/leaseService.ts +++ b/services/leaseService.ts @@ -247,5 +247,3 @@ export async function getLeaseStatsByOwner(owner_id: string) { without_tenant: allLeases.filter((l) => l.tenant_id === null).length, }; } - - diff --git a/services/paymentService.ts b/services/paymentService.ts index 42667d4..c239937 100644 --- a/services/paymentService.ts +++ b/services/paymentService.ts @@ -391,7 +391,7 @@ export async function cancelAutoPayment( export async function getTransactionByStripeId(stripeId: string) { if (isE2EEnabled()) { const transactions = getE2EPaymentTransactionsByOwner(""); // Get all transactions and filter - return transactions.find(tx => tx.stripe_payment_id === stripeId) || null; + return transactions.find((tx) => tx.stripe_payment_id === stripeId) || null; } const result = await db.select() .from(payment_transactions) diff --git a/tests/e2e/landlord-dashboard.spec.ts b/tests/e2e/landlord-dashboard.spec.ts index 7825176..267f401 100644 --- a/tests/e2e/landlord-dashboard.spec.ts +++ b/tests/e2e/landlord-dashboard.spec.ts @@ -75,5 +75,3 @@ test("landlord can update maintenance status", async ({ page }: { page: Page }) await expect(page).toHaveURL(/\/landlord\/maintenance/); await expect(statusSelect).toHaveValue("in_progress"); }); - - diff --git a/tests/e2e/lease-creation.spec.ts b/tests/e2e/lease-creation.spec.ts index 3d40565..77c6954 100644 --- a/tests/e2e/lease-creation.spec.ts +++ b/tests/e2e/lease-creation.spec.ts @@ -13,7 +13,8 @@ test("lease acceptance workflow (E2E fixtures)", async ({ page }: { page: Page } } else { await page.goto("/leased-home"); } - await expect(page.getByRole("heading", { name: /leased homes/i })).toBeVisible(); + await expect(page.getByRole("heading", { name: /leased homes/i })) + .toBeVisible(); // Create an invite for an existing e2e lease (server-side fixture) const inviteResp = await page.request.post("/api/update/lease_invite", {