Service Layer medium complexity backend
0
Dependencies
0
Dependents
1
Entities
0
Integrations

Description

Backend service that manages the approval workflow for activity records, including fetching pending activities, persisting approval or rejection decisions, and enforcing business rules around Bufdir compliance. It acts as the authoritative layer between the admin UI and the activity data store, ensuring all state transitions are valid and auditable.

Feature: Activity Review & Approval

activity-approval-service

Sources & reasoning

Lines 327-330 list Aktivitetsoversikt og grunnleggende statistikk as Admin Web Portal MVP scope (Phase 1 maps to MVP). Line 46 confirms the admin portal is the sole surface for Bufdir oversight, directly motivating a structured review and approval workflow as an MVP-critical feature.

  • **Admin Web Portal (MVP scope):** - Brukeradministrasjon (invitere, deaktivere, rolletildeling) - Organisasjonsinnstillinger og terminologikonfigurasjon - Aktivitetsoversikt og grunnleggende statistikk
  • Rapporteringsdata samles inn gjennom aktivitetsregistrering i mobilappen, men selve Bufdir-eksporten er en admin-funksjon: organisasjonsadministrator kjører eksporten fra Admin Web Portal.

Responsibilities

  • Retrieve activity records filtered by status, mentor, or date range
  • Apply approval or rejection decisions with audit timestamps and reviewer identity
  • Validate that required fields are present before allowing approval
  • Enforce role-based access so only authorized coordinators and admins can approve
  • Emit status-change events consumed by reporting and notification subsystems

Interfaces

getActivities(filters: ActivityFilter): Promise<ActivityRecord[]>
approveActivity(activityId: string, reviewerId: string): Promise<void>
rejectActivity(activityId: string, reviewerId: string, reason: string): Promise<void>
getActivityById(activityId: string): Promise<ActivityRecord>

Related Data Entities (1)

Data entities managed by this component