-
Notifications
You must be signed in to change notification settings - Fork 10.2k
refactor: convert findQualifiedHostsWithDelegationCredentials to service class with DI #22974
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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), | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to fix this
- 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/di
from 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
calAIPhone
imports 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 --force
to ensure no TypeScript compilation errors were introduced by the import changesget-inbound-dynamic-variables.ts
andslots/util.ts
preserved both remote changes and CamelCase naming correctlyDiagram
Notes
calAIPhone
imports) and the new CamelCase file naming