Commit Graph
378 Commits
Author SHA1 Message Date
popertots 3a9bc02796 fix: check ParseMultipartForm errors, reduce maxMemory, handle 413 properly 2026-07-10 12:06:12 +01:00
popertots ef3cfe8c4f fix: replace crypto/md5 with crypto/sha256 for IP hashing 2026-07-10 12:04:49 +01:00
popertots d1e85bb855 fix: add missing err checks and fix loop termination in tests 2026-07-10 12:03:11 +01:00
popertots cf0cd8de15 fix: remove 10 unused test functions flagged by staticcheck U1000 2026-07-10 12:01:02 +01:00
popertotsandSisyphus 5f95abf804 ci: add secrets scanning, staticcheck, gosec, coverage, env docs, compose/nginx validation, a11y
CI / Nginx config check (push) Failing after 7s
CI / Docker compose check (push) Failing after 7s
CI / Secrets scan (push) Failing after 7s
CI / Env docs check (push) Failing after 8s
CI / Frontend deps check (push) Failing after 23s
CI / Knip (push) Has been skipped
CI / Frontend a11y check (push) Has been skipped
CI / Go build (push) Successful in 37s
CI / Go vulnerabilities (push) Successful in 37s
CI / Frontend build (push) Successful in 1m1s
CI / go mod tidy (push) Successful in 24s
CI / Svelte strict check (push) Has been skipped
CI / Frontend QC (audit) (push) Has been skipped
CI / Frontend QC (typecheck) (push) Has been skipped
CI / Frontend QC (lint) (push) Has been skipped
CI / Go vet (push) Successful in 1m31s
CI / Staticcheck (push) Failing after 1m50s
CI / golangci-lint (push) Successful in 2m26s
CI / Security scan (gosec) (push) Failing after 2m38s
CI / Tests (prod) (push) Has been skipped
CI / Tests (dev) (push) Has been skipped
CI / Race (prod) (push) Has been skipped
CI / Race (dev) (push) Has been skipped
New jobs in pipeline:

secrets-scan: gitleaks detection
go-staticcheck: static analysis (complement to golangci-lint)
go-gosec: Go security linter
test: coverage profiling with 50% threshold gate
env-docs-check: verifies all env vars are documented in .env.example
docker-compose-check: validates compose.yml syntax
nginx-check: validates nginx config
frontend-a11y: Svelte a11y accessibility checks

