Repository navigation
Conversation
A migration gerada automaticamente pelo TypeORM nao criava apenas a tabela audit_log: ela derrubava todas as FKs, indices e constraints unicas do schema, apagava 6 colunas com dados reais (auditorReward, requiresActivityDate, requiresProof, requiresDescription, participationReward, activityDate) e reescrevia o notification_type_enum removendo EVENT_UPDATED/EVENT_CANCELLED. Substituida por uma migration escrita a mao que cria somente audit_log e seus 3 indices. Os specs de submissions e events nao forneciam o mock de AuditLogsService apos a injecao, quebrando 33 testes. Adicionado o mock nos dois. Validado: nest build ok, 184/184 testes passando.
Resolve conflitos entre o modulo de auditoria (audit-logs) e as mudancas de confiabilidade/notificacao ja mescladas do PR #108 (try/catch em torno de notificacao de evento, ordem de injecao de dependencia em EventsService/SubmissionsService). Nenhuma logica de nenhum dos dois lados foi descartada - so combinadas. Validado: nest build ok, 184/184 testes passando.
|
leo-nardo
added a commit
that referenced
this pull request
Aug 18, 2026
feat: implement audit logs module
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.



O que foi feito:
src/audit-logscom persistência para registro de auditorias dos administradores. Controller protegido por admin.audit_logcom índices apropriados.recordsegura usando try/catch.Pontos Instrumentados:
submissions.service.ts:SUBMISSION_REVIEWEDevents.service.ts:EVENT_SUBSCRIPTION_REVIEWED,EVENT_CANCELEDcontribution-reports.service.ts:CONTRIBUTION_REPORT_REVIEWEDusers.service.ts:USER_ROLE_CHANGED,USER_BANNED,USER_UNBANNEDPontos Não Encontrados/Ignorados:
XP_MANUAL_ADJUSTMENTemsrc/transactionsousrc/gamification-profilesnão foi encontrado ativamente, sendo assim ignorado.