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

11 - Workshop

## Page purpose Workshopsområdet (`/workshop`) dekker: - visning av verkstedprofil - redigering av basisinfo, adresse, kontakt, åpningstider og galleri - growth-seksjon (media, sertifikater, sosial, presence, support) - workshop ownership onboarding when ownership is missing

31Mapped endpoints
2Frontend files
69Lines
5.6 KBFile size

Source: API-DOC/page-api-mapping/11-verksted.md

Mapped endpoints for this page

MethodPathScopeUI usageTest
GET/api/ws/shopPage-specificLoad full verkstedprofilTry-It
GET/api/ws/categoriesSharedWorkshop-kategorier for visning/redigeringTry-It
PUT/api/ws/shopPage-specificUpdate verkstedinfo/logo/kategorierTry-It
POST/api/ws/addressPage-specificCreate adresseTry-It
PUT/api/ws/addressPage-specificUpdate adresseTry-It
GET/api/ws/contactPage-specificFetch kontakterTry-It
POST/api/ws/contactPage-specificCreate kontaktTry-It
PUT/api/ws/contactPage-specificUpdate kontaktTry-It
GET/api/ws/socialSharedFetch sosial/nettsideTry-It
POST/api/ws/socialSharedCreate sosialprofilTry-It
PUT/api/ws/socialSharedUpdate sosialprofilTry-It
POST/api/ws/opening-hours/validatePage-specificValidering før lagring av åpningstiderTry-It
PUT/api/ws/opening-hoursPage-specificSave åpningstiderTry-It
POST/api/ws/opening-hoursPage-specific fallbackFallback hvis PUT ikke finnesTry-It
POST/api/ws/mediaPage-specificLoad opp galleribildeTry-It
GET/api/ws/mediaPage-specificList mediaTry-It
PUT/api/ws/media/:idPage-specificEndre mediatittelTry-It
DELETE/api/ws/media/:idPage-specificDelete mediaTry-It
GET/api/ws/certificatesPage-specificList sertifikaterTry-It
POST/api/ws/certificatesPage-specificCreate sertifikatTry-It
PUT/api/ws/certificatesPage-specificUpdate sertifikatstatusTry-It
DELETE/api/ws/certificatesPage-specificDelete sertifikatTry-It
DELETE/api/ws/certificates/:idPage-specific fallbackFallback delete-ruteTry-It
PUT/api/ws/presencePage-specificUpdate presence-statusTry-It
GET/api/ws/support/contactPage-specificFetch supportkontaktTry-It
POST/api/ws/support/ownership-disputePage-specificSende supportsak om eierskapTry-It
GET/api/ws/realtime/configPage-specificFetch realtime-konfigTry-It
POST/api/ws/shop/addPage-relatedSteg 1: preview Brreg-dataTry-It
POST/api/ws/shop/add/confirmPage-relatedSteg 2: send verifikasjonskodeTry-It
POST/api/ws/shop/add/confirm-ownershipPage-relatedSteg 3: bekreft eierskapTry-It
POST/api/ws/shop/confirm-ownershipPage-related fallbackLegacy fallback i frontendTry-It
GET/api/ws/shop

Scope: Page-specific

UI usage: Load full verkstedprofil

Response fields used: workshop (navn, orgnr, adresse, kontakter, social, media, services, ratings, opening_hours)

GET/api/ws/categories

Scope: Shared

UI usage: Workshop-kategorier for visning/redigering

Response fields used: workshop_category_id, workshop_category_name

PUT/api/ws/shop

Scope: Page-specific

UI usage: Update verkstedinfo/logo/kategorier

Response fields used: message/oppdatert workshop

POST/api/ws/address

Scope: Page-specific

UI usage: Create adresse

Response fields used: opprettet adresse

PUT/api/ws/address

Scope: Page-specific

UI usage: Update adresse

Response fields used: oppdatert adresse

GET/api/ws/contact

Scope: Page-specific

UI usage: Fetch kontakter

Response fields used: kontaktliste

POST/api/ws/contact

Scope: Page-specific

UI usage: Create kontakt

Response fields used: opprettet kontakt

PUT/api/ws/contact

Scope: Page-specific

UI usage: Update kontakt

