fix(dao): enforce strict DAO finalization — audit logs, close_date, and summary placement#466
Open
ayushshukla1807 wants to merge 3 commits intohatnote:masterfrom
Open
Conversation
…dit logs and dates
|
Hi @ayushshukla1807, apologies, but I’ve already opened a PR for this that also includes the additional tests covering the changes. |
Author
|
Hi @userAdityaa, excellent catch! I missed PR #463 while surveying the issue tracker! Closing this duplicate in favor of your implementation. |
…sSummary to finalize_campaign Per lgelauff's feedback on hatnote#462: - finalize_ranking_round now only sets close_date, status, and writes audit log - RoundResultsSummary creation moved to finalize_campaign, where it belongs (only created when the last round was a ranking round) - finalize_round endpoint delegates to coord_dao.finalize_round()
Collaborator
|
You may also want to consider #491 here - there seems to be some overlap? |
- Moved RoundResultsSummary creation from finalize_ranking_round to finalize_campaign as requested by maintainer. - Created generic CoordinatorDAO.finalize_round method to ensure consistent status updates, close_date injection, and audit logging. - Updated admin_endpoints.py to delegate to the new DAO method, resolving the bypass issue. - Integrated regression test from PR hatnote#491 to ensure technical parity and future stability.
Author
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.
Fixes #462.
The
finalize_roundendpoint was bypassing the standardDAO.close_roundlogic and mutating row state directly. This skipped writing theclose_dateand audit logs. I've routed it properly through the DAO so the lifecycle hooks trigger as expected.