Also: remove orphaned Makefile, update .env.example with 11 missing vars,
create .gitleaks.toml with allowlist, add check-env-docs.py script.

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-07-10 09:38:07 +01:00
popertotsandSisyphus 407de74b51 fix: restore test-used functions, silence tx.Rollback closed errors, prune knip dead code
CI / Frontend deps check (push) Successful in 22s
CI / Go vulnerabilities (push) Successful in 32s
CI / Go build (push) Successful in 32s
CI / go mod tidy (push) Successful in 13s
CI / Knip (push) Failing after 33s
CI / Frontend build (push) Successful in 1m12s
CI / Svelte strict check (push) Has been skipped
CI / Frontend QC (audit) (push) Has been skipped
CI / Frontend QC (typecheck) (push) Has been skipped
CI / Frontend QC (lint) (push) Has been skipped
CI / Go vet (push) Successful in 57s
CI / golangci-lint (push) Successful in 1m8s
CI / Tests (prod) (push) Successful in 1m45s
CI / Tests (dev) (push) Successful in 2m5s
CI / Race (prod) (push) Successful in 3m27s
CI / Race (dev) (push) Successful in 4m52s
Restore processImage (images.go) and nonDepositPaymentType (handlers.go) with //nolint:unused — used in test files.
Fix 97 tx.Rollback defers to silently discard expected "tx is closed" error after commit.
Frontend: remove 44 unused shadcn-svelte files, 2 dead components, 9 stale npm deps, prune unused exports.

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-07-09 19:20:25 +01:00
popertotsandSisyphus 9e6c415cc4 fix: run go mod tidy to sync go.sum after golangci-lint changes
CI / Frontend deps check (push) Successful in 27s
CI / Go build (push) Successful in 36s
CI / Go vulnerabilities (push) Successful in 36s
CI / go mod tidy (push) Successful in 15s
CI / Frontend build (push) Successful in 1m10s
CI / Knip (push) Failing after 38s
CI / Svelte strict check (push) Has been skipped
CI / Frontend QC (audit) (push) Has been skipped
CI / Frontend QC (typecheck) (push) Has been skipped
CI / Frontend QC (lint) (push) Has been skipped
CI / Go vet (push) Failing after 51s
CI / golangci-lint (push) Successful in 1m7s
CI / Tests (prod) (push) Has been skipped
CI / Tests (dev) (push) Has been skipped
CI / Race (prod) (push) Has been skipped
CI / Race (dev) (push) Has been skipped
2 stale checksum entries removed.

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-07-09 18:54:01 +01:00
popertotsandSisyphus ed9cb1489c fix: resolve golangci-lint violations (errcheck, unused, gosimple, ineffassign)
errcheck: add proper error handling with slog.Error for tx.Rollback, key generation, and s3/dav operations. Add nolint comments for intentionally discarded DB scan errors and HTTP write errors.
unused: remove dead code (svcRow type, processImage, nonDepositPaymentType, generateSecureCode, colorBold, nGreen, nRed)
gosimple S1021: merge var declaration with assignment in manage.go
ineffassign: remove dead assignments in settings.go, till.go, images.go

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-07-09 18:53:51 +01:00
popertotsandSisyphus 510828c924 chore: run go fix for Go 1.26 modernization
CI / Go vulnerabilities (push) Successful in 1m10s
CI / Build & Vet (push) Successful in 1m39s
CI / Frontend build (gate) (push) Successful in 1m42s
CI / Frontend QC (audit) (push) Successful in 56s
CI / Frontend QC (typecheck) (push) Successful in 1m36s
CI / Frontend QC (lint) (push) Successful in 1m51s
CI / Tests (prod) (push) Has been cancelled
CI / Tests (dev) (push) Has been cancelled
CI / Race (prod) (push) Has been cancelled
CI / Race (dev) (push) Has been cancelled
106 files: interface{}→any, strings.Split→SplitSeq, CutPrefix/Cut, strings.Builder, slices.Contains, remove redundant // +build directives, gofmt import ordering and indentation.

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-07-09 17:25:23 +01:00
popertotsandSisyphus ef26bd59e9 ci: fix go-version to 1.26 (no patch) and clean up step names
CI / Go vulnerabilities (push) Successful in 34s
CI / Build & Vet (push) Successful in 43s
CI / Frontend build (gate) (push) Successful in 54s
CI / Frontend QC (audit) (push) Successful in 1m4s
CI / Tests (prod) (push) Successful in 1m56s
CI / Tests (dev) (push) Successful in 1m55s
CI / Frontend QC (typecheck) (push) Successful in 2m38s
CI / Frontend QC (lint) (push) Successful in 2m41s
CI / Race (prod) (push) Successful in 5m8s
CI / Race (dev) (push) Successful in 6m58s
setup-go resolves '1.26' to latest patch (1.26.5). go.mod follows convention with minor version only. All CI steps now have descriptive names.

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-07-09 17:22:23 +01:00
popertotsandSisyphus c344d6c54d chore: upgrade Go from 1.25.7 to 1.26.5
CI / Go vulnerabilities (push) Failing after 54s
CI / Frontend build (gate) (push) Successful in 59s
CI / Build & Vet (push) Successful in 1m40s
CI / Frontend audit (push) Successful in 39s
CI / Tests (prod) (push) Has been skipped
CI / Tests (dev) (push) Has been skipped
CI / Race (prod) (push) Has been skipped
CI / Race (dev) (push) Has been skipped
CI / Frontend typecheck (push) Successful in 1m0s
CI / Frontend lint (push) Successful in 1m23s
Go 1.26.5 released Jul 7, 2026. Includes security fix for GO-2026-5856 (crypto/tls ECH leak). Updates: CI runner (4x setup-go), go.mod, README, obsidian docs.

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-07-09 17:11:49 +01:00
popertotsandSisyphus 27be7cea91 refactor: wire centralized job scheduler and custom request logging in main.go
Replace inline cleanup goroutines and default chi logger with centralized jobs scheduler and custom colored request logger.

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-07-07 00:10:09 +01:00
popertotsandSisyphus e86248b27c refactor: move auth, GDPR, and booking cleanup to centralized scheduler
Convert CleanupRevokedJTIs to return (int, error) and remove StartJTICleanup goroutine. Add CleanupStaleLoginEntries and CleanupGDPRExportCache for centralized scheduler. Add clock.London timezone location.

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-07-07 00:10:00 +01:00
popertotsandSisyphus a4fa75154d refactor: centralize scheduling cleanup with row-count returns
Convert all scheduling cleanup functions to return (int, error). Remove inline cleanup calls from GetAvailableHours. Add scheduled-cleanup.go for centralized job wrappers.

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-07-07 00:09:51 +01:00
popertotsandSisyphus 6064a06b7d refactor: extract shared rate limiter types into ratelimit_shared.go
Move RateLimiter, ProgressiveRateLimiter, and cleanup functions to ratelimit_shared.go. Add dev and prod rate limiter tests. Remove inline cleanup goroutines.

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-07-07 00:09:43 +01:00
popertotsandSisyphus f78489ae00 feat: add logutil and jobs internal packages
Add centralized jobs scheduler and logutil package with ANSI colors and duration formatting.

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-07-07 00:09:34 +01:00
popertotsandSisyphus 72161e8c4f docs(backend): clarify auth fallback rationale in reserve handler
CI / Go vulnerabilities (push) Successful in 37s
CI / Tests (push) Successful in 1m33s
CI / Frontend lint & types (push) Successful in 1m46s
CI / Race detector (push) Successful in 3m38s
Expands inline comments to explain why the Bearer token fallback is deliberately kept — it serves 22+ test invocations that call ReserveSlotHandler directly without middleware, never executes in production, and acts as defense-in-depth.

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-07-06 19:22:08 +01:00
popertotsandSisyphus e303c07f8d refactor(backend): replace inline Bearer parsing with OptionalAuth middleware in services
Removes the inline Bearer token fallback in ServicesHandler — the OptionalAuth middleware (added to the public services route group in main.go) now handles auth context population. This eliminates duplicated token parsing logic and ensures consistent auth behavior across all routes.

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-07-06 19:22:00 +01:00
popertots c2aa0b93cb feat(api): add admin reservation cancel endpoint
Add DELETE /api/admin/bookings/reserve to release admin walk-in/call-in reservations.

