# App Blueprint — CoreConsult Time Registration

Purpose: turn approved project context, product rules, and preview work into a build-ready product map.

## Current Readiness

We have enough to start the MVP shell and first workflows:

- Brand direction, logo, fonts, palette, imagery.
- Roles: consultant, owner, admin.
- Core data model direction.
- Reporting periods and utilisation formula.
- Service-line options.
- Mileage rules.
- Hosting/deployment direction.

We still need a few decisions before final logic is locked:

- Fixed-price burn valuation: standard rate card vs project-specific role rate.
- Public holidays: public-only, or also optional/bank/company closure days.
- Auth/test access strategy for the first client review.
- Exact employee/role/rate seed data.

## Roles

Consultant:

- Books own hours and mileage.
- Edits own entries until locked.
- Views own weekly/monthly totals and utilisation.

Project owner:

- Creates and manages assigned projects.
- Assigns people to project roles.
- Reviews project reporting, budget burn, mileage, and utilisation context.
- Cannot edit locked periods unless admin permission is also present.

Admin:

- Manages employees, roles, rates, internal booking codes, public holidays, period locks, and exports.
- Can edit all records, including locked periods.

Roles are functional and can overlap.

## Sitemap

Public/preview:

- `/` — client-facing preview hub for design system, delivery plan, and case-study roadmap.

App:

- `/app` — dashboard / role-aware home.
- `/app/book` — book time and mileage.
- `/app/my-time` — consultant's own entries and totals.
- `/app/projects` — project list.
- `/app/projects/new` — create project.
- `/app/projects/[projectId]` — project dashboard.
- `/app/projects/[projectId]/setup` — roles, rates, assignments, budget, fee/installments.
- `/app/projects/[projectId]/entries` — project time and mileage entries.
- `/app/projects/[projectId]/reports` — project reporting.
- `/app/reports` — owner/admin reporting overview.
- `/app/reports/utilisation` — utilisation reporting.
- `/app/reports/mileage` — mileage exports and payroll/project mileage views.
- `/app/admin` — admin overview.
- `/app/admin/employees` — employee management.
- `/app/admin/rate-card` — standard roles and rates.
- `/app/admin/booking-codes` — internal zero-rate booking codes.
- `/app/admin/holidays` — public holidays and company closure days.
- `/app/admin/period-locking` — locked-through date.
- `/app/admin/exports` — CSV/Excel exports.
- `/login` — Supabase auth, added when auth is switched on.

## Navigation Model

Primary app navigation:

- Dashboard
- Book
- My time
- Projects
- Reports
- Admin

Role-aware visibility:

- Consultants see Dashboard, Book, My time.
- Owners also see Projects and Reports scoped to their projects.
- Admins see everything.

## Screen Inventory

### Dashboard

Audience: all users.

Shows:

- Utilisation YTD.
- Utilisation this month.
- Hours booked this week.
- Missing/low booking prompt if relevant.
- Quick action to book time.
- Owner/admin summary cards where relevant.

### Book Time

Audience: consultants, owners, admins.

Core fields:

- Date.
- Project or booking code.
- Project role/assignment.
- Hours.
- Note.
- Mileage kilometres, optional.

Rules:

- Entries before locked-through date are read-only unless admin.
- Registered holiday is entered as a booking code/internal project-style option.
- Client project hours count towards utilisation numerator.
- Internal booking codes do not count towards utilisation numerator.

### My Time

Audience: consultants.

Views:

- This week.
- This month.
- Custom date range.
- Mileage/payroll period: 20th previous month to 19th current month.

Actions:

- Edit unlocked entries.
- Filter by project/booking code.

### Projects List

Audience: owners/admins.

Shows:

- Project name.
- Client.
- Service line.
- Type: T&M or fixed-price.
- Owner.
- Status.
- Budget consumed.
- Hours and DKK value.

Service lines:

- Strategy.
- Operational Excellence.
- Commercial Excellence.
- M&A.

### Project Setup

Audience: owners/admins.

Fields:

- Client.
- Project name.
- Service line.
- Project type.
- Owner.
- Start/end dates.
- Status.
- Budget DKK.
- Fixed-price fee and installment schedule, if applicable.
- Roles and rates.
- Assignments.

