Expense Service
Overview
The Expense Service within the DIGIT Health Campaign Management (HCM) ecosystem facilitates the creation and management of bills and payments associated with health campaigns. It operates in conjunction with the Expense Calculator Service, which provides the business logic for computing expenses. The Expense Service is primarily invoked by the Expense Calculator to generate bills, which can then be aggregated into payments. Payment advice can be submitted through any third-party payment provider.
Pre-requisites
Before deploying the Expense Service, ensure the following configurations are in place:
Helm Environment Configuration: Update the Helm environment file (e.g.,
unified-health-qa.yaml
) with the necessary environment variables, including:db-host
,db-name
,db-url
,domain
Configurations for core DIGIT platform services such as Idgen, workflow, user, etc.
Expense service-related environment variables.
Database Credentials: Ensure that the Postgres and Flyway database credentials are added to the respective environment secret YAML files.
Expense Persister Configuration: Verify that the expense persister file is included in the
egov-persister.perister-yml-path
variable. If not, follow the outlined steps to add it.
Functionalities
The Expense Service offers the following capabilities:
Bill Management: Create, update, and search bills.
Bill Type Configuration: Define various bill types according to the configuration.
Workflow Integration: Integrate with workflows, which need to be configured for use.
Calculator Integration: Work in conjunction with the Expense Calculator, which contains the business logic to compute bills.
Setup
Before deploying the Expense Service, configure the required environment variables and secrets as outlined below:
Helm Environment File Locate the environment YAML file at:
https://github.com/{{ORG}}/DIGIT-DevOps/deploy-as-code/helm/environments/{{EnvironmentFile}}.yaml
Add the following variables:
db-host
,db-name
,db-url
,domain
.Configure all DIGIT core platform services (e.g., Idgen, workflow, user, etc.) within this file.
Include muster-roll-service-related variables in the same way as defined in the
dev
environment YAML file.egov-service-host config map - Configure
egov-service-host
in the config mapexpense service environment variables - Add expense service environment variables
health-expense service helm chart - Reference the health-expense service helm chart
Expense Persister Configuration
Verify that the
expense-persister
file is added to theegov-persister.persister-yml-path
variable.If it is missing, follow the steps provided here.
Database Credentials
Add Postgres and Flyway DB username and password in the respective environment secret YAML file. Follow the steps provided here.
Ensure that all DIGIT core services–related secrets are also configured in the same secret file. Follow the steps provided here.
Configuration
Configure Actions
Add all the exposed APIs to the actions.json
file in MDMS:
Module Name:
ACCESSCONTROL-ACTIONS-TEST
Master Name:
actions-test
Configure Roles
Configure roles in the roles.json
file:
Module Name:
ACCESSCONTROL-ROLES
Master Name:
roles
Configure Role-Action Mapping
Map roles to actions in the roleactions.json
file:
Module Name:
ACCESSCONTROL-ROLEACTIONS
Master Name:
roleactions.json
Ensure that the role-action mappings align with the defined roles and actions.
Internal call
/bill/v1/_create
Internal call
/bill/v1/_update
CAMPAIGN_SUPERVISOR
/bill/v1/_search
Other expense masters are configured in the common-masters
folder: IdFormat
Last updated
Was this helpful?