New handler AdminCancelReservationHandler targets only RESERVATION:admin:%
entries (partitioned from user RESERVATION:user:% by WHERE clause). Includes
12 tests covering walkin + callin success, isolation, no-op, unauth, empty ctx,
walkin+callin coexistence, anon untouched, response format parity, overlapping
reservations deleted, user reservations untouched, and idempotent double-cancel.

Inverse-isolation tests in cancel_reservation_test.go prove the user-side
DELETE /api/bookings/reserve does not touch admin or anon reservations.
2026-07-06 17:58:03 +01:00
popertotsandSisyphus be22710f7b test: add scheduling excludeUserID integration test
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-07-05 20:26:40 +01:00
popertotsandSisyphus 2e0760f083 feat: add IP-based anon reservation cleanup to admin reserve handler
Extend AdminReserveSlotHandler's pre-overlap DELETE to also clean up anonymous RESERVATION:anon entries matching the admin's IP address. This handles the edge case where an admin previously reserved a slot without authentication. Also reorganise imports to follow goimports conventions.

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-07-05 20:26:33 +01:00
popertotsandSisyphus cc6ad7f00f fix: remove t.Parallel from VAT lifecycle test
CI / Go vulnerabilities (push) Successful in 33s
CI / Tests (push) Successful in 1m28s
CI / Frontend lint & types (push) Successful in 1m45s
CI / Race detector (push) Successful in 3m28s
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-07-05 20:08:12 +01:00
popertotsandSisyphus 30c9012562 fix: move dav.Service init from auth_test to user testmain
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-07-05 20:08:09 +01:00
popertotsandSisyphus 69ae3e1f99 chore: bump golang.org/x/image from v0.42.0 to v0.43.0
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-07-05 11:55:39 +01:00
popertotsandSisyphus 296a67770e fix: resolve RLock deadlock in Square mock client
Move m.mu.RUnlock to defer in GetCheckout and remove duplicate RLock/RUnlock around m.completed lookup. This prevents a deadlock when CheckoutPending error is returned but the RLock was already released.

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-07-05 11:48:04 +01:00
popertotsandSisyphus 33c945159c feat: add cancel reservation handler and background cleanup
Add CancelReservationHandler (DELETE /api/bookings/reserve) to release authenticated user's active reservation. Register route in main.go. Add background goroutine for periodic reservation cleanup using CleanupOldReservations. Add idx_time_blockers_created_at index and extend anon cleanup to cover edit_request reservations in init-script.sql.

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-07-05 11:47:54 +01:00
popertotsandSisyphus 2386bd0ca2 test: add tests for reservation self-block prevention
Add TestReserveSlot_DoesNotSelfBlock, TestAdminReserveSlot_DoesNotSelfBlock and TestReserveSlot_CleansUpAnonReservation. Add UserIDKey context to admin approve edit request tests. Remove weekend-day adjustment in TestAdminApproveEditRequest_OverlapWithBooking_Regression and TestAdminApproveEditRequest_EvictsPendingRelease (no longer needed).

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-07-05 11:47:43 +01:00
popertotsandSisyphus c1a9f35ea5 feat: prevent reservation self-block in booking handlers
Pass excludeUserID to CheckTimeBlockerOverlap in AdminReserveSlotHandler, CreateBookingHandler, EditBookingHandler, AdminRescheduleBookingHandler, AdminCreateBookingForUserHandler, AdminApproveEditRequestHandler, and ReserveSlotHandler. Also clean up stale reservations before overlap check in AdminReserveSlotHandler and ReserveSlotHandler via db.Conn.Exec for cross-connection visibility. Improve error handling in RequestEditHandler's service update block.

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-07-05 11:45:02 +01:00
popertotsandSisyphus 920eb761fd feat: add excludeUserID param to scheduling time blockers
Add optional excludeUserID parameter to GetTimeBlockersInRange and CheckTimeBlockerOverlap so a user's own RESERVATION entries are excluded from overlap checks. This prevents users from self-blocking on their existing reservation when checking availability or confirming a booking.

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-07-05 11:44:52 +01:00
popertots 766b5b7dbd fix(vat): resolve non-deterministic ORDER BY in TestVAT_ToggleLifecycle
Frontend Lint & Vulns / Lint & vulns (push) Failing after 48s
The phase 3 payment query used ORDER BY created_at DESC LIMIT 1.
Within a single transaction, NOW() returns the same timestamp for all
inserts, making the ordering non-deterministic when other parallel tests
insert payment rows with the same timestamp. Fix by parsing the
response's payment ID and querying by it directly.

