from datetime import datetime

ownership_list_mapping = {
    'Individual': "1",
    'Joint': "2",
    'Joint Account': "2",
    'Authorized User': "3",
    'Authorized user': "3",
    'Guarantor': "7",
    'Deceased': "20",
}
account_type= {
    "1": "Auto Loan",
    "01": "Auto Loan",
    "2": "Housing Loan",
    "02": "Housing Loan",
    "3": "Property Loan",
    "03": "Property Loan",
    "4": "LOAN AGAINST SHARES/SECURITIES",
    "04": "LOAN AGAINST SHARES/SECURITIES",
    "5": "Personal Loan",
    "05": "Personal Loan",
    "6": "Consumer Loan",
    "06": "Consumer Loan",
    "7": "Gold Loan",
    "07": "Gold Loan",
    "8": "EDUCATIONAL LOAN",
    "08": "EDUCATIONAL LOAN",
    "9": "LOAN TO PROFESSIONAL",
    "09": "LOAN TO PROFESSIONAL",
    "10": "Credit Card",
    "11": "LEASING",
    "12": "OVERDRAFT",
    "13": "TWO-WHEELER LOAN",
    "14": "NON-FUNDED CREDIT FACILITY",
    "15": "LOAN AGAINST BANK DEPOSITS",
    "16": "FLEET CARD",
    "17": "Commercial Vehicle Loan",
    "18": "Telco – Wireless",
    "19": "Telco – Broadband",
    "20": "Telco – Landline",
    "23": "GECL Secured",
    "24": "GECL Unsecured",
    "31": "Secured Credit Card",
    "32": "Used Car Loan",
    "33": "Construction Equipment Loan",
    "34": "Tractor Loan",
    "35": "Corporate Credit Card",
    "36": "Kisan Credit Card",
    "37": "Loan on Credit Card",
    "38": "Prime Minister Jaan Dhan Yojana - Overdraft",
    "39": "Mudra Loans – Shishu / Kishor / Tarun",
    "40": "Microfinance – Business Loan",
    "41": "Microfinance – Personal Loan",
    "42": "Microfinance – Housing Loan",
    "43": "Microfinance – Others",
    "44": "Pradhan Mantri Awas Yojana - Credit Link Subsidy Scheme MAY CLSS",
    "45": "P2P Personal Loan",
    "46": "P2P Auto Loan",
    "47": "P2P Education Loan",
    "51": "BUSINESS LOAN – GENERAL",
    "52": "BUSINESS LOAN –PRIORITY SECTOR – SMALL BUSINESS",
    "53": "BUSINESS LOAN –PRIORITY SECTOR – AGRICULTURE",
    "54": "BUSINESS LOAN –PRIORITY SECTOR – OTHERS",
    "55": "BUSINESS NON-FUNDED CREDIT FACILITY – GENERAL",
    "56": "BUSINESS NON-FUNDED CREDIT FACILITY – PRIORITY SECTOR – SMALL BUSINESS",
    "57": "BUSINESS NON-FUNDED CREDIT FACILITY – PRIORITY SECTOR – AGRICULTURE",
    "58": "BUSINESS NON-FUNDED CREDIT FACILITY – PRIORITY SECTOR – OTHERS",
    "59": "BUSINESS LOANS AGAINST BANK DEPOSITS",
    "60": "Staff Loan",
    "61": "Business Loan - Unsecured",
    "00": "Others",
    "50": "Business Loan - Secured",
    "69": "Short Term Personal Loan [Unsecured]",
    "70": "Priority Sector Gold Loan [Secured]",
    "71": "Temporary Overdraft [Unsecured]"
}
rule = {
                            "value": {
                                "amount": 75000,
                                "exception": [
                                    "LOAN AGAINST SHARES/SECURITIES",
                                    "Gold Loan",
                                    "OVERDRAFT",
                                    "LOAN AGAINST BANK DEPOSITS",
                                    "FLEET CARD",
                                    "Telco – Wireless",
                                    "Telco – Broadband",
                                    "Telco – Landline",
                                    "Kisan Credit Card",
                                    "Others",
                                    "Priority Sector Gold Loan [Secured]",
                                    "Temporary Overdraft [Unsecured]"
                                ],
                                "ownership": [
                                    "Individual"
                                ],
                                "percentage": 50,
                                "open_months": 6,
                                "close_months": 36
                            },
                            "status": 1
                        }

def check_track_record(reported_date, net_loan_amount, ownership_dict, accounts, rule, bureau_type, account_type_dict):
    passed_account = []
    success = total_payment_grid = 0
    rule = rule.get("value")
    ownership_type = rule.get("ownership")
    reported_date = '' if not reported_date else datetime.strptime(reported_date, '%Y%m%d')
    relevant_ownerships = [ownership_dict.get(i.capitalize()) for i in ownership_type]
    exception_account_types = rule.get("exception")
    exception_account_types = [i.replace(" ", "").lower() for i in exception_account_types]
    sanction_amount_threshold = rule.get("amount")
    percentage_threshold = (net_loan_amount * rule.get("percentage")/100)
    close_months = rule.get("close_months")
    open_months = rule.get("open_months")
    for account in accounts:
        if str(account.get("AccountHoldertypeCode")) in relevant_ownerships or str(account.get("sch:OwnershipType")) in ownership_type:
            if bureau_type == 'experian':
                close_date_key = "Date_Closed"
                account_type_key, account_amount_key = "Account_Type", "Highest_Credit_or_Original_Loan_Amount"
                if account.get("CAIS_Account_History") and isinstance(account.get("CAIS_Account_History"), list):
                    total_payment_grid = len(account.get("CAIS_Account_History"))
                elif isinstance(account.get("CAIS_Account_History"), dict):
                    total_payment_grid = 1
            else:
                close_date_key = "sch:DateClosed"
                account_type_key, account_amount_key = "sch:AccountType", "sch:SanctionAmount"
                if account.get("sch:History48Months").get("sch:Month") and isinstance(account.get("sch:History48Months").get("sch:Month"), list):
                    total_payment_grid = len(account.get("sch:History48Months").get("sch:Month"))
                elif isinstance(account.get("sch:History48Months").get("sch:Month"), dict):
                    total_payment_grid = 1
            threshold_amount = percentage_threshold if percentage_threshold < sanction_amount_threshold else sanction_amount_threshold
            formatted_close_months = '' if not account.get(close_date_key) else datetime.strptime(account.get(close_date_key), '%Y%m%d')
            account_close_months = calculate_bureau_months(reported_date, formatted_close_months)
            if account_close_months is not None and account_close_months < close_months and total_payment_grid > open_months:
                tradeline_account_type = account_type_dict.get(str(account.get(account_type_key))) if bureau_type == 'experian' else account.get(account_type_key)
                if tradeline_account_type and tradeline_account_type.replace(" ", "").lower() not in exception_account_types:
                    if bureau_type == 'equifax' and not account.get(account_amount_key):
                        account_amount_key = "sch:HighCredit"
                    if account.get(account_amount_key) and float(account.get(account_amount_key)) > float(threshold_amount):
                        success = 1
                        passed_account = [account.get("Account_Number")]
                        break
    return [success], passed_account


def calculate_bureau_months(date1, date2):
    if not date1 or not date2:
        return 0
    return (date1 - date2).days // 30

