chore: [Booking Audit Stack -2] Add dependency injection for BookingAudit system and associated services#25123
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
Hey there and thank you for opening this pull request! 👋🏼 We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted. Details: |
This stack of pull requests is managed by Graphite. Learn more about stacking. |
ca9a12f to
9cd647c
Compare
9cd647c to
c67ea30
Compare
a2dddaf to
a2b4be1
Compare
c67ea30 to
b516e69
Compare
a2b4be1 to
476b5e8
Compare
b516e69 to
2b8fd50
Compare
476b5e8 to
25820e9
Compare
25820e9 to
d475433
Compare
2b8fd50 to
79c9309
Compare
05ed8eb to
7e73880
Compare
330d235 to
4df835a
Compare
E2E results are ready! |
There was a problem hiding this comment.
1 issue found across 26 files
Prompt for AI agents (all 1 issues)
Understand the root cause of the following 1 issues and fix them.
<file name="packages/features/booking-audit/lib/service/BookingAuditService.ts">
<violation number="1" location="packages/features/booking-audit/lib/service/BookingAuditService.ts:50">
Rule violated: **Avoid Logging Sensitive Information**
The new audit log statement emits `bookingUid` and `actorId`, leaking stable booking and user identifiers into application logs, which violates the "Avoid Logging Sensitive Information" rule. Remove these identifiers or replace them with non-sensitive aggregates before logging.</violation>
</file>
Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR
5733315 to
2bb803a
Compare
| { | ||
| provide: Logger, | ||
| useFactory: () => { | ||
| return new Logger(); |
There was a problem hiding this comment.
Need this because Logger has an optional dependency in constructor that isn't injected. Following convention similar to used in prisma.module.ts to solve this.
There was a problem hiding this comment.
LGTM.
Just file name change is required #25123 which was created in earlier PR and can be done in a follow up PR
|
@hariombalhara can you fix the conflicts? |
2bb803a to
4a59495
Compare

What does this PR do?
This PR establishes the Dependency Injection (DI) infrastructure for the BookingAudit system. It creates the necessary DI modules, services, and repositories to support audit logging of booking events, but does not yet integrate them into the actual booking flow (that will come in a follow-up PR).
Key changes:
BookingAuditService,BookingAuditRepository, andActorRepositorywith proper token-based dependency resolutionBookingEventHandlerServiceand wired it intoRegularBookingServiceIBookingAuditRepository(usingJsonValueinstead ofunknown, proper action typing)BookingAuditActiontypes by removing redundant reason-update actions and consolidating toREASSIGNMENTImportant notes:
BookingAuditServiceis wired intoBookingEventHandlerServicebut marked as optional - actual audit recording will be implemented in a follow-up PRVisual Demo
N/A - This is infrastructure/refactoring work with no user-facing changes.
Mandatory Tasks
How should this be tested?
Environment setup:
Testing approach:
yarn buildyarn type-check:ci --forceyarn testyarn devExpected behavior:
Human Review Checklist
Critical items to review:
Logger service refactor - The logger was completely rewritten from a factory-based approach to a tslog class. Verify:
LoggerServiceclass provides the same interface as the old loggerBookingAuditAction type changes - Several action types were removed:
CANCELLATION_REASON_UPDATEDREJECTION_REASON_UPDATEDASSIGNMENT_REASON_UPDATEDREASSIGNMENT_REASON_UPDATEDThese were consolidated into just
REASSIGNMENT. Verify these removed types aren't referenced anywhere in the codebase.PrismaBookingAuditRepository null handling - The
create()method has this line:Why would
databe null? Is this correct or should it throw an error instead?DI module loading order - Verify the dependency graph is correct:
BookingAuditServicedepends onBookingAuditRepositoryandActorRepositoryBookingEventHandlerServicedepends onBookingAuditService,HashedLinkService, andLoggerRegularBookingServicedepends onBookingEventHandlerServiceOptional dependency -
BookingAuditServiceis marked as optional inBookingEventHandlerService. Confirm this is intentional for this PR and will be made required in the follow-up.Link to Devin run: https://app.devin.ai/sessions/e771b4569f224cc199bd1cb11aa5e50d
Requested by: hariom@cal.com (@hariombalhara)
Checklist