feat: the last bug#68
Merged
Merged
Conversation
…ação para re-sincronização
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



This pull request introduces functionality to ensure that all coordinators with an associated course in the
usuariostable are properly linked in thecoordenadores_cursosjoin table. It adds both a migration to backfill missing links and updates the application logic to maintain this relationship when creating or updating users. The main changes are grouped below:Database Migration & Data Consistency
005_backfill_coordenadores_cursos.sqlto insert missing coordinator-course links for coordinators with acurso_idin theusuariostable, ensuring data consistency between the two tables.Repository Layer Enhancements
vincularCoordenadorAoCursofunction tocursos/repositorio.ts, providing an idempotent way to link a coordinator to a course in thecoordenadores_cursostable.API Logic Updates
POST /usuarios) to automatically link a new coordinator to a course incoordenadores_cursosif bothperfilis 'coordenador' andcurso_idis provided.PUT /usuarios/:id) to ensure any updated coordinator with acurso_idis also linked incoordenadores_cursos.usuarios/rotas.tsto support the above logic.…ação para re-sincronização