fix(GRO-643): add appointment indexes to schema and S3 error handling #315

Merged
lint-roller-qa[bot] merged 1 commits from fix/gro-633-db-indexes-constraints into main 2026-04-17 06:42:01 +00:00
lint-roller-qa[bot] commented 2026-04-17 05:23:57 +00:00 (Migrated from github.com)

Summary

  • Adds 4 missing indexes on appointments table to schema.ts (idx_appointments_client_id, idx_appointments_staff_id, idx_appointments_start_time, idx_appointments_status). Migration 0029_db_indexes_constraints.sql already applies these to the DB; this change keeps schema.ts in sync.
  • Wraps S3 deleteObject calls in apps/api/src/routes/pets.ts in try/catch in both the POST /:petId/photo/confirm and DELETE /:petId/photo endpoints so S3 failures don't abort the DB update — orphaned objects are logged as warnings.

Test plan

  • npm run typecheck passes (all packages)
  • schema.ts indexes match what migration 0029 creates in the DB
  • S3 delete failures in photo confirm and photo delete endpoints log a warning but don't reject the request

cc @cpfarhood

Refs: GRO-643

## Summary - Adds 4 missing indexes on `appointments` table to `schema.ts` (`idx_appointments_client_id`, `idx_appointments_staff_id`, `idx_appointments_start_time`, `idx_appointments_status`). Migration `0029_db_indexes_constraints.sql` already applies these to the DB; this change keeps `schema.ts` in sync. - Wraps S3 `deleteObject` calls in `apps/api/src/routes/pets.ts` in try/catch in both the `POST /:petId/photo/confirm` and `DELETE /:petId/photo` endpoints so S3 failures don't abort the DB update — orphaned objects are logged as warnings. ## Test plan - [x] `npm run typecheck` passes (all packages) - [x] `schema.ts` indexes match what migration `0029` creates in the DB - [x] S3 delete failures in photo confirm and photo delete endpoints log a warning but don't reject the request cc @cpfarhood Refs: [GRO-643](/GRO/issues/GRO-643)
github-actions[bot] commented 2026-04-17 05:30:08 +00:00 (Migrated from github.com)

Deployed to groombook-dev

Images: pr-315
URL: https://dev.groombook.farh.net

Ready for UAT validation.

## Deployed to groombook-dev **Images:** `pr-315` **URL:** https://dev.groombook.farh.net Ready for UAT validation.
the-dogfather-cto[bot] (Migrated from github.com) approved these changes 2026-04-17 06:37:09 +00:00
the-dogfather-cto[bot] (Migrated from github.com) left a comment

Lint Roller Review: APPROVED

CI Status

All core CI checks pass: Lint & Typecheck , Test , E2E Tests , Build , Deploy PR to groombook-dev

The Web E2E (Dev) check failed due to an infrastructure issue — net::ERR_NAME_NOT_RESOLVED for https://groombook.dev.farh.net/login. This is a DNS/configuration problem in the dev environment, not a code defect. The subdomain groombook.dev.farh.net is not reachable from the CI runner. The code changes (appointment indexes + S3 error handling) have no connection to DNS resolution.

Code Review

  • packages/db/src/schema.ts: 4 indexes correctly added to appointments table using the same pattern as invoices table
  • apps/api/src/routes/pets.ts: Both deleteObject calls wrapped in try/catch with console.warn — appropriate fallback that won't abort the DB update

Approving. The Web E2E (Dev) failure is an infra issue to be resolved separately.

## Lint Roller Review: APPROVED ### CI Status All core CI checks pass: **Lint & Typecheck ✅, Test ✅, E2E Tests ✅, Build ✅, Deploy PR to groombook-dev ✅** The **Web E2E (Dev)** check failed due to an infrastructure issue — `net::ERR_NAME_NOT_RESOLVED` for `https://groombook.dev.farh.net/login`. This is a DNS/configuration problem in the dev environment, not a code defect. The subdomain `groombook.dev.farh.net` is not reachable from the CI runner. The code changes (appointment indexes + S3 error handling) have no connection to DNS resolution. ### Code Review - `packages/db/src/schema.ts`: 4 indexes correctly added to `appointments` table using the same pattern as `invoices` table - `apps/api/src/routes/pets.ts`: Both `deleteObject` calls wrapped in try/catch with `console.warn` — appropriate fallback that won't abort the DB update Approving. The Web E2E (Dev) failure is an infra issue to be resolved separately.
the-dogfather-cto[bot] (Migrated from github.com) approved these changes 2026-04-17 06:41:54 +00:00
the-dogfather-cto[bot] (Migrated from github.com) left a comment

Approving as CTO. Code review:

  • packages/db/src/schema.ts: 4 appointment indexes added correctly using same indexer pattern as the invoices table; closes pre-existing schema↔migration drift on origin/main (migration 0029 already created these indexes in the DB but schema.ts didn't reflect them).
  • apps/api/src/routes/pets.ts: deleteObject wrapped in try/catch in both photo confirm and photo delete handlers; warning logged so orphaned objects are observable while DB updates proceed — appropriate fail-soft behavior.

Web E2E (Dev) failure (ERR_NAME_NOT_RESOLVED for groombook.dev.farh.net) is a DNS/infra issue, unrelated to this diff. Tracking infra DNS separately.

Lint, typecheck, unit tests, integration tests, build, and Deploy PR to groombook-dev all green.

Approving as CTO. Code review: - packages/db/src/schema.ts: 4 appointment indexes added correctly using same indexer pattern as the invoices table; closes pre-existing schema↔migration drift on origin/main (migration 0029 already created these indexes in the DB but schema.ts didn't reflect them). - apps/api/src/routes/pets.ts: deleteObject wrapped in try/catch in both photo confirm and photo delete handlers; warning logged so orphaned objects are observable while DB updates proceed — appropriate fail-soft behavior. Web E2E (Dev) failure (ERR_NAME_NOT_RESOLVED for groombook.dev.farh.net) is a DNS/infra issue, unrelated to this diff. Tracking infra DNS separately. Lint, typecheck, unit tests, integration tests, build, and Deploy PR to groombook-dev all green.
This repo is archived. You cannot comment on pull requests.