Spaces:
Sleeping
Sleeping
| from pydantic import ValidationError | |
| from app import TransactionData # Reuse model from app.py | |
| import json | |
| # Example JSON input (update as needed) | |
| sample_input = { | |
| "Transaction_Id": "T123456789", | |
| "Hit_Seq": 1, | |
| "Hit_Id_List": "HIT001", | |
| "Origin": "USA", | |
| "Designation": "Manager", | |
| "Keywords": "Payment", | |
| "Name": "John Doe", | |
| "SWIFT_Tag": "TAG001", | |
| "Currency": "USD", | |
| "Entity": "CompanyX", | |
| "Message": "This is a test message", | |
| "City": "New York", | |
| "Country": "USA", | |
| "State": "NY", | |
| "Hit_Type": "Name Match", | |
| "Record_Matching_String": "Matching String Example", | |
| "WatchList_Match_String": "Watchlist Match Example", | |
| "Payment_Sender_Name": "Alice", | |
| "Payment_Reciever_Name": "Bob", | |
| "Swift_Message_Type": "MT103", | |
| "Text_Sanction_Data": "Sanction text here", | |
| "Matched_Sanctioned_Entity": "Entity XYZ", | |
| "Is_Match": 1, | |
| "Red_Flag_Reason": "High Risk", | |
| "Risk_Level": "High", | |
| "Risk_Score": 85.0, | |
| "Risk_Score_Description": "High Risk Score", | |
| "CDD_Level": "Enhanced", | |
| "PEP_Status": "No", | |
| "Value_Date": "2023-10-01", | |
| "Last_Review_Date": "2023-11-01", | |
| "Next_Review_Date": "2024-11-01", | |
| "Sanction_Description": "Some sanctions", | |
| "Checker_Notes": "Verified manually", | |
| "Sanction_Context": "Transaction under review", | |
| "Maker_Action": "Escalated", | |
| "Customer_ID": 1001, | |
| "Customer_Type": "Corporate", | |
| "Industry": "Finance", | |
| "Transaction_Date_Time": "2023-10-01T12:00:00", | |
| "Transaction_Type": "Transfer", | |
| "Transaction_Channel": "Online", | |
| "Originating_Bank": "Bank A", | |
| "Beneficiary_Bank": "Bank B", | |
| "Geographic_Origin": "USA", | |
| "Geographic_Destination": "UK", | |
| "Match_Score": 0.95, | |
| "Match_Type": "Fuzzy", | |
| "Sanctions_List_Version": "v2023.10", | |
| "Screening_Date_Time": "2023-10-01T10:00:00", | |
| "Risk_Category": "Fraud", | |
| "Risk_Drivers": "Transaction Volume", | |
| "Alert_Status": "Open", | |
| "Investigation_Outcome": "Pending", | |
| "Case_Owner_Analyst": "Analyst1", | |
| "Escalation_Level": "Level 2", | |
| "Escalation_Date": "2023-10-02", | |
| "Regulatory_Reporting_Flags": True, | |
| "Audit_Trail_Timestamp": "2023-10-01T10:15:00", | |
| "Source_Of_Funds": "Internal", | |
| "Purpose_Of_Transaction": "Loan Repayment", | |
| "Beneficial_Owner": "OwnerX", | |
| "Sanctions_Exposure_History": False | |
| } | |
| if __name__ == "__main__": | |
| try: | |
| validated = TransactionData(**sample_input) | |
| print(" Input is valid.") | |
| except ValidationError as e: | |
| print(" Validation failed:") | |
| print(e.json()) |