feat(jubilee): implement price package sync, diff engine, and UI actions#1180
Merged
av-dev2 merged 1 commit intoAakvatech-Limited:nurse-ot-modulefrom Apr 22, 2026
Merged
Conversation
Add the Jubilee price package integration: fetching packages from the API, computing diffs between successive syncs, and wiring up the UI trigger on Healthcare Insurance Company. Jubilee price_package.py - bulk insert fix: - Add creation, owner, modified, modified_by to the bulk_insert fields list and populate them with frappe.session.user and now_datetime(), fixing missing required DB columns during insert Jubilee price_package.py - response data parsing: - Replace json.loads() with a new _parse_response_data() helper that tries json.loads first, then falls back to ast.literal_eval for legacy records stored via str() (which produces single-quoted Python repr instead of valid JSON) - Add ast import to support the fallback parser Jubilee price_package.py - diff comparison improvements: - Use .get(field) instead of direct key access to avoid KeyError when a field exists in one response but not the other - Iterate over the union of both key sets (set(current) | set(previous)) instead of only current_item keys, so removed fields are also detected - Remove stale commented-out code Jubilee price_package.py - record mapping corrections: - Rename price_row.type to price_row.change_type to match the updated child DocType field name - Map ItemPrice instead of UnitPrice to price_row.itemprice to match the actual API response key - Add price_row.cleanname mapping from CleanName - Remove commented-out olditemcode and record assignments NHIF price_package.py - same diff comparison fix: - Apply the identical .get() and set union fix to the NHIF set_package_diff function for consistency between both insurance integrations insurance_company.js - UI actions: - Add "Get Jubilee Packages" button calling enqueue_get_jubilee_price_packages to trigger background package sync - Remove "Process Jubilee Records" button (no longer needed as a separate manual action) - Normalize arrow function syntax across all Jubilee action buttons - Remove extra blank line in process_jubilee_coverages Files modified: - hms_tz/jubilee/api/price_package.py - hms_tz/nhif/nhif_api/price_package.py - hms_tz/nhif/api/insurance_company.js
Not up to standards ⛔
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add the Jubilee price package integration: fetching packages from the API, computing diffs between successive syncs, and wiring up the UI trigger on Healthcare Insurance Company.
Jubilee price_package.py - bulk insert fix:
Jubilee price_package.py - response data parsing:
Jubilee price_package.py - diff comparison improvements:
Jubilee price_package.py - record mapping corrections:
NHIF price_package.py - same diff comparison fix:
insurance_company.js - UI actions:
Files modified: