80 lines
3.0 KiB
Markdown
80 lines
3.0 KiB
Markdown
# CyberHybridHub TODO
|
|
|
|
## High Priority 🔴
|
|
|
|
### Lease Creation Feature Implementation
|
|
|
|
#### Frontend Components
|
|
- [ ] **Create lease creation form component** (`components/LeaseForm.tsx`)
|
|
- Rent amount input field
|
|
- Security deposit amount input field
|
|
- Property selection dropdown
|
|
- Lease term start/end date pickers
|
|
- Form validation and error handling
|
|
- [ ] **Add "Create New Lease" button next to "Add Property" button** on landlord dashboard (`/dashboard/landlord` route)
|
|
- [ ] **Create lease creation modal/page** (`routes/landlord/create-lease.tsx`)
|
|
- [ ] **Tenant invitation interface** - Email input and invitation sending UI
|
|
|
|
#### Backend API Endpoints
|
|
- [ ] **POST `/api/leases`** - Create new lease endpoint
|
|
- Request body validation (rent, deposit, propertyId, dates)
|
|
- Database insertion with `new` state
|
|
- Return created lease object
|
|
- [ ] **PUT `/api/leases/:id/invite`** - Send tenant invitation
|
|
- Generate invitation token
|
|
- Send email to tenant
|
|
- Update lease status
|
|
- [ ] **PUT `/api/leases/:id/accept`** - Tenant accepts invitation
|
|
- Validate invitation token
|
|
- Update lease tenant field and status to `signed`
|
|
|
|
## Medium Priority 🟡
|
|
|
|
### Payment Service Fixes
|
|
- [ ] **Implement `getTransactionByStripeId(stripeId: string)`** in `services/paymentService.ts`
|
|
- Query database by stripe transaction ID
|
|
- Return transaction object or null
|
|
- [ ] **Fix TypeScript import errors** in receipt API routes
|
|
- Check all `routes/api/receipts/` files
|
|
- Fix relative import paths
|
|
- [ ] **Add proper TypeScript types** for Fresh route handlers
|
|
- Define request/response types for API endpoints
|
|
- Update handler function signatures
|
|
|
|
### Code Quality & Testing
|
|
- [ ] **Fix TypeScript compilation errors**
|
|
- Run `deno check` to identify issues
|
|
- Fix all type mismatches
|
|
- [ ] **Validate all changed files**
|
|
- Run `deno fmt` for formatting
|
|
- Run `deno lint` for code quality
|
|
- Run `deno check` for type checking
|
|
- [ ] **Test lease creation workflow end-to-end**
|
|
- Manual testing in development environment
|
|
- Verify database state changes
|
|
- Test tenant invitation flow
|
|
|
|
## Low Priority 🟢
|
|
|
|
### Testing Infrastructure
|
|
- [ ] **Unit tests for lease creation** (`tests/unit/lease.test.ts`)
|
|
- [ ] **Integration tests for tenant invitation flow** (`tests/integration/invitation.test.ts`)
|
|
- [ ] **E2E tests for complete lease lifecycle** (`tests/e2e/lease-lifecycle.spec.ts`)
|
|
- [ ] **Payment service integration tests** (`tests/integration/payment.test.ts`)
|
|
|
|
## Database Schema Verification Needed
|
|
- [ ] **Verify lease table supports required states**
|
|
- Check `state` column accepts `new` and `signed`
|
|
- Verify `tenant_id` column is nullable
|
|
- Confirm all required fields exist
|
|
|
|
## Current Blockers
|
|
- ❌ **TypeScript compilation errors** preventing development
|
|
- ❌ **Missing payment service functions** breaking receipt functionality
|
|
|
|
## Next Steps
|
|
1. Fix immediate TypeScript and payment service issues
|
|
2. Implement lease creation API endpoints
|
|
3. Create frontend components for lease management
|
|
4. Test complete workflow end-to-end
|