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

Description

Business-logic layer managing cookie consent lifecycle for the Sales Website. Reads and writes consent state, validates stored consent is not expired, and gates analytics initialisation. Used by both the CookieConsentBanner and the analytics infrastructure layer.

Feature: Privacy Policy

cookie-consent-service

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

  • Parse and validate stored consent from localStorage
  • Expire consent records older than 12 months (GDPR re-consent requirement)
  • Provide typed API for querying per-category consent (analytics, marketing)
  • Notify registered listeners when consent state changes
  • Log consent events with timestamp for audit trail

Interfaces

loadConsent(): ConsentState | null
saveConsent(state: ConsentState): void
isConsentValid(): boolean
hasAnalyticsConsent(): boolean
subscribe(listener: ConsentListener): () => void