-
Notifications
You must be signed in to change notification settings - Fork 11.5k
feat: create BookingHistoryViewerService to combine audit logs with routing form submissions #26045
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
feat: create BookingHistoryViewerService to combine audit logs with routing form submissions #26045
Conversation
…outing form submissions Co-Authored-By: hariom@cal.com <hariombalhara@gmail.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:
|
…-viewer-service-1766126882
- Updated the booking logs view to use the new getBookingHistory query instead of getAuditLogs. - Introduced DisplayBookingAuditLog type for improved clarity in BookingAuditViewerService. - Refactored BookingHistoryViewerService to utilize the new DisplayBookingAuditLog type and added sorting functionality for history logs. - Adjusted related types and methods to ensure consistency across services.
- Consolidated type exports and imports from the features library for better organization. - Removed redundant type definitions and functions in zod.ts, findFieldValueByIdentifier.ts, getFieldIdentifier.ts, and parseRoutingFormResponse.ts. - Introduced new utility functions for handling field responses and parsing routing form responses. - Improved type safety and clarity across routing form response handling.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
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.
Moved code from @calcom/app-store
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.
Moved code from @calcom/app-store
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.
Moved code from @calcom/app-store
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.
Moved code from @calcom/app-store
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.
Moved code from @calcom/app-store
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.
2 issues found across 22 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="packages/trpc/server/routers/viewer/bookings/_router.tsx">
<violation number="1" location="packages/trpc/server/routers/viewer/bookings/_router.tsx:111">
P2: The route name was changed from `getAuditLogs` to `getBookingHistory`, but the PR description claims backward compatibility was maintained by keeping the route name as `getAuditLogs`. If there are existing consumers of this tRPC endpoint, this will be a breaking change. Either:
1. Keep the original route name `getAuditLogs` (or add an alias) to maintain backward compatibility
2. Update the PR description to reflect that this is a breaking change</violation>
</file>
<file name="packages/features/booking-audit/lib/service/BookingHistoryViewerService.ts">
<violation number="1" location="packages/features/booking-audit/lib/service/BookingHistoryViewerService.ts:79">
P1: The `uniqueId` variable already contains the `id: ` prefix, causing double prefixing in the `id` field (`id: id: form-submission-X`) and inconsistent prefixing in `operationId` (`operationId: id: form-submission-X`). Remove the `id: ` prefix from `uniqueId`.</violation>
</file>
Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR
packages/features/booking-audit/lib/service/BookingHistoryViewerService.ts
Outdated
Show resolved
Hide resolved
Co-Authored-By: hariom@cal.com <hariombalhara@gmail.com>
E2E results are ready! |
Udit-takkar
left a comment
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.
LGTM
Merge activity
|
…-viewer-service-1766126882
|
@volnei @Udit-takkar Resolved a small conflict here. So, need a reapproval |
…outing form submissions (calcom#26045) * feat: create BookingHistoryViewerService to combine audit logs with routing form submissions Co-Authored-By: hariom@cal.com <hariombalhara@gmail.com> * refactor(booking): rename audit log query and enhance type safety - Updated the booking logs view to use the new getBookingHistory query instead of getAuditLogs. - Introduced DisplayBookingAuditLog type for improved clarity in BookingAuditViewerService. - Refactored BookingHistoryViewerService to utilize the new DisplayBookingAuditLog type and added sorting functionality for history logs. - Adjusted related types and methods to ensure consistency across services. * refactor(routing-forms): streamline imports and enhance type definitions - Consolidated type exports and imports from the features library for better organization. - Removed redundant type definitions and functions in zod.ts, findFieldValueByIdentifier.ts, getFieldIdentifier.ts, and parseRoutingFormResponse.ts. - Introduced new utility functions for handling field responses and parsing routing form responses. - Improved type safety and clarity across routing form response handling. * fix: remove double prefix from uniqueId in form submission entry Co-Authored-By: hariom@cal.com <hariombalhara@gmail.com> * 1c97f9c (calcom#26453) --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
What does this PR do?
Creates a new
BookingHistoryViewerServicethat combines booking audit logs with routing form submission data to provide a complete chronological history of a booking. This service replaces the direct usage ofBookingAuditViewerServicein the tRPC handler.Changes:
BookingHistoryViewerServicethat injectsBookingAuditViewerServiceandRoutingFormResponseRepositoryRoutingFormResponseRepository(tokens and module)booking-logs-view.tsxto use the newgetBookingHistoryendpoint@calcom/app-storeto@calcom/features/routing-forms/lib/Updates since last revision
uniqueIdgeneration for form submission entries (was producingid: id: form-submission-X, now correctly producesform-submission-X)Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
Human Review Checklist
createFormSubmissionEntrymatches whatbooking-logs-view.tsxexpectstype: "RECORD_CREATED",action: "CREATED",source: "WEBAPP",actor.type: "GUEST"- are these semantically appropriate for form submissions?getAuditLogstogetBookingHistoryis acceptableChecklist
Link to Devin run: https://app.devin.ai/sessions/88c554ef0ed04e6d9b79985709d48552
Requested by: @hariombalhara (hariom@cal.com)