refactor: convert findQualifiedHostsWithDelegationCredentials to service class with DI#22974
Conversation
…ice class with DI - Create QualifiedHostsService class following UserAvailabilityService pattern - Add IQualifiedHostsService interface with prisma and bookingRepo dependencies - Create DI module and container for qualified hosts service - Update filterHostsBySameRoundRobinHost to accept prisma as parameter - Update all usage sites to use the new service: - loadAndValidateUsers.ts - slots/util.ts - test mocks in _post.test.ts - Maintain backward compatibility with original function export - Fix type issues in team properties (rrResetInterval, rrTimestampBasis) Co-Authored-By: morgan@cal.com <morgan@cal.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Join our Discord community for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
…rameter - Add missing prisma parameter to all test function calls - Resolves unit test failure caused by function signature change Co-Authored-By: morgan@cal.com <morgan@cal.com>
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ |
- Import PrismaClient type instead of using unknown - Fix type compatibility for BookingRepository constructor - Update test mocks to use proper BookingRepository type - Ensure all DI dependencies are properly typed Co-Authored-By: morgan@cal.com <morgan@cal.com>
Graphite Automations"Add consumer team as reviewer" took an action on this PR • (08/08/25)1 reviewer was added to this PR based on Keith Williams's automation. |
E2E results are ready! |
| filterHostsService: new FilterHostsService(bookingRepository), | ||
| }); |
- Rename all files in packages/lib/di from kebab-case to CamelCase - Update 22 external files with import statements to use new file names - Update internal DI module files with corrected imports - Maintain consistency with TypeScript naming conventions Co-Authored-By: morgan@cal.com <morgan@cal.com>
d655aa2 to
c3d360e
Compare
- Remove obsolete mock for old function module - Keep correct mock for new DI container - Resolves CI unit test failures Co-Authored-By: morgan@cal.com <morgan@cal.com>
Co-Authored-By: morgan@cal.com <morgan@cal.com>
…23003) * refactor * fix type check
Co-authored-by: CarinaWolli <wollencarina@gmail.com>
Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
* --init * address change requests * adding further changes * address feedback * further changes * further clean-up * clean up * fix module import and others * add guards * remove unnecessary comments * remove unnecessary comments * cleanup * sort coderabbig suggestions * improve check * chore: bump platform libraries --------- Co-authored-by: Lauris Skraucis <lauris.skraucis@gmail.com> Co-authored-by: supalarry <laurisskraucis@gmail.com>
|
|
refactor: rename DI files to CamelCase and update imports
Summary
Renamed all 29 files in
packages/lib/difrom kebab-case to CamelCase naming convention and updated corresponding import statements throughout the codebase. This change improves consistency with TypeScript naming conventions.Key changes:
available-slots.ts→AvailableSlots.ts,booking-limits.ts→BookingLimits.ts, etc. (9 files)busy-times.ts→BusyTimes.ts,check-booking-limits.ts→CheckBookingLimits.ts, etc. (20 files)During implementation, resolved merge conflicts particularly around
calAIPhoneimports and trpc utility files.Review & Testing Checklist for Human
grep -r "di/containers/[a-z-]" packages/ apps/andgrep -r "di/modules/[a-z-]" packages/ apps/)yarn type-check:ci --forceto ensure no TypeScript compilation errors were introduced by the import changesget-inbound-dynamic-variables.tsandslots/util.tspreserved both remote changes and CamelCase naming correctlyDiagram
%%{ init : { "theme" : "default" }}%% graph TD subgraph "packages/lib/di" DC["containers/<br/>AvailableSlots.ts<br/>BookingLimits.ts<br/>QualifiedHosts.ts<br/>etc. (9 files)"]:::major-edit DM["modules/<br/>BusyTimes.ts<br/>CheckBookingLimits.ts<br/>FilterHosts.ts<br/>etc. (20 files)"]:::major-edit end subgraph "Import References" T1["test/lib/<br/>getSchedule.test.ts<br/>checkBookingLimits.test.ts"]:::minor-edit F1["features/bookings/<br/>handleNewBooking/loadUsers.ts"]:::minor-edit T2["trpc/server/routers/<br/>viewer/slots/util.ts"]:::minor-edit I1["features/insights/<br/>server/trpc-router.ts"]:::minor-edit end subgraph "Merge Conflicts" MC1["apps/web/pages/api/<br/>get-inbound-dynamic-variables.ts"]:::minor-edit MC2["packages/trpc/server/<br/>routers/viewer/slots/util.ts"]:::minor-edit end DC --> T1 DC --> F1 DM --> T2 DM --> I1 subgraph Legend L1[Major Edit]:::major-edit L2[Minor Edit]:::minor-edit L3[Context/No Edit]:::context end classDef major-edit fill:#90EE90 classDef minor-edit fill:#87CEEB classDef context fill:#FFFFFFNotes
calAIPhoneimports) and the new CamelCase file naming