Muster Roll

Overview

The attendance service supplies raw attendance logs, while the muster roll service collects these logs and calculates attendance according to specific business rules. For instance, determining whether attendance is measured in hours or days and defining what constitutes a half-day or a full day of attendance are decisions that depend on the specific implementation. These configurations can be adjusted within the service, and attendance calculations will be carried out based on these settings.

Pre-requisites

  • Attendance

  • Individual

  • Persister

  • MDMS

  • Workflow

  • Idgen

  • Notification

Functionalities

The functionality includes the following APIs:

  1. Estimate Muster Roll: This API calculates the attendance for a wage seeker based on their attendance logs.

  2. Create Muster Roll: It allows you to create a muster roll, which is essentially a list of wage seekers.

  3. Update Muster Roll: You can use this API to update a muster roll with modified aggregate attendance data.

  4. Search for Muster Roll: This API enables you to search for a muster roll using specific parameters. For more details, you can refer to the Swagger contract.

Setup

1

Locate the Environment YAML File

Go to the Helm environment file for your deployment environment:

https://github.com/{{ORG}}/DIGIT-DevOps/deploy-as-code/helm/environments/{{EnvironmentFile}}.yaml
2

Add Required Variables

In the environment file, add the following:

  • Database details: db-host, db-name, db-url

  • domain

  • Core service configs: idgen, workflow, user, etc.

  • Muster Roll-specific variables (refer to how it’s done in the dev file):

3

Verify Helm Chart Reference

Ensure you're using the correct chart for muster roll: health-muster-roll chart

4

Configure Persister Path

Check that the muster-roll persister YAML file is added in egov-persister.persister-yml-path. Add it if missing.

5

Add Secrets to Secret YAML File

In the corresponding secrets file:

  • Add DB credentials for Postgres and Flyway

  • Add secrets for DIGIT core services (like user, filestore, mdms, etc.)

  • Sample steps given here

Configuration Details

Configure Actions

Add all the APIs exposed (refer to the table below for actual APIs) to the actions.json file in MDMS

Module name: ACCESSCONTROL-ACTIONS-TEST

Master name: actions-test

Configure Roles

Configure roles based on the roles column below in roles.json file.

Module name: ACCESSCONTROL-ROLES

Master name: roles

Configure Role-Action

Role-action mapping is configured in MDMS per the table below.

Module name: ACCESSCONTROL-ROLEACTIONS

Master name: roleactions.json

Roles
API Endpoints

CAMPAIGN_SUPERVISOR

PROXIMITY_SUPERVISOR

/muster-roll/v1/_estimate

CAMPAIGN_SUPERVISOR PROXIMITY_SUPERVISOR

/muster-roll/v1/_create

CAMPAIGN_SUPERVISOR PROXIMITY_SUPERVISOR

/muster-roll/v1/_update

CAMPAIGN_SUPERVISOR PROXIMITY_SUPERVISOR

/muster-roll/v1/_search

Other masters to be added

Other muster roll masters are configured in the common-masters folder:

MusterRoll.json

IdFormat.json

workerRates.json

Persister Configuration

Integration Details

Links to the Environment file and Postman collection

  1. Import Collection Load the Muster Roll Postman collection into your Postman app.

  2. Import Environment Import the environment file. This sets up a "Muster Environment" with required variables.

  3. Run Attendance Setup APIs First Before running the Muster Roll APIs, run the following Attendance APIs:

    • Create Attendance Register POST https://{{hostname}}/{{attendance_context}}/v1/_create

    • Enrol Attendees POST https://{{hostname}}/{{attendance_context}}/attendee/v1/_create

    • Create Attendance Logs POST https://{{hostname}}/{{attendance_context}}/log/v1/_create

  4. Update Register ID Copy the registerId from the response of the first API (step 3a), and set it as the current value of registerId in the Muster Environment.

  5. Run the Muster Roll Collection Use the "Run Collection" option in Postman. This will trigger:

    • /muster-roll/v1/_estimate

    • /muster-roll/v1/_create

    • /muster-roll/v1/_update

    • /muster-roll/v1/_search — covering both success and error scenarios.

  6. Track Output Variables After /create, the environment variables musterRollId and musterRollNumber will be set automatically. These are used in the update and search requests.

Last updated

Was this helpful?