Merged in DAIP2-2162-fix-mapping-issue-program-product-not-mapping-to-lob (pull request #914)

DAIP2-2162 fix mapping issue program product not mapping to lob

* fixed empty LOB

* adding program-lob mapping when there is no client

* code cleanup

* code change refactored

* code change refactored

* additional test case removed

* pipeline error fixed


Approved-by: Katon Minhas
This commit is contained in:
Mayank Aamseek
2026-03-17 18:10:57 +00:00
committed by Katon Minhas
parent dd34c00303
commit cbfbbc1257
6 changed files with 85 additions and 2 deletions
+20
View File
@@ -24,6 +24,7 @@ from src.pipelines.shared.postprocessing.postprocessing_funcs import (
standardize_reimb_method_and_fee_schedule,
validate_and_reformat_date,
)
from src.pipelines.shared.postprocessing import aarete_derived
from src.pipelines.shared.postprocessing.postprocess import standard_postprocess
from src.constants.constants import Constants
@@ -957,6 +958,25 @@ class TestPostprocessFunctions(unittest.TestCase):
self.assertEqual(result_df.loc[0, "CONTRACT_TITLE"], "")
self.assertEqual(result_df.loc[1, "CONTRACT_TITLE"], "Another Valid")
def test_fill_na_mapping_derives_lob_from_aarete_derived_product(self):
"""fill_na_mapping should derive LOB from AARETE_DERIVED_PRODUCT."""
rows = [
{
"PRODUCT": "",
"AARETE_DERIVED_PRODUCT": '["Connexus", "Synergy"]',
"AARETE_DERIVED_LOB": "",
"LOB": "",
"AARETE_DERIVED_PROGRAM": "",
"LOB_PROGRAM_RELATIONSHIP": "",
"LOB_PRODUCT_RELATIONSHIP": "",
}
]
result = aarete_derived.fill_na_mapping(rows)
self.assertEqual(result[0]["AARETE_DERIVED_LOB"], ["Commercial"])
self.assertEqual(result[0]["LOB"], ["Commercial"])
class TestStandardizeReimbMethodAndFeeScheduleUOM(unittest.TestCase):
"""Tests for UNIT_OF_MEASURE post-processing when DEFAULT_IND='Y' and flat rate."""