refactor(handlers): migrate remaining backend handlers to clock.Now() and transaction patterns

Apply clock.Now() migration, transaction wrapping, and minor refactors across admin, scheduling, today, user, auth handler, notifications, webhooks, services, portfolio, ratelimit, testutils, and main.go.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
2026-06-24 23:43:50 +01:00
co-authored by Sisyphus
parent 7b24f8e484
commit e4b9003439
36 changed files with 1923 additions and 590 deletions
@@ -8,6 +8,7 @@ import (
"testing"
"time"
"crussell/clock"
"crussell/testutils"
"crussell/handlers/bookings"
"crussell/testutils/fixtures"
@@ -116,7 +117,7 @@ func TestAdminRescheduleBooking(t *testing.T) {
t.Fatalf("failed to create test service: %v", err)
}
startTime := time.Now().Add(48 * time.Hour).Truncate(time.Second)
startTime := clock.Now().Add(48 * time.Hour).Truncate(time.Second)
bookingID, err := fixtures.CreateTestBookingAtTime(tx, userID, serviceID, startTime)
if err != nil {
t.Fatalf("failed to create test booking: %v", err)