From 08d34e27298f6c2808f1f11986a8e2aaed4f432e Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Fri, 17 Feb 2023 10:35:15 +0700 Subject: mapping sales person in wati leads --- indoteknik_custom/models/wati.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/indoteknik_custom/models/wati.py b/indoteknik_custom/models/wati.py index 170b4245..158a16d7 100644 --- a/indoteknik_custom/models/wati.py +++ b/indoteknik_custom/models/wati.py @@ -28,9 +28,30 @@ class WatiNotification(models.Model): event_type = json.loads(wati.json_raw)['eventType'] if event_type == 'sessionMessageSent': + if 'Saya *Eko*' in str(text): + sales = 11 + elif 'Saya *Nabila*' in str(text): + sales = 20 + elif 'Saya *Novita*' in str(text): + sales = 377 + elif 'Saya *Putri*' in str(text): + sales = 10 + elif 'Saya *Heriyanto*' in str(text): + sales = 375 + elif 'Saya *Ade*' in str(text): + sales = 9 + elif 'Saya *Adela*' in str(text): + sales = 8 + elif 'Saya *Jananto*' in str(text): + sales = 376 + elif 'Saya *Dwi*' in str(text): + sales = 24 + else: + sales = 20 #Nabila current_lead.description = str(current_lead.description)+ "| i:" + str(text) current_lead.operator_email = operator_email current_lead.operator_name = operator_name + current_lead.user_id = sales wati.is_lead = True elif current_lead: # must append internal notes as a reply here -- cgit v1.2.3