diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2023-02-17 10:35:15 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2023-02-17 10:35:15 +0700 |
| commit | 08d34e27298f6c2808f1f11986a8e2aaed4f432e (patch) | |
| tree | 276656a376e35c283bde6efa4ab675d90aa1a707 | |
| parent | 37e33dfc0f0f79f67aa600c13e2e134037005f45 (diff) | |
mapping sales person in wati leads
| -rw-r--r-- | indoteknik_custom/models/wati.py | 21 |
1 files changed, 21 insertions, 0 deletions
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 |
