Skip to content

Conversation

@sruthi-egov
Copy link
Collaborator

@sruthi-egov sruthi-egov commented Aug 18, 2025

Summary by CodeRabbit

  • New Features
    • Introduced worker rate configurations for HCM, enabling rate lookup by skill and event type (campaigns and training).
    • Added rate breakdowns (Food, Travel, Per Day) with USD currency for multiple campaigns.
    • Supports distinct campaigns with unique IDs and dedicated training rates.
    • Ensures availability for tenant “mz,” improving consistency and clarity of worker compensation across supported events.

@sruthi-egov sruthi-egov requested a review from a team as a code owner August 18, 2025 09:54
@sruthi-egov sruthi-egov requested review from GhanshyamRawat-eGov and removed request for a team August 18, 2025 09:54
@coderabbitai
Copy link

coderabbitai bot commented Aug 18, 2025

Walkthrough

Introduces a new MDMS data file mdms/HCM/v1.7/workerRates.json containing WORKER_RATES entries for the HCM module under tenant "mz", detailing campaign and training rate structures by skillCode, rateBreakup (FOOD, TRAVEL, PER_DAY), currency (USD), eventType, and campaignId.

Changes

Cohort / File(s) Summary
MDMS HCM worker rates data
mdms/HCM/v1.7/workerRates.json
Added dataset defining WORKER_RATES: multiple campaign/training entries with name, eventType (CAMPAIGN/TRAINING), currency USD, campaignId GUIDs, rateBreakup fields (FOOD, TRAVEL, PER_DAY), and skillCode-based rates; includes duplicated campaign name with distinct IDs.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I twitch my whiskers at fresh rate lore,
New skills and coins in JSON galore.
Campaigns hop in, training too—
USD crumbs for every crew.
In HCM fields I dance with glee,
Carrots balanced per diem-ly. 🥕✨

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch sruthi-egov-patch-1

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@sruthi-egov sruthi-egov self-assigned this Aug 18, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (2)
mdms/HCM/v1.7/workerRates.json (2)

86-164: Duplicate campaign name “SMC Demo” (different campaignId) — confirm intent.

Two entries share the same name but have different campaignIds and identical rates. If consumers look up campaigns by name, this can cause ambiguity. If the intent is to track separate runs of the same campaign, consider adding a disambiguator (e.g., date, region) to name or introducing a separate displayName vs internal name.

Would you like a quick patch to rename one of these for clarity (e.g., “SMC Demo (Run 2)”)?


166-260: Optional: normalize and future-proof the data model.

If the platform permits, consider:

  • Adding effectiveFrom/effectiveTo to each campaign to support temporal changes without overwriting past rates.
  • Enforcing skillCode uniqueness per campaign via CI checks.
  • Defining a schema (JSON Schema) for WORKER_RATES to validate enum values and required fields.

I can open a follow-up issue and provide a JSON Schema + CI validation step.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 91ad643 and 4d954c9.

📒 Files selected for processing (1)
  • mdms/HCM/v1.7/workerRates.json (1 hunks)
🔇 Additional comments (3)
mdms/HCM/v1.7/workerRates.json (3)

5-84: Rates block for “SMC Demo” looks consistent and well-formed.

rateBreakup keys are consistent, numeric values are valid, and campaignId is present.


81-83: Verify currency choice (“USD”) for tenant “mz”.

All entries use currency USD. If this tenant is Mozambique (“mz”), confirm whether rates should be in MZN instead. If USD is intentional, ensure UI/exports don’t auto-format to local currency.

Would you like a PR comment bot check that flags mismatches between tenant and currency?

Also applies to: 161-163, 257-259, 313-315


262-316: TRAINING event rates block looks coherent.

Structure matches CAMPAIGN blocks, eventType is correctly set to TRAINING, and values are plausible.

