Service Layer medium complexity mobilebackend
1
Dependencies
0
Dependents
2
Entities
0
Integrations

Description

Blindeforbundet-specific service managing driver honorarium records and confidentiality declaration lifecycle. Persists honorarium amounts, tracks declaration acknowledgement, and links records to the parent expense and activity.

Feature: Travel & Expense Registration

driver-honorarium-service

Summaries

The Driver Honorarium Service ensures Blindeforbundet meets its legal and organizational obligations when compensating volunteer drivers. By automating honorarium tracking and enforcing confidentiality declaration acknowledgement, the organization reduces compliance risk and administrative overhead associated with manual record-keeping. This directly protects the organization from audit failures and potential regulatory penalties. Accurate honorarium records also improve financial transparency, supporting trust with funders and enabling faster accounting exports at period close.

This is a medium-complexity backend and mobile service with a clear, bounded scope. It depends on the Expense Repository, so sequencing is important — the repository layer must be stable before honorarium logic is built on top of it. Testing should cover eligibility validation rules across all activity types, declaration timestamp accuracy, and period-based reporting queries. A key delivery risk is unclear business rules around eligibility; these must be confirmed with Blindeforbundet stakeholders before implementation to avoid rework in the validation logic.

The Driver Honorarium Service is a domain service running in both mobile and backend execution contexts. It wraps the expense-repository dependency and adds honorarium-specific business logic on top of raw expense persistence. The saveHonorarium interface should atomically persist the amount and declaration acknowledgement with a server-side timestamp to prevent client-side manipulation. getHonorariumsForPeriod will require efficient date-range queries on the underlying expense records — ensure Supabase indexes cover organizationId + timestamp.

validateEligibility should be driven by a configurable activity type allowlist to avoid hardcoded conditionals.

Responsibilities

  • Persist driver honorarium amount linked to expense record
  • Record confidentiality declaration acknowledgement with timestamp
  • Retrieve honorarium records for reporting and accounting export
  • Validate honorarium eligibility based on activity type

Interfaces

saveHonorarium(expenseId, amount, declarationAcknowledged)
getHonorariumByExpense(expenseId)
getHonorariumsForPeriod(organizationId, from, to)
validateEligibility(activityType)

Relationships

Dependencies (1)

Components this component depends on

Related Data Entities (2)

Data entities managed by this component

API Contract

View full contract →
REST /api/v1/honorariums 7 endpoints
GET /api/v1/honorariums List honorariums for a period and organization
GET /api/v1/honorariums/:id Get honorarium by ID
POST /api/v1/honorariums Save a driver honorarium declaration
PUT /api/v1/honorariums/:id Update honorarium amount or re-acknowledge declaration
DELETE /api/v1/honorariums/:id Delete honorarium (draft expense only)
GET /api/v1/honorariums/by-expense/:expenseId Get honorarium linked to a specific expense
+1 more