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 a is_active field to PointDeCharge table? #129

Open
5 tasks
jmaupetit opened this issue Jul 18, 2024 · 1 comment
Open
5 tasks

Add a is_active field to PointDeCharge table? #129

jmaupetit opened this issue Jul 18, 2024 · 1 comment
Labels
API Item related to the API service question Further information is requested schema Discussions around data schemas

Comments

@jmaupetit
Copy link
Member

jmaupetit commented Jul 18, 2024

Purpose

When a point of charge (PoC) is decommissioned (most of the time when the PoC has a new operator), we should keep this database entry to ensure database consistency (mostly regarding dynamic data). But if this PoC is no longer active, we should be able to flag it as is and adapt database queries or indicator calculations by taking into account this status update.

Proposal

  • add a is_active: bool = True field to the PointDeCharge model
  • add database migration
  • ensure the Statique model does not export this field

Cherry on the cake:

  • add a /statique/inactivate/bulk endpoint *
  • add a /statique/activate/bulk endpoint (in case we made a mistake) *

* expected payload would be a list of id_pdc_itinerance

@jmaupetit jmaupetit added question Further information is requested schema Discussions around data schemas API Item related to the API service labels Jul 18, 2024
@loco-philippe
Copy link
Collaborator

I think it's a good idea, but it seems to me that it's better to add the field to the station table.

It may also be useful to discuss with operators to understand what types of operations are required to define operating modes (and possible additional attributes or endpoints).

e.g. is it interesting to separate the creation of an operator, the creation of a station and the association of a station to an operator ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Item related to the API service question Further information is requested schema Discussions around data schemas
Projects
None yet
Development

No branches or pull requests

2 participants