diff --git a/block.py b/block.py index 5da574a..7baa8cc 100644 --- a/block.py +++ b/block.py @@ -100,6 +100,7 @@ def __main__( ownhome: str, payfrequency: str, monthsatresidence: str, + state: str, #thxresponse-> EventType: str, DigitalIdConfidence: str, @@ -127,6 +128,7 @@ def __main__( "ownhome" : ownhome, "payfrequency" : payfrequency, "monthsatresidence" : monthsatresidence, + "state" : state, "EventType" : EventType, "DigitalIdConfidence" : DigitalIdConfidence, "RiskRating" : RiskRating, @@ -165,8 +167,14 @@ def __main__( df["application_timestamp"] = df["application_timestamp"].astype(str) # logger.info("prediction: %.8f", float(df['prediction'].iloc[0])) result = post_processing(df) - # logger.info("Score: %.0f", float(result["hd_score_m1"])) + logger.info("post_processed_data") logger.info(result) + # State Check + state_value = combined_df["state"].iloc[0] + if pd.notnull(state_value) and state_value == "ZZ": + result["hd_score_m1"] = 1250 + logger.info("post_processed_data after state check") + logger.info(result) return result diff --git a/request_schema.json b/request_schema.json index 73d1e51..9fc2039 100644 --- a/request_schema.json +++ b/request_schema.json @@ -89,6 +89,10 @@ "monthsatresidence": { "type": ["number", "null"], "description": "Number of months the applicant has lived at their current residence." + }, + "state": { + "type": ["string", "null"], + "description": "State of the current residence." } }, "required": [] diff --git a/test_block.py b/test_block.py index 44a968a..d866241 100644 --- a/test_block.py +++ b/test_block.py @@ -26,7 +26,8 @@ input_json = { "payfrequency": None, "lengthatbank": None, "educationlevel": None, - "monthsatresidence": None + "monthsatresidence": None, + "state": None }