Response fields used: oppdatert kontakt

GET/api/ws/social

Scope: Shared

UI usage: Fetch sosial/nettside

Response fields used: website, facebook, instagram, etc.

POST/api/ws/social

Scope: Shared

UI usage: Create sosialprofil

Response fields used: opprettet sosialprofil

PUT/api/ws/social

Scope: Shared

UI usage: Update sosialprofil

Response fields used: oppdatert sosialprofil

POST/api/ws/opening-hours/validate

Scope: Page-specific

UI usage: Validering før lagring av åpningstider

Response fields used: validering OK/feil

PUT/api/ws/opening-hours

Scope: Page-specific

UI usage: Save åpningstider

Response fields used: oppdatert åpningstidsett

POST/api/ws/opening-hours

Scope: Page-specific fallback

UI usage: Fallback hvis PUT ikke finnes

Response fields used: opprettet/oppdatert åpningstidsett

POST/api/ws/media

Scope: Page-specific

UI usage: Load opp galleribilde

Response fields used: mediaobjekt med url

GET/api/ws/media

Scope: Page-specific

UI usage: List media

Response fields used: items[] (id, title, media_url, media_type)

PUT/api/ws/media/:id

Scope: Page-specific

UI usage: Endre mediatittel

Response fields used: oppdatert media

DELETE/api/ws/media/:id

Scope: Page-specific

UI usage: Delete media

Response fields used: message

GET/api/ws/certificates

Scope: Page-specific

UI usage: List sertifikater

Response fields used: items[] (id, certificate_name, issued_date, expiry_date, is_active)

POST/api/ws/certificates

Scope: Page-specific

UI usage: Create sertifikat

Response fields used: opprettet sertifikat

PUT/api/ws/certificates

Scope: Page-specific

UI usage: Update sertifikatstatus

Response fields used: oppdatert sertifikat

DELETE/api/ws/certificates

Scope: Page-specific

UI usage: Delete sertifikat

Response fields used: message

DELETE/api/ws/certificates/:id

Scope: Page-specific fallback

UI usage: Fallback delete-rute

Response fields used: message

PUT/api/ws/presence

Scope: Page-specific

UI usage: Update presence-status

Response fields used: away

GET/api/ws/support/contact

Scope: Page-specific

UI usage: Fetch supportkontakt

Response fields used: support-kontaktdata

POST/api/ws/support/ownership-dispute

Scope: Page-specific

UI usage: Sende supportsak om eierskap

Response fields used: confirmation/ID

GET/api/ws/realtime/config

Scope: Page-specific

UI usage: Fetch realtime-konfig

Response fields used: realtime config

POST/api/ws/shop/add

Scope: Page-related

UI usage: Steg 1: preview Brreg-data

Response fields used: enhet/company, next_action

POST/api/ws/shop/add/confirm

Scope: Page-related

UI usage: Steg 2: send verifikasjonskode

Response fields used: verification_code_sent, expires_at

POST/api/ws/shop/add/confirm-ownership

Scope: Page-related

UI usage: Steg 3: bekreft eierskap

Response fields used: verified=true, org_nr

POST/api/ws/shop/confirm-ownership

Scope: Page-related fallback

UI usage: Legacy fallback i frontend

Response fields used: confirmationsrespons

Try this page endpoints

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

Source markdown

11 - Workshop

Page purpose

Workshopsområdet (/workshop) dekker:

  • visning av verkstedprofil
  • redigering av basisinfo, adresse, kontakt, åpningstider og galleri
  • growth-seksjon (media, sertifikater, sosial, presence, support)
  • workshop ownership onboarding when ownership is missing

Frontend methods and components

  • Main page: src/app/(private)/workshop/page.tsx
    • fetchWorkshopData, getWorkshopCategories
  • Edit modal tabs:
    • EditWorkshopTab, EditAddressTab, EditContactTab, EditOpeningHoursTab, EditImageGalleryTab
  • Growth section:
    • src/features/workshops/WorkshopGrowthSection.tsx
  • Onboarding/ownership:
    • WorkshopOnboardingModal, ShopVerificationModal

Endpoint matrix

A) Hovedprofil og redigering

