Design a company expense reimbursement portal

Difficulty: MEDIUMCategory: HLDFrequency: 1Asked On 2022-07-29

Problem Statement

Design a web-based expense reimbursement system that allows employees to submit business-related expenses, upload receipts, and request reimbursements.

Managers should be able to review, approve, or reject requests, and the finance team should be able to track, audit, and process approved reimbursements efficiently.


The system should ensure security, transparency, auditability, and scalability to handle a large number of employees and concurrent submissions.


📋 Functional Requirements


👤 Employee Features


1.Submit Expense Requests
•Create new reimbursement requests by entering expense details (date, category, amount, purpose).
•Upload receipts (PDF, image, etc.).
•Tag expenses to projects, clients, or cost centers.
•View reimbursement status (Pending, Approved, Rejected, Paid).
2.Expense Categories
•Predefined (Travel, Meals, Lodging, Office Supplies) and custom categories.
•Apply company policy rules (e.g., per diem limits, category caps).
3.Notifications
•Receive updates on request status changes or comments.


👩‍💼 Manager Features


1.Approval Workflow
•Review pending reimbursement requests.
•Approve, reject, or request additional information.
•Add comments during approval.
2.Delegation
•Assign approval authority to another manager temporarily.


💰 Finance/Admin Features


1.Expense Auditing
•Verify receipts, enforce policy compliance, and detect anomalies.
•Generate expense reports by department, employee, or category.
2.Payment Processing
•Integrate with internal payment or payroll systems for disbursements.
•Mark requests as reimbursed.
3.Policy Management
•Define and manage expense policies, approval hierarchies, and thresholds.
4.Reporting & Analytics
•Export data (CSV, Excel) for auditing and financial analysis.
•Dashboard showing total reimbursements, pending requests, trends, etc.


⚙️ Non-Functional Requirements


AspectRequirement


Scalability

Should support thousands of employees and parallel submissions.


Security

Encrypt receipts and financial data; use role-based access control.


Auditability

Maintain a full history of approvals, edits, and reimbursements.


Performance

Requests and file uploads should complete under 2 seconds.


Availability

99.9% uptime for business continuity.


Compliance

Support audit trails and retention policies (e.g., 7 years).


Extensibility

Easy integration with ERP, payroll, and accounting tools.


🧩 Key System Components


1.Frontend (Web & Mobile App)
•Employee, Manager, and Finance portals.
•Built using React / Angular / Flutter.
2.API Gateway
•Authentication, routing, and rate limiting.
•REST/GraphQL endpoints for CRUD operations.
3.Expense Service
•Core logic for creating, updating, approving, and rejecting expenses.
4.Workflow Engine
•Manages approval flows based on role hierarchy and company policy.
5.Document Service
•Handles secure receipt storage (S3/Blob Storage) with metadata.
6.Notification Service
•Sends status updates (email, Slack, Teams, or push notifications).
7.Finance & Payment Service
•Integrates with payroll/banking systems for reimbursement.
8.Policy & Audit Service
•Validates requests against company expense policies.
•Tracks compliance and suspicious patterns.
9.Database Layer
•Stores expense details, user data, and workflow logs (PostgreSQL/MySQL).
•Object storage for receipts.
10.Analytics Layer
•Aggregates historical data for dashboards and financial insights.


🏗️ High-Level Architecture Overview

1 2+------------------------------+ 3| Users | 4| (Employees, Managers, Admin)| 5+---------------+--------------+ 6 | 7 ▼ 8 +------------------+ 9 | Web/Mobile UI | 10 +------------------+ 11 | 12 ▼ 13 +------------------+ 14 | API Gateway | 15 +------------------+ 16 | 17 +---------+---------+ 18 | | 19 ▼ ▼ 20+-----------------+ +------------------+ 21| Expense Service | | Workflow Engine | 22+-----------------+ +------------------+ 23 | | 24 ▼ ▼ 25+------------------+ +--------------------+ 26| Document Service | | Notification Service| 27+------------------+ +--------------------+ 28 | 29 ▼ 30+--------------------+ 31| Storage (S3/Blob) | 32+--------------------+ 33 34 ▼ 35+-----------------------+ 36| Finance & Payment Svc | 37+-----------------------+ 38 | 39 ▼ 40+------------------------+ 41| Reporting & Analytics | 42+------------------------+


🔍 Design Discussion Points


•How to ensure secure receipt uploads (virus scanning, encryption)?
•How to handle multi-level approval hierarchies dynamically?
•Should the workflow engine be custom-built or integrated (e.g., Camunda)?
•How to support multi-region deployments for global companies?
•How to implement policy validation rules efficiently at scale?
•How can audit logs be immutable and tamper-proof?


✅ Summary

Design a scalable, secure, and auditable expense reimbursement system where employees can submit expenses, managers can approve or reject them, and finance teams can track, audit, and process payments — ensuring policy compliance, transparency, and operational efficiency.


Solution

Comments