# CyberHybridHub TODO ## 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 - Security deposit amount - Property selection - Lease term dates - **Lease states implementation**: - `new` - Initial state when created by landlord - `signed` - After tenant accepts invitation - **Tenant field handling**: - Make tenant field optional during creation - Allow landlord to invite tenant after lease creation - 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 - **Validate all changed files** with `deno check`, `deno fmt`, and `deno lint` ## Technical Implementation Details ### Lease Creation Flow 1. **Landlord Dashboard Enhancement** - Add "Create New Lease" button component - Create lease creation modal/page - Form validation for required fields 2. **Database Schema Updates** - Ensure lease table supports `new` and `signed` states - Add tenant invitation workflow - Handle optional tenant assignment 3. **API Endpoints** - POST `/api/leases` - Create new lease - PUT `/api/leases/:id/invite` - Send tenant invitation - 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 - [ ] Fix TypeScript compilation errors - [ ] Validate all changed files with `deno check`, `deno fmt`, and `deno lint` - [ ] Test lease creation workflow end-to-end - [ ] 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