Also revert eslint.config.js back to error-level rules for all categories
(removing the previous 'warn' overrides).
2026-06-25 14:12:48 +01:00
popertots 3fd66d5414 ci: remove -a flag and debug log now fix is confirmed
Backend Tests / test (push) Successful in 1m0s
2026-06-25 12:04:56 +01:00
popertots 2db552db44 ci: add -a flag and debug print for savedPOSTGRESHost
Backend Tests / test (push) Successful in 1m33s
2026-06-25 11:52:22 +01:00
popertots 248756a1fe fix(db): prevent POSTGRES_HOST env var leakage between tests
Backend Tests / test (push) Successful in 59s
resetEnv() conditionally set POSTGRES_HOST only when empty. When
TestConnect_InvalidCredentials explicitly set it to 'localhost' and
then called resetEnv(), the value was preserved because it wasn't
empty. This leaked into TestConcurrentQueries, which then tried to
connect to localhost:5432 instead of the workflow-configured postgres
hostname.

Fix: capture the POSTGRES_HOST value at init() time in a package-level
variable (savedPOSTGRESHost) and always restore it in resetEnv(), so
the correct value is always used regardless of which tests ran before.
2026-06-25 01:21:15 +01:00
popertots 7accd73463 fix(testdb): fallback to POSTGRES_HOST in dbHost()
Backend Tests / test (push) Failing after 2m31s
dbHost() only checked TEST_DB_HOST, defaulting to localhost. When the
CI workflow removed PG service port mappings (to avoid host port conflicts),
all tests using testdb.CreateTestDatabase() failed because localhost:5432
was unreachable inside the job container.

