Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
318 changes: 318 additions & 0 deletions mdms/HCM/v1.7/workerRates.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,318 @@
{
"tenantId": "mz",
"moduleName": "HCM",
"WORKER_RATES": [
Comment on lines +1 to +4
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.

{
"name": "SMC Demo",
"rates": [
{
"skillCode": "CDD",
"rateBreakup": {
"FOOD": 5,
"TRAVEL": 3,
"PER_DAY": 2
}
},
{
"skillCode": "HEALTH_FACILITY_WORKER",
"rateBreakup": {
"FOOD": 2.5,
"TRAVEL": 4,
"PER_DAY": 6
}
},
{
"skillCode": "PROXIMITY_SUPERVISOR",
"rateBreakup": {
"FOOD": 7,
"TRAVEL": 5,
"PER_DAY": 3
}
},
{
"skillCode": "PAYMENT_SUPERVISOR",
"rateBreakup": {
"FOOD": 8,
"TRAVEL": 6,
"PER_DAY": 6
}
},
{
"skillCode": "MUNICIPAL_ADVISOR",
"rateBreakup": {
"FOOD": 9,
"TRAVEL": 7,
"PER_DAY": 6.5
}
},
{
"skillCode": "NATIONAL_SUPERVISOR",
"rateBreakup": {
"FOOD": 10,
"TRAVEL": 8,
"PER_DAY": 12
}
},
{
"skillCode": "DISTRICT_SUPERVISOR",
"rateBreakup": {
"FOOD": 5,
"TRAVEL": 5,
"PER_DAY": 5.5
}
},
{
"skillCode": "DISTRIBUTOR",
"rateBreakup": {
"FOOD": 5,
"TRAVEL": 5,
"PER_DAY": 6.5
}
},
{
"skillCode": "WAREHOUSE_MANAGER",
"rateBreakup": {
"FOOD": 5.5,
"TRAVEL": 5.5,
"PER_DAY": 6.5
}
}
],
"currency": "USD",
"eventType": "CAMPAIGN",
"campaignId": "486d06d6-e35f-47b8-acf2-96ebb2ce5dd4"
},
{
"name": "SMC Demo",
"rates": [
{
"skillCode": "CDD",
"rateBreakup": {
"FOOD": 5,
"TRAVEL": 3,
"PER_DAY": 2
}
},
{
"skillCode": "HEALTH_FACILITY_WORKER",
"rateBreakup": {
"FOOD": 2.5,
"TRAVEL": 4,
"PER_DAY": 6
}
},
{
"skillCode": "PROXIMITY_SUPERVISOR",
"rateBreakup": {
"FOOD": 7,
"TRAVEL": 5,
"PER_DAY": 3
}
},
{
"skillCode": "PAYMENT_SUPERVISOR",
"rateBreakup": {
"FOOD": 8,
"TRAVEL": 6,
"PER_DAY": 6
}
},
{
"skillCode": "MUNICIPAL_ADVISOR",
"rateBreakup": {
"FOOD": 9,
"TRAVEL": 7,
"PER_DAY": 6.5
}
},
{
"skillCode": "NATIONAL_SUPERVISOR",
"rateBreakup": {
"FOOD": 10,
"TRAVEL": 8,
"PER_DAY": 12
}
},
{
"skillCode": "DISTRICT_SUPERVISOR",
"rateBreakup": {
"FOOD": 5,
"TRAVEL": 5,
"PER_DAY": 5.5
}
},
{
"skillCode": "DISTRIBUTOR",
"rateBreakup": {
"FOOD": 5,
"TRAVEL": 5,
"PER_DAY": 6.5
}
},
{
"skillCode": "WAREHOUSE_MANAGER",
"rateBreakup": {
"FOOD": 5.5,
"TRAVEL": 5.5,
"PER_DAY": 6.5
}
}
],
"currency": "USD",
"eventType": "CAMPAIGN",
"campaignId": "d2913c8c-b35d-4bac-9bf2-2cb7be98cbf1"
},
{
"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"
},
Comment on lines +166 to +260
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.

{
"name": "SMC Campaign Registration Training Rates",
"rates": [
{
"skillCode": "CDD",
"rateBreakup": {
"FOOD": 5,
"TRAVEL": 3,
"PER_DAY": 2
}
},
{
"skillCode": "HEALTH_FACILITY_SUPERVISOR",
"rateBreakup": {
"FOOD": 6,
"TRAVEL": 4,
"PER_DAY": 2.5
}
},
{
"skillCode": "PROXIMITY_SUPERVISOR",
"rateBreakup": {
"FOOD": 7,
"TRAVEL": 5,
"PER_DAY": 3
}
},
{
"skillCode": "PAYMENT_SUPERVISOR",
"rateBreakup": {
"FOOD": 8,
"TRAVEL": 6,
"PER_DAY": 6
}
},
{
"skillCode": "MUNICIPAL_ADVISOR",
"rateBreakup": {
"FOOD": 9,
"TRAVEL": 7,
"PER_DAY": 6.5
}
},
{
"skillCode": "NATIONAL_SUPERVISOR",
"rateBreakup": {
"FOOD": 10,
"TRAVEL": 8,
"PER_DAY": 12
}
}
],
"currency": "USD",
"eventType": "TRAINING",
"campaignId": "8e082a63-0c9d-4e6c-a89e-de56f7517a89"
}
]
}