codeforboston/maple

Update Testimony Counts When Deleting Testimony

Open

#1,955 opened on 2025年9月29日

GitHub で見る
 (0 comments) (0 reactions) (1 assignee)TypeScript (168 forks)auto 404
Ready for DevelopmentTestimony Flowbackendenhancementgood first issue

Repository metrics

Stars
 (56 stars)
PR merge metrics
 (PR metrics pending)

説明

Problem

When an Admin deletes a reported testimony for a bill from the admin view, we want that bill's testimony counts (i.e. endore/neutral/oppose/total) to reflect the new totals. Currently, the testimony counts are not updated when deleting a testimony through the admin view. This is because we have two delete paths for deleting testimony - one in a Firebase function (that correctly updates counts on deletion) and one through an edge function in the Next.js API (that does not update counts). The admin page uses the latter.

Success Criteria

  • When deleting a reported testimony for a bill through the Admin page, that bill's testimony counts should be updated
    • e.g. If a bill has 10 Endorse and 4 Oppose testimonies and one of the Endorse testimony is deleted, the bill should now have 9 Endore and 4 Oppose in its testimony counts.
    • It may be prudent to unify the two testimony deletion paths for more consistent behavior going forward - given that deleting testimony tends to be an admin-facing process, I don't think the cold start latency concerns of the Firebase function should be considered a blocker (and it seems that the Firebase Function deleteTestimony is the more fully-featured path).

Additional Notes

コントリビューターガイド