Skip to content

Conversation

@lucioserra
Copy link
Contributor

No description provided.

lucioserra and others added 7 commits December 10, 2025 20:23
- Update PetSchema to use nested lookup objects (species, sex, status, size)
- Add Zod schemas for lookup objects (PetSpeciesSchema, SexSchema, etc.)
- Modify petRepository queries to join lookup tables
- Update findAllAsync, findByIdAsync, createAsync, updateAsync, archiveAsync
- Maintain consistent pattern with existing colors implementation
- Change LEFT JOIN to INNER JOIN for pet_species, sexes, pet_statuses, pet_sizes
- These are required foreign keys, so INNER JOIN prevents null values
- Fixes TypeScript compilation errors
- Add export:openapi script to package.json
- Create script to export OpenAPI specification to JSON file
- Enables frontend type generation from backend spec
## Lookup API Endpoints
- Add GET /lookups/pet-species - Fetch all pet species
- Add GET /lookups/sexes - Fetch all sexes
- Add GET /lookups/pet-statuses - Fetch all pet statuses
- Add GET /lookups/pet-sizes - Fetch all pet sizes
- Add GET /lookups/pet-colors - Fetch all pet colors

## Implementation
- Create lookup controller, service, repository, and models
- Mount lookup router at /lookups endpoint
- Register lookup endpoints in OpenAPI specification
- All endpoints return dynamic data from database lookup tables

## Documentation
- Fix external docs URL in OpenAPI spec (/swagger.json → /api-docs/swagger.json)
- Add lookup schemas to OpenAPI registry

## Code Quality
- Fix unused variable warning in seed.ts
- Remove unused import in healthCheck test

These endpoints provide dynamic dropdown data for the frontend,
complementing the type-safe API integration.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Change ServiceResponse.failure to return empty arrays instead of null
to match the expected return type.

- getPetSpecies: null → []
- getSexes: null → []
- getPetStatuses: null → []
- getPetSizes: null → []
- getPetColors: null → []

This fixes CI build failures while maintaining correct error handling.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Major API refactoring:
- Renamed `responseObject` to `data` globally across all endpoints
- Simplified pet list/detail responses to return strings instead of nested objects
- Added photo integration with S3 signed URLs (profile + all photos)
- Integrated events and vaccinations into pet detail response
- Maintained numeric pet IDs while removing lookup ID exposure
- Updated all tests to reflect new response structure

Changes affect:
- ServiceResponse class and all API responses
- Pet schemas: PetListItemSchema, PetDetailResponseSchema
- Pet repository: findAllForListAsync, findByIdForDetailAsync
- Pet service: S3 URL generation for photos
- All middleware and service tests

All 48 tests passing ✅

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Fixed all Biome linting issues to pass CI checks:

- Fixed unused error variable in petRepository (prepended with _)
- Changed clientConfig from `any` to proper S3ClientConfig type
- Changed error types from `any` to `unknown` with proper type guards
- Added biome-ignore comments for necessary test mocks
- Fixed migration types to use `Kysely<unknown>` instead of `Kysely<any>`
- Updated logger.error call to handle unknown error type safely

All checks now passing:
- ✅ Biome linting (0 errors, 0 warnings)
- ✅ TypeScript compilation
- ✅ All 48 tests passing
- ✅ Build successful

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@lucioserra lucioserra changed the title Front integration [skip ci] Front integration Dec 12, 2025
Disabled rate limiting for local development to prevent "Too many requests" errors during development and testing.

Changes:
- Added `skip: () => env.isDevelopment` to rate limiter config
- Rate limiting still active in production (NODE_ENV=production)
- Removed unused imports (Response, NextFunction)

Previous behavior:
- 20 requests per 15 minutes (too restrictive for dev)
- Caused 429 errors during rapid testing/development

New behavior:
- Development: Unlimited requests (rate limiting skipped)
- Production: 20 requests per 15 minutes (unchanged)

Tested with 25 rapid requests - all returned 200 ✅
All tests passing ✅

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
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.

2 participants