chore: Integrate creation/rescheduling booking audit for Recurring/regular booking/seated bookings (#26046)

* Integrate creation/rescheduling booking audit

* fix: add missing hostUserUuid to booking audit test data

Co-Authored-By: [email protected] <[email protected]>

* fix-ci

* feat: enhance booking audit with seat reference

- Added support for seat reference in booking audit actions.
- Updated localization for booking creation to include seat information.
- Modified relevant services to pass attendee seat ID during booking creation.

* fix: update test data to match schema requirements

- Add seatReferenceUid: null to default mock audit log data
- Add seatReferenceUid: null to multiple audit logs test case
- Convert SEAT_RESCHEDULED test data to use numeric timestamps instead of ISO strings

Co-Authored-By: [email protected] <[email protected]>

* Allow nullish seatReferenceUid

* feat: enhance booking audit to support rescheduledBy information

- Updated booking audit actions to include rescheduledBy details, allowing tracking of who rescheduled a booking.
- Refactored related services to accommodate the new rescheduledBy parameter in booking events.
- Adjusted type definitions and function signatures to reflect the changes in the booking audit context.

* Avoid possible run time issue

* Fix imoport path

* fix failing test due to merge from main\

* Pass useruuid

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
Hariom BalharaandDevin AI authored and GitHub committed 2026-01-13 13:16:16 +00:00
1 parent 0408ce0741
commit 75d611c2e8
36 files changed
+1198 -453

No files matched your search

+1 -18
View File
@@ -58,24 +58,7 @@ async function handler(req: NextApiRequest & { userId?: number; traceContext: Tr
},
});
// const booking = await createBookingThroughFactory();
return booking;
// To be added in the follow-up PR
// async function createBookingThroughFactory() {
// console.log("Creating booking through factory");
// const regularBookingService = getRegularBookingService();
// const booking = await regularBookingService.createBooking({
// bookingData: req.body,
// bookingMeta: {
// userId: session?.user?.id || -1,
// hostname: req.headers.host || "",
// forcedSlug: req.headers["x-cal-force-slug"] as string | undefined,
// },
// });
// return booking;
// }
}
export default defaultResponder(handler, "/api/book/event");
export default defaultResponder(handler, "/api/book/event");
+2 -2
View File
@@ -1,5 +1,4 @@
import type { NextApiRequest } from "next";
import { getServerSession } from "@calcom/features/auth/lib/getServerSession";
import { getRecurringBookingService } from "@calcom/features/bookings/di/RecurringBookingService.container";
import type { BookingResponse } from "@calcom/features/bookings/types";
@@ -55,6 +54,7 @@ async function handler(req: NextApiRequest & RequestMeta) {
platformBookingLocation: req.platformBookingLocation,
noEmail: req.noEmail,
},
creationSource: "WEBAPP",
});
return createdBookings;
@@ -62,4 +62,4 @@ async function handler(req: NextApiRequest & RequestMeta) {
export const handleRecurringEventBooking = handler;
export default defaultResponder(handler);
export default defaultResponder(handler);
+13 -6
View File
@@ -3321,7 +3321,7 @@
"only_if_field_is_empty": "Only if field is empty",
"booking_start_date": "Booking start date",
"booking_created_date": "Booking created date",
"booking_reassigned_to_host": "Booking reassigned to {{host}}",
"booking_reassigned_to_host": "Reassigned to {{host}}",
"no_contact_owner": "No contact owner",
"routing_forms_created": "Routing forms created",
"routing_forms_total_responses": "Total Responses",
@@ -3718,13 +3718,15 @@
"pbac_action_delete": "Delete",
"pbac_action_manage": "Manage",
"pbac_action_invite": "Invite",
"pbac_action_remove": "Remove",
"pbac_action_remove": "Remove",
"pbac_action_change_member_role": "Change member role",
"pbac_action_list_members": "List members",
"pbac_action_manage_billing": "Manage billing",
"pbac_action_read_team_bookings": "View team bookings",
"pbac_action_read_org_bookings": "View organization bookings",
"pbac_action_read_recordings": "View recordings",
"pbac_action_read_team_booking_audit_logs": "View team booking audit logs",
"pbac_action_read_org_booking_audit_logs": "View organization booking audit logs",
"pbac_action_impersonate": "Impersonate",
"pbac_action_edit_users": "Edit users",
"role_created_successfully": "Role created successfully",
@@ -3795,6 +3797,8 @@
"pbac_desc_view_team_bookings": "View team bookings",
"pbac_desc_view_organization_bookings": "View organization bookings",
"pbac_desc_view_booking_recordings": "View booking recordings",
"pbac_desc_read_team_booking_audit_logs": "View audit logs for team bookings",
"pbac_desc_read_org_booking_audit_logs": "View audit logs for organization bookings",
"pbac_desc_update_bookings": "Update bookings",
"pbac_desc_manage_bookings": "All actions on bookings",
"pbac_desc_view_team_insights": "View team insights",
@@ -4263,7 +4267,8 @@
"booking_history": "Booking history",
"booking_history_description": "View the history of actions performed on this booking",
"booking_audit_action": {
"created": "Created",
"created": "Booked with {{host}}",
"created_with_seat": "Seat Booked with {{host}}",
"cancelled": "Cancelled",
"rescheduled": "Rescheduled {{oldDate}} -> <0>{{newDate}}</0>",
"rescheduled_from": "Rescheduled <0>{{oldDate}}</0> -> {{newDate}}",
@@ -4278,9 +4283,11 @@
"location_changed": "Location changed",
"location_changed_from_to": "Location changed from {{fromLocation}} to {{toLocation}}",
"attendee_no_show_updated": "Attendee no-show updated",
"type": "Assignment type",
"assignmentType_manual": "Manual assignment",
"assignmentType_roundRobin": "Round robin assignment",
"seat_booked": "Seat booked",
"seat_rescheduled": "Seat rescheduled {{oldDate}} -> <0>{{newDate}}</0>",
"assignment_type": "Assignment",
"assignment_type_manual": "Manual",
"assignment_type_round_robin": "Round robin",
"actor_impersonated_by": "Impersonator",
"source": "Source"
},