Skip to content

Comments

feat: Implement booking audit producer-consumer pattern with feature flag support#25470

Merged
hariombalhara merged 2 commits intobooking-audit-more-infrafrom
booking-audit-consumer-producer
Dec 6, 2025
Merged

feat: Implement booking audit producer-consumer pattern with feature flag support#25470
hariombalhara merged 2 commits intobooking-audit-more-infrafrom
booking-audit-consumer-producer

Conversation

@hariombalhara
Copy link
Member

@hariombalhara hariombalhara commented Nov 29, 2025

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 an async producer–consumer pipeline for booking audit events behind a feature flag. This decouples audit recording from booking flows and processes audits in the background with schema validation and migration.

  • New Features
    • BookingAuditProducerService interface with a Tasker-based implementation.
    • BookingAuditTaskConsumer validates payloads, checks org feature flag, migrates schemas, and routes actions.
    • Tasker: new bookingAudit task, passes taskId to handlers, and Task.updatePayload for migrations.
    • DI modules/containers and tokens for producer and consumer.
    • BookingEventHandlerService queues audit tasks for created/rescheduled and other booking events.
    • Discriminated unions for BookingAuditTaskPayload and BookingAuditActionData.

Written for commit fde380a. Summary will update automatically on new commits.

@vercel
Copy link

vercel bot commented Nov 29, 2025

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

Project Deployment Preview Comments Updated (UTC)
cal-companion Error Error Nov 30, 2025 9:17am
2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
cal Ignored Ignored Nov 30, 2025 9:17am
cal-eu Ignored Ignored Nov 30, 2025 9:17am

Copy link
Member Author

hariombalhara commented Nov 29, 2025

- Restore all 11 action services (Accepted, Cancelled, Rejected, etc.)
- Update BookingAuditViewerService to support all actions
- Add changeSchemas for common change patterns

This branch extends booking-audit-viewer-demo with full action support.
…flag support

- Add BookingAuditProducerService interface for async audit task queueing
- Implement BookingAuditTaskerProducerService using Tasker for local/background jobs
- Add BookingAuditTaskConsumer for processing audit tasks with feature flag checks
- Add booking-audit feature flag to control audit processing at organization level
- Integrate BookingAuditProducerService into BookingEventHandlerService
- Update BookingEventHandlerService to queue audit tasks for all booking events
- Add bookingAudit task handler in Tasker infrastructure
- Add organizationId parameter throughout audit flow for feature flag checks
- Update Tasker to pass taskId to handlers for schema migration support
- Add Task.updatePayload method for migrating old task schemas
- Create DI containers and modules for producer and consumer services
- Define BookingAuditTaskPayload and BookingAuditActionData types with discriminated unions
- Consumer validates payloads, checks feature flags, and routes to action services
- Add DI tokens for producer and consumer services

This enables async, feature-flag gated booking audit processing.
@hariombalhara hariombalhara force-pushed the booking-audit-consumer-producer branch from e81c326 to fde380a Compare November 30, 2025 09:08
@hariombalhara hariombalhara force-pushed the booking-audit-more-infra branch from 068e516 to c141adc Compare November 30, 2025 09:08
@hariombalhara hariombalhara force-pushed the booking-audit-more-infra branch 2 times, most recently from 427f17a to 8fc2fb9 Compare December 6, 2025 04:23
@hariombalhara hariombalhara merged commit fde380a into booking-audit-more-infra Dec 6, 2025
13 of 18 checks passed
@hariombalhara hariombalhara deleted the booking-audit-consumer-producer branch December 6, 2025 06:24
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 size/XXL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants