File size: 566 Bytes
3c079d1
9aba538
 
 
 
 
0f80c4e
 
3c079d1
0f80c4e
 
 
 
9aba538
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# utils.py

def validate_data(data):
    return all([
        isinstance(data.get("amount"), (int, float)),
        isinstance(data.get("lead_score"), (int, float)),
        isinstance(data.get("emails_last_7_days"), (int, float)),
        isinstance(data.get("meetings_last_30_days"), (int, float)),
        isinstance(data.get("industry"), str) and data.get("industry").strip() != "",
        data.get("stage") in [
            "Prospecting", "Qualified", "Proposal", "Proposal/Price Quote",
            "Negotiation", "Closed Won", "Closed Lost"
        ]
    ])