Skip to content

fix id dropdown incorrectly showing wrong values in program create wizard#167

Merged
anthonymarkQA merged 1 commit into19.0from
fix-id-dropdown-values
Apr 27, 2026
Merged

fix id dropdown incorrectly showing wrong values in program create wizard#167
anthonymarkQA merged 1 commit into19.0from
fix-id-dropdown-values

Conversation

@anthonymarkQA
Copy link
Copy Markdown
Contributor

fix id dropdown incorrectly showing wrong values in program create wizard

Why is this change needed?

The id_type_id field on both the entitlement manager base and the program creation wizard incorrectly referenced spp.id.type instead of spp.vocabulary.code. Since spp.registry.id records store their id_type_id as spp.vocabulary.code, the ID lookup filter at entitlement preparation time always compared IDs across two different tables, causing it to return empty results — meaning id_number was never stamped on the entitlement. With spp_dci installed, the dropdown in the wizard also showed civil registry codes (BRN, DRN, MRN, UIN) instead of identity document types (National ID, Passport, etc.).

How was the change implemented?

  • Changed id_type_id in BaseEntitlementManager and SPPCreateNewProgramWiz from spp.id.type to spp.vocabulary.code, with a domain filter scoped to the urn:openspp:vocab:id-type vocabulary.
  • Added migrations/19.0.2.0.11/pre_migrate.py to remap existing id_type_id values from spp.id.type IDs to matching spp.vocabulary.code IDs by name. Records with no match are set to NULL.
  • Bumped module version to 19.0.2.0.11 to trigger the migration.

No changes were needed to the lambda filters in the cash, in-kind, or default entitlement managers — once both sides of the comparison use spp.vocabulary.code, they work correctly.

New unit tests

Unit tests executed by the author

How to test manually

  1. Upgrade spp_programs.
  2. Open Programs > Create Program → Step 1 → Redemption ID dropdown.
  3. Should list vocabulary-based ID types (e.g. National ID, Passport) — not BRN/DRN/MRN/UIN.
  4. Create a cash program with Redemption ID = National ID.
  5. Enroll a beneficiary who has a National ID registry record (spp.registry.id).
  6. Prepare entitlements — the entitlement record's id_number field should be populated with the beneficiary's National ID value.

Related links

ticket #945

@cursor
Copy link
Copy Markdown

cursor Bot commented Apr 27, 2026

You have used all of your free Bugbot PR reviews.

To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.46%. Comparing base (5f420e8) to head (fb8b5dd).
⚠️ Report is 4 commits behind head on 19.0.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             19.0     #167   +/-   ##
=======================================
  Coverage   71.46%   71.46%           
=======================================
  Files         932      932           
  Lines       54846    54846           
=======================================
  Hits        39198    39198           
  Misses      15648    15648           
Flag Coverage Δ
spp_api_v2 80.10% <ø> (ø)
spp_api_v2_change_request 66.85% <ø> (ø)
spp_api_v2_cycles 71.12% <ø> (ø)
spp_api_v2_data 64.41% <ø> (ø)
spp_api_v2_entitlements 70.19% <ø> (ø)
spp_api_v2_gis 71.52% <ø> (ø)
spp_api_v2_products 66.27% <ø> (ø)
spp_api_v2_service_points 70.94% <ø> (ø)
spp_api_v2_simulation 71.12% <ø> (ø)
spp_api_v2_vocabulary 57.26% <ø> (ø)
spp_audit 72.60% <ø> (ø)
spp_base_common 90.26% <ø> (ø)
spp_case_entitlements 97.61% <ø> (ø)
spp_case_programs 97.14% <ø> (ø)
spp_cel_event 85.11% <ø> (ø)
spp_claim_169 58.11% <ø> (ø)
spp_dci_client_dr 55.87% <ø> (ø)
spp_dci_client_ibr 60.17% <ø> (ø)
spp_programs 64.48% <100.00%> (ø)
spp_security 66.66% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
spp_programs/__manifest__.py 0.00% <ø> (ø)
...pp_programs/models/managers/entitlement_manager.py 100.00% <100.00%> (ø)
spp_programs/wizard/create_program_wizard.py 75.43% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the id_type_id field in both BaseEntitlementManager and create_program_wizard to use the spp.vocabulary.code model with a domain filter, replacing the previous spp.id.type model. Additionally, the module version has been incremented. I have no feedback to provide.

@anthonymarkQA anthonymarkQA merged commit 74f3225 into 19.0 Apr 27, 2026
35 checks passed
@anthonymarkQA anthonymarkQA deleted the fix-id-dropdown-values branch April 27, 2026 05:46
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