chore: patch cancel#24
Conversation
There was a problem hiding this comment.
Pull Request Overview
This pull request implements a comprehensive filtering system for gatherings, along with several refactoring improvements. The main purpose is to add category-based filtering and enhance the user interface for searching and filtering gatherings.
- Adds category filtering functionality with support for multiple category selection
- Introduces a new FilterBar component with collapsible design and improved search interface
- Refactors booking cancellation to use a dedicated API endpoint instead of generic update
Reviewed Changes
Copilot reviewed 27 out of 28 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Evently.Server.Test/Features/Gatherings/Services/GatheringServiceTests.cs | Adds categoryIds parameter to test method call |
| src/evently.client/src/setup-tests.ts | Adds global setState declaration for testing |
| src/evently.client/src/routes/healthcheck/-index.test.tsx | Updates test wrapper component name |
| src/evently.client/src/routes/gatherings/index.tsx | Major refactor to add filtering functionality and loader |
| src/evently.client/src/routes/gatherings/-index.test.tsx | Updates tests for new filtering functionality |
| src/evently.client/src/routes/gatherings/-components/filter-bar.tsx | New component implementing filtering interface |
| src/evently.client/src/routes/gatherings/-components/gathering-form.tsx | Updates function name for date formatting |
| src/evently.client/src/routes/gatherings/$gatheringId/index.tsx | Replaces booking update with dedicated cancel function |
| src/evently.client/src/lib/services/gathering-service.ts | Adds categoryIds support to API calls |
| src/evently.client/src/lib/services/booking-service.ts | Replaces updateBooking with cancelBooking function |
| src/evently.client/src/lib/services/util-service.ts | Renames and adds date formatting functions |
| src/evently.client/src/lib/components/test-wrappers.tsx | Refactors test wrapper components |
| src/Evently.Server/Features/Gatherings/Services/GatheringService.cs | Adds categoryIds filtering to service |
| src/Evently.Server/Features/Gatherings/Controllers/GatheringsController.cs | Adds categoryIds parameter and logging |
| src/Evently.Server/Features/Bookings/Controllers/BookingsController.cs | Replaces update endpoint with cancel endpoint |
Files not reviewed (1)
- src/evently.client/pnpm-lock.yaml: Language not supported
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| const date: Date | null = !value.isValid ? null : value.startOf("day").toJSDate(); | ||
| handleParamsChange({ | ||
| ...queryParams, | ||
| startDateAfter: date as any |
There was a problem hiding this comment.
Using 'as any' type assertion bypasses TypeScript's type safety. Consider defining the proper type or using a more specific type assertion.
| const date: Date | null = !value.isValid ? null : value.endOf("day").toJSDate(); | ||
| handleParamsChange({ | ||
| ...queryParams, | ||
| endDateBefore: date as any |
There was a problem hiding this comment.
Using 'as any' type assertion bypasses TypeScript's type safety. Consider defining the proper type or using a more specific type assertion.
| bool? isCancelled, | ||
| long[]? categoryIds, | ||
| int? offset, int? limit) { | ||
| logger.LogInformation("categoryIds: {}", string.Join(",", categoryIds ?? [])); |
There was a problem hiding this comment.
This debug logging statement should be removed or moved to a more appropriate log level (Debug/Trace) as it will log on every request in production.
| logger.LogInformation("categoryIds: {}", string.Join(",", categoryIds ?? [])); | |
| logger.LogDebug("categoryIds: {}", string.Join(",", categoryIds ?? [])); |
| booking.CancellationDateTime = DateTimeOffset.UtcNow; | ||
| booking = await bookingService.UpdateBooking(bookingId, bookingReqDto: booking.ToBookingDto()); |
There was a problem hiding this comment.
The parameter name 'bookingReqDto' is explicitly specified but the method is still using the generic UpdateBooking. Consider creating a dedicated CancelBooking method in the service layer for better semantic clarity.
| booking.CancellationDateTime = DateTimeOffset.UtcNow; | |
| booking = await bookingService.UpdateBooking(bookingId, bookingReqDto: booking.ToBookingDto()); | |
| booking = await bookingService.CancelBooking(bookingId); |
No description provided.