Annuaire des Entreprises lookup: names and addresses arrive in capitals with abbreviated street types #1244
Labels
No labels
accessibility
authentication
breaking change
bug
documentation
enhancement
interface
internationalisation
observability
performance
security
tier
1
tier
2
tier
3
tier/4
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Postulo/postulo#1244
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What happens
The lookup in the Annuaire des Entreprises (the
fr-recherche-entreprisesadapter of the register lookup plugin) copies what the API answers: the name, the street and the municipality come back in capitals, and the street type is the register's abbreviation. A company found this way is saved as15 AV DES CHAMPS ELYSEES,75008 PARIS,DUPONT SERVICES, which looks wrong beside every other record.Where
src/postulo/plugins/register_lookup/adapters.py,_france():name(nom_raison_sociale/nom_complet),street(numero_voie,type_voie,libelle_voie) andmunicipality(libelle_commune) are used as received.Expected
Avenue des Champs-Élysées,Saint-Denis. Small words (de,du,des,la,le,et,sur,sous) stay lower case;l'andd'are kept; a hyphen starts a new capital (Saint-Denis); roman numerals and acronyms stay upper case.type_voiecodes:AVAvenue,BDBoulevard,CHEChemin,RTERoute,ALLAllée,IMPImpasse,PLPlace,QUAI,RUE,CRSCours,SQSquare,PASPassage,ZA,ZI, and the rest of the list), andST/STEinside a name becomeSaint/Sainte.AXA,EDF,SNCF) must not becomeAxa,Edf,Sncf. A short word of capitals with no vowel, or one the company already holds in capitals elsewhere, stays as it is; say in the issue's decision what rule is used.Tests
A table of cases for the formatter (street types, particles, apostrophes, hyphens, acronyms, roman numerals, accents) and one adapter test with a recorded API answer for a company whose name and address are in capitals.
Other registers
Check the other adapters in the same file (Norway, Finland, Czechia, Poland, GLEIF) for the same problem and apply the formatter where a register answers in capitals.