Rate handling:

- Project role captures valuation for entries booked against it.
- Mid-project rate change means create a new project role and reassign from the change date.

### Project Dashboard

Audience: owners/admins.

Shows:

- Hours by person.
- Hours by week/month.
- DKK value.
- Budget consumed/remaining/%.
- Soft over-budget flag.
- Fixed-price fee vs burn.
- Recognised revenue by installment month.
- Mileage by calendar month for project invoicing.

### Reports

Audience: owners/admins.

Report types:

- Project summary.
- Person summary.
- Month summary.
- Utilisation.
- Mileage.
- Export-ready totals.

Date rules:

- Project reporting and invoicing: calendar month.
- Project mileage invoicing: calendar month, per project.
- Payslip mileage: 20th previous month to 19th current month, per employee.
- Performance/utilisation year: 1 July to 30 June.

### Admin Settings

Audience: admins.

Sections:

- Employees.
- Standard role/rate card.
- Internal booking codes.
- Holidays and company closure days.
- Period locking.
- Export settings.

Booking code defaults:

- Registered holiday / vacation.
- Sick.
- Business development.
- Admin.

## User Stories

Consultant:

- As a consultant, I can book hours against an assigned project for a specific date so my work is captured accurately.
- As a consultant, I can add a short note to a time entry so the project owner has context.
- As a consultant, I can book mileage in kilometres so payroll and project reporting can extract it.
- As a consultant, I can book registered holiday using a standard booking code so utilisation is calculated correctly.
- As a consultant, I can edit my own unlocked entries so mistakes can be corrected quickly.
- As a consultant, I can see my weekly/monthly totals so I know whether my time is complete.
- As a consultant, I can see my utilisation so I understand my current KPI position.

Project owner:

- As a project owner, I can create a project with service line, type, duration, budget, and owner so work can be tracked from setup.
- As a project owner, I can assign people to project roles so booked hours value correctly.
- As a project owner, I can override T&M rates where needed so project valuation matches the commercial agreement.
- As a project owner, I can create a new project role for a rate change so historical hours keep their old valuation.
- As a project owner, I can see hours and DKK value by person/week/month so I can manage delivery.
- As a project owner, I can see budget consumed and remaining so I can spot overrun risk early.
- As a project owner, I can view fixed-price fee vs burn and recognised revenue so I can manage project economics.
- As a project owner, I can export project mileage by calendar month so invoicing can use it.

Admin:

- As an admin, I can maintain employee records so access and reporting stay accurate.
- As an admin, I can maintain the standard role/rate card so project setup starts from agreed defaults.
- As an admin, I can maintain internal booking codes so all time is accounted for.
- As an admin, I can maintain holidays and closure days so utilisation denominator is correct.
- As an admin, I can lock periods through a date so historic entries stop changing.
- As an admin, I can edit locked entries when required so exceptions can be handled.
- As an admin, I can export hours, DKK value, and mileage by person/project/period so board and payroll reporting is supported.

## Core Entities

- Employee.
- Standard role.
- Client.
- Project.
- Service line.
- Project role.
- Assignment.
- Time entry.
- Travel/mileage entry.
- Internal booking code.
- Fixed-price installment.
- Budget change log.
- Holiday/calendar day.
- Period lock setting.

## First Build Sequence

1. App shell and shared design components.
2. Mock-data dashboard and navigation.
3. Booking flow with time, mileage, project, booking code, and locked-period states.
4. Project list and project setup flow.
5. Project dashboard/reporting with mock data.
6. Admin settings screens with mock data.
7. Supabase schema/RLS/auth.
8. Replace mock data with real persistence.
9. Exports.
10. Staging/client review.

## First Shareable Product Journeys

For Nicolai/client review after the design preview:

- Consultant books a day of time and mileage.
- Consultant books registered holiday.
- Owner creates a project with service line and roles.
- Owner views project burn and mileage.
- Admin reviews utilisation and export periods.

## Open Questions

- Fixed-price burn valuation source.
- Public holiday rule: public-only or include optional/bank/company closure days.
- Initial rate card values.
- Initial employees and project examples.
- Whether the first clickable build should be open-preview or login-gated.
