Apply patch [skip ci]
This commit is contained in:
parent
b7edcc3964
commit
9dd9520532
8
TODO.md
8
TODO.md
@ -3,6 +3,7 @@
|
|||||||
## High Priority
|
## High Priority
|
||||||
|
|
||||||
### Implement Lease Creation for Landlord Dashboard
|
### Implement Lease Creation for Landlord Dashboard
|
||||||
|
|
||||||
- **Add "Create New Lease" button** to the landlord dashboard
|
- **Add "Create New Lease" button** to the landlord dashboard
|
||||||
- **Lease creation form** with basic price information:
|
- **Lease creation form** with basic price information:
|
||||||
- Rent amount
|
- Rent amount
|
||||||
@ -18,6 +19,7 @@
|
|||||||
- Update tenant field when invitation is accepted
|
- Update tenant field when invitation is accepted
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
- **Fix TypeScript import errors** in receipt API routes
|
- **Fix TypeScript import errors** in receipt API routes
|
||||||
- **Add missing `getTransactionByStripeId` function** to paymentService.ts
|
- **Add missing `getTransactionByStripeId` function** to paymentService.ts
|
||||||
- **Fix type annotations** for API route handlers
|
- **Fix type annotations** for API route handlers
|
||||||
@ -26,6 +28,7 @@
|
|||||||
## Technical Implementation Details
|
## Technical Implementation Details
|
||||||
|
|
||||||
### Lease Creation Flow
|
### Lease Creation Flow
|
||||||
|
|
||||||
1. **Landlord Dashboard Enhancement**
|
1. **Landlord Dashboard Enhancement**
|
||||||
- Add "Create New Lease" button component
|
- Add "Create New Lease" button component
|
||||||
- Create lease creation modal/page
|
- Create lease creation modal/page
|
||||||
@ -42,11 +45,13 @@
|
|||||||
- PUT `/api/leases/:id/accept` - Tenant accepts invitation
|
- PUT `/api/leases/:id/accept` - Tenant accepts invitation
|
||||||
|
|
||||||
### Payment Service Fixes
|
### Payment Service Fixes
|
||||||
|
|
||||||
- Implement `getTransactionByStripeId(stripeId: string)` function
|
- Implement `getTransactionByStripeId(stripeId: string)` function
|
||||||
- Fix import paths in API routes
|
- Fix import paths in API routes
|
||||||
- Add proper TypeScript types for Fresh handlers
|
- Add proper TypeScript types for Fresh handlers
|
||||||
|
|
||||||
## Development Tasks
|
## Development Tasks
|
||||||
|
|
||||||
- [ ] Create lease creation UI components
|
- [ ] Create lease creation UI components
|
||||||
- [ ] Implement lease creation API endpoint
|
- [ ] Implement lease creation API endpoint
|
||||||
- [ ] Add tenant invitation system
|
- [ ] Add tenant invitation system
|
||||||
@ -56,9 +61,8 @@
|
|||||||
- [ ] Update landlord dashboard with new lease button
|
- [ ] Update landlord dashboard with new lease button
|
||||||
|
|
||||||
## Testing
|
## Testing
|
||||||
|
|
||||||
- [ ] Unit tests for lease creation
|
- [ ] Unit tests for lease creation
|
||||||
- [ ] Integration tests for tenant invitation flow
|
- [ ] Integration tests for tenant invitation flow
|
||||||
- [ ] E2E tests for complete lease lifecycle
|
- [ ] E2E tests for complete lease lifecycle
|
||||||
- [ ] Payment service integration tests
|
- [ ] Payment service integration tests
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -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) {
|
if (!lease_id) {
|
||||||
return new Response(JSON.stringify({ error: "lease_id is required" }), {
|
return new Response(JSON.stringify({ error: "lease_id is required" }), {
|
||||||
status: 400,
|
status: 400,
|
||||||
@ -46,10 +47,13 @@ export const handler = define.handlers({
|
|||||||
|
|
||||||
const property_id = lease.property_id as string | undefined;
|
const property_id = lease.property_id as string | undefined;
|
||||||
if (!property_id) {
|
if (!property_id) {
|
||||||
return new Response(JSON.stringify({ error: "lease has no property_id" }), {
|
return new Response(
|
||||||
status: 400,
|
JSON.stringify({ error: "lease has no property_id" }),
|
||||||
headers: { "Content-Type": "application/json" },
|
{
|
||||||
});
|
status: 400,
|
||||||
|
headers: { "Content-Type": "application/json" },
|
||||||
|
},
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const invite = await createTenantInvite(user_id as string, property_id);
|
const invite = await createTenantInvite(user_id as string, property_id);
|
||||||
|
|||||||
@ -542,4 +542,3 @@ export default define.page(
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -282,4 +282,3 @@ export default define.page(function LandlordPayments({ data }) {
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -171,4 +171,3 @@ export default define.page(function LandlordPortfolio({ data }) {
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -536,4 +536,3 @@ export default define.page(function LandlordPropertyCleanup({ data }) {
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -1221,5 +1221,3 @@ export function getE2ELandlordDashboardData(userId: string) {
|
|||||||
monthlyRevenue,
|
monthlyRevenue,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -247,5 +247,3 @@ export async function getLeaseStatsByOwner(owner_id: string) {
|
|||||||
without_tenant: allLeases.filter((l) => l.tenant_id === null).length,
|
without_tenant: allLeases.filter((l) => l.tenant_id === null).length,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -391,7 +391,7 @@ export async function cancelAutoPayment(
|
|||||||
export async function getTransactionByStripeId(stripeId: string) {
|
export async function getTransactionByStripeId(stripeId: string) {
|
||||||
if (isE2EEnabled()) {
|
if (isE2EEnabled()) {
|
||||||
const transactions = getE2EPaymentTransactionsByOwner(""); // Get all transactions and filter
|
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()
|
const result = await db.select()
|
||||||
.from(payment_transactions)
|
.from(payment_transactions)
|
||||||
|
|||||||
@ -75,5 +75,3 @@ test("landlord can update maintenance status", async ({ page }: { page: Page })
|
|||||||
await expect(page).toHaveURL(/\/landlord\/maintenance/);
|
await expect(page).toHaveURL(/\/landlord\/maintenance/);
|
||||||
await expect(statusSelect).toHaveValue("in_progress");
|
await expect(statusSelect).toHaveValue("in_progress");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -13,7 +13,8 @@ test("lease acceptance workflow (E2E fixtures)", async ({ page }: { page: Page }
|
|||||||
} else {
|
} else {
|
||||||
await page.goto("/leased-home");
|
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)
|
// Create an invite for an existing e2e lease (server-side fixture)
|
||||||
const inviteResp = await page.request.post("/api/update/lease_invite", {
|
const inviteResp = await page.request.post("/api/update/lease_invite", {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user