Skip to content

Resolves #2322 Track supervisor id, decision and comment in anonymous profile - #2399

Open
codetuscan wants to merge 2 commits into
mosip:developfrom
codetuscan:feature/2322-supervisor-details-anonymous-profile
Open

codetuscan wants to merge 2 commits into
mosip:developfrom
codetuscan:feature/2322-supervisor-details-anonymous-profile

Conversation

@codetuscan

Copy link
Copy Markdown

Issue

Resolves #2322

What this adds

supervisorId, supervisorDecision and supervisorComment on the anonymous profile, so supervisor-wise approved/rejected packet reports can be produced through the existing Elasticsearch/Kibana pipeline.

Where each field comes from

  • supervisorId - already present in the packet operationsData and already read next to officerId in AnonymousProfileServiceImpl. It was only going into assisted[]; it is now also set on its own field so reports can group by it.
  • supervisorDecision / supervisorComment - not in the packet at all. The supervisor takes the decision on the registration client and it reaches registration_list on sync (supervisor_status, supervisor_comment). AnonymousProfileTagGenerator now reads them from there while it builds the profile tag, looking up by workflowInstanceId - the same unique key SupervisorApprovalStatusTagGenerator in the same package already uses.

Behaviour notes

  • A missing registration_list record leaves both fields null and the profile is still tagged - supervisor reporting never costs us the profile itself.
  • A lookup failure is caught by the generator's existing handler, so packet classification is never blocked; the workflow manager then falls back to building the profile from the packet.
  • The enrichment is a round trip through AnonymousProfileDTO using the same JsonUtil mapper that produced the JSON, so field shape and null handling are unchanged.
  • Packets that reach the buildAndSaveAnonymousProfileFromPacket fallback (no tag present, e.g. processed before the classifier stage ran) get supervisorId only. Adding the same lookup there is a small follow-up if wanted - that path has workflowInstanceId on its DTO.

Constraints from the issue

No DB schema change, no new API, no Registration Client change, and no change to any existing method signature. The three fields are additive, so existing reports and dashboards keep working and historical profiles need no migration.

…ymous profile

Adds supervisorId, supervisorDecision and supervisorComment to the
anonymous profile so reports can be grouped by supervisor.

supervisorId is already present in the packet operationsData and is read
alongside officerId; it is now labelled on its own instead of only being
part of assisted[].

The decision and comment are not in the packet at all - the supervisor
takes the decision on the registration client and it reaches
registration_list on sync. AnonymousProfileTagGenerator therefore reads
them from there by workflowInstanceId, the same unique key
SupervisorApprovalStatusTagGenerator uses, and adds them to the profile
JSON it tags. A missing registration_list record leaves both fields null
and the profile is still tagged.

No schema change, no new API and no change to any existing method
signature; existing profiles and dashboards are unaffected because the
three fields are additive.

Co-authored-by: Sarthak Maheshwari <65298686+SartMa@users.noreply.github.com>
Signed-off-by: codetuscan <Sunhith.Reddy@iiitb.ac.in>
@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Team

Run ID: 17458aed-9a5a-491f-a78b-cc1afe70c220


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

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

@codetuscan
codetuscan force-pushed the feature/2322-supervisor-details-anonymous-profile branch from 1780c39 to b7a80ed Compare August 31, 2026 11:52
…r lookup fails

The supervisor decision fetch is a best-effort enrichment, so a failure in
addSupervisorDecision must cost only the supervisorDecision and
supervisorComment fields - not the profile tag itself. Wrap the call so the
profile JSON built from the packet is still tagged, mirroring how a failed
biometrics fetch only drops the biometrics.

A missing registration_list record is the normal case at classification time
(the supervisor decision has not synced yet), so drop that log from warn to
debug.

Co-authored-by: Sarthak Maheshwari <65298686+SartMa@users.noreply.github.com>
Signed-off-by: codetuscan <Sunhith.Reddy@iiitb.ac.in>
@codetuscan
codetuscan force-pushed the feature/2322-supervisor-details-anonymous-profile branch from 0b62de3 to 93061d5 Compare September 7, 2026 13:24
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.

1 participant