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

07 - Document archive

## Page purpose Document archiveet (`/booking/archive`) shows én samlet feed med: - service records - dokumenter/vedlegg - sertifikater/media - kjøretøyhistorikk fra core API - eksport (CSV/XLSX)

4Mapped endpoints
1Frontend files
35Lines
1.9 KBFile size

Source: API-DOC/page-api-mapping/07-dokumentarkiv.md

Mapped endpoints for this page

MethodPathScopeUI usageTest
GET/api/ws/v2/archive/feedPage-specific (kanonisk)Samlet arkivtabell (service records + dokumenter)Try-It
GET/api/ws/v2/documents/archivePage-specific aliasDokumentfeed kompatibilitetTry-It
GET/api/core/vehicle-service-history/:registration_numberPage-specific (core)Sidepanel med servicehistorikk + NPRA-dataTry-It
GET/api/ws/service-records/exportPage-specificEksportknapp (CSV/XLSX)Try-It
GET/api/ws/v2/archive/feed

Scope: Page-specific (kanonisk)

UI usage: Samlet arkivtabell (service records + dokumenter)

Response fields used: items[] med id, source, booking_id, registration_number, service_title, service_date, booking_status, service_price, document_url, document_title

GET/api/ws/v2/documents/archive

Scope: Page-specific alias

UI usage: Dokumentfeed kompatibilitet

Response fields used: tilsvarende dokumentfelt

GET/api/core/vehicle-service-history/:registration_number

Scope: Page-specific (core)

UI usage: Sidepanel med servicehistorikk + NPRA-data

Response fields used: registration_number, services[], npra, meta

GET/api/ws/service-records/export

Scope: Page-specific

UI usage: Eksportknapp (CSV/XLSX)

Response fields used: binær fil + content-disposition

Try this page endpoints

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

Source markdown

07 - Document archive

Page purpose

Document archiveet (/booking/archive) shows én samlet feed med:

  • service records
  • dokumenter/vedlegg
  • sertifikater/media
  • kjøretøyhistorikk fra core API
  • eksport (CSV/XLSX)

Frontend methods and components

  • src/app/(private)/booking/archive/page.tsx
    • getDocumentsArchive(...)
    • getVehicleServiceHistory(...)
    • exportWorkshopServiceRecords(...)

Endpoint matrix

Scope Method Endpoint UI usage Request Response fields used by frontend
Page-specific (kanonisk) GET /api/ws/v2/archive/feed Samlet arkivtabell (service records + dokumenter) days, limit, registration_number, ev. booking_id/from/to items[] med id, source, booking_id, registration_number, service_title, service_date, booking_status, service_price, document_url, document_title
Page-specific alias GET /api/ws/v2/documents/archive Dokumentfeed kompatibilitet samme filtre tilsvarende dokumentfelt
Page-specific (core) GET /api/core/vehicle-service-history/{registration_number} Sidepanel med servicehistorikk + NPRA-data path registration_number registration_number, services[], npra, meta
Page-specific GET /api/ws/service-records/export Eksportknapp (CSV/XLSX) format, days, registration_number binær fil + content-disposition

Contract and field usage

UI bruker én radmodell (ArchiveRow) med feltene:

  • identifikatorer: source, group_id, booking_id
  • visning: service_date, service_title, customer_name, booking_status, service_price
  • dokument: document_url, document_title, document_type
  • kjøretøy: registration_number

Robusthet

  • Arkivlesing er konsolidert til én v2 read-model (/v2/archive/feed).
  • Alias-rute (/v2/documents/archive) beholdes for kompatibilitet.