diff --git a/block.py b/block.py index 74de71e..fc07805 100644 --- a/block.py +++ b/block.py @@ -16,6 +16,7 @@ def __main__( email_cnt: int, rejected_app_count: float, app_dt_day_cnt: int, + hd_score_iso_m2: float ) -> dict: # Create a dictionary instead of using pandas DataFrame data = { @@ -26,6 +27,7 @@ def __main__( "email_cnt": email_cnt, "rejected_app_count": rejected_app_count, "app_dt_day_cnt": app_dt_day_cnt, + "hd_score_iso_m2": hd_score_iso_m2, } final = processing(data) diff --git a/request_schema.json b/request_schema.json index 273cd13..fbf2d89 100644 --- a/request_schema.json +++ b/request_schema.json @@ -29,6 +29,10 @@ "app_dt_day_cnt": { "type": ["number", "null"], "description": "Number of application days counted." + }, + "hd_score_iso_m2": { + "type": ["number", "null"], + "description": "HD fraud Score M2" } }, "required": [] diff --git a/response_schema.json b/response_schema.json index b4dcb57..bdfa09f 100644 --- a/response_schema.json +++ b/response_schema.json @@ -21,6 +21,10 @@ "hd_score_s3": { "type": ["number", "null"], "description": "HD Fraud Score S3" + }, + "hd_score_iso_m2": { + "type": ["number", "null"], + "description": "HD Fraud Score M2" } } } diff --git a/rules_processing.py b/rules_processing.py index 1645256..bbe7005 100644 --- a/rules_processing.py +++ b/rules_processing.py @@ -49,6 +49,7 @@ def processing(data: dict) -> dict: "hd_score_s1": hd_score_s1, "hd_score_s2": hd_score_s2, "hd_score_s3": hd_score_s3, + "hd_score_iso_m2": data["hd_score_iso_m2"], } diff --git a/test_block.py b/test_block.py index 763dbc4..06a235b 100644 --- a/test_block.py +++ b/test_block.py @@ -1,7 +1,7 @@ import unittest from block import __main__ -data = {'hd_score_m1': 1173.0, 'hd_score_g1': 1203.0, 'cluster_size_users_v2': 3.0, 'target_connected_30_sum': 0.0, 'email_cnt': 1.0, 'rejected_app_count': 2.0, 'app_dt_day_cnt': 3.0} +data = {'hd_score_m1': 1093.0, 'hd_score_g1': 0.0, 'cluster_size_users_v2': 1.0, 'target_connected_30_sum': 0.0, 'email_cnt': 1.0, 'rejected_app_count': 0.0, 'app_dt_day_cnt': 1.0, 'hd_score_iso_m2': 1001.0} class TestBlock(unittest.TestCase): def test_main_success(self):