Skip to content

Credit volunteer hours from the admin - #48

Merged
byteful merged 2 commits into
feat/user-hours-ledgerfrom
feat/user-hours-credit-form
Sep 27, 2026
Merged

byteful merged 2 commits into
feat/user-hours-ledgerfrom
feat/user-hours-credit-form

Conversation

@byteful

@byteful byteful commented Sep 27, 2026 •

Copy link
Copy Markdown
Member

What changed

An operator can credit volunteer hours to a person from the admin panel. The credit is either for a real event that has already ended (for example, someone who attended before they had the app) or a manual adjustment with a date of service. Visible in admin, and to the credited person on web and mobile.

Before you start

Verify

[Admin] event credit

  1. Open "Users", pick the citizen, open the "Hours" tab and click "Credit hours" — Expect: an inline "Credit hours" form with "Event credit" selected and "Manual adjustment" beside it
  2. Type part of the ended event's title in "Search ended events by title or place…" — Expect: the event appears with its place and date; upcoming and cancelled events never appear
  3. Pick it, enter "2" in "Hours", type a reason, click "Credit hours" — Expect: a confirm "Credit 2 h to for ?" that says the person is notified and sees CivFix as the creditor
  4. Confirm with "Credit hours" — Expect: toast " · +2 h"; the form closes; a new top row shows the event, "Credited by CivFix · ", your reason and "2 h"; "Total hours" rises by 2
  5. Click "Credit hours" again, pick the same event, enter "1", type a reason, submit and confirm — Expect: the form stays open with "That volunteer already holds 2 h for this event; void that entry first."

[Admin] limits and validation

  1. Submit with no event picked — Expect: "Pick the event to credit." under "Event", no confirm dialog
  2. Enter "30" in "Hours" and submit — Expect: "Enter between 0.01 and 24 hours."
  3. Clear the reason and submit — Expect: "A reason is required."
  4. Pick an event that ran exactly 1 hour, enter "5" and confirm — Expect: inline "This event ran for 1 h, so at most 2 h may be credited per attendee"

[Admin] manual adjustment

  1. Click "Credit hours", then "Manual adjustment" — Expect: a "Date of service" field set to today that won't accept a later date
  2. Pick yesterday, enter "1.5", type a reason, submit — Expect: confirm "Credit 1.5 h to as a manual adjustment for ?"
  3. Confirm — Expect: toast " · +1.5 h"; a "Manual adjustment" row dated yesterday with "Credited by CivFix · "
  4. Immediately repeat the exact same credit — Expect: "That adjustment was recorded moments ago; check the ledger before adding it again."

[Admin] accounts that can't be credited

  1. Open "Hours" on a deleted account (filter "Deleted") — Expect: "Hours can't be credited to a deleted account." and "Credit hours" is disabled
  2. Open "Hours" on your own operator account — Expect: "Hours can't be credited to an operator account." and "Credit hours" is disabled

[Web] the credited citizen

  1. Open the notifications bell — Expect: two "Service hours credited" notifications: "2 hours were credited for ." and "CivFix credited 1.5 hours to your volunteer record."
  2. Tap one — Expect: your profile opens; tap "Hours"
  3. Look at "Service record" — Expect: the event credit shows the event title with "credited by CivFix"; the manual one shows "Adjustment" with "credited by CivFix"; the total includes both

[Mobile] the credited citizen

  1. Repeat the three web steps in the app — Expect: the same notifications and rows

Regression

Events page list and search — [Admin]

  1. Open "Events", type in "Search title, place, organizer…" and switch between "All", "Upcoming", "In progress", "Completed" and "Flagged" — Expect: the list and counts filter as before; "Load more" pages
  2. On the Dashboard look at the "Events" tile — Expect: preview rows load; flag an event on the Events page and come back — Expect: the tile reflects it

Host hours for the same event — [Web] [Mobile]

  1. As the event's host, open the ended event — Expect: the "Volunteer hours" card total includes the operator's 2 h, with a row reading "Credited by CivFix" (once the host-label PR is on staging; before that it reads "Former attendee")

Leaderboard — [Web]

  1. As the citizen, open the "Search" tab, then "See all" under "Volunteer leaderboard" for the event's area — Expect: your hours there include the 2 h event credit but not the 1.5 h manual adjustment

Not covered

  • A server refusal for the daily 24 h limit needs 24 h already logged for that person that day; not set up here.
  • The notification opens the profile on its first tab, not "Hours"; tapping "Hours" is part of the steps.

@byteful
byteful merged commit 430ef93 into feat/user-hours-ledger Sep 27, 2026
@byteful
byteful deleted the feat/user-hours-credit-form branch September 27, 2026 06:16
byteful added a commit that referenced this pull request Sep 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant