Data Layer medium complexity Shared Component frontend
0
Dependencies
0
Dependents
0
Entities
0
Integrations

Description

Thin localStorage adapter responsible for persisting and retrieving serialised cookie consent records. Encapsulates the storage key, schema version, and JSON serialisation so the rest of the system never touches localStorage directly. Shared across all Sales Website pages.

Feature: Privacy Policy

consent-store

Sources & reasoning

Enumerated in the Sales Website product description at line 224 and explicitly grouped under Fase 1 MVP scope at line 336 ("Privacy policy og vilkår"). Phase mapping: Fase 1 → "MVP". Legal requirement for any public website collecting demo-request data under GDPR.

Responsibilities

  • Read and write consent records under a versioned localStorage key
  • Handle missing or corrupt stored values gracefully by returning null
  • Stamp each record with ISO 8601 timestamp on write
  • Provide a clear() method for consent withdrawal flows

Interfaces

read(): StoredConsent | null
write(consent: StoredConsent): void
clear(): void