Spaces:
Sleeping
Sleeping
Create validate.py
Browse files- validate.py +70 -0
validate.py
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from pydantic import BaseModel
|
| 2 |
+
from typing import Optional
|
| 3 |
+
|
| 4 |
+
class TransactionData(BaseModel):
|
| 5 |
+
Transaction_Id: str
|
| 6 |
+
Hit_Seq: int
|
| 7 |
+
Hit_Id_List: str
|
| 8 |
+
Origin: str
|
| 9 |
+
Designation: str
|
| 10 |
+
Keywords: str
|
| 11 |
+
Name: str
|
| 12 |
+
SWIFT_Tag: str
|
| 13 |
+
Currency: str
|
| 14 |
+
Entity: str
|
| 15 |
+
Message: str
|
| 16 |
+
City: str
|
| 17 |
+
Country: str
|
| 18 |
+
State: str
|
| 19 |
+
Hit_Type: str
|
| 20 |
+
Record_Matching_String: str
|
| 21 |
+
WatchList_Match_String: str
|
| 22 |
+
Payment_Sender_Name: Optional[str] = ""
|
| 23 |
+
Payment_Reciever_Name: Optional[str] = ""
|
| 24 |
+
Swift_Message_Type: str
|
| 25 |
+
Text_Sanction_Data: str
|
| 26 |
+
Matched_Sanctioned_Entity: str
|
| 27 |
+
Is_Match: int
|
| 28 |
+
Red_Flag_Reason: str
|
| 29 |
+
Risk_Level: str
|
| 30 |
+
Risk_Score: float
|
| 31 |
+
Risk_Score_Description: str
|
| 32 |
+
CDD_Level: str
|
| 33 |
+
PEP_Status: str
|
| 34 |
+
Value_Date: str
|
| 35 |
+
Last_Review_Date: str
|
| 36 |
+
Next_Review_Date: str
|
| 37 |
+
Sanction_Description: str
|
| 38 |
+
Checker_Notes: str
|
| 39 |
+
Sanction_Context: str
|
| 40 |
+
Maker_Action: str
|
| 41 |
+
Customer_ID: int
|
| 42 |
+
Customer_Type: str
|
| 43 |
+
Industry: str
|
| 44 |
+
Transaction_Date_Time: str
|
| 45 |
+
Transaction_Type: str
|
| 46 |
+
Transaction_Channel: str
|
| 47 |
+
Originating_Bank: str
|
| 48 |
+
Beneficiary_Bank: str
|
| 49 |
+
Geographic_Origin: str
|
| 50 |
+
Geographic_Destination: str
|
| 51 |
+
Match_Score: float
|
| 52 |
+
Match_Type: str
|
| 53 |
+
Sanctions_List_Version: str
|
| 54 |
+
Screening_Date_Time: str
|
| 55 |
+
Risk_Category: str
|
| 56 |
+
Risk_Drivers: str
|
| 57 |
+
Alert_Status: str
|
| 58 |
+
Investigation_Outcome: str
|
| 59 |
+
Case_Owner_Analyst: str
|
| 60 |
+
Escalation_Level: str
|
| 61 |
+
Escalation_Date: str
|
| 62 |
+
Regulatory_Reporting_Flags: bool
|
| 63 |
+
Audit_Trail_Timestamp: str
|
| 64 |
+
Source_Of_Funds: str
|
| 65 |
+
Purpose_Of_Transaction: str
|
| 66 |
+
Beneficial_Owner: str
|
| 67 |
+
Sanctions_Exposure_History: bool
|
| 68 |
+
|
| 69 |
+
def validate_input(request: TransactionData):
|
| 70 |
+
return {"message": "Input is valid."}
|