Expense Calculator
Overview
The Expense Calculator Service is a core component of DIGIT HCM that applies business logic to calculate campaign expenses. It works closely with the Expense Service: after performing calculations, it prepares the payload for bill creation and generates Excel and PDF formats of the resulting bills.
The service supports different types of bills (e.g., wage bills based on approved muster rolls, paid to workers after work completion).
Pre-requisites
Before deploying the Expense Calculator, ensure the following are available:
DIGIT Core Services (Idgen, Workflow, User, etc.) are configured and accessible.
Supporting Services such as:
Persister
MDMS (Master Data Management System)
Attendance Service
Muster Roll Service
Project Service
Individual Service / Registry
Expense Service
Localization
PdfService (for generating documents)
Filestore (for storing and retrieving files)
Functionalities
Calculation API: Retrieves attendance and computes payable amounts using MDMS-defined rates, roles, and worker skills.
Bill Generation: Prepares and submits payloads to the Expense Service to create bills.
Document Creation: Produces Excel and PDF versions of bills for record-keeping and distribution.
Setup
Helm Environment Configuration
Locate the environment file:
https://github.com/{{ORG}}/DIGIT-DevOps/deploy-as-code/helm/environments/{{EnvironmentFile}}.yaml
Refer to the sample here.
Add:
db-host
,db-name
,db-url
,domain
DIGIT core services configurations (Idgen, workflow, user, etc.)
Expense Calculator environment variables (reference
dev
environment for examples)service-host-config-map - Update the
egov-service-host
config map.health-expense calculator service helm chart - Reference the health-expense-calculator helm chart
Configuration
Actions
Add Expense Calculator APIs (e.g.,
/health-expense-calculator/v1/_calculator
) toactions.json
in MDMS.Module Name:
ACCESSCONTROL-ACTIONS-TEST
Master Name:
actions-test
Roles
Define the necessary roles in
roles.json
.Module Name:
ACCESSCONTROL-ROLES
Master Name:
roles
Role-Action Mapping
Map APIs to roles in
roleactions.json
.Module Name:
ACCESSCONTROL-ROLEACTIONS
Master Name:
roleactions.json
CAMPAIGN_SUPERVISOR
/health-expense-calculator/v1/_calculator
Other masters to be added
Other muster roll masters are configured in the common-masters
folder: workerRates.json
Last updated
Was this helpful?