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.

  • Secrets and Credentials

    • Add Postgres and Flyway DB credentials (username and password) in the environment secret YAML file as per the steps outlined here.

    • Configure secrets for DIGIT core services in the same secret file as per the steps outlined here.

Configuration

Actions

  • Add Expense Calculator APIs (e.g., /health-expense-calculator/v1/_calculator) to actions.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

Roles
API Endpoints

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?