The workflow sets POSTGRES_HOST=postgres for the db package's Connect(),
but testdb's dbHost() never checked this env var. Add POSTGRES_HOST as
a second fallback so all packages using testdb automatically work with
the existing CI configuration.
2026-06-25 01:11:00 +01:00
popertots 0ac69a92c7 fix(db): use POSTGRES_HOST env var in dev Connect()
Backend Tests / test (push) Failing after 49s
The dev-tagged Connect() in db_dev.go hardcoded localhost:5432 in the
DSN instead of reading the POSTGRES_HOST env var. Since CI tests run
with -tags "test,dev", db_dev.go is compiled and the POSTGRES_HOST=postgres
env var was silently ignored, causing db package tests to try connecting
to 127.0.0.1:5432 where no PostgreSQL is listening (service container
is only reachable via Docker DNS hostname postgres).

Also remove the -a flag from the workflow now that caching is no longer
suspected of causing issues.
2026-06-25 01:08:28 +01:00
popertots 99a06048c8 ci: stop overriding POSTGRES_HOST in test helpers
Backend Tests / test (push) Failing after 50s
2026-06-25 01:01:32 +01:00
popertots a11d2538e9 ci: fix db test init to respect POSTGRES_HOST from env
Backend Tests / test (push) Failing after 50s
2026-06-25 00:59:22 +01:00
popertots 3cb6a7f6ad ci: set POSTGRES_HOST directly in workflow
Backend Tests / test (push) Failing after 1m1s
2026-06-25 00:56:45 +01:00
popertots c3f0440713 ci: respect TEST_DB_HOST in db package tests
Backend Tests / test (push) Failing after 54s
2026-06-25 00:50:21 +01:00
popertots f3a41585d2 ci: add TEST_DB_HOST env var for service container connectivity
Backend Tests / test (push) Failing after 58s
2026-06-25 00:47:18 +01:00
popertotsandSisyphus e4b9003439 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>
2026-06-24 23:43:50 +01:00
popertotsandSisyphus 7b24f8e484 refactor(payments): integrate VAT into gift card buy flow and wrap in transactions
Refactor BuyGiftCard to insert pending payment before Square call with VAT applied. Add transaction wrapping to gift card handlers. Remove redundant Content-Type header sets. Migrate all time.Now() to clock.Now().

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-24 23:43:40 +01:00
popertotsandSisyphus 40bbd9ba49 refactor(bookings): migrate remaining handlers and tests to clock.Now()
Replace time.Now() with clock.Now() in bookings handlers and all test files. Includes deposit, discount, dedup, overlap, and edit request test updates.

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-24 23:43:32 +01:00
popertotsandSisyphus 0ea1bb64b4 feat(bookings): add closing_time validation and repo layer
Extract closing hours check into reusable checkClosingHours helper. Add repo.go for shared DB query helpers. Update admin_reserve to use closing_time and move overlap check inside transaction with FOR UPDATE.

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-24 23:43:23 +01:00
popertotsandSisyphus 58996c553a refactor(internal): replace log.Fatal with panic, add timezone to DSN, add empty S3 bucket check
Replace log.Fatal in dev service init with panic for consistency. Add timezone=UTC to DAV connection DSN. Add IsEmpty() check for S3 dev bucket.

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-24 23:43:14 +01:00
popertotsandSisyphus e95b1a65af refactor(auth): wrap JWT operations in transactions and migrate to clock.Now()
Wrap JTI revocation, cleanup, refresh token generation, and verification in explicit DB transactions with Begin/defer Rollback/Commit. Replace time.Now() with clock.Now() for testability.

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-24 23:43:07 +01:00
popertotsandSisyphus da0e64c02b feat(mw): add content-type and response middleware
Add Content-Type enforcement middleware and generic JSON response helpers to standardize API responses.

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-24 23:42:57 +01:00
popertotsandSisyphus 08c8828bb0 refactor(db): set UTC timezone in pool config and add Querier docs
Set UTC timezone in pgxpool config to ensure consistent timestamp handling. Add detailed doc comment to Querier interface clarifying QueryRow vs Querier distinction.

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-24 23:42:49 +01:00
popertotsandSisyphus 6ec2cf1d69 feat(clock): add clock package for testable time
Add a Clock interface and default real-clock implementation so production code can use clock.Now() instead of time.Now(), and tests can inject a fake clock for deterministic timeouts and scheduling.

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-24 23:42:41 +01:00
popertotsandSisyphus 37a9ba3517 fix(bookings): use transaction context for discount check in approve edit
Use tx.QueryRow instead of db.Conn.QueryRow for discount count check in AdminApproveEditRequestHandler to ensure consistency within the transaction.

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-22 17:06:18 +01:00