# Alya Paros Implementation Plan

This plan is intentionally phased. Each phase must leave the app runnable and each assumption must be documented instead of silently turning into product behavior.

## Phase 0 - Foundation

- [x] Inspect workspace and tooling.
- [x] Scaffold current stable Next.js App Router project.
- [x] Record initial architecture and booking/security decisions.
- [x] Add `.env.example` with placeholders only.
- [x] Add Docker Compose plan for PostgreSQL and Mailpit.
- [ ] Install application dependencies.
- [ ] Initialize shadcn/ui and add core components.
- [ ] Establish formatting, lint, typecheck, test, and build scripts.

## Phase 1 - Data And Domain Core

- [ ] Add Drizzle configuration and migration layout.
- [ ] Model properties, accommodation types, units, amenities, media, localized content, users, roles, sessions, bookings, holds, blocks, prices, payments, emails, iCal, settings, and audit events.
- [ ] Implement PostgreSQL date-range overlap protection for bookings, holds, and blocks.
- [ ] Implement pricing engine using integer minor units.
- [ ] Add seed data for Alya Paros from the verified public listing facts.
- [ ] Add domain tests for price calculations and booking overlap rules.

## Phase 2 - Public Bilingual Website

- [ ] Configure next-intl with `/en` and `/el` routes and English root redirect/default.
- [ ] Build public navigation, footer, locale switcher, and metadata.
- [ ] Build Home, Accommodation, Gallery, Amenities, Location, Discover Paros, Availability, FAQ, Contact, House Rules, Cancellation Policy, Privacy Policy, Cookie Policy, Terms, confirmation, guest booking management, 404, and error pages.
- [ ] Add structured data only where facts are known.
- [ ] Add authentic media workflow and temporary placeholders that clearly indicate missing owner media.

## Phase 3 - Booking Flow

- [ ] Build availability search with half-open stay ranges `[check_in, check_out)`.
- [ ] Build guest selection and occupancy validation.
- [ ] Build transparent quote and immutable pricing snapshot.
- [ ] Build temporary holds with expiration.
- [ ] Build booking request, confirmation emails, and secure guest-management link.
- [ ] Add fake local payment adapter and provider abstraction.
- [ ] Add tests for adjacent bookings, overlaps, holds, cancellations, timezone boundaries, and concurrency.

## Phase 4 - Administration

- [ ] Add secure administrator authentication with Argon2id password hashing.
- [ ] Add role-based authorization and audit logging.
- [ ] Build dashboard, booking calendar, booking detail/actions, rate management, blocks, content, FAQ, policies, media, contact inbox, email templates, settings, iCal, users, health, CSV export, and backup info.
- [ ] Add admin tests and Playwright flows.

## Phase 5 - Integrations

- [ ] Implement localized transactional email provider using Mailpit locally.
- [ ] Implement iCal export, import, manual sync, duplicate detection, and conflict reporting.
- [ ] Implement administrator-only OpenAI image-generation utility for non-factual assets.
- [ ] Add rate limiting and audit events for all sensitive endpoints.

## Phase 6 - Quality Gates

- [ ] Run formatting.
- [ ] Run lint.
- [ ] Run TypeScript typecheck.
- [ ] Run unit and integration tests.
- [ ] Run Playwright tests at 360, 768, 1024, and 1440 px.
- [ ] Run production build.
- [ ] Verify clean database migration and seed.
- [ ] Review browser console errors.
- [ ] Review accessibility and reduced-motion behavior.
- [ ] Review broken links and localized content.
- [ ] Review security checklist.

## Current Assumptions

- The property currently has one accommodation unit, but the schema must support more.
- Operations use the `Europe/Athens` timezone.
- Currency is EUR unless the owner later configures otherwise.
- Direct bookings begin as booking requests requiring administrator approval unless the owner enables instant booking.
- No real payment provider is active in local development.
- OpenAI image generation is optional and administrator-only.
- Authentic property photography is required before production launch.
