-
Notifications
You must be signed in to change notification settings - Fork 31
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
Structuration import GTFS en batch job + dashboard de reporting #2920
Conversation
try do | ||
data_import_id = Transport.GTFSImportStops.import_stops_and_remove_previous(rh.id) | ||
%{resource_history_id: rh.id, status: :ok, data_import_id: data_import_id} | ||
rescue |
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.
En cas d'erreur, je constitue une map précise pour afficher des choses dans le backoffice et faire en sorte d'itérer sur les imports.
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.
Me parait très bien pour suivre l'état d'avancement d'un import. Quelques petits comms
apps/transport/test/transport/jobs/gtfs_import_stops_job_test.exs
Outdated
Show resolved
Hide resolved
apps/transport/lib/transport_web/live/backoffice/data_import_batch_report_live.ex
Outdated
Show resolved
Hide resolved
apps/transport/lib/transport_web/templates/backoffice/page/index.html.heex
Show resolved
Hide resolved
…atch_report_live.ex Co-authored-by: Antoine Augusti <[email protected]>
Co-authored-by: Antoine Augusti <[email protected]>
@AntoineAugusti j'ai pris en compte des comm, merci! |
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.
Très cool, hâte de voir ça dans le backoffice/en base
Dans cette PR, j'ajoute un job
GTFSImportStopsJob
qui va rafraichir (viaTransport.GTFSImportStops.import_stops_and_remove_previous
) tous les GTFS importés en base (gtfs_stops
) et importer ceux qui ne le sont pas déjà.Le résultat est tracé dans une nouvelle table
data_import_batch
sous forme demap
simplifiée.Le job peut être lancé depuis le back office avec un bouton.
Le résultat est affiché au même endroit (la vue prend le
DB.DataImportBatch
le plus récent).Le résultat de consolidation est affiché de façon triée, pour grouper un peu les erreurs par "type d'erreur" et faciliter le travail de traitement de ces erreurs dans les prochaines PR.