bureau_data = [
                            {
                                "Identification_Number": "PVTXXXXXXXX",
                                "Subscriber_Name": "XXXXXXXXXX",
                                "Account_Number": "XXXXXXXXXXXX1576",
                                "Portfolio_Type": "R",
                                "Account_Type": "10",
                                "Open_Date": "20061116",
                                "Credit_Limit_Amount": "138000",
                                "Highest_Credit_or_Original_Loan_Amount": "29567",
                                "Terms_Duration": None,
                                "Terms_Frequency": None,
                                "Scheduled_Monthly_Payment_Amount": None,
                                "Account_Status": "13",
                                "Payment_Rating": "0",
                                "Payment_History_Profile": "N",
                                "Special_Comment": None,
                                "Current_Balance": "0",
                                "Amount_Past_Due": "0",
                                "Original_Charge_Off_Amount": None,
                                "Date_Reported": "20221104",
                                "Date_of_First_Delinquency": None,
                                "Date_Closed": "20221104",
                                "Date_of_Last_Payment": "20180303",
                                "SuitFiledWillfulDefaultWrittenOffStatus": None,
                                "SuitFiled_WillfulDefault": None,
                                "Written_off_Settled_Status": None,
                                "Value_of_Credits_Last_Month": None,
                                "Occupation_Code": None,
                                "Settlement_Amount": None,
                                "Value_of_Collateral": None,
                                "Type_of_Collateral": None,
                                "Written_Off_Amt_Total": None,
                                "Written_Off_Amt_Principal": None,
                                "Rate_of_Interest": None,
                                "Repayment_Tenure": "0",
                                "Promotional_Rate_Flag": None,
                                "Income": None,
                                "Income_Indicator": None,
                                "Income_Frequency_Indicator": None,
                                "DefaultStatusDate": None,
                                "LitigationStatusDate": None,
                                "WriteOffStatusDate": None,
                                "DateOfAddition": "20221104",
                                "CurrencyCode": "INR",
                                "Subscriber_comments": None,
                                "Consumer_comments": None,
                                "AccountHoldertypeCode": "3",
                                "CAIS_Account_History": {
                                    "Year": "2022",
                                    "Month": "11",
                                    "Days_Past_Due": "0",
                                    "Asset_Classification": "?"
                                },
                                "CAIS_Holder_Details": [
                                    {
                                        "Surname_Non_Normalized": "NEERAJ",
                                        "First_Name_Non_Normalized": "SHARMA",
                                        "Middle_Name_1_Non_Normalized": None,
                                        "Middle_Name_2_Non_Normalized": None,
                                        "Middle_Name_3_Non_Normalized": None,
                                        "Alias": None,
                                        "Gender_Code": "2",
                                        "Income_TAX_PAN": None,
                                        "Passport_Number": None,
                                        "Voter_ID_Number": None,
                                        "Date_of_birth": "19700101"
                                    },
                                    {
                                        "Surname_Non_Normalized": "NEERAJ SHARMA",
                                        "First_Name_Non_Normalized": None,
                                        "Middle_Name_1_Non_Normalized": None,
                                        "Middle_Name_2_Non_Normalized": None,
                                        "Middle_Name_3_Non_Normalized": None,
                                        "Alias": None,
                                        "Gender_Code": "2",
                                        "Income_TAX_PAN": None,
                                        "Passport_Number": None,
                                        "Voter_ID_Number": None,
                                        "Date_of_birth": "19700101"
                                    }
                                ],
                                "CAIS_Holder_Address_Details": [
                                    {
                                        "First_Line_Of_Address_non_normalized": "37 ASHOKA ENCLAVE MAIN SEC 34 S/O B S SH",
                                        "Second_Line_Of_Address_non_normalized": "ARMA NR ASHOKA ENCLAVE KHWAZA",
                                        "Third_Line_Of_Address_non_normalized": None,
                                        "City_non_normalized": None,
                                        "Fifth_Line_Of_Address_non_normalized": None,
                                        "State_non_normalized": "06",
                                        "ZIP_Postal_Code_non_normalized": "121003",
                                        "CountryCode_non_normalized": "IB",
                                        "Address_indicator_non_normalized": "02",
                                        "Residence_code_non_normalized": "02"
                                    },
                                    {
                                        "First_Line_Of_Address_non_normalized": "SHAMA INTERNATIONAL PVT LTD C 119 OKHLA",
                                        "Second_Line_Of_Address_non_normalized": "INDUSTRIAL AREA PH 1 NR LOGISTIC ESTATE",
                                        "Third_Line_Of_Address_non_normalized": None,
                                        "City_non_normalized": None,
                                        "Fifth_Line_Of_Address_non_normalized": None,
                                        "State_non_normalized": "07",
                                        "ZIP_Postal_Code_non_normalized": "110020",
                                        "CountryCode_non_normalized": "IB",
                                        "Address_indicator_non_normalized": "03",
                                        "Residence_code_non_normalized": "02"
                                    },
                                    {
                                        "First_Line_Of_Address_non_normalized": "37 ASHOKA ENCLAVE MAIN SEC 34 S/O B S SH",
                                        "Second_Line_Of_Address_non_normalized": "ARMA",
                                        "Third_Line_Of_Address_non_normalized": None,
                                        "City_non_normalized": None,
                                        "Fifth_Line_Of_Address_non_normalized": None,
                                        "State_non_normalized": "06",
                                        "ZIP_Postal_Code_non_normalized": "121003",
                                        "CountryCode_non_normalized": "IB",
                                        "Address_indicator_non_normalized": "01",
                                        "Residence_code_non_normalized": "02"
                                    },
                                    {
                                        "First_Line_Of_Address_non_normalized": "SHAMA INTERNATIONAL PVT LTD C 119 OKHLA",
                                        "Second_Line_Of_Address_non_normalized": "NDUSTRIAL AREA PH 1",
                                        "Third_Line_Of_Address_non_normalized": None,
                                        "City_non_normalized": None,
                                        "Fifth_Line_Of_Address_non_normalized": None,
                                        "State_non_normalized": None,
                                        "ZIP_Postal_Code_non_normalized": "110020",
                                        "CountryCode_non_normalized": "IB",
                                        "Address_indicator_non_normalized": "04",
                                        "Residence_code_non_normalized": "02"
                                    },
                                    {
                                        "First_Line_Of_Address_non_normalized": "SHAMA INTERNATIONAL PVT LTD C 119 OKHLA",
                                        "Second_Line_Of_Address_non_normalized": "INDUSTRIAL AREA PH 1 NR LOGISTIC ESTATE",
                                        "Third_Line_Of_Address_non_normalized": None,
                                        "City_non_normalized": None,
                                        "Fifth_Line_Of_Address_non_normalized": None,
                                        "State_non_normalized": None,
                                        "ZIP_Postal_Code_non_normalized": "110020",
                                        "CountryCode_non_normalized": "IB",
                                        "Address_indicator_non_normalized": "04",
                                        "Residence_code_non_normalized": "02"
                                    },
                                    {
                                        "First_Line_Of_Address_non_normalized": "37 ASHOKA ENCLAVE MAIN SEC 34 S/O B S SH",
                                        "Second_Line_Of_Address_non_normalized": "ARMA",
                                        "Third_Line_Of_Address_non_normalized": None,
                                        "City_non_normalized": None,
                                        "Fifth_Line_Of_Address_non_normalized": None,
                                        "State_non_normalized": None,
                                        "ZIP_Postal_Code_non_normalized": "121003",
                                        "CountryCode_non_normalized": "IB",
                                        "Address_indicator_non_normalized": "04",
                                        "Residence_code_non_normalized": "02"
                                    },
                                    {
                                        "First_Line_Of_Address_non_normalized": "37 ASHOKA ENCLAVE MAIN SEC 34 S/O B S SH",
                                        "Second_Line_Of_Address_non_normalized": "ARMA NR ASHOKA ENCLAVE KHWAZA",
                                        "Third_Line_Of_Address_non_normalized": None,
                                        "City_non_normalized": None,
                                        "Fifth_Line_Of_Address_non_normalized": None,
                                        "State_non_normalized": None,
                                        "ZIP_Postal_Code_non_normalized": "121003",
                                        "CountryCode_non_normalized": "IB",
                                        "Address_indicator_non_normalized": "04",
                                        "Residence_code_non_normalized": "02"
                                    },
                                    {
                                        "First_Line_Of_Address_non_normalized": "37 ASHOKA ENCLAVE MAIN SEC 34  B S",
                                        "Second_Line_Of_Address_non_normalized": "SHARMA",
                                        "Third_Line_Of_Address_non_normalized": None,
                                        "City_non_normalized": None,
                                        "Fifth_Line_Of_Address_non_normalized": None,
                                        "State_non_normalized": None,
                                        "ZIP_Postal_Code_non_normalized": "121003",
                                        "CountryCode_non_normalized": "IB",
                                        "Address_indicator_non_normalized": "04",
                                        "Residence_code_non_normalized": "02"
                                    }
                                ],
                                "CAIS_Holder_Phone_Details": [
                                    {
                                        "Telephone_Number": None,
                                        "Telephone_Type": "01",
                                        "Telephone_Extension": None,
                                        "Mobile_Telephone_Number": "9313059033",
                                        "FaxNumber": None,
                                        "EMailId": "ANIL@SHAMA.BIZ"
                                    },
                                    {
                                        "Telephone_Number": "2271604",
                                        "Telephone_Type": "02",
                                        "Telephone_Extension": None,
                                        "Mobile_Telephone_Number": None,
                                        "FaxNumber": None,
                                        "EMailId": "ANIL@SHAMA.BIZ"
                                    },
                                    {
                                        "Telephone_Number": "9313059033",
                                        "Telephone_Type": None,
                                        "Telephone_Extension": None,
                                        "Mobile_Telephone_Number": None,
                                        "FaxNumber": None,
                                        "EMailId": "ANIL@SHAMA.BIZ"
                                    },
                                    {
                                        "Telephone_Number": "129 2271604",
                                        "Telephone_Type": "02",
                                        "Telephone_Extension": None,
                                        "Mobile_Telephone_Number": None,
                                        "FaxNumber": None,
                                        "EMailId": "ANIL@SHAMA.BIZ"
                                    },
                                    {
                                        "Telephone_Number": "1292271604EXT.:",
                                        "Telephone_Type": "00",
                                        "Telephone_Extension": None,
                                        "Mobile_Telephone_Number": None,
                                        "FaxNumber": None,
                                        "EMailId": "ANIL@SHAMA.BIZ"
                                    },
                                    {
                                        "Telephone_Number": "1292271604",
                                        "Telephone_Type": None,
                                        "Telephone_Extension": None,
                                        "Mobile_Telephone_Number": None,
                                        "FaxNumber": None,
                                        "EMailId": "ANIL@SHAMA.BIZ"
                                    }
                                ],
                                "CAIS_Holder_ID_Details": [
                                    {
                                        "Income_TAX_PAN": None,
                                        "PAN_Issue_Date": None,
                                        "PAN_Expiration_Date": None,
                                        "Passport_Number": None,
                                        "Passport_Issue_Date": None,
                                        "Passport_Expiration_Date": None,
                                        "Voter_ID_Number": None,
                                        "Voter_ID_Issue_Date": None,
                                        "Voter_ID_Expiration_Date": None,
                                        "Driver_License_Number": None,
                                        "Driver_License_Issue_Date": None,
                                        "Driver_License_Expiration_Date": None,
                                        "Ration_Card_Number": None,
                                        "Ration_Card_Issue_Date": None,
                                        "Ration_Card_Expiration_Date": None,
                                        "Universal_ID_Number": None,
                                        "Universal_ID_Issue_Date": None,
                                        "Universal_ID_Expiration_Date": None
                                    },
                                    {
                                        "Income_TAX_PAN": None,
                                        "PAN_Issue_Date": None,
                                        "PAN_Expiration_Date": None,
                                        "Passport_Number": None,
                                        "Passport_Issue_Date": None,
                                        "Passport_Expiration_Date": None,
                                        "Voter_ID_Number": None,
                                        "Voter_ID_Issue_Date": None,
                                        "Voter_ID_Expiration_Date": None,
                                        "Driver_License_Number": None,
                                        "Driver_License_Issue_Date": None,
                                        "Driver_License_Expiration_Date": None,
                                        "Ration_Card_Number": None,
                                        "Ration_Card_Issue_Date": None,
                                        "Ration_Card_Expiration_Date": None,
                                        "Universal_ID_Number": None,
                                        "Universal_ID_Issue_Date": None,
                                        "Universal_ID_Expiration_Date": None
                                    }
                                ]
                            },
                            {
                                "Identification_Number": "RURXXXXXXXX",
                                "Subscriber_Name": "XXXXXXXXXX",
                                "Account_Number": "XXXXXXXXXX8410",
                                "Portfolio_Type": None,
                                "Account_Type": None,
                                "Open_Date": "20160629",
                                "Credit_Limit_Amount": None,
                                "Highest_Credit_or_Original_Loan_Amount": "360000",
                                "Terms_Duration": None,
                                "Terms_Frequency": None,
                                "Scheduled_Monthly_Payment_Amount": None,
                                "Account_Status": "21",
                                "Payment_Rating": "S",
                                "Payment_History_Profile": "??SSSSS?SS??????????????????????????",
                                "Special_Comment": None,
                                "Current_Balance": "-9340",
                                "Amount_Past_Due": "0",
                                "Original_Charge_Off_Amount": None,
                                "Date_Reported": "20170531",
                                "Date_of_First_Delinquency": None,
                                "Date_Closed": None,
                                "Date_of_Last_Payment": "20161103",
                                "SuitFiledWillfulDefaultWrittenOffStatus": None,
                                "SuitFiled_WillfulDefault": None,
                                "Written_off_Settled_Status": None,
                                "Value_of_Credits_Last_Month": None,
                                "Occupation_Code": None,
                                "Settlement_Amount": None,
                                "Value_of_Collateral": None,
                                "Type_of_Collateral": None,
                                "Written_Off_Amt_Total": None,
                                "Written_Off_Amt_Principal": None,
                                "Rate_of_Interest": None,
                                "Repayment_Tenure": "0",
                                "Promotional_Rate_Flag": None,
                                "Income": None,
                                "Income_Indicator": None,
                                "Income_Frequency_Indicator": None,
                                "DefaultStatusDate": None,
                                "LitigationStatusDate": None,
                                "WriteOffStatusDate": None,
                                "DateOfAddition": "20160731",
                                "CurrencyCode": "INR",
                                "Subscriber_comments": None,
                                "Consumer_comments": None,
                                "AccountHoldertypeCode": "1",
                                "CAIS_Account_History": [
                                    {
                                        "Year": "2017",
                                        "Month": "05",
                                        "Days_Past_Due": None,
                                        "Asset_Classification": "S"
                                    },
                                    {
                                        "Year": "2017",
                                        "Month": "02",
                                        "Days_Past_Due": None,
                                        "Asset_Classification": "S"
                                    },
                                    {
                                        "Year": "2017",
                                        "Month": "01",
                                        "Days_Past_Due": None,
                                        "Asset_Classification": "S"
                                    },
                                    {
                                        "Year": "2016",
                                        "Month": "12",
                                        "Days_Past_Due": None,
                                        "Asset_Classification": "S"
                                    },
                                    {
                                        "Year": "2016",
                                        "Month": "11",
                                        "Days_Past_Due": None,
                                        "Asset_Classification": "S"
                                    },
                                    {
                                        "Year": "2016",
                                        "Month": "10",
                                        "Days_Past_Due": None,
                                        "Asset_Classification": "S"
                                    },
                                    {
                                        "Year": "2016",
                                        "Month": "08",
                                        "Days_Past_Due": None,
                                        "Asset_Classification": "S"
                                    },
                                    {
                                        "Year": "2016",
                                        "Month": "07",
                                        "Days_Past_Due": None,
                                        "Asset_Classification": "S"
                                    }
                                ],
                                "CAIS_Holder_Details": {
                                    "Surname_Non_Normalized": "NEERAJ SHARMA",
                                    "First_Name_Non_Normalized": None,
                                    "Middle_Name_1_Non_Normalized": None,
                                    "Middle_Name_2_Non_Normalized": None,
                                    "Middle_Name_3_Non_Normalized": None,
                                    "Alias": None,
                                    "Gender_Code": "2",
                                    "Income_TAX_PAN": "CSKPS8762F",
                                    "Passport_Number": None,
                                    "Voter_ID_Number": "HR0651633091",
                                    "Date_of_birth": "19700101"
                                },
                                "CAIS_Holder_Address_Details": {
                                    "First_Line_Of_Address_non_normalized": "37,MAIN ASHOKA ENC.FBD",
                                    "Second_Line_Of_Address_non_normalized": None,
                                    "Third_Line_Of_Address_non_normalized": "..",
                                    "City_non_normalized": None,
                                    "Fifth_Line_Of_Address_non_normalized": None,
                                    "State_non_normalized": "06",
                                    "ZIP_Postal_Code_non_normalized": "121003",
                                    "CountryCode_non_normalized": "IB",
                                    "Address_indicator_non_normalized": "04",
                                    "Residence_code_non_normalized": None
                                },
                                "CAIS_Holder_Phone_Details": {
                                    "Telephone_Number": "832047208942",
                                    "Telephone_Type": "02",
                                    "Telephone_Extension": None,
                                    "Mobile_Telephone_Number": None,
                                    "FaxNumber": None,
                                    "EMailId": None
                                },
                                "CAIS_Holder_ID_Details": {
                                    "Income_TAX_PAN": "CSKPS8762F",
                                    "PAN_Issue_Date": None,
                                    "PAN_Expiration_Date": None,
                                    "Passport_Number": None,
                                    "Passport_Issue_Date": None,
                                    "Passport_Expiration_Date": None,
                                    "Voter_ID_Number": "HR0651633091",
                                    "Voter_ID_Issue_Date": None,
                                    "Voter_ID_Expiration_Date": None,
                                    "Driver_License_Number": None,
                                    "Driver_License_Issue_Date": None,
                                    "Driver_License_Expiration_Date": None,
                                    "Ration_Card_Number": None,
                                    "Ration_Card_Issue_Date": None,
                                    "Ration_Card_Expiration_Date": None,
                                    "Universal_ID_Number": None,
                                    "Universal_ID_Issue_Date": None,
                                    "Universal_ID_Expiration_Date": None,
                                    "EMailId": None
                                }
                            },
                            {
                                "Identification_Number": "RURXXXXXXXX",
                                "Subscriber_Name": "XXXXXXXXXX",
                                "Account_Number": "XXXXXXXXXX0154",
                                "Portfolio_Type": "I",
                                "Account_Type": "12",
                                "Open_Date": "20190918",
                                "Credit_Limit_Amount": None,
                                "Highest_Credit_or_Original_Loan_Amount": "2500000",
                                "Terms_Duration": None,
                                "Terms_Frequency": None,
                                "Scheduled_Monthly_Payment_Amount": None,
                                "Account_Status": "21",
                                "Payment_Rating": "S",
                                "Payment_History_Profile": "SSSSSSSSSSSSSSSSSS??SSS?SS?S????????",
                                "Special_Comment": None,
                                "Current_Balance": "8020",
                                "Amount_Past_Due": "0",
                                "Original_Charge_Off_Amount": None,
                                "Date_Reported": "20260131",
                                "Date_of_First_Delinquency": None,
                                "Date_Closed": None,
                                "Date_of_Last_Payment": "20260120",
                                "SuitFiledWillfulDefaultWrittenOffStatus": None,
                                "SuitFiled_WillfulDefault": "00",
                                "Written_off_Settled_Status": None,
                                "Value_of_Credits_Last_Month": None,
                                "Occupation_Code": None,
                                "Settlement_Amount": None,
                                "Value_of_Collateral": None,
                                "Type_of_Collateral": None,
                                "Written_Off_Amt_Total": None,
                                "Written_Off_Amt_Principal": None,
                                "Rate_of_Interest": None,
                                "Repayment_Tenure": "0",
                                "Promotional_Rate_Flag": None,
                                "Income": None,
                                "Income_Indicator": None,
                                "Income_Frequency_Indicator": None,
                                "DefaultStatusDate": None,
                                "LitigationStatusDate": None,
                                "WriteOffStatusDate": None,
                                "DateOfAddition": "20230930",
                                "CurrencyCode": "INR",
                                "Subscriber_comments": None,
                                "Consumer_comments": None,
                                "AccountHoldertypeCode": "1",
                                "CAIS_Account_History": [
                                    {
                                        "Year": "2026",
                                        "Month": "01",
                                        "Days_Past_Due": None,
                                        "Asset_Classification": "S"
                                    },
                                    {
                                        "Year": "2025",
                                        "Month": "12",
                                        "Days_Past_Due": None,
                                        "Asset_Classification": "S"
                                    },
                                    {
                                        "Year": "2025",
                                        "Month": "11",
                                        "Days_Past_Due": None,
                                        "Asset_Classification": "S"
                                    },
                                    {
                                        "Year": "2025",
                                        "Month": "10",
                                        "Days_Past_Due": None,
                                        "Asset_Classification": "S"
                                    },
                                    {
                                        "Year": "2025",
                                        "Month": "09",
                                        "Days_Past_Due": None,
                                        "Asset_Classification": "S"
                                    },
                                    {
                                        "Year": "2025",
                                        "Month": "08",
                                        "Days_Past_Due": None,
                                        "Asset_Classification": "S"
                                    },
                                    {
                                        "Year": "2025",
                                        "Month": "07",
                                        "Days_Past_Due": None,
                                        "Asset_Classification": "S"
                                    },
                                    {
                                        "Year": "2025",
                                        "Month": "06",
                                        "Days_Past_Due": None,
                                        "Asset_Classification": "S"
                                    },
                                    {
                                        "Year": "2025",
                                        "Month": "05",
                                        "Days_Past_Due": None,
                                        "Asset_Classification": "S"
                                    },
                                    {
                                        "Year": "2025",
                                        "Month": "04",
                                        "Days_Past_Due": None,
                                        "Asset_Classification": "S"
                                    },
                                    {
                                        "Year": "2025",
                                        "Month": "03",
                                        "Days_Past_Due": None,
                                        "Asset_Classification": "S"
                                    },
                                    {
                                        "Year": "2025",
                                        "Month": "02",
                                        "Days_Past_Due": None,
                                        "Asset_Classification": "S"
                                    },
                                    {
                                        "Year": "2025",
                                        "Month": "01",
                                        "Days_Past_Due": None,
                                        "Asset_Classification": "S"
                                    },
                                    {
                                        "Year": "2024",
                                        "Month": "12",
                                        "Days_Past_Due": None,
                                        "Asset_Classification": "S"
                                    },
                                    {
                                        "Year": "2024",
                                        "Month": "11",
                                        "Days_Past_Due": None,
                                        "Asset_Classification": "S"
                                    },
                                    {
                                        "Year": "2024",
                                        "Month": "10",
                                        "Days_Past_Due": None,
                                        "Asset_Classification": "S"
                                    },
                                    {
                                        "Year": "2024",
                                        "Month": "09",
                                        "Days_Past_Due": None,
                                        "Asset_Classification": "S"
                                    },
                                    {
                                        "Year": "2024",
                                        "Month": "08",
                                        "Days_Past_Due": None,
                                        "Asset_Classification": "S"
                                    },
                                    {
                                        "Year": "2024",
                                        "Month": "07",
                                        "Days_Past_Due": None,
                                        "Asset_Classification": "S"
                                    },
                                    {
                                        "Year": "2024",
                                        "Month": "04",
                                        "Days_Past_Due": None,
                                        "Asset_Classification": "S"
                                    },
                                    {
                                        "Year": "2024",
                                        "Month": "03",
                                        "Days_Past_Due": None,
                                        "Asset_Classification": "S"
                                    },
                                    {
                                        "Year": "2024",
                                        "Month": "02",
                                        "Days_Past_Due": None,
                                        "Asset_Classification": "S"
                                    },
                                    {
                                        "Year": "2023",
                                        "Month": "12",
                                        "Days_Past_Due": None,
                                        "Asset_Classification": "S"
                                    },
                                    {
                                        "Year": "2023",
                                        "Month": "11",
                                        "Days_Past_Due": None,
                                        "Asset_Classification": "S"
                                    },
                                    {
                                        "Year": "2023",
                                        "Month": "09",
                                        "Days_Past_Due": None,
                                        "Asset_Classification": "S"
                                    }
                                ],
                                "CAIS_Holder_Details": {
                                    "Surname_Non_Normalized": "NEERAJ SHARMA WO ANIL",
                                    "First_Name_Non_Normalized": "SHARMA",
                                    "Middle_Name_1_Non_Normalized": None,
                                    "Middle_Name_2_Non_Normalized": None,
                                    "Middle_Name_3_Non_Normalized": None,
                                    "Alias": None,
                                    "Gender_Code": "2",
                                    "Income_TAX_PAN": "CSKPS8762F",
                                    "Passport_Number": None,
                                    "Voter_ID_Number": None,
                                    "Date_of_birth": "19700101"
                                },
                                "CAIS_Holder_Address_Details": {
                                    "First_Line_Of_Address_non_normalized": "37,MAIN ASHOKA ENC.FBDSEC 35",
                                    "Second_Line_Of_Address_non_normalized": "NA",
                                    "Third_Line_Of_Address_non_normalized": "NA",
                                    "City_non_normalized": "NA",
                                    "Fifth_Line_Of_Address_non_normalized": None,
                                    "State_non_normalized": "06",
                                    "ZIP_Postal_Code_non_normalized": "121003",
                                    "CountryCode_non_normalized": "IB",
                                    "Address_indicator_non_normalized": "01",
                                    "Residence_code_non_normalized": None
                                },
                                "CAIS_Holder_Phone_Details": {
                                    "Telephone_Number": None,
                                    "Telephone_Type": "01",
                                    "Telephone_Extension": None,
                                    "Mobile_Telephone_Number": "917838485344",
                                    "FaxNumber": None,
                                    "EMailId": None
                                },
                                "CAIS_Holder_ID_Details": [
                                    {
                                        "Income_TAX_PAN": "CSKPS8762F",
                                        "PAN_Issue_Date": None,
                                        "PAN_Expiration_Date": None,
                                        "Passport_Number": None,
                                        "Passport_Issue_Date": None,
                                        "Passport_Expiration_Date": None,
                                        "Voter_ID_Number": None,
                                        "Voter_ID_Issue_Date": None,
                                        "Voter_ID_Expiration_Date": None,
                                        "Driver_License_Number": None,
                                        "Driver_License_Issue_Date": None,
                                        "Driver_License_Expiration_Date": None,
                                        "Ration_Card_Number": None,
                                        "Ration_Card_Issue_Date": None,
                                        "Ration_Card_Expiration_Date": None,
                                        "Universal_ID_Number": None,
                                        "Universal_ID_Issue_Date": None,
                                        "Universal_ID_Expiration_Date": None,
                                        "EMailId": None
                                    },
                                    {
                                        "Income_TAX_PAN": "CSKPS8762F",
                                        "PAN_Issue_Date": None,
                                        "PAN_Expiration_Date": None,
                                        "Passport_Number": None,
                                        "Passport_Issue_Date": None,
                                        "Passport_Expiration_Date": None,
                                        "Voter_ID_Number": None,
                                        "Voter_ID_Issue_Date": None,
                                        "Voter_ID_Expiration_Date": None,
                                        "Driver_License_Number": None,
                                        "Driver_License_Issue_Date": None,
                                        "Driver_License_Expiration_Date": None,
                                        "Ration_Card_Number": None,
                                        "Ration_Card_Issue_Date": None,
                                        "Ration_Card_Expiration_Date": None,
                                        "Universal_ID_Number": None,
                                        "Universal_ID_Issue_Date": None,
                                        "Universal_ID_Expiration_Date": None,
                                        "EMailId": None
                                    }
                                ]
                            },
                            {
                                "Identification_Number": "RURXXXXXXXX",
                                "Subscriber_Name": "XXXXXXXXXX",
                                "Account_Number": "XXXXXXXXXX7509",
                                "Portfolio_Type": "M",
                                "Account_Type": "02",
                                "Open_Date": "20190830",
                                "Credit_Limit_Amount": None,
                                "Highest_Credit_or_Original_Loan_Amount": "240000",
                                "Terms_Duration": None,
                                "Terms_Frequency": None,
                                "Scheduled_Monthly_Payment_Amount": None,
                                "Account_Status": "21",
                                "Payment_Rating": "S",
                                "Payment_History_Profile": "N",
                                "Special_Comment": None,
                                "Current_Balance": "168123",
                                "Amount_Past_Due": "0",
                                "Original_Charge_Off_Amount": None,
                                "Date_Reported": "20211201",
                                "Date_of_First_Delinquency": None,
                                "Date_Closed": None,
                                "Date_of_Last_Payment": "20210728",
                                "SuitFiledWillfulDefaultWrittenOffStatus": None,
                                "SuitFiled_WillfulDefault": "00",
                                "Written_off_Settled_Status": None,
                                "Value_of_Credits_Last_Month": None,
                                "Occupation_Code": None,
                                "Settlement_Amount": None,
                                "Value_of_Collateral": None,
                                "Type_of_Collateral": None,
                                "Written_Off_Amt_Total": None,
                                "Written_Off_Amt_Principal": None,
                                "Rate_of_Interest": None,
                                "Repayment_Tenure": "0",
                                "Promotional_Rate_Flag": None,
                                "Income": None,
                                "Income_Indicator": None,
                                "Income_Frequency_Indicator": None,
                                "DefaultStatusDate": None,
                                "LitigationStatusDate": None,
                                "WriteOffStatusDate": None,
                                "DateOfAddition": "20211201",
                                "CurrencyCode": "INR",
                                "Subscriber_comments": None,
                                "Consumer_comments": None,
                                "AccountHoldertypeCode": "1",
                                "CAIS_Account_History": {
                                    "Year": "2021",
                                    "Month": "12",
                                    "Days_Past_Due": None,
                                    "Asset_Classification": "S"
                                },
                                "CAIS_Holder_Details": {
                                    "Surname_Non_Normalized": "NEERAJ SHARMA WO ANIL",
                                    "First_Name_Non_Normalized": "SHARMA",
                                    "Middle_Name_1_Non_Normalized": None,
                                    "Middle_Name_2_Non_Normalized": None,
                                    "Middle_Name_3_Non_Normalized": None,
                                    "Alias": None,
                                    "Gender_Code": "2",
                                    "Income_TAX_PAN": "CSKPS8762F",
                                    "Passport_Number": None,
                                    "Voter_ID_Number": None,
                                    "Date_of_birth": "19700101"
                                },
                                "CAIS_Holder_Address_Details": {
                                    "First_Line_Of_Address_non_normalized": "37,MAIN ASHOKA ENC.FBDSEC 35",
                                    "Second_Line_Of_Address_non_normalized": "NA",
                                    "Third_Line_Of_Address_non_normalized": "NA",
                                    "City_non_normalized": "NA",
                                    "Fifth_Line_Of_Address_non_normalized": None,
                                    "State_non_normalized": "06",
                                    "ZIP_Postal_Code_non_normalized": "121003",
                                    "CountryCode_non_normalized": "IB",
                                    "Address_indicator_non_normalized": "01",
                                    "Residence_code_non_normalized": None
                                },
                                "CAIS_Holder_Phone_Details": {
                                    "Telephone_Number": None,
                                    "Telephone_Type": "01",
                                    "Telephone_Extension": None,
                                    "Mobile_Telephone_Number": "917838485344",
                                    "FaxNumber": None,
                                    "EMailId": None
                                },
                                "CAIS_Holder_ID_Details": [
                                    {
                                        "Income_TAX_PAN": "CSKPS8762F",
                                        "PAN_Issue_Date": None,
                                        "PAN_Expiration_Date": None,
                                        "Passport_Number": None,
                                        "Passport_Issue_Date": None,
                                        "Passport_Expiration_Date": None,
                                        "Voter_ID_Number": None,
                                        "Voter_ID_Issue_Date": None,
                                        "Voter_ID_Expiration_Date": None,
                                        "Driver_License_Number": None,
                                        "Driver_License_Issue_Date": None,
                                        "Driver_License_Expiration_Date": None,
                                        "Ration_Card_Number": None,
                                        "Ration_Card_Issue_Date": None,
                                        "Ration_Card_Expiration_Date": None,
                                        "Universal_ID_Number": None,
                                        "Universal_ID_Issue_Date": None,
                                        "Universal_ID_Expiration_Date": None,
                                        "EMailId": None
                                    },
                                    {
                                        "Income_TAX_PAN": "CSKPS8762F",
                                        "PAN_Issue_Date": None,
                                        "PAN_Expiration_Date": None,
                                        "Passport_Number": None,
                                        "Passport_Issue_Date": None,
                                        "Passport_Expiration_Date": None,
                                        "Voter_ID_Number": None,
                                        "Voter_ID_Issue_Date": None,
                                        "Voter_ID_Expiration_Date": None,
                                        "Driver_License_Number": None,
                                        "Driver_License_Issue_Date": None,
                                        "Driver_License_Expiration_Date": None,
                                        "Ration_Card_Number": None,
                                        "Ration_Card_Issue_Date": None,
                                        "Ration_Card_Expiration_Date": None,
                                        "Universal_ID_Number": None,
                                        "Universal_ID_Issue_Date": None,
                                        "Universal_ID_Expiration_Date": None,
                                        "EMailId": None
                                    }
                                ]
                            },
                            {
                                "Identification_Number": "RURXXXXXXXX",
                                "Subscriber_Name": "XXXXXXXXXX",
                                "Account_Number": "XXXXXXXXXX9710",
                                "Portfolio_Type": "I",
                                "Account_Type": "03",
                                "Open_Date": "20221027",
                                "Credit_Limit_Amount": None,
                                "Highest_Credit_or_Original_Loan_Amount": "0",
                                "Terms_Duration": None,
                                "Terms_Frequency": None,
                                "Scheduled_Monthly_Payment_Amount": None,
                                "Account_Status": "15",
                                "Payment_Rating": "S",
                                "Payment_History_Profile": "S?SS?S?S????????????????????????????",
                                "Special_Comment": None,
                                "Current_Balance": "0",
                                "Amount_Past_Due": "0",
                                "Original_Charge_Off_Amount": None,
                                "Date_Reported": "20240331",
                                "Date_of_First_Delinquency": None,
                                "Date_Closed": "20240330",
                                "Date_of_Last_Payment": "20240330",
                                "SuitFiledWillfulDefaultWrittenOffStatus": None,
                                "SuitFiled_WillfulDefault": "00",
                                "Written_off_Settled_Status": None,
                                "Value_of_Credits_Last_Month": None,
                                "Occupation_Code": None,
                                "Settlement_Amount": None,
                                "Value_of_Collateral": None,
                                "Type_of_Collateral": None,
                                "Written_Off_Amt_Total": None,
                                "Written_Off_Amt_Principal": None,
                                "Rate_of_Interest": None,
                                "Repayment_Tenure": "0",
                                "Promotional_Rate_Flag": None,
                                "Income": None,
                                "Income_Indicator": None,
                                "Income_Frequency_Indicator": None,
                                "DefaultStatusDate": None,
                                "LitigationStatusDate": None,
                                "WriteOffStatusDate": None,
                                "DateOfAddition": "20230731",
                                "CurrencyCode": "INR",
                                "Subscriber_comments": None,
                                "Consumer_comments": None,
                                "AccountHoldertypeCode": "1",
                                "CAIS_Account_History": [
                                    {
                                        "Year": "2024",
                                        "Month": "03",
                                        "Days_Past_Due": None,
                                        "Asset_Classification": "S"
                                    },
                                    {
                                        "Year": "2024",
                                        "Month": "02",
                                        "Days_Past_Due": None,
                                        "Asset_Classification": "S"
                                    },
                                    {
                                        "Year": "2023",
                                        "Month": "12",
                                        "Days_Past_Due": None,
                                        "Asset_Classification": "S"
                                    },
                                    {
                                        "Year": "2023",
                                        "Month": "11",
                                        "Days_Past_Due": None,
                                        "Asset_Classification": "S"
                                    },
                                    {
                                        "Year": "2023",
                                        "Month": "09",
                                        "Days_Past_Due": None,
                                        "Asset_Classification": "S"
                                    },
                                    {
                                        "Year": "2023",
                                        "Month": "07",
                                        "Days_Past_Due": None,
                                        "Asset_Classification": "S"
                                    }
                                ],
                                "CAIS_Holder_Details": {
                                    "Surname_Non_Normalized": "NEERAJ SHARMA WO ANIL",
                                    "First_Name_Non_Normalized": "SHARMA",
                                    "Middle_Name_1_Non_Normalized": None,
                                    "Middle_Name_2_Non_Normalized": None,
                                    "Middle_Name_3_Non_Normalized": None,
                                    "Alias": None,
                                    "Gender_Code": "2",
                                    "Income_TAX_PAN": "CSKPS8762F",
                                    "Passport_Number": None,
                                    "Voter_ID_Number": None,
                                    "Date_of_birth": "19700101"
                                },
                                "CAIS_Holder_Address_Details": {
                                    "First_Line_Of_Address_non_normalized": "37,MAIN ASHOKA ENC.FBDSEC 35",
                                    "Second_Line_Of_Address_non_normalized": "NA",
                                    "Third_Line_Of_Address_non_normalized": "NA",
                                    "City_non_normalized": "NA",
                                    "Fifth_Line_Of_Address_non_normalized": None,
                                    "State_non_normalized": "06",
                                    "ZIP_Postal_Code_non_normalized": "121003",
                                    "CountryCode_non_normalized": "IB",
                                    "Address_indicator_non_normalized": "01",
                                    "Residence_code_non_normalized": None
                                },
                                "CAIS_Holder_Phone_Details": {
                                    "Telephone_Number": None,
                                    "Telephone_Type": "01",
                                    "Telephone_Extension": None,
                                    "Mobile_Telephone_Number": "917838485344",
                                    "FaxNumber": None,
                                    "EMailId": None
                                },
                                "CAIS_Holder_ID_Details": [
                                    {
                                        "Income_TAX_PAN": "CSKPS8762F",
                                        "PAN_Issue_Date": None,
                                        "PAN_Expiration_Date": None,
                                        "Passport_Number": None,
                                        "Passport_Issue_Date": None,
                                        "Passport_Expiration_Date": None,
                                        "Voter_ID_Number": None,
                                        "Voter_ID_Issue_Date": None,
                                        "Voter_ID_Expiration_Date": None,
                                        "Driver_License_Number": None,
                                        "Driver_License_Issue_Date": None,
                                        "Driver_License_Expiration_Date": None,
                                        "Ration_Card_Number": None,
                                        "Ration_Card_Issue_Date": None,
                                        "Ration_Card_Expiration_Date": None,
                                        "Universal_ID_Number": None,
                                        "Universal_ID_Issue_Date": None,
                                        "Universal_ID_Expiration_Date": None,
                                        "EMailId": None
                                    },
                                    {
                                        "Income_TAX_PAN": "CSKPS8762F",
                                        "PAN_Issue_Date": None,
                                        "PAN_Expiration_Date": None,
                                        "Passport_Number": None,
                                        "Passport_Issue_Date": None,
                                        "Passport_Expiration_Date": None,
                                        "Voter_ID_Number": None,
                                        "Voter_ID_Issue_Date": None,
                                        "Voter_ID_Expiration_Date": None,
                                        "Driver_License_Number": None,
                                        "Driver_License_Issue_Date": None,
                                        "Driver_License_Expiration_Date": None,
                                        "Ration_Card_Number": None,
                                        "Ration_Card_Issue_Date": None,
                                        "Ration_Card_Expiration_Date": None,
                                        "Universal_ID_Number": None,
                                        "Universal_ID_Issue_Date": None,
                                        "Universal_ID_Expiration_Date": None,
                                        "EMailId": None
                                    },
                                    {
                                        "Income_TAX_PAN": "CSKPS8762F",
                                        "PAN_Issue_Date": None,
                                        "PAN_Expiration_Date": None,
                                        "Passport_Number": None,
                                        "Passport_Issue_Date": None,
                                        "Passport_Expiration_Date": None,
                                        "Voter_ID_Number": None,
                                        "Voter_ID_Issue_Date": None,
                                        "Voter_ID_Expiration_Date": None,
                                        "Driver_License_Number": None,
                                        "Driver_License_Issue_Date": None,
                                        "Driver_License_Expiration_Date": None,
                                        "Ration_Card_Number": None,
                                        "Ration_Card_Issue_Date": None,
                                        "Ration_Card_Expiration_Date": None,
                                        "Universal_ID_Number": None,
                                        "Universal_ID_Issue_Date": None,
                                        "Universal_ID_Expiration_Date": None,
                                        "EMailId": None
                                    }
                                ]
                            },
                            {
                                "Identification_Number": "RURXXXXXXXX",
                                "Subscriber_Name": "XXXXXXXXXX",
                                "Account_Number": "XXXXXXXXXX8023",
                                "Portfolio_Type": "M",
                                "Account_Type": "02",
                                "Open_Date": "20240328",
                                "Credit_Limit_Amount": None,
                                "Highest_Credit_or_Original_Loan_Amount": "0",
                                "Terms_Duration": None,
                                "Terms_Frequency": None,
                                "Scheduled_Monthly_Payment_Amount": None,
                                "Account_Status": "15",
                                "Payment_Rating": "S",
                                "Payment_History_Profile": "SSSS??S?????????????????????????????",
                                "Special_Comment": None,
                                "Current_Balance": "0",
                                "Amount_Past_Due": None,
                                "Original_Charge_Off_Amount": None,
                                "Date_Reported": "20241115",
                                "Date_of_First_Delinquency": None,
                                "Date_Closed": "20241102",
                                "Date_of_Last_Payment": "20241102",
                                "SuitFiledWillfulDefaultWrittenOffStatus": None,
                                "SuitFiled_WillfulDefault": "00",
                                "Written_off_Settled_Status": None,
                                "Value_of_Credits_Last_Month": None,
                                "Occupation_Code": None,
                                "Settlement_Amount": None,
                                "Value_of_Collateral": None,
                                "Type_of_Collateral": None,
                                "Written_Off_Amt_Total": None,
                                "Written_Off_Amt_Principal": None,
                                "Rate_of_Interest": None,
                                "Repayment_Tenure": "0",
                                "Promotional_Rate_Flag": None,
                                "Income": None,
                                "Income_Indicator": None,
                                "Income_Frequency_Indicator": None,
                                "DefaultStatusDate": None,
                                "LitigationStatusDate": None,
                                "WriteOffStatusDate": None,
                                "DateOfAddition": "20240430",
                                "CurrencyCode": "INR",
                                "Subscriber_comments": None,
                                "Consumer_comments": None,
                                "AccountHoldertypeCode": "1",
                                "CAIS_Account_History": [
                                    {
                                        "Year": "2024",
                                        "Month": "11",
                                        "Days_Past_Due": None,
                                        "Asset_Classification": "S"
                                    },
                                    {
                                        "Year": "2024",
                                        "Month": "10",
                                        "Days_Past_Due": None,
                                        "Asset_Classification": "S"
                                    },
                                    {
                                        "Year": "2024",
                                        "Month": "09",
                                        "Days_Past_Due": None,
                                        "Asset_Classification": "S"
                                    },
                                    {
                                        "Year": "2024",
                                        "Month": "08",
                                        "Days_Past_Due": None,
                                        "Asset_Classification": "S"
                                    },
                                    {
                                        "Year": "2024",
                                        "Month": "07",
                                        "Days_Past_Due": None,
                                        "Asset_Classification": "S"
                                    },
                                    {
                                        "Year": "2024",
                                        "Month": "04",
                                        "Days_Past_Due": None,
                                        "Asset_Classification": "S"
                                    }
                                ],
                                "CAIS_Holder_Details": {
                                    "Surname_Non_Normalized": "NEERAJ SHARMA WO ANIL",
                                    "First_Name_Non_Normalized": "SHARMA",
                                    "Middle_Name_1_Non_Normalized": None,
                                    "Middle_Name_2_Non_Normalized": None,
                                    "Middle_Name_3_Non_Normalized": None,
                                    "Alias": None,
                                    "Gender_Code": "2",
                                    "Income_TAX_PAN": "CSKPS8762F",
                                    "Passport_Number": None,
                                    "Voter_ID_Number": None,
                                    "Date_of_birth": "19700101"
                                },
                                "CAIS_Holder_Address_Details": {
                                    "First_Line_Of_Address_non_normalized": "37,MAIN ASHOKA ENC.FBDSEC 35",
                                    "Second_Line_Of_Address_non_normalized": "NA",
                                    "Third_Line_Of_Address_non_normalized": "NA",
                                    "City_non_normalized": "NA",
                                    "Fifth_Line_Of_Address_non_normalized": None,
                                    "State_non_normalized": "06",
                                    "ZIP_Postal_Code_non_normalized": "121003",
                                    "CountryCode_non_normalized": "IB",
                                    "Address_indicator_non_normalized": "01",
                                    "Residence_code_non_normalized": None
                                },
                                "CAIS_Holder_Phone_Details": {
                                    "Telephone_Number": None,
                                    "Telephone_Type": "01",
                                    "Telephone_Extension": None,
                                    "Mobile_Telephone_Number": "917838485344",
                                    "FaxNumber": None,
                                    "EMailId": None
                                },
                                "CAIS_Holder_ID_Details": [
                                    {
                                        "Income_TAX_PAN": "CSKPS8762F",
                                        "PAN_Issue_Date": None,
                                        "PAN_Expiration_Date": None,
                                        "Passport_Number": None,
                                        "Passport_Issue_Date": None,
                                        "Passport_Expiration_Date": None,
                                        "Voter_ID_Number": None,
                                        "Voter_ID_Issue_Date": None,
                                        "Voter_ID_Expiration_Date": None,
                                        "Driver_License_Number": None,
                                        "Driver_License_Issue_Date": None,
                                        "Driver_License_Expiration_Date": None,
                                        "Ration_Card_Number": None,
                                        "Ration_Card_Issue_Date": None,
                                        "Ration_Card_Expiration_Date": None,
                                        "Universal_ID_Number": None,
                                        "Universal_ID_Issue_Date": None,
                                        "Universal_ID_Expiration_Date": None,
                                        "EMailId": None
                                    },
                                    {
                                        "Income_TAX_PAN": "CSKPS8762F",
                                        "PAN_Issue_Date": None,
                                        "PAN_Expiration_Date": None,
                                        "Passport_Number": None,
                                        "Passport_Issue_Date": None,
                                        "Passport_Expiration_Date": None,
                                        "Voter_ID_Number": None,
                                        "Voter_ID_Issue_Date": None,
                                        "Voter_ID_Expiration_Date": None,
                                        "Driver_License_Number": None,
                                        "Driver_License_Issue_Date": None,
                                        "Driver_License_Expiration_Date": None,
                                        "Ration_Card_Number": None,
                                        "Ration_Card_Issue_Date": None,
                                        "Ration_Card_Expiration_Date": None,
                                        "Universal_ID_Number": None,
                                        "Universal_ID_Issue_Date": None,
                                        "Universal_ID_Expiration_Date": None,
                                        "EMailId": None
                                    }
                                ]
                            },
                            {
                                "Identification_Number": "RURXXXXXXXX",
                                "Subscriber_Name": "XXXXXXXXXX",
                                "Account_Number": "XXXXXXXXXX0051",
                                "Portfolio_Type": "M",
                                "Account_Type": "02",
                                "Open_Date": "20240330",
                                "Credit_Limit_Amount": None,
                                "Highest_Credit_or_Original_Loan_Amount": "3950000",
                                "Terms_Duration": None,
                                "Terms_Frequency": None,
                                "Scheduled_Monthly_Payment_Amount": None,
                                "Account_Status": "21",
                                "Payment_Rating": "S",
                                "Payment_History_Profile": "SS0S100000SSSSSSSS??S???????????????",
                                "Special_Comment": None,
                                "Current_Balance": "3662923",
                                "Amount_Past_Due": "0",
                                "Original_Charge_Off_Amount": None,
                                "Date_Reported": "20260131",
                                "Date_of_First_Delinquency": None,
                                "Date_Closed": None,
                                "Date_of_Last_Payment": "20251113",
                                "SuitFiledWillfulDefaultWrittenOffStatus": None,
                                "SuitFiled_WillfulDefault": "00",
                                "Written_off_Settled_Status": None,
                                "Value_of_Credits_Last_Month": None,
                                "Occupation_Code": None,
                                "Settlement_Amount": None,
                                "Value_of_Collateral": None,
                                "Type_of_Collateral": None,
                                "Written_Off_Amt_Total": None,
                                "Written_Off_Amt_Principal": None,
                                "Rate_of_Interest": None,
                                "Repayment_Tenure": "0",
                                "Promotional_Rate_Flag": None,
                                "Income": None,
                                "Income_Indicator": None,
                                "Income_Frequency_Indicator": None,
                                "DefaultStatusDate": None,
                                "LitigationStatusDate": None,
                                "WriteOffStatusDate": None,
                                "DateOfAddition": "20240430",
                                "CurrencyCode": "INR",
                                "Subscriber_comments": None,
                                "Consumer_comments": None,
                                "AccountHoldertypeCode": "1",
                                "CAIS_Account_History": [
                                    {
                                        "Year": "2026",
                                        "Month": "01",
                                        "Days_Past_Due": None,
                                        "Asset_Classification": "S"
                                    },
                                    {
                                        "Year": "2025",
                                        "Month": "12",
                                        "Days_Past_Due": None,
                                        "Asset_Classification": "S"
                                    },
                                    {
                                        "Year": "2025",
                                        "Month": "11",
                                        "Days_Past_Due": None,
                                        "Asset_Classification": "S"
                                    },
                                    {
                                        "Year": "2025",
                                        "Month": "10",
                                        "Days_Past_Due": "1",
                                        "Asset_Classification": "?"
                                    },
                                    {
                                        "Year": "2025",
                                        "Month": "09",
                                        "Days_Past_Due": None,
                                        "Asset_Classification": "S"
                                    },
                                    {
                                        "Year": "2025",
                                        "Month": "08",
                                        "Days_Past_Due": "32",
                                        "Asset_Classification": "?"
                                    },
                                    {
                                        "Year": "2025",
                                        "Month": "07",
                                        "Days_Past_Due": "1",
                                        "Asset_Classification": "?"
                                    },
                                    {
                                        "Year": "2025",
                                        "Month": "06",
                                        "Days_Past_Due": "1",
                                        "Asset_Classification": "?"
                                    },
                                    {
                                        "Year": "2025",
                                        "Month": "05",
                                        "Days_Past_Due": "1",
                                        "Asset_Classification": "?"
                                    },
                                    {
                                        "Year": "2025",
                                        "Month": "04",
                                        "Days_Past_Due": "1",
                                        "Asset_Classification": "?"
                                    },
                                    {
                                        "Year": "2025",
                                        "Month": "03",
                                        "Days_Past_Due": "2",
                                        "Asset_Classification": "?"
                                    },
                                    {
                                        "Year": "2025",
                                        "Month": "02",
                                        "Days_Past_Due": None,
                                        "Asset_Classification": "S"
                                    },
                                    {
                                        "Year": "2025",
                                        "Month": "01",
                                        "Days_Past_Due": None,
                                        "Asset_Classification": "S"
                                    },
                                    {
                                        "Year": "2024",
                                        "Month": "12",
                                        "Days_Past_Due": None,
                                        "Asset_Classification": "S"
                                    },
                                    {
                                        "Year": "2024",
                                        "Month": "11",
                                        "Days_Past_Due": None,
                                        "Asset_Classification": "S"
                                    },
                                    {
                                        "Year": "2024",
                                        "Month": "10",
                                        "Days_Past_Due": None,
                                        "Asset_Classification": "S"
                                    },
                                    {
                                        "Year": "2024",
                                        "Month": "09",
                                        "Days_Past_Due": None,
                                        "Asset_Classification": "S"
                                    },
                                    {
                                        "Year": "2024",
                                        "Month": "08",
                                        "Days_Past_Due": None,
                                        "Asset_Classification": "S"
                                    },
                                    {
                                        "Year": "2024",
                                        "Month": "07",
                                        "Days_Past_Due": None,
                                        "Asset_Classification": "S"
                                    },
                                    {
                                        "Year": "2024",
                                        "Month": "04",
                                        "Days_Past_Due": None,
                                        "Asset_Classification": "S"
                                    }
                                ],
                                "CAIS_Holder_Details": {
                                    "Surname_Non_Normalized": "NEERAJ SHARMA WO ANIL",
                                    "First_Name_Non_Normalized": "SHARMA",
                                    "Middle_Name_1_Non_Normalized": None,
                                    "Middle_Name_2_Non_Normalized": None,
                                    "Middle_Name_3_Non_Normalized": None,
                                    "Alias": None,
                                    "Gender_Code": "2",
                                    "Income_TAX_PAN": "CSKPS8762F",
                                    "Passport_Number": None,
                                    "Voter_ID_Number": None,
                                    "Date_of_birth": "19700101"
                                },
                                "CAIS_Holder_Address_Details": {
                                    "First_Line_Of_Address_non_normalized": "37,MAIN ASHOKA ENC.FBDSEC 35",
                                    "Second_Line_Of_Address_non_normalized": "NA",
                                    "Third_Line_Of_Address_non_normalized": "NA",
                                    "City_non_normalized": "NA",
                                    "Fifth_Line_Of_Address_non_normalized": None,
                                    "State_non_normalized": "06",
                                    "ZIP_Postal_Code_non_normalized": "121003",
                                    "CountryCode_non_normalized": "IB",
                                    "Address_indicator_non_normalized": "01",
                                    "Residence_code_non_normalized": None
                                },
                                "CAIS_Holder_Phone_Details": [
                                    {
                                        "Telephone_Number": None,
                                        "Telephone_Type": "01",
                                        "Telephone_Extension": None,
                                        "Mobile_Telephone_Number": "7838485344",
                                        "FaxNumber": None,
                                        "EMailId": None
                                    },
                                    {
                                        "Telephone_Number": None,
                                        "Telephone_Type": "01",
                                        "Telephone_Extension": None,
                                        "Mobile_Telephone_Number": "917838485344",
                                        "FaxNumber": None,
                                        "EMailId": None
                                    }
                                ],
                                "CAIS_Holder_ID_Details": [
                                    {
                                        "Income_TAX_PAN": "CSKPS8762F",
                                        "PAN_Issue_Date": None,
                                        "PAN_Expiration_Date": None,
                                        "Passport_Number": None,
                                        "Passport_Issue_Date": None,
                                        "Passport_Expiration_Date": None,
                                        "Voter_ID_Number": None,
                                        "Voter_ID_Issue_Date": None,
                                        "Voter_ID_Expiration_Date": None,
                                        "Driver_License_Number": None,
                                        "Driver_License_Issue_Date": None,
                                        "Driver_License_Expiration_Date": None,
                                        "Ration_Card_Number": None,
                                        "Ration_Card_Issue_Date": None,
                                        "Ration_Card_Expiration_Date": None,
                                        "Universal_ID_Number": None,
                                        "Universal_ID_Issue_Date": None,
                                        "Universal_ID_Expiration_Date": None,
                                        "EMailId": None
                                    },
                                    {
                                        "Income_TAX_PAN": "CSKPS8762F",
                                        "PAN_Issue_Date": None,
                                        "PAN_Expiration_Date": None,
                                        "Passport_Number": None,
                                        "Passport_Issue_Date": None,
                                        "Passport_Expiration_Date": None,
                                        "Voter_ID_Number": None,
                                        "Voter_ID_Issue_Date": None,
                                        "Voter_ID_Expiration_Date": None,
                                        "Driver_License_Number": None,
                                        "Driver_License_Issue_Date": None,
                                        "Driver_License_Expiration_Date": None,
                                        "Ration_Card_Number": None,
                                        "Ration_Card_Issue_Date": None,
                                        "Ration_Card_Expiration_Date": None,
                                        "Universal_ID_Number": None,
                                        "Universal_ID_Issue_Date": None,
                                        "Universal_ID_Expiration_Date": None,
                                        "EMailId": None
                                    }
                                ]
                            },
                            {
                                "Identification_Number": "RURXXXXXXXX",
                                "Subscriber_Name": "XXXXXXXXXX",
                                "Account_Number": "XXXXXXXXXX9826",
                                "Portfolio_Type": "I",
                                "Account_Type": "03",
                                "Open_Date": "20251231",
                                "Credit_Limit_Amount": None,
                                "Highest_Credit_or_Original_Loan_Amount": "4000000",
                                "Terms_Duration": None,
                                "Terms_Frequency": None,
                                "Scheduled_Monthly_Payment_Amount": None,
                                "Account_Status": "21",
                                "Payment_Rating": "S",
                                "Payment_History_Profile": "S???????????????????????????????????",
                                "Special_Comment": None,
                                "Current_Balance": "3990708",
                                "Amount_Past_Due": "0",
                                "Original_Charge_Off_Amount": None,
                                "Date_Reported": "20260131",
                                "Date_of_First_Delinquency": None,
                                "Date_Closed": None,
                                "Date_of_Last_Payment": "20260107",
                                "SuitFiledWillfulDefaultWrittenOffStatus": None,
                                "SuitFiled_WillfulDefault": "00",
                                "Written_off_Settled_Status": None,
                                "Value_of_Credits_Last_Month": None,
                                "Occupation_Code": None,
                                "Settlement_Amount": None,
                                "Value_of_Collateral": None,
                                "Type_of_Collateral": None,
                                "Written_Off_Amt_Total": None,
                                "Written_Off_Amt_Principal": None,
                                "Rate_of_Interest": None,
                                "Repayment_Tenure": "0",
                                "Promotional_Rate_Flag": None,
                                "Income": None,
                                "Income_Indicator": None,
                                "Income_Frequency_Indicator": None,
                                "DefaultStatusDate": None,
                                "LitigationStatusDate": None,
                                "WriteOffStatusDate": None,
                                "DateOfAddition": "20251231",
                                "CurrencyCode": "INR",
                                "Subscriber_comments": None,
                                "Consumer_comments": None,
                                "AccountHoldertypeCode": "1",
                                "CAIS_Account_History": [
                                    {
                                        "Year": "2026",
                                        "Month": "01",
                                        "Days_Past_Due": None,
                                        "Asset_Classification": "S"
                                    },
                                    {
                                        "Year": "2025",
                                        "Month": "12",
                                        "Days_Past_Due": None,
                                        "Asset_Classification": "S"
                                    }
                                ],
                                "CAIS_Holder_Details": {
                                    "Surname_Non_Normalized": "NEERAJ SHARMA",
                                    "First_Name_Non_Normalized": None,
                                    "Middle_Name_1_Non_Normalized": None,
                                    "Middle_Name_2_Non_Normalized": None,
                                    "Middle_Name_3_Non_Normalized": None,
                                    "Alias": None,
                                    "Gender_Code": "2",
                                    "Income_TAX_PAN": "CSKPS8762F",
                                    "Passport_Number": None,
                                    "Voter_ID_Number": None,
                                    "Date_of_birth": "19700101"
                                },
                                "CAIS_Holder_Address_Details": {
                                    "First_Line_Of_Address_non_normalized": "37,MAIN ASHOKA ENC.FBDSEC 35",
                                    "Second_Line_Of_Address_non_normalized": "NA",
                                    "Third_Line_Of_Address_non_normalized": "NA",
                                    "City_non_normalized": "NA",
                                    "Fifth_Line_Of_Address_non_normalized": None,
                                    "State_non_normalized": "06",
                                    "ZIP_Postal_Code_non_normalized": "121003",
                                    "CountryCode_non_normalized": "IB",
                                    "Address_indicator_non_normalized": "01",
                                    "Residence_code_non_normalized": None
                                },
                                "CAIS_Holder_Phone_Details": {
                                    "Telephone_Number": None,
                                    "Telephone_Type": "01",
                                    "Telephone_Extension": None,
                                    "Mobile_Telephone_Number": "7838485344",
                                    "FaxNumber": None,
                                    "EMailId": None
                                },
                                "CAIS_Holder_ID_Details": [
                                    {
                                        "Income_TAX_PAN": "CSKPS8762F",
                                        "PAN_Issue_Date": None,
                                        "PAN_Expiration_Date": None,
                                        "Passport_Number": None,
                                        "Passport_Issue_Date": None,
                                        "Passport_Expiration_Date": None,
                                        "Voter_ID_Number": None,
                                        "Voter_ID_Issue_Date": None,
                                        "Voter_ID_Expiration_Date": None,
                                        "Driver_License_Number": None,
                                        "Driver_License_Issue_Date": None,
                                        "Driver_License_Expiration_Date": None,
                                        "Ration_Card_Number": None,
                                        "Ration_Card_Issue_Date": None,
                                        "Ration_Card_Expiration_Date": None,
                                        "Universal_ID_Number": None,
                                        "Universal_ID_Issue_Date": None,
                                        "Universal_ID_Expiration_Date": None,
                                        "EMailId": None
                                    },
                                    {
                                        "Income_TAX_PAN": "CSKPS8762F",
                                        "PAN_Issue_Date": None,
                                        "PAN_Expiration_Date": None,
                                        "Passport_Number": None,
                                        "Passport_Issue_Date": None,
                                        "Passport_Expiration_Date": None,
                                        "Voter_ID_Number": None,
                                        "Voter_ID_Issue_Date": None,
                                        "Voter_ID_Expiration_Date": None,
                                        "Driver_License_Number": None,
                                        "Driver_License_Issue_Date": None,
                                        "Driver_License_Expiration_Date": None,
                                        "Ration_Card_Number": None,
                                        "Ration_Card_Issue_Date": None,
                                        "Ration_Card_Expiration_Date": None,
                                        "Universal_ID_Number": None,
                                        "Universal_ID_Issue_Date": None,
                                        "Universal_ID_Expiration_Date": None,
                                        "EMailId": None
                                    },
                                    {
                                        "Income_TAX_PAN": "CSKPS8762F",
                                        "PAN_Issue_Date": None,
                                        "PAN_Expiration_Date": None,
                                        "Passport_Number": None,
                                        "Passport_Issue_Date": None,
                                        "Passport_Expiration_Date": None,
                                        "Voter_ID_Number": None,
                                        "Voter_ID_Issue_Date": None,
                                        "Voter_ID_Expiration_Date": None,
                                        "Driver_License_Number": None,
                                        "Driver_License_Issue_Date": None,
                                        "Driver_License_Expiration_Date": None,
                                        "Ration_Card_Number": None,
                                        "Ration_Card_Issue_Date": None,
                                        "Ration_Card_Expiration_Date": None,
                                        "Universal_ID_Number": None,
                                        "Universal_ID_Issue_Date": None,
                                        "Universal_ID_Expiration_Date": None,
                                        "EMailId": None
                                    }
                                ]
                            }
                        ]

print(check_track_record('20260209', 480000, ownership_list_mapping, bureau_data, rule, 'experian', account_type))