Comment on lines +1 to +4
{
"tenantId": "mz",
"moduleName": "HCM",
"WORKER_RATES": [
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Schema alignment check recommended.

The top-level layout { tenantId, moduleName, WORKER_RATES: [] } looks reasonable, but MDMS integrations can be strict. Please verify this file conforms to the HCM v1.7 schema (field names, enums like eventType, and rateBreakup keys: FOOD/TRAVEL/PER_DAY).

Run this script to surface duplicate skillCodes per campaign and repeated names; it also sanity-checks key shapes.


🏁 Script executed:

#!/bin/bash
set -euo pipefail

FILE="mdms/HCM/v1.7/workerRates.json"
python - << 'PY'
import json, sys, collections, re
path = "mdms/HCM/v1.7/workerRates.json"
with open(path) as f:
    data = json.load(f)

errors = 0

# Basic shape
required_top = {"tenantId","moduleName","WORKER_RATES"}
missing = required_top - set(data.keys())
if missing:
    errors += 1
    print(f"[ERROR] Missing top-level keys: {sorted(missing)}")

# Check campaigns
seen_names = collections.Counter()
seen_ids = set()
for idx, camp in enumerate(data.get("WORKER_RATES", []), 1):
    name = camp.get("name")
    cid = camp.get("campaignId")
    seen_names[name] += 1
    if cid in seen_ids:
        errors += 1
        print(f"[ERROR] Duplicate campaignId at index {idx}: {cid}")
    seen_ids.add(cid)

    # Check currency presence and basic type
    if "currency" not in camp or not isinstance(camp["currency"], str):
        errors += 1
        print(f"[ERROR] Campaign {name}: missing/invalid currency")

    # eventType value sanity check
    et = camp.get("eventType")
    if et not in {"CAMPAIGN","TRAINING"}:
        errors += 1
        print(f"[ERROR] Campaign {name}: unexpected eventType={et}")

    # Duplicate skillCode detection and rateBreakup keys
    skill_counts = collections.Counter()
    for r in camp.get("rates", []):
        sc = r.get("skillCode")
        rb = r.get("rateBreakup", {})
        skill_counts[sc] += 1
        expected_keys = {"FOOD","TRAVEL","PER_DAY"}
        if set(rb.keys()) != expected_keys:
            errors += 1
            print(f"[ERROR] Campaign {name}, skill {sc}: rateBreakup keys {sorted(rb.keys())} != {sorted(expected_keys)}")
        # Number sanity
        for k,v in rb.items():
            if not isinstance(v, (int, float)) or v < 0:
                errors += 1
                print(f"[ERROR] Campaign {name}, skill {sc}: {k} invalid value {v}")

    dups = [s for s,c in skill_counts.items() if c>1]
    if dups:
        errors += 1
        print(f"[ERROR] Campaign {name}: duplicate skillCodes: {dups}")

# Report duplicate names
dup_names = [n for n,c in seen_names.items() if c>1 and n is not None]
if dup_names:
    print(f"[WARN] Duplicate campaign names detected: {dup_names} (ensure consumers select by campaignId)")

if errors == 0:
    print("OK: No schema/duplicate issues detected by this basic check.")
else:
    print(f"Found {errors} issue(s).")
PY

Length of output: 281


Duplicate entries detected in mdms/HCM/v1.7/workerRates.json – action required

  • Duplicate skillCodes in campaign SMC_campaign_payments_test_2:
    HEALTH_FACILITY_SUPERVISOR appears more than once in the rates array. Ensure each skillCode is unique per campaign.
  • Duplicate campaign name SMC Demo across entries:
    – Either rename one of the campaigns or confirm that consumers always disambiguate by campaignId.

No other schema/key‐shape issues were flagged (top‐level keys, eventType enums, rateBreakup keys conform). Once duplicates are resolved, please re‐run validation to confirm full HCM v1.7 compliance.

🤖 Prompt for AI Agents
In mdms/HCM/v1.7/workerRates.json around lines 1 to 4, there are duplicate
entries causing schema problems: within campaign "SMC_campaign_payments_test_2"
the skillCode "HEALTH_FACILITY_SUPERVISOR" appears multiple times in the rates
array (ensure each skillCode is unique per campaign by removing or merging
duplicates and consolidating rateBreakup entries), and the campaign display name
"SMC Demo" is used more than once (rename one of the duplicate campaigns or
otherwise disambiguate by ensuring unique campaignId values); after making these
changes, re-run the v1.7 HCM validation to confirm compliance.

Comment on lines +166 to +260
"name": "SMC_campaign_payments_test_2",
"rates": [
{
"skillCode": "CDD",
"rateBreakup": {
"FOOD": 2,
"TRAVEL": 1,
"PER_DAY": 2
}
},
{
"skillCode": "HEALTH_FACILITY_SUPERVISOR",
"rateBreakup": {
"FOOD": 4.5,
"TRAVEL": 5,
"PER_DAY": 5.5
}
},
{
"skillCode": "PROXIMITY_SUPERVISOR",
"rateBreakup": {
"FOOD": 3.5,
"TRAVEL": 5,
"PER_DAY": 11.5
}
},
{
"skillCode": "PAYMENT_SUPERVISOR",
"rateBreakup": {
"FOOD": 6,
"TRAVEL": 6.5,
"PER_DAY": 12.5
}
},
{
"skillCode": "MUNICIPAL_ADVISOR",
"rateBreakup": {
"FOOD": 6.5,
"TRAVEL": 7,
"PER_DAY": 9.5
}
},
{
"skillCode": "NATIONAL_SUPERVISOR",
"rateBreakup": {
"FOOD": 8,
"TRAVEL": 8,
"PER_DAY": 12
}
},
{
"skillCode": "DISTRICT_SUPERVISOR",
"rateBreakup": {
"FOOD": 6,
"TRAVEL": 8,
"PER_DAY": 10
}
},
{
"skillCode": "WAREHOUSE_MANAGER",
"rateBreakup": {
"FOOD": 5.5,
"TRAVEL": 6.5,
"PER_DAY": 10
}
},
{
"skillCode": "HEALTH_FACILITY_SUPERVISOR",
"rateBreakup": {
"FOOD": 5.5,
"TRAVEL": 6.5,
"PER_DAY": 11.5
}
},
{
"skillCode": "DISTRIBUTOR",
"rateBreakup": {
"FOOD": 5.5,
"TRAVEL": 6.5,
"PER_DAY": 12.5
}
},
{
"skillCode": "HEALTH_FACILITY_WORKER",
"rateBreakup": {
"FOOD": 5.5,
"TRAVEL": 6.5,
"PER_DAY": 9.5
}
}
],
"currency": "USD",
"eventType": "CAMPAIGN",
"campaignId": "c2220d30-aafb-474e-97c6-8f5a4f6da7b0"
},
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Duplicate skillCode within the same campaign (“HEALTH_FACILITY_SUPERVISOR”) with conflicting rates.

In “SMC_campaign_payments_test_2”, HEALTH_FACILITY_SUPERVISOR appears twice (Lines 177–183 and 233–239) with different rateBreakup values. This is likely a data bug; downstream code may pick one arbitrarily or the latter silently overrides in transformations, leading to hard-to-debug payment inconsistencies.

Decide which set is correct and remove the other, or merge according to business rules. Below are two alternative diffs to remove one of the duplicates.

Option A: Keep the later, higher values (Lines 233–239), remove the earlier block:

@@
-        {
-          "skillCode": "HEALTH_FACILITY_SUPERVISOR",
-          "rateBreakup": {
-            "FOOD": 4.5,
-            "TRAVEL": 5,
-            "PER_DAY": 5.5
-          }
-        },

Option B: Keep the earlier values (Lines 177–183), remove the later block:

@@
-        {
-          "skillCode": "HEALTH_FACILITY_SUPERVISOR",
-          "rateBreakup": {
-            "FOOD": 5.5,
-            "TRAVEL": 6.5,
-            "PER_DAY": 11.5
-          }
-        },

Additionally, consider adding a pre-commit validation to fail builds on duplicate skillCodes within a campaign. I can provide a script.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"name": "SMC_campaign_payments_test_2",
"rates": [
{
"skillCode": "CDD",
"rateBreakup": {
"FOOD": 2,
"TRAVEL": 1,
"PER_DAY": 2
}
},
{
"skillCode": "HEALTH_FACILITY_SUPERVISOR",
"rateBreakup": {
"FOOD": 4.5,
"TRAVEL": 5,
"PER_DAY": 5.5
}
},
{
"skillCode": "PROXIMITY_SUPERVISOR",
"rateBreakup": {
"FOOD": 3.5,
"TRAVEL": 5,
"PER_DAY": 11.5
}
},
{
"skillCode": "PAYMENT_SUPERVISOR",
"rateBreakup": {
"FOOD": 6,
"TRAVEL": 6.5,
"PER_DAY": 12.5
}
},
{
"skillCode": "MUNICIPAL_ADVISOR",
"rateBreakup": {
"FOOD": 6.5,
"TRAVEL": 7,
"PER_DAY": 9.5
}
},
{
"skillCode": "NATIONAL_SUPERVISOR",
"rateBreakup": {
"FOOD": 8,
"TRAVEL": 8,
"PER_DAY": 12
}
},
{
"skillCode": "DISTRICT_SUPERVISOR",
"rateBreakup": {
"FOOD": 6,
"TRAVEL": 8,
"PER_DAY": 10
}
},
{
"skillCode": "WAREHOUSE_MANAGER",
"rateBreakup": {
"FOOD": 5.5,
"TRAVEL": 6.5,
"PER_DAY": 10
}
},
{
"skillCode": "HEALTH_FACILITY_SUPERVISOR",
"rateBreakup": {
"FOOD": 5.5,
"TRAVEL": 6.5,
"PER_DAY": 11.5
}
},
{
"skillCode": "DISTRIBUTOR",
"rateBreakup": {
"FOOD": 5.5,
"TRAVEL": 6.5,
"PER_DAY": 12.5
}
},
{
"skillCode": "HEALTH_FACILITY_WORKER",
"rateBreakup": {
"FOOD": 5.5,
"TRAVEL": 6.5,
"PER_DAY": 9.5
}
}
],
"currency": "USD",
"eventType": "CAMPAIGN",
"campaignId": "c2220d30-aafb-474e-97c6-8f5a4f6da7b0"
},
"rates": [
{
"skillCode": "CDD",
"rateBreakup": {
"FOOD": 2,
"TRAVEL": 1,
"PER_DAY": 2
}
},
{
"skillCode": "PROXIMITY_SUPERVISOR",
"rateBreakup": {
"FOOD": 3.5,
"TRAVEL": 5,
"PER_DAY": 11.5
}
},
{
"skillCode": "PAYMENT_SUPERVISOR",
"rateBreakup": {
"FOOD": 6,
"TRAVEL": 6.5,
"PER_DAY": 12.5
}
},
{
"skillCode": "MUNICIPAL_ADVISOR",
"rateBreakup": {
"FOOD": 6.5,
"TRAVEL": 7,
"PER_DAY": 9.5
}
},
{
"skillCode": "NATIONAL_SUPERVISOR",
"rateBreakup": {
"FOOD": 8,
"TRAVEL": 8,
"PER_DAY": 12
}
},
{
"skillCode": "DISTRICT_SUPERVISOR",
"rateBreakup": {
"FOOD": 6,
"TRAVEL": 8,
"PER_DAY": 10
}
},
{
"skillCode": "WAREHOUSE_MANAGER",
"rateBreakup": {
"FOOD": 5.5,
"TRAVEL": 6.5,
"PER_DAY": 10
}
},
{
"skillCode": "HEALTH_FACILITY_SUPERVISOR",
"rateBreakup": {
"FOOD": 5.5,
"TRAVEL": 6.5,
"PER_DAY": 11.5
}
},
{
"skillCode": "DISTRIBUTOR",
"rateBreakup": {
"FOOD": 5.5,
"TRAVEL": 6.5,
"PER_DAY": 12.5
}
},
{
"skillCode": "HEALTH_FACILITY_WORKER",
"rateBreakup": {
"FOOD": 5.5,
"TRAVEL": 6.5,
"PER_DAY": 9.5
}
}
],
🤖 Prompt for AI Agents
In mdms/HCM/v1.7/workerRates.json around lines 166–260 there is a duplicate
skillCode "HEALTH_FACILITY_SUPERVISOR" with conflicting rateBreakup values;
decide which rate set is authoritative (Option A: keep the later higher values,
Option B: keep the earlier values), remove the other entry (or merge according
to business rules), fix any trailing commas so the JSON array remains valid, and
add a simple pre-commit or CI validation that fails on duplicate skillCode
entries within the same campaign to prevent regressions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants