Skip to content

Comments

feat:[Booking Audit Stack - 4] Implement audit log reschedule handling#24902

Closed
hariombalhara wants to merge 1 commit intographite-base/24902from
devin/booking-reschedule-chain
Closed

feat:[Booking Audit Stack - 4] Implement audit log reschedule handling#24902
hariombalhara wants to merge 1 commit intographite-base/24902from
devin/booking-reschedule-chain

Conversation

@hariombalhara
Copy link
Member

@hariombalhara hariombalhara commented Nov 4, 2025

  • Update audit action services (Attendee, Cancellation, Reassignment, Rejection)
  • Refactor booking-audit architecture documentation
  • Integrate audit logging in handleCancelBooking
  • Add audit logging to round-robin reassignment flows
  • Clean up deprecated schemas
  • Fix unused variable linting issues## What does this PR do?
  • Fixes #XXXX (GitHub issue number)
  • Fixes CAL-XXXX (Linear issue number - should be visible at the bottom of the GitHub issue description)

Visual Demo (For contributors especially)

A visual demonstration is strongly recommended, for both the original and new change (video / image - any one).

Video Demo (if applicable):

  • Show screen recordings of the issue or feature.
  • Demonstrate how to reproduce the issue, the behavior before and after the change.

Image Demo (if applicable):

  • Add side-by-side screenshots of the original and updated change.
  • Highlight any significant change(s).

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. If N/A, write N/A here and check the checkbox.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

  • Are there environment variables that should be set?
  • What are the minimal test data to have?
  • What is expected (happy path) to have (input and output)?
  • Any other important info that could help to test that PR

Checklist

  • I haven't read the contributing guide
  • My code doesn't follow the style guidelines of this project
  • I haven't commented my code, particularly in hard-to-understand areas
  • I haven't checked if my changes generate no new warnings

Summary by cubic

Adds reschedule chain tracking and integrates reschedule audit logging so users can see a complete booking history across reschedules, while hiding logs after a booking is superseded. Also skips authentication and email verification for valid reschedule requests.

  • New Features

    • Added originalBookingUid to Booking, with indexes for fromReschedule and originalBookingUid.
    • Set originalBookingUid on new rescheduled bookings (carry forward chain root).
    • Included previousBookingUid in reschedule audit data; emitted RESCHEDULED entries with start/end changes.
    • Hid originalBookingUid in booking API responses.
    • Updated getAuditLogs to fetch logs across the full reschedule chain and filter logs to the reschedule timestamp for superseded bookings.
    • Skipped auth and email verification for reschedules, with validation that rescheduleUid exists, is ACCEPTED or PENDING, and matches the same event type.
  • Migration

    • Run scripts/backfill-original-booking-id.ts to populate original booking roots for existing bookings (supports --dry-run).

Written for commit 95d4007. Summary will update automatically on new commits.

@keithwillcode keithwillcode added core area: core, team members only enterprise area: enterprise, audit log, organisation, SAML, SSO labels Nov 4, 2025
@hariombalhara hariombalhara force-pushed the devin/booking-reschedule-chain branch from bfbb633 to 7d16539 Compare November 4, 2025 11:51
@vercel
Copy link

vercel bot commented Nov 4, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
cal Ignored Ignored Nov 14, 2025 6:36am
cal-eu Ignored Ignored Nov 14, 2025 6:36am

@hariombalhara hariombalhara force-pushed the devin/booking-audit-integration-1761111651 branch from 551e500 to b806432 Compare November 4, 2025 11:58
@hariombalhara hariombalhara changed the title feat: Implement audit log backend infrastructure and integrations feat: Implement audit log reschedule handling Nov 6, 2025
@hariombalhara hariombalhara changed the title feat: Implement audit log reschedule handling feat:[Booking Audit Stack - 4] Implement audit log reschedule handling Nov 13, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Nov 13, 2025

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:

No release type found in pull request title "feat:[Booking Audit Stack - 4] Implement audit log reschedule handling". Add a prefix to indicate what kind of release this pull request corresponds to. For reference, see https://www.conventionalcommits.org/

Available types:
 - feat: A new feature
 - fix: A bug fix
 - docs: Documentation only changes
 - style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
 - refactor: A code change that neither fixes a bug nor adds a feature
 - perf: A code change that improves performance
 - test: Adding missing tests or correcting existing tests
 - build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
 - ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
 - chore: Other changes that don't modify src or test files
 - revert: Reverts a previous commit

@github-actions github-actions bot added the ❗️ migrations contains migration files label Nov 13, 2025
@hariombalhara hariombalhara force-pushed the devin/booking-reschedule-chain branch from 333d7ff to 921018b Compare November 13, 2025 13:46
@hariombalhara hariombalhara changed the base branch from devin/booking-audit-integration-1761111651 to graphite-base/24902 November 13, 2025 13:46
@hariombalhara hariombalhara changed the base branch from graphite-base/24902 to booking-audit-more-infra November 13, 2025 13:47
Copy link
Member Author

hariombalhara commented Nov 13, 2025

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

- Add originalBookingId field to Booking model to track the first booking in a reschedule chain
- Add indexes on fromReschedule and originalBookingId for efficient querying
- Update RescheduledAuditActionService to include previousBookingId in audit data
- Set originalBookingId when creating rescheduled bookings
- Pass previousBookingId to audit service when bookings are rescheduled
- Add backfill script to populate originalBookingId for existing bookings

This enables users to view complete audit history across all rescheduled versions of a booking.
@hariombalhara hariombalhara force-pushed the devin/booking-reschedule-chain branch from 0b9003c to 95d4007 Compare November 14, 2025 06:36
@hariombalhara hariombalhara changed the base branch from booking-audit-more-infra to graphite-base/24902 November 14, 2025 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core area: core, team members only enterprise area: enterprise, audit log, organisation, SAML, SSO ❗️ migrations contains migration files size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants