Add "Date Created" and "Number of Days Open" to Suggestions Admin - #2817
Open
VirginiaWu11 wants to merge 1 commit into
Open
Add "Date Created" and "Number of Days Open" to Suggestions Admin#2817VirginiaWu11 wants to merge 1 commit into
VirginiaWu11 wants to merge 1 commit into
Conversation
VirginiaWu11
force-pushed
the
2580-add-date-created-and-number-of-days-open-to-suggestions
branch
from
June 23, 2026 02:27
94c4060 to
dc93f71
Compare
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.
Summary
Adds two read-only fields to the Suggestions Administration table and details modal so admins can see when a correction/suggestion was submitted and how long it's been open.
created_date, now exposed via the API (it was already in the DB but never selected for this view).today − createdDatefor OPEN statuses (New, Pending),closedDate − createdDatefor CLOSED statuses (Incorrect, Confirmed), frozen once closed.Why server changes were needed
The ticket assumed this was front-end only, but two gaps required backend work:
selectAll/selectByIdinsuggestion-service.tsdidn't selectcreated_datefor this view.closed_datecolumn, so the CLOSED-status interval couldn't be computed at all.Changes
closed_datetimestamp column onsuggestion.selectAll/selectByIdnow returncreated_date/closed_date;updatestampsclosed_datewhen status moves to Incorrect/Confirmed (idempotent — re-saving a closed record doesn't reset the timestamp) and clears it when moved back to New/Pending. Added the fields toSuggestion/SuggestionPostFieldstypes and the PUT validation schema (POST schema explicitly excludes them — they're server-derived, not client-supplied).closedDateto theSuggestionandAdminSuggestiontypes; added agetDaysOpen/formatDatehelper pair; inserted the two columns between Notes and Status in the table, and the two fields in the modal's Admin Notes section before Tipster details.Notes
closed_dateand will shown/afor days-open until an admin re-saves them with a closed status (not backfilled — accepted tradeoff).DisplayTextcomponent's call site: a same-day suggestion hasdaysOpen === 0, which is falsy, so it's passed as a string to avoid being swallowed into"n/a".