# Venue Events Manager — Implementation Tasks

Track progress across all phases. Mark items `[x]` when complete and verified.

## Phase 0 — Documentation & Bootstrap

- [x] Inspect repository
- [x] Create PROJECT_PLAN.md
- [x] Create TASKS.md (this file — keep updated)
- [x] Create docs/ARCHITECTURE.md
- [x] Create docs/BUSINESS_RULES.md
- [x] Create docs/DATABASE_SCHEMA.md
- [x] Create docs/CPANEL_DEPLOYMENT.md
- [x] Create docs/ROLES_AND_PERMISSIONS.md
- [x] Create docs/USER_GUIDE.md
- [x] Create README.md, INSTALLATION.md, CPANEL_INSTALLATION.md
- [x] Create DEVELOPMENT.md, TESTING.md, CHANGELOG.md, SECURITY.md
- [x] Initialize Laravel 12 application (PHP 8.2)

## Phase 1 — Foundation

- [x] Base configuration (session/cache/queue/timezone)
- [x] Admin layout (sidebar, topnav, mobile) — Bootstrap 5 + radminly-inspired structure
- [x] Authentication (login, logout, change password, throttling)
- [x] User active/inactive + last login
- [x] Roles & permissions tables and models
- [x] Default roles and granular permissions seeder
- [x] Permission middleware and policies foundation
- [x] Settings module
- [x] AuditService + activity_logs
- [x] Admin password reset by administrator
- [x] Phase 1 tests (AuthenticationTest)

## Phase 2 — Customers & Spaces

- [x] Customers CRUD + archive
- [x] Customer history endpoints
- [x] Space types
- [x] Spaces CRUD + operational statuses
- [x] Space images
- [x] Space layouts / capacities
- [x] Space blocks (maintenance / internal)
- [x] Space list availability indicators
- [x] Phase 2 migrations / seeders / policies

## Phase 3 — Products, Packages, Pricing

- [x] Product categories
- [x] Products CRUD + archive
- [x] ChargeBasis enum
- [x] Packages + package items
- [x] Package duplicate / estimate
- [x] PricingService (all charge bases, discounts, tax, service charge)
- [x] Pricing unit tests (19 tests)
- [x] Phase 3 complete

## Phase 4 — Bookings & Availability

- [x] Event types
- [x] Bookings + booking_spaces + booking_items
- [x] DocumentNumberService for bookings
- [x] Provisional holds + lazy expiry
- [x] AvailabilityService (overlap rule, hours, blocks)
- [x] Availability calendar (FullCalendar)
- [x] Booking status transitions (BookingStatusService)
- [x] Confirm / postpone / cancel / complete / no-show
- [x] Reschedule with transaction + locking
- [x] Multi-space reservations
- [x] Reservation filtered views (all/upcoming/today/past/…)
- [x] Availability conflict tests (8)
- [x] Phase 4 tests

## Phase 5 — Quotations

- [x] Quotations + quotation_items + snapshots
- [x] Create from booking
- [x] Issue / revise / accept / reject / expire / cancel
- [x] Quotation PDF + printable HTML
- [x] QuotationConversionService
- [x] Conversion does not duplicate booking
- [x] Quote does not reserve space
- [x] Phase 5 tests

## Phase 6 — Invoices & Payments

- [x] Invoices + invoice_items + snapshots
- [x] Create from booking / quotation / direct
- [x] Issue / void (reason required)
- [x] Overdue calculation on read
- [x] Payments + receipt numbers
- [x] PaymentStatusService
- [x] Deposit / partial / full / reverse / refund
- [x] Invoice + receipt PDFs
- [x] Financial tests
- [x] Phase 6 tests

## Phase 7 — Dashboard, Reports, Notifications

- [x] DashboardService + dashboard UI
- [x] Compact availability calendar on dashboard
- [x] ReportService + reservation/space/quote/financial reports
- [x] CSV / PDF / print exports
- [x] In-system notifications
- [x] Phase 7 tests

## Phase 8 — Attachments, Security, Installer, Release

- [x] AttachmentService + polymorphic attachments
- [x] Security hardening (.htaccess)
- [x] Web installation wizard (public/install)
- [x] database/install.sql synchronized with migrations
- [x] scripts/build_cpanel_release.php
- [x] CPANEL_INSTALLATION.md finalized
- [x] Phase 8 tests (installer + attachments)

## Phase 9 — Acceptance

- [x] Full PHPUnit suite green (59 tests, 165 assertions)
- [x] Migrations from empty database (`migrate:fresh --seed`)
- [x] Quote→invoice conversion verified (tests)
- [x] Overlap prevention verified (tests)
- [x] Payment totals verified (tests)
- [x] Default roles seeded
- [x] Installer lock verified (tests)
- [x] Final cPanel ZIP built
- [x] Docs complete; TASKS.md accurate
- [x] Path to release ZIP documented

## Acceptance Criteria Checklist

- [x] 1. cPanel install without SSH
- [x] 2. Installer creates DB + admin
- [x] 3. Manage event spaces
- [x] 4. Space pages show upcoming reservations
- [x] 5. Calendar shows availability
- [x] 6. Setup/breakdown in conflict detection
- [x] 7. Confirmed double-booking prevented
- [x] 8. All charge bases supported
- [x] 9. Packages with multiple products
- [x] 10. Package totals correct
- [x] 11. Customers linked to bookings
- [x] 12. Multi-space bookings
- [x] 13. Quotations from bookings
- [x] 14. Quotes do not reserve without hold
- [x] 15. Accepted quote → invoice
- [x] 16. Conversion does not duplicate booking
- [x] 17. Direct invoices
- [x] 18. Deposit/partial/full payments
- [x] 19. Invoice balances automatic
- [x] 20. Upcoming/today/past views correct
- [x] 21. Dashboard matches records
- [x] 22. Quote/invoice/receipt PDFs
- [x] 23. Reports CSV + PDF
- [x] 24. Issued invoices not deletable
- [x] 25. Master records archived not deleted
- [x] 26. Role permissions enforced
- [x] 27. Overrides audited
- [x] 28. Responsive UI
- [x] 29. No Node/Redis/queue worker in production
- [x] 30. Release ZIP includes runtime deps

## Delivery Artifacts

| Artifact | Path |
|----------|------|
| cPanel release ZIP | `dist/venue-events-manager-cpanel.zip` |
| Install SQL | `database/install.sql` |
| Web installer | `public/install/index.php` |
| Release builder | `scripts/build_cpanel_release.php` |

## Known residual / optional items

- Dedicated multi-process concurrent double-confirm stress test not simulated beyond transactional locking (AvailabilityService + BookingService use row locks; SQLite tests cover sequential conflict paths).
- Optional demo data: `php artisan db:seed --class=DemoSeeder` (also available via installer checkbox).
- Local `radminly/` folder is a UI reference only and is excluded from the release ZIP.
- On Windows, release builder may warn when cleaning temp build dirs (ZIP still created successfully).

## Notes

- UI: Bootstrap 5 local assets with radminly-inspired sidebar/topbar patterns
- Default local admin after seed: `admin@venue.local` / `password` (change immediately)
- Production: `APP_DEBUG=false`, `QUEUE_CONNECTION=sync`, `CACHE_STORE=file`, `SESSION_DRIVER=file|database`
