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

Orphan entries creation using the /statique/{id_pdc_itinerance} PUT endpoint (update) #40

Open
jmaupetit opened this issue May 6, 2024 · 0 comments
Labels
API Item related to the API service improvement

Comments

@jmaupetit
Copy link
Member

Purpose

When updating a Statique entry, we manipulate multiple database tables. Some of those tables have no unicity criterion that allows us to update a PointDeCharge-related entry, but instead creates a new entry, leaving the former entry possibly orphan, i.e. not linked to any PointDeCharge.

Example: if we update the contact_amenageur field of a Statique entry, we will create a new entry for the Amenageur table and link this entry to the updated PointDeCharge. The original Amenageur entry won't be linked to this PointDeCharge, making it (possibly) orphan.

Proposal

Maybe we should be more granular and allow to update all statique-related entries (database tables) using a dedicated endpoint per object: PUT /statique/amenageur/{amenageur_id}.

An alternative - temporary - solution may be to clean orphan entries regularly to avoid database pollution.

@jmaupetit jmaupetit added the API Item related to the API service label Jul 18, 2024
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 improvement
Projects
None yet
Development

No branches or pull requests

1 participant