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

Description

Evaluates whether a receipt is mandatory for a given expense based on organisation-configured threshold rules — for example, HLF requires a receipt for all expenses exceeding 100 NOK. Queries the backend for current rules, caches them locally for offline use, and provides real-time validation feedback to the expense form so peer mentors are informed before attempting submission.

Feature: Receipt Photo Upload

receipt-requirement-service

Responsibilities

  • Fetch and cache organisation-specific receipt requirement rules
  • Evaluate requirement status given expense type, amount, and organisation
  • Return a human-readable requirement message for display in the UI
  • Block expense submission when a mandatory receipt is absent
  • Refresh cached rules when connectivity is restored

Interfaces

isReceiptRequired(expenseType, amount, organizationId)
getRequirementRules(organizationId)
getRequirementMessage(expenseType, amount, organizationId)
validateReceiptAttachment(expenseId)
refreshRules(organizationId)
clearCache()

Relationships

Dependents (1)

Components that depend on this component

Related Data Entities (3)

Data entities managed by this component