Skip to content
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

Add operational unit database schema #51

Merged
merged 3 commits into from
May 20, 2024
Merged

Conversation

jmaupetit
Copy link
Member

@jmaupetit jmaupetit commented May 15, 2024

Purpose

Operational units regroup stations managed by an operator. We need to support them to prepare permissions management for users.

Proposal

  • add OperationalUnit schema
  • automate operational units importation from AFIREV datasets edit 2024/05/17 (see below)

AFIREV datasets are available from: https://afirev.fr/fr/liste-des-identifiants-attribues/

Edit 2024/05/17: we finally choose to add a data migration with the current dataset version. Things will move in a near future, we'll adapt then. See: etalab/transport-site#3592

An operational unit designs a group of stations managed by a designated
operator. The operational unit `code` is a 5 characters string
corresponding to the 4 or 5 first characters of the
`Station.id_station_itinerance` or `PointDeCharge.id_pdc_itinerance`
Makefile Outdated Show resolved Hide resolved
@jmaupetit jmaupetit marked this pull request as ready for review May 20, 2024 08:46
@jmaupetit jmaupetit removed the WIP label May 20, 2024
jmaupetit added 2 commits May 20, 2024 10:58
Official AFIREV's prefixes are imported as OperationalUnits using a data
migration and then used to automatically link Stations to
OperationalUnits using a database event.

Registering a new Station with an unknown prefix in its
id_station_itinerance throws an error.
We should rollback and properly close the session on server restart or
database-related failures.
@jmaupetit jmaupetit force-pushed the add-operational-unit-schema branch from 1f0fabe to e70c0be Compare May 20, 2024 09:00
@jmaupetit jmaupetit merged commit be8696b into main May 20, 2024
8 checks passed
@jmaupetit jmaupetit deleted the add-operational-unit-schema branch May 20, 2024 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant