Skip to content

Commit

Permalink
Assouplissement du schéma sur le formatage des identifiants (#51)
Browse files Browse the repository at this point in the history
* Add failing test-case for #48

* Add failing test-case for dynamic schema (like #48)

* Soften requirement on id prefix
  • Loading branch information
thbar authored Feb 5, 2024
1 parent 740ddd1 commit 07ff238
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions dynamique/exemple-valide-dynamique.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
id_pdc_itinerance,etat_pdc,occupation_pdc,horodatage,etat_prise_type_2,etat_prise_type_combo_ccs,etat_prise_type_chademo,etat_prise_type_ef
FRA68P68021001,en_service,libre,2022-10-18T12:35:49+0000,fonctionnel,fonctionnel,,fonctionnel
ESZUNE1111ER7,en_service,libre,2022-10-18T12:35:49+0000,fonctionnel,fonctionnel,,fonctionnel
2 changes: 1 addition & 1 deletion dynamique/schema-dynamique.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"type": "string",
"constraints": {
"required": true,
"pattern": "^FR[A-Z0-9]{4,33}$"
"pattern": "^[A-Z]{2}[A-Z0-9]{4,33}$"
}
},
{
Expand Down
3 changes: 2 additions & 1 deletion statique/exemple-valide-statique.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
nom_amenageur,siren_amenageur,contact_amenageur,nom_operateur,contact_operateur,telephone_operateur,nom_enseigne,id_station_itinerance,id_station_local,nom_station,implantation_station,adresse_station,code_insee_commune,coordonneesXY,nbre_pdc,id_pdc_itinerance,id_pdc_local,puissance_nominale,prise_type_ef,prise_type_2,prise_type_combo_ccs,prise_type_chademo,prise_type_autre,gratuit,paiement_acte,paiement_cb,paiement_autre,tarification,condition_acces,reservation,horaires,accessibilite_pmr,restriction_gabarit,station_deux_roues,raccordement,num_pdl,date_mise_en_service,observations,date_maj,cable_t2_attache
Société X,130025265,[email protected],Société Y,[email protected],0111111111,Réseau de recharge ABC,FRA68P68021001,,Picpus,Voirie,1 avenue de la Paix 75001 Paris,75001,"[7.48710500,48.345345]",10,FRA68E680210015,,22,true,true,false,false,false,false,true,true,true,0.40€ / kwh,Accès libre,true,"Mo-Fr 08:00-12:00,Mo-Fr 14:00-18:00,Th 08:00-18:00",Accessible mais non réservé PMR,Hauteur maximale 2m,false,Direct,12345678912345,2020-01-14,,2021-04-05,true
Société X,130025265,[email protected],Société Y,[email protected],111111111,Réseau de recharge ABC,FRA68P68021001,,Picpus,Voirie,1 avenue de la Paix 75001 Paris,75001,"[7.48710500,48.345345]",10,FRA68E680210015,,22,true,true,false,false,false,false,true,true,true,0.40€ / kwh,Accès libre,true,"Mo-Fr 08:00-12:00,Mo-Fr 14:00-18:00,Th 08:00-18:00",Accessible mais non réservé PMR,Hauteur maximale 2m,false,Direct,12345678912345,2020-01-14,,2021-04-05,true
Exemple invalide (id_station_itinerance et id_pdc_itinerance),130025265,[email protected],Société Y,[email protected],111111111,Réseau de recharge ABC,ESZUNP395912133460086982,,Picpus,Voirie,1 avenue de la Paix 75001 Paris,75001,"[7.48710500,48.345345]",10,ESZUNE1111ER7,,22,true,true,false,false,false,false,true,true,true,0.40€ / kwh,Accès libre,true,"Mo-Fr 08:00-12:00,Mo-Fr 14:00-18:00,Th 08:00-18:00",Accessible mais non réservé PMR,Hauteur maximale 2m,false,Direct,12345678912345,2020-01-14,,2021-04-05,true
4 changes: 2 additions & 2 deletions statique/schema-statique.json
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
"type": "string",
"constraints": {
"required": true,
"pattern": "(?:(?:^|,)(^FR[A-Z0-9]{4,33}$|Non concerné))+$"
"pattern": "(?:(?:^|,)(^[A-Z]{2}[A-Z0-9]{4,33}$|Non concerné))+$"
}
},
{
Expand Down Expand Up @@ -251,7 +251,7 @@
"type": "string",
"constraints": {
"required": true,
"pattern": "(?:(?:^|,)(^FR[A-Z0-9]{4,33}$|Non concerné))+$"
"pattern": "(?:(?:^|,)(^[A-Z]{2}[A-Z0-9]{4,33}$|Non concerné))+$"
}
},
{
Expand Down

0 comments on commit 07ff238

Please sign in to comment.