# Real Estate Management Checklist

## Feature Completion

### Core Product Scope
- [x] Property monitoring dashboard with KPIs and charts
- [x] Property CRUD with map pin (lat/lng) support
- [x] Unit CRUD and occupancy tracking
- [x] Tenant CRUD and profile details
- [x] Lease CRUD with payment schedule generation
- [x] Payment tracking (unpaid/partial/paid/overdue)
- [x] Upcoming due list and overdue list views
- [x] Record payment and generate receipt/PDF
- [x] Income module
- [x] Expenses module
- [x] Reports: income, expenses, collection, occupancy, tenant ledger
- [x] In-app notifications
- [x] Document upload/download management
- [x] Email template CRUD with preview

### Email and Collections Enhancements
- [x] Automatic due-date reminder email flow
- [x] Automatic overdue notice email flow
- [x] Non-payment demand email flow (single send)
- [x] Non-payment demand email flow (bulk send)
- [x] Overdue notice bulk sending
- [x] Lease expiry reminder cron script
- [x] Email activity logging (sent/failed)
- [x] Email activity page with filters, retry, CSV export
- [x] Email activity pagination
- [x] Email activity page-size selector and quick filter UX

## Runtime and Deployment Checklist

### Required Before Production
- [x] Configure SMTP loading in config/mail.php via environment variables
- [ ] Set real SMTP secret values on server environment
- [x] Configure production-safe app settings in config/app.php (APP_DEBUG via env, default false)
- [x] Ensure database path/credentials are configurable for target environment (env-driven config/database.php)
- [x] Create and verify cron schedules on server
  - [x] cron/send_reminders.php
  - [x] cron/check_overdue.php
  - [x] cron/send_lease_expiry.php
- [x] Add and validate cron preflight mode (`--dry-run`) for reminder/overdue/lease-expiry jobs
- [x] Fix fresh database initialization migration parsing in app/Core/Database.php

### Validation and QA
- [ ] End-to-end browser smoke test with realistic data
  - [ ] Lease creation creates unpaid schedule correctly
  - [ ] Upcoming and overdue lists update correctly over dates/status changes
  - [ ] Single and bulk email sends succeed and log correctly
  - [ ] Retry failed email from Email Activity works
  - [ ] CSV export matches filters/date range
- [x] Security and reliability pass
  - [x] Confirm authorization boundaries for all sensitive actions
  - [x] Confirm upload restrictions and storage permissions
  - [x] Confirm backup/restore strategy for DB and uploads

Validation evidence (latest run):
- `php tools/validate_qa.php`
- `php tools/backup.php`
- `php tools/restore.php --from=storage/backups/<latest_backup_dir>`

# Start the app locally
php -S localhost:8000 -t public

### Seed Settings (Demo Data)
- View available seed options and current settings
  - `php tools/seed_demo.php --help`
- Clear and reseed demo data (recommended for QA reset)
  - `php tools/seed_demo.php --fresh`
- Add demo data without clearing existing records
  - `php tools/seed_demo.php --append`
- Clear seeded tables only (no reseed)
  - `php tools/seed_demo.php --clear`

Notes:
- Seeder settings are defined in `tools/seed_demo.php` (`$settings` block).
- Current seeded scope includes properties, units, tenants, leases, payments, expenses, income, maintenance requests, and documents.

## Remaining Feature Gaps (Classic PHP)

- [x] Report PDF export for income/expenses/collection/occupancy/tenant-ledger
- [x] Global search across properties, units, tenants, leases, and payments
- [x] Full realistic demo dataset seeder (properties, units, tenants, leases, payments, expenses, income, maintenance, documents)
- [ ] End-to-end smoke test evidence with seeded realistic data

## Optional Hardening (Nice to Have)
- [ ] Add rate limiting for bulk/retry email actions
- [ ] Add idempotency guard for repeated cron runs
- [ ] Add automated tests for critical controllers and cron workflows
- [ ] Add structured audit trail for admin actions
