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

Description

Backend service managing the lifecycle of confidentiality declarations including version control of declaration texts, validation of whether a user has a current valid declaration, and storage of timestamped acknowledgement records. Exposes endpoints consumed by both the mobile app (peer mentor acceptance flow) and the admin portal (coordinator status view).

Feature: Confidentiality Declarations

declaration-service

Responsibilities

  • Serve the current declaration text version for a given expense type
  • Validate whether a user has a valid declaration before allowing expense submission
  • Store timestamped acknowledgement records linked to user, expense, and declaration version
  • Provide declaration status queries for admin portal coordinator views
  • Track declaration text version hashes for audit compliance

Interfaces

getCurrentDeclaration(expenseTypeId: string): DeclarationVersion
submitAcknowledgement(userId: string, declarationVersionId: string, expenseId?: string, assignmentId?: string): AcknowledgementRecord
hasValidDeclaration(userId: string, expenseTypeId: string): boolean
getDeclarationHistory(userId: string): AcknowledgementRecord[]
getDeclarationStatusForOrg(organizationId: string): UserDeclarationStatus[]
updateDeclarationText(expenseTypeId: string, content: string): DeclarationVersion
getDeclarationVersionByHash(hash: string): DeclarationVersion

Relationships

Dependencies (1)

Components this component depends on

Dependents (1)

Components that depend on this component