-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Ajout d'attributs dans Brevo pour les structures #1513
Conversation
b38d41e
to
7b0ab70
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Des petits retours, essentiellement pour la lisibilité ;)
1c9faa8
to
8482909
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Top !
lemarche/crm/tests.py
Outdated
self.assertEqual( | ||
siae_with_recent_stats.tender_detail_contact_click_count_annotated, | ||
1, | ||
"Les clics de contact récents dans les 90 jours devraient être 1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trop bien les messages sur les asserts !
7cd8329
to
d92f5d9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Je te propose qu'on finalise ça ensemble demain, faudrait ajouter les nouveaux attributs sur brevo et juste les renommer comme il faut et on peut envoyer :)
lemarche/utils/apis/api_brevo.py
Outdated
@@ -146,6 +146,7 @@ def create_or_update_company(siae): | |||
"geo_range": siae.geo_range, | |||
"app_url": get_object_share_url(siae), | |||
"app_admin_url": get_object_admin_url(siae), | |||
**siae.extra_data, # includes completion_rate, tender_email_send_count, etc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tu risque d'inclure des attributs en trop si tu fait ça, vaut mieux les nommé pour éviter d'ajouter d'autres attributs qu'il peut y avoir dans extra_data.
|
||
# extra_data update if needed | ||
if siae.extra_data != new_extra_data: | ||
siae.extra_data = new_extra_data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra_data peut contenir d'autres attributs que ceux là, donc en faisant ça t'écrase les anciens attributs ^^ faudrait juste écraser les anciennes clés.
D'ailleurs je pense que les clés ne doivent pas correspondre dans Brevo, faut utiliser une notation de type TAUX_DE_COMPLETION
sans accents :)
@@ -78,6 +79,24 @@ def get_city_filter(perimeter, with_country=False): | |||
return filters | |||
|
|||
|
|||
def count_field(field_name, date_limit): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Jolie
c3d5e1d
to
ae5db36
Compare
} | ||
|
||
# extra_data update if needed | ||
if siae.extra_data != new_extra_data: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if siae.extra_data != new_extra_data: | |
if siae.extra_data.get('brevo_company_data') != new_extra_data: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🎉
Quoi ?
Partie 2 de la synchro Brevo, donc suite de la PR1468
Ajout d'attributs dans la liste des Structures dans Brevo.
Pourquoi ?
Pour segmenter les envois d’email marketing, et ne pas multiplier les listes sur Brevo.
Comment ?
En ajoutant 3 attributs dans siae.extra_data :
Enfin, le dictionnaire est initialisé et/ou mis à jour dans la commande
crm_brevo_sync_companies
.