Page Introduction

Page contract details

This contract page maps concrete frontend page behavior to API calls, payloads, and response fields.

  • Use the endpoint matrix as implementation checklist.
  • Use page-specific try-it for fast request verification.
  • Keep request/response shape aligned with listed frontend usage fields.

Platform Page Contract

02 - Dashboard

## Page purpose Dashboardet (`/dashboard`) shows KPI-er, bookingtrender, status distribution, latest bookings og global notification status.

10Mapped endpoints
4Frontend files
33Lines
2.1 KBFile size

Source: API-DOC/page-api-mapping/02-kontrollpanel.md

Mapped endpoints for this page

MethodPathScopeUI usageTest
GET/api/ws/v2/dashboardPage-specificKPI + graferTry-It
GET/api/ws/v2/bookingsSharedSiste bestillinger-tabellTry-It
GET/api/ws/bookingsShared fallback (feature-flagged)Legacy fallback ved migreringTry-It
GET/api/ws/v2/notifications/feedGlobalBell count + dropdownTry-It
POST/api/ws/v2/notifications/mark-readGlobalMarker varsler som lestTry-It
DELETE/api/ws/v2/notifications/:idGlobalSlett notifikasjonTry-It
GET/api/ws/profileGlobalSidebar-brukerinfoTry-It
POST/api/ws/auth/logoutGlobalLogg utTry-It
POST/api/ws/auth/sign-outGlobal alias (deprecated)Temporary compatibilityTry-It
GET/api/ws/shopGlobal (guard)Ownership-guard når session mangler verifiedOwnerTry-It
GET/api/ws/v2/dashboard

Scope: Page-specific

UI usage: KPI + grafer

Response fields used: kpis.*, status_breakdown, bookings_series

GET/api/ws/v2/bookings

Scope: Shared

UI usage: Siste bestillinger-tabell

Response fields used: items[] med booking-kjernefelt

GET/api/ws/bookings

Scope: Shared fallback (feature-flagged)

UI usage: Legacy fallback ved migrering

Response fields used: legacy booking list

GET/api/ws/v2/notifications/feed

Scope: Global

UI usage: Bell count + dropdown

Response fields used: items[], unread_count, page_info

POST/api/ws/v2/notifications/mark-read

Scope: Global

UI usage: Marker varsler som lest

Response fields used: updated, is_read, all

DELETE/api/ws/v2/notifications/:id

Scope: Global

UI usage: Slett notifikasjon

Response fields used: message

GET/api/ws/profile

Scope: Global

UI usage: Sidebar-brukerinfo

Response fields used: display_name, email, profile_image

POST/api/ws/auth/logout

Scope: Global

UI usage: Logg ut

Response fields used: logout-status

POST/api/ws/auth/sign-out

Scope: Global alias (deprecated)

UI usage: Temporary compatibility

Response fields used: logout-status

GET/api/ws/shop

Scope: Global (guard)

UI usage: Ownership-guard når session mangler verifiedOwner

Response fields used: workshop-data brukt til tilgangsvurdering

Try this page endpoints

Interactive console below is filtered to endpoints mapped for this page contract.

Source markdown

02 - Dashboard

Page purpose

Dashboardet (/dashboard) shows KPI-er, bookingtrender, status distribution, latest bookings og global notification status.

Frontend methods and components

  • src/app/(private)/dashboard/page.tsx
    • getDashboardData(...)
    • getBookings(..., { limit: 5, sort: '-created_at' })
  • Layout/globalt:
    • src/features/notifications/NotificationBell.tsx
    • src/features/notifications/NotificationDropdown.tsx
    • src/components/layout/Sidebar.tsx

Endpoint matrix

Scope Method Endpoint UI usage Request Response fields used by frontend
Page-specific GET /api/ws/v2/dashboard KPI + grafer tz, ev. from, to kpis.*, status_breakdown, bookings_series
Shared GET /api/ws/v2/bookings Siste bestillinger-tabell limit=5, sort=-created_at items[] med booking-kjernefelt
Shared fallback (feature-flagged) GET /api/ws/bookings Legacy fallback ved migrering legacy query params legacy booking list
Global GET /api/ws/v2/notifications/feed Bell count + dropdown limit=5, filter=all items[], unread_count, page_info
Global POST /api/ws/v2/notifications/mark-read Marker varsler som lest { ids } eller { all: true } updated, is_read, all
Global DELETE /api/ws/v2/notifications/{id} Slett notifikasjon path id message
Global GET /api/ws/profile Sidebar-brukerinfo Bearer-token display_name, email, profile_image
Global POST /api/ws/auth/logout Logg ut tom body logout-status
Global alias (deprecated) POST /api/ws/auth/sign-out Temporary compatibility tom body logout-status
Global (guard) GET /api/ws/shop?full=true Ownership-guard når session mangler verifiedOwner full=true workshop-data brukt til tilgangsvurdering

What frontend expects from backend

  • Dashboard-endepunktet må gi stabile KPI-felter for polling.
  • Notifikasjonsfeed og mutasjoner må holde unread_count konsistent etter handlinger.
  • Logout-kontrakten skal være stabil på /auth/logout.