Scope Method Endpoint UI usage Request Response fields used by frontend
Page-specific GET /api/ws/shop?full=true Load full verkstedprofil query full=true workshop (navn, orgnr, adresse, kontakter, social, media, services, ratings, opening_hours)
Shared GET /api/ws/categories Workshop-kategorier for visning/redigering ingen workshop_category_id, workshop_category_name
Page-specific PUT /api/ws/shop Update verkstedinfo/logo/kategorier multipart/json med org_nr, name, description, employees, category_ids, file/logo message/oppdatert workshop
Page-specific POST /api/ws/address Create adresse street_name, street_number, postal_code, city, county, country opprettet adresse
Page-specific PUT /api/ws/address Update adresse samme felter oppdatert adresse
Page-specific GET /api/ws/contact Fetch kontakter ingen kontaktliste
Page-specific POST /api/ws/contact Create kontakt first_name, last_name, email, phone_number, mobile_number opprettet kontakt
Page-specific PUT /api/ws/contact?id={id} Update kontakt kontaktfelt + query id oppdatert kontakt
Shared GET /api/ws/social Fetch sosial/nettside ingen website, facebook, instagram, etc.
Shared POST /api/ws/social Create sosialprofil sosialfelt opprettet sosialprofil
Shared PUT /api/ws/social Update sosialprofil sosialfelt oppdatert sosialprofil
Page-specific POST /api/ws/opening-hours/validate Validering før lagring av åpningstider regular_hours, special_hours validering OK/feil
Page-specific PUT /api/ws/opening-hours Save åpningstider regular_hours, special_hours oppdatert åpningstidsett
Page-specific fallback POST /api/ws/opening-hours Fallback hvis PUT ikke finnes samme payload opprettet/oppdatert åpningstidsett
Page-specific POST /api/ws/media Load opp galleribilde multipart file, title, media_type mediaobjekt med url

B) Growth section (media/sertifikat/support)

Scope Method Endpoint UI usage Request Response fields used by frontend
Page-specific GET /api/ws/media List media page_size, order, sort items[] (id, title, media_url, media_type)
Page-specific PUT /api/ws/media/{id} Endre mediatittel { title } oppdatert media
Page-specific DELETE /api/ws/media/{id} Delete media path id message
Page-specific GET /api/ws/certificates List sertifikater ingen items[] (id, certificate_name, issued_date, expiry_date, is_active)
Page-specific POST /api/ws/certificates Create sertifikat multipart med certificate_name, file, valgfri dato/beskrivelse opprettet sertifikat
Page-specific PUT /api/ws/certificates Update sertifikatstatus { certificate_id, is_active } oppdatert sertifikat
Page-specific DELETE /api/ws/certificates Delete sertifikat certificate_id, valgfri delete_file message
Page-specific fallback DELETE /api/ws/certificates/{id} Fallback delete-rute path id message
Page-specific PUT /api/ws/presence Update presence-status `{ status: online away
Page-specific GET /api/ws/support/contact Fetch supportkontakt ingen support-kontaktdata
Page-specific POST /api/ws/support/ownership-dispute Sende supportsak om eierskap name, email, phone, org_nr, description confirmation/ID
Page-specific GET /api/ws/realtime/config Fetch realtime-konfig ingen realtime config

C) Ownership/onboarding (når bruker ikke er verifisert eier)

Scope Method Endpoint UI usage Request Response fields used by frontend
Page-related POST /api/ws/shop/add Steg 1: preview Brreg-data org_nr (multipart/json) enhet/company, next_action
Page-related POST /api/ws/shop/add/confirm Steg 2: send verifikasjonskode { org_nr } verification_code_sent, expires_at
Page-related POST /api/ws/shop/add/confirm-ownership Steg 3: bekreft eierskap { org_nr, verification_code } verified=true, org_nr
Page-related fallback POST /api/ws/shop/confirm-ownership Legacy fallback i frontend { org_nr, verification_code } confirmationsrespons

What frontend expects from backend

  • /shop?full=true må være stabil som hoved-readmodel for verkstedprofil.
  • Oppdateringsruter må akseptere både JSON og multipart der UI tillater fil.
  • Ownership-flyt må være deterministisk (preview -> confirm -> confirm-ownership), ellers låses bruker ute av private sider.