From 2bfa07ad1bf44e481a1923577b0b91b45ef28518 Mon Sep 17 00:00:00 2001 From: "open-swe-dev-andrinoid[bot]" Date: Thu, 22 Jan 2026 05:28:07 +0000 Subject: [PATCH 01/29] Apply patch [skip ci] --- routes/landlord/dashboard/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/routes/landlord/dashboard/index.tsx b/routes/landlord/dashboard/index.tsx index fc733fc..9bfc72d 100644 --- a/routes/landlord/dashboard/index.tsx +++ b/routes/landlord/dashboard/index.tsx @@ -536,3 +536,4 @@ export default define.page( ); }, ); + From 7fa264838e797820c02cee84849b566cb27a43ac Mon Sep 17 00:00:00 2001 From: "open-swe-dev-andrinoid[bot]" Date: Thu, 22 Jan 2026 05:29:12 +0000 Subject: [PATCH 02/29] Apply patch [skip ci] --- routes/landlord/dashboard/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/routes/landlord/dashboard/index.tsx b/routes/landlord/dashboard/index.tsx index 9bfc72d..ae03063 100644 --- a/routes/landlord/dashboard/index.tsx +++ b/routes/landlord/dashboard/index.tsx @@ -537,3 +537,4 @@ export default define.page( }, ); + From 2051ffd611cbb53d885218f9d6aa6a6b60503be6 Mon Sep 17 00:00:00 2001 From: "open-swe-dev-andrinoid[bot]" Date: Thu, 22 Jan 2026 05:32:45 +0000 Subject: [PATCH 03/29] Apply patch [skip ci] --- routes/landlord/dashboard/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/routes/landlord/dashboard/index.tsx b/routes/landlord/dashboard/index.tsx index ae03063..a8bd196 100644 --- a/routes/landlord/dashboard/index.tsx +++ b/routes/landlord/dashboard/index.tsx @@ -538,3 +538,4 @@ export default define.page( ); + From 7a136a25a9b7b99a68563012d71360efc8d0ae39 Mon Sep 17 00:00:00 2001 From: "open-swe-dev-andrinoid[bot]" Date: Thu, 22 Jan 2026 05:33:19 +0000 Subject: [PATCH 04/29] Apply patch [skip ci] --- routes/landlord/dashboard/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/routes/landlord/dashboard/index.tsx b/routes/landlord/dashboard/index.tsx index a8bd196..6585e9b 100644 --- a/routes/landlord/dashboard/index.tsx +++ b/routes/landlord/dashboard/index.tsx @@ -539,3 +539,4 @@ export default define.page( + From 2f751c370c99e9dca0f2ca861d937f765986955c Mon Sep 17 00:00:00 2001 From: "open-swe-dev-andrinoid[bot]" Date: Thu, 22 Jan 2026 05:34:04 +0000 Subject: [PATCH 05/29] Apply patch [skip ci] --- services/leaseService.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/services/leaseService.ts b/services/leaseService.ts index 2ddd6ed..11d6f3c 100644 --- a/services/leaseService.ts +++ b/services/leaseService.ts @@ -247,3 +247,4 @@ export async function getLeaseStatsByOwner(owner_id: string) { without_tenant: allLeases.filter((l) => l.tenant_id === null).length, }; } + From e90bdfcc02e57e214bba16ac3dc58b04b80549de Mon Sep 17 00:00:00 2001 From: "open-swe-dev-andrinoid[bot]" Date: Thu, 22 Jan 2026 05:36:36 +0000 Subject: [PATCH 06/29] Apply patch [skip ci] --- routes/landlord/dashboard/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/routes/landlord/dashboard/index.tsx b/routes/landlord/dashboard/index.tsx index 6585e9b..c656bf2 100644 --- a/routes/landlord/dashboard/index.tsx +++ b/routes/landlord/dashboard/index.tsx @@ -540,3 +540,4 @@ export default define.page( + From 8e184c265f863bb02a2c5631cd83d218255663fd Mon Sep 17 00:00:00 2001 From: "open-swe-dev-andrinoid[bot]" Date: Thu, 22 Jan 2026 05:37:38 +0000 Subject: [PATCH 07/29] Apply patch [skip ci] --- services/leaseService.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/services/leaseService.ts b/services/leaseService.ts index 11d6f3c..f651d13 100644 --- a/services/leaseService.ts +++ b/services/leaseService.ts @@ -248,3 +248,4 @@ export async function getLeaseStatsByOwner(owner_id: string) { }; } + From 66b8e56f17989c5b2a1f33bd60dedf5850c810fa Mon Sep 17 00:00:00 2001 From: "open-swe-dev-andrinoid[bot]" Date: Thu, 22 Jan 2026 05:41:00 +0000 Subject: [PATCH 08/29] Apply patch [skip ci] --- routes/landlord/dashboard/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/routes/landlord/dashboard/index.tsx b/routes/landlord/dashboard/index.tsx index c656bf2..24d1d56 100644 --- a/routes/landlord/dashboard/index.tsx +++ b/routes/landlord/dashboard/index.tsx @@ -541,3 +541,4 @@ export default define.page( + From 2936656d96d241b4b5e91b1e8cb62125b0d0b108 Mon Sep 17 00:00:00 2001 From: "open-swe-dev-andrinoid[bot]" Date: Thu, 22 Jan 2026 05:45:15 +0000 Subject: [PATCH 09/29] Apply patch [skip ci] --- services/leaseService.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/services/leaseService.ts b/services/leaseService.ts index f651d13..6f42071 100644 --- a/services/leaseService.ts +++ b/services/leaseService.ts @@ -249,3 +249,4 @@ export async function getLeaseStatsByOwner(owner_id: string) { } + From cbf1357654e038b525d9989ca56c0700536f01c7 Mon Sep 17 00:00:00 2001 From: "open-swe-dev-andrinoid[bot]" Date: Thu, 22 Jan 2026 05:49:18 +0000 Subject: [PATCH 10/29] Apply patch [skip ci] --- routes/api/update/lease_accept.ts | 50 +++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 routes/api/update/lease_accept.ts diff --git a/routes/api/update/lease_accept.ts b/routes/api/update/lease_accept.ts new file mode 100644 index 0000000..c366d18 --- /dev/null +++ b/routes/api/update/lease_accept.ts @@ -0,0 +1,50 @@ +// routes/api/update/lease_accept.ts +import { define } from "../../../utils.ts"; +import { signLease } from "../../../services/leaseService.ts"; +import { SessionCookie } from "../../auth/callback.ts"; + +export const handler = define.handlers({ + async POST(ctx) { + try { + const stateData: SessionCookie = ctx.state.data; + const { user_id } = stateData || {}; + + if (!user_id) { + return new Response(JSON.stringify({ error: "Unauthorized" }), { + status: 401, + headers: { "Content-Type": "application/json" }, + }); + } + + const contentType = ctx.req.headers.get("content-type") || ""; + let data: Record = {}; + if (contentType.includes("application/json")) { + data = await ctx.req.json(); + } else { + const form = await ctx.req.formData(); + for (const [k, v] of form.entries()) { + data[k] = typeof v === "string" ? v : String(v); + } + } + + 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, + headers: { "Content-Type": "application/json" }, + }); + } + + const result = await signLease(lease_id, user_id as string); + return new Response(JSON.stringify({ success: true, lease: result?.[0] || null }), { + status: 200, + headers: { "Content-Type": "application/json" }, + }); + } catch (err) { + return new Response(JSON.stringify({ error: String(err) }), { + status: 500, + headers: { "Content-Type": "application/json" }, + }); + } + }, +}); From 3a63942bfd30459ed9f5fe458c9f14282127b77d Mon Sep 17 00:00:00 2001 From: "open-swe-dev-andrinoid[bot]" Date: Thu, 22 Jan 2026 05:50:05 +0000 Subject: [PATCH 11/29] Apply patch [skip ci] --- routes/api/update/lease_accept.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/routes/api/update/lease_accept.ts b/routes/api/update/lease_accept.ts index c366d18..c950938 100644 --- a/routes/api/update/lease_accept.ts +++ b/routes/api/update/lease_accept.ts @@ -48,3 +48,4 @@ export const handler = define.handlers({ } }, }); + From 883a5a5186e89ecdf40984094852549e8e5d3707 Mon Sep 17 00:00:00 2001 From: "open-swe-dev-andrinoid[bot]" Date: Thu, 22 Jan 2026 05:50:47 +0000 Subject: [PATCH 12/29] Apply patch [skip ci] --- routes/api/update/lease_accept.ts | 15 +++++++++------ services/leaseService.ts | 3 --- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/routes/api/update/lease_accept.ts b/routes/api/update/lease_accept.ts index c950938..356e9a9 100644 --- a/routes/api/update/lease_accept.ts +++ b/routes/api/update/lease_accept.ts @@ -27,7 +27,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, @@ -36,10 +37,13 @@ export const handler = define.handlers({ } const result = await signLease(lease_id, user_id as string); - return new Response(JSON.stringify({ success: true, lease: result?.[0] || null }), { - status: 200, - headers: { "Content-Type": "application/json" }, - }); + return new Response( + JSON.stringify({ success: true, lease: result?.[0] || null }), + { + status: 200, + headers: { "Content-Type": "application/json" }, + }, + ); } catch (err) { return new Response(JSON.stringify({ error: String(err) }), { status: 500, @@ -48,4 +52,3 @@ export const handler = define.handlers({ } }, }); - diff --git a/services/leaseService.ts b/services/leaseService.ts index 6f42071..2ddd6ed 100644 --- a/services/leaseService.ts +++ b/services/leaseService.ts @@ -247,6 +247,3 @@ export async function getLeaseStatsByOwner(owner_id: string) { without_tenant: allLeases.filter((l) => l.tenant_id === null).length, }; } - - - From b0763837ade7041fbad5fb8caff53bf31a840d33 Mon Sep 17 00:00:00 2001 From: "open-swe-dev-andrinoid[bot]" Date: Thu, 22 Jan 2026 05:56:25 +0000 Subject: [PATCH 13/29] Apply patch [skip ci] --- routes/landlord/payments/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/routes/landlord/payments/index.tsx b/routes/landlord/payments/index.tsx index b973a2f..6f0dd53 100644 --- a/routes/landlord/payments/index.tsx +++ b/routes/landlord/payments/index.tsx @@ -282,3 +282,4 @@ export default define.page(function LandlordPayments({ data }) { ); }); + From 3ca3a25bbcd2d2a9853e423259c6640af429bf74 Mon Sep 17 00:00:00 2001 From: "open-swe-dev-andrinoid[bot]" Date: Thu, 22 Jan 2026 05:57:11 +0000 Subject: [PATCH 14/29] Apply patch [skip ci] --- routes/landlord/properties/cleanup.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/routes/landlord/properties/cleanup.tsx b/routes/landlord/properties/cleanup.tsx index 01f6c10..a8da508 100644 --- a/routes/landlord/properties/cleanup.tsx +++ b/routes/landlord/properties/cleanup.tsx @@ -536,3 +536,4 @@ export default define.page(function LandlordPropertyCleanup({ data }) { ); }); + From 7bede6cd446a81b5bd7658d66f323a1c8569dcf5 Mon Sep 17 00:00:00 2001 From: "open-swe-dev-andrinoid[bot]" Date: Thu, 22 Jan 2026 05:59:28 +0000 Subject: [PATCH 15/29] Apply patch [skip ci] --- routes/landlord/portfolio/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/routes/landlord/portfolio/index.tsx b/routes/landlord/portfolio/index.tsx index 46f7260..f391d1d 100644 --- a/routes/landlord/portfolio/index.tsx +++ b/routes/landlord/portfolio/index.tsx @@ -171,3 +171,4 @@ export default define.page(function LandlordPortfolio({ data }) { ); }); + From 409eef0281c5e0feec9a88118cecf8165289f657 Mon Sep 17 00:00:00 2001 From: "open-swe-dev-andrinoid[bot]" Date: Thu, 22 Jan 2026 06:02:44 +0000 Subject: [PATCH 16/29] Apply patch [skip ci] --- routes/api/update/lease_invite.ts | 67 +++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 routes/api/update/lease_invite.ts diff --git a/routes/api/update/lease_invite.ts b/routes/api/update/lease_invite.ts new file mode 100644 index 0000000..93bf3b6 --- /dev/null +++ b/routes/api/update/lease_invite.ts @@ -0,0 +1,67 @@ +// routes/api/update/lease_invite.ts +import { define } from "../../../utils.ts"; +import { getLeaseById } from "../../../services/leaseService.ts"; +import { createTenantInvite } from "../../../services/tenantInviteService.ts"; +import { SessionCookie } from "../../auth/callback.ts"; + +export const handler = define.handlers({ + async POST(ctx) { + try { + const stateData: SessionCookie = ctx.state.data; + const { user_id } = stateData || {}; + + if (!user_id) { + return new Response(JSON.stringify({ error: "Unauthorized" }), { + status: 401, + headers: { "Content-Type": "application/json" }, + }); + } + + const contentType = ctx.req.headers.get("content-type") || ""; + let data: Record = {}; + if (contentType.includes("application/json")) { + data = await ctx.req.json(); + } else { + const form = await ctx.req.formData(); + for (const [k, v] of form.entries()) { + data[k] = typeof v === "string" ? v : String(v); + } + } + + 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, + headers: { "Content-Type": "application/json" }, + }); + } + + const lease = await getLeaseById(lease_id); + if (!lease) { + return new Response(JSON.stringify({ error: "lease not found" }), { + status: 404, + headers: { "Content-Type": "application/json" }, + }); + } + + 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" }, + }); + } + + const invite = await createTenantInvite(user_id as string, property_id); + return new Response(JSON.stringify({ success: true, invite }), { + status: 200, + headers: { "Content-Type": "application/json" }, + }); + } catch (err) { + return new Response(JSON.stringify({ error: String(err) }), { + status: 500, + headers: { "Content-Type": "application/json" }, + }); + } + }, +}); From 73585966bb7d06238387142d74d73c60de3714b1 Mon Sep 17 00:00:00 2001 From: "open-swe-dev-andrinoid[bot]" Date: Thu, 22 Jan 2026 06:04:01 +0000 Subject: [PATCH 17/29] Apply patch [skip ci] --- routes/api/receipt/[id].ts | 1 + 1 file changed, 1 insertion(+) diff --git a/routes/api/receipt/[id].ts b/routes/api/receipt/[id].ts index bbd009c..86ba07c 100644 --- a/routes/api/receipt/[id].ts +++ b/routes/api/receipt/[id].ts @@ -51,3 +51,4 @@ export const handler = define.handlers({ }); }, }); + From 3e119728aeefd360d522932892e2718310ed2c15 Mon Sep 17 00:00:00 2001 From: "open-swe-dev-andrinoid[bot]" Date: Thu, 22 Jan 2026 06:04:10 +0000 Subject: [PATCH 18/29] Apply patch [skip ci] --- routes/api/receipt/[id].ts | 1 - 1 file changed, 1 deletion(-) diff --git a/routes/api/receipt/[id].ts b/routes/api/receipt/[id].ts index 86ba07c..bbd009c 100644 --- a/routes/api/receipt/[id].ts +++ b/routes/api/receipt/[id].ts @@ -51,4 +51,3 @@ export const handler = define.handlers({ }); }, }); - From ac958ab60a5ef2272f652aa2b2989106173104a0 Mon Sep 17 00:00:00 2001 From: "open-swe-dev-andrinoid[bot]" Date: Thu, 22 Jan 2026 14:30:57 +0000 Subject: [PATCH 19/29] Apply patch [skip ci] --- routes/landlord/dashboard/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/routes/landlord/dashboard/index.tsx b/routes/landlord/dashboard/index.tsx index 24d1d56..15a9fca 100644 --- a/routes/landlord/dashboard/index.tsx +++ b/routes/landlord/dashboard/index.tsx @@ -542,3 +542,4 @@ export default define.page( + From 466703f786b904626ab861dff014ed7d5fed3101 Mon Sep 17 00:00:00 2001 From: "open-swe-dev-andrinoid[bot]" Date: Thu, 22 Jan 2026 14:32:02 +0000 Subject: [PATCH 20/29] Apply patch [skip ci] --- routes/landlord/dashboard/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/routes/landlord/dashboard/index.tsx b/routes/landlord/dashboard/index.tsx index 15a9fca..12139cf 100644 --- a/routes/landlord/dashboard/index.tsx +++ b/routes/landlord/dashboard/index.tsx @@ -543,3 +543,4 @@ export default define.page( + From 008de04a69ae372e39e1cf7b83727d2b6408e903 Mon Sep 17 00:00:00 2001 From: "open-swe-dev-andrinoid[bot]" Date: Thu, 22 Jan 2026 14:32:21 +0000 Subject: [PATCH 21/29] Apply patch [skip ci] --- routes/landlord/dashboard/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/routes/landlord/dashboard/index.tsx b/routes/landlord/dashboard/index.tsx index 12139cf..f533c65 100644 --- a/routes/landlord/dashboard/index.tsx +++ b/routes/landlord/dashboard/index.tsx @@ -544,3 +544,4 @@ export default define.page( + From 0e4ba11f82229a888b3d5273b4a2b86d014f95a9 Mon Sep 17 00:00:00 2001 From: "open-swe-dev-andrinoid[bot]" Date: Thu, 22 Jan 2026 14:33:03 +0000 Subject: [PATCH 22/29] Apply patch [skip ci] --- routes/landlord/dashboard/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/routes/landlord/dashboard/index.tsx b/routes/landlord/dashboard/index.tsx index f533c65..ff2ef10 100644 --- a/routes/landlord/dashboard/index.tsx +++ b/routes/landlord/dashboard/index.tsx @@ -545,3 +545,4 @@ export default define.page( + From 6d4707f388dd9b824535af80b55137ca7ae0f5d0 Mon Sep 17 00:00:00 2001 From: "open-swe-dev-andrinoid[bot]" Date: Thu, 22 Jan 2026 14:33:37 +0000 Subject: [PATCH 23/29] Apply patch [skip ci] --- routes/landlord/dashboard/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/routes/landlord/dashboard/index.tsx b/routes/landlord/dashboard/index.tsx index ff2ef10..8e4f3c3 100644 --- a/routes/landlord/dashboard/index.tsx +++ b/routes/landlord/dashboard/index.tsx @@ -546,3 +546,4 @@ export default define.page( + From 6cbf71b1c52a47af11844f6a1b64956acf99fc5d Mon Sep 17 00:00:00 2001 From: "open-swe-dev-andrinoid[bot]" Date: Thu, 22 Jan 2026 14:36:29 +0000 Subject: [PATCH 24/29] Apply patch [skip ci] --- routes/landlord/dashboard/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/routes/landlord/dashboard/index.tsx b/routes/landlord/dashboard/index.tsx index 8e4f3c3..03f20a5 100644 --- a/routes/landlord/dashboard/index.tsx +++ b/routes/landlord/dashboard/index.tsx @@ -547,3 +547,4 @@ export default define.page( + From aeb864a8b6cb0cb0e8559e80c868b61a0eb3875f Mon Sep 17 00:00:00 2001 From: "open-swe-dev-andrinoid[bot]" Date: Thu, 22 Jan 2026 14:37:05 +0000 Subject: [PATCH 25/29] Apply patch [skip ci] --- routes/landlord/dashboard/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/routes/landlord/dashboard/index.tsx b/routes/landlord/dashboard/index.tsx index 03f20a5..e813045 100644 --- a/routes/landlord/dashboard/index.tsx +++ b/routes/landlord/dashboard/index.tsx @@ -548,3 +548,4 @@ export default define.page( + From d9085c33116f07ae88ab7a016905d9578586314d Mon Sep 17 00:00:00 2001 From: "open-swe-dev-andrinoid[bot]" Date: Thu, 22 Jan 2026 14:37:57 +0000 Subject: [PATCH 26/29] Apply patch [skip ci] --- routes/landlord/dashboard/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/routes/landlord/dashboard/index.tsx b/routes/landlord/dashboard/index.tsx index e813045..10af7aa 100644 --- a/routes/landlord/dashboard/index.tsx +++ b/routes/landlord/dashboard/index.tsx @@ -549,3 +549,4 @@ export default define.page( + From cbfd52e665b3993838833242d445f9c9b06af89e Mon Sep 17 00:00:00 2001 From: "open-swe-dev-andrinoid[bot]" Date: Thu, 22 Jan 2026 14:38:11 +0000 Subject: [PATCH 27/29] Apply patch [skip ci] --- routes/landlord/dashboard/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/routes/landlord/dashboard/index.tsx b/routes/landlord/dashboard/index.tsx index 10af7aa..c242399 100644 --- a/routes/landlord/dashboard/index.tsx +++ b/routes/landlord/dashboard/index.tsx @@ -550,3 +550,4 @@ export default define.page( + From 03cb7c51eb51b97ee8e1917ab62509fcb12abf33 Mon Sep 17 00:00:00 2001 From: "open-swe-dev-andrinoid[bot]" Date: Thu, 22 Jan 2026 14:38:20 +0000 Subject: [PATCH 28/29] Apply patch [skip ci] --- routes/landlord/dashboard/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/routes/landlord/dashboard/index.tsx b/routes/landlord/dashboard/index.tsx index c242399..3585226 100644 --- a/routes/landlord/dashboard/index.tsx +++ b/routes/landlord/dashboard/index.tsx @@ -551,3 +551,4 @@ export default define.page( + From 25e89a5888d68dd8bfbe51b354df188a0718b8d9 Mon Sep 17 00:00:00 2001 From: "open-swe-dev-andrinoid[bot]" Date: Thu, 22 Jan 2026 14:55:45 +0000 Subject: [PATCH 29/29] Apply patch [skip ci] --- routes/landlord/dashboard/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/routes/landlord/dashboard/index.tsx b/routes/landlord/dashboard/index.tsx index 3585226..bcf8668 100644 --- a/routes/landlord/dashboard/index.tsx +++ b/routes/landlord/dashboard/index.tsx @@ -552,3 +552,4 @@ export default define.page( +