fix(api): return original email without OAuth suffix in bookings#99
Conversation
Code Review by Qodo
1. output.service.ts naming violation
|
| export class OutputBookingsService_2024_08_13 { | ||
| constructor(private readonly bookingsRepository: BookingsRepository_2024_08_13) {} | ||
|
|
||
| private getDisplayEmail(email: string): string { | ||
| return email.replace(/\+[a-zA-Z0-9]{25}/, ""); | ||
| } | ||
|
|
There was a problem hiding this comment.
1. output.service.ts naming violation 📘 Rule violation ✓ Correctness
• The modified service file uses a dot-suffix filename (output.service.ts) and does not match the required <Entity>Service.ts / PascalCase filename convention. • This breaks the repository/service naming convention, reducing discoverability and making it harder to reliably locate or refactor service implementations.
Agent prompt
## Issue description
The modified service file name `output.service.ts` violates the required service naming convention (PascalCase `<Entity>Service.ts` with filename/class name alignment).
## Issue Context
Compliance requires consistent naming for service classes/files to maintain discoverability and predictable architecture.
## Fix Focus Areas
- apps/api/v2/src/ee/bookings/2024-08-13/services/output.service.ts[92-99]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| const bookingsMap = new Map(databaseBookings.map(booking => [booking.id, booking])); | ||
|
|
||
| const transformed = bookingsIds.map(bookingId => { | ||
| const databaseBooking = bookingsMap.get(bookingId); |
There was a problem hiding this comment.
2. booking => missing parentheses 📘 Rule violation ✓ Correctness
• New arrow functions omit parentheses around a single parameter (e.g., booking =>), which violates the Biome formatting requirement to always include arrow function parentheses. • This creates inconsistent formatting and may cause CI/format checks to fail if Biome is enforced.
Agent prompt
## Issue description
Arrow functions were added without parentheses around parameters, violating the project's Biome formatting standard.
## Issue Context
Compliance requires "always use arrow function parentheses" for consistent code formatting.
## Fix Focus Areas
- apps/api/v2/src/ee/bookings/2024-08-13/services/output.service.ts[414-417]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| async getOutputRecurringSeatedBookings(bookingsIds: number[], showAttendees: boolean) { | ||
| const databaseBookings = await this.bookingsRepository.getByIdsWithAttendeesWithBookingSeatAndUserAndEvent(bookingsIds); | ||
|
|
||
| const bookingsMap = new Map(databaseBookings.map(booking => [booking.id, booking])); | ||
|
|
||
| const transformed = bookingsIds.map(bookingId => { | ||
| const databaseBooking = bookingsMap.get(bookingId); | ||
| if (!databaseBooking) { |
There was a problem hiding this comment.
3. Recurring seated order nondeterministic 🐞 Bug ✓ Correctness
• getOutputRecurringSeatedBookings no longer sorts by start time, so the returned array order is whatever order bookingsIds happens to be in. • The recurring booking IDs come from a Prisma findMany without orderBy, so the ID order is not guaranteed and can vary between runs/DBs. • This is inconsistent with getOutputRecurringBookings (which sorts) and can break clients that expect recurring bookings to be chronological.
Agent prompt
### Issue description
`getOutputRecurringSeatedBookings` returns results without sorting, but its inputs originate from Prisma `findMany` calls without `orderBy`, making response order non-deterministic and inconsistent with the non-seated recurring booking response ordering.
### Issue Context
This can break clients that assume recurring bookings are returned in chronological order.
### Fix Focus Areas
- apps/api/v2/src/ee/bookings/2024-08-13/services/output.service.ts[411-425]
- apps/api/v2/src/ee/bookings/2024-08-13/repositories/bookings.repository.ts[174-185]
- apps/api/v2/src/ee/bookings/2024-08-13/services/output.service.ts[231-244]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Benchmark PR from agentic-review-benchmarks#4