Skip to content

feat: Add infrastructure for no-show audit integration#27187

Merged
hariombalhara merged 11 commits intomainfrom
prepare-for-no-show-audit
Jan 29, 2026
Merged

feat: Add infrastructure for no-show audit integration#27187
hariombalhara merged 11 commits intomainfrom
prepare-for-no-show-audit

Conversation

@hariombalhara
Copy link
Copy Markdown
Member

@hariombalhara hariombalhara commented Jan 23, 2026

What does this PR do?

Adds the infrastructure foundation for no-show audit integration. This is a preparatory PR that sets up the booking audit system to track no-show events. The actual integration with no-show flows will be stacked on top of this PR (PR #26570).

Key changes:

Database schema:

  • Adds SYSTEM source to BookingAuditSource enum for background jobs (tasker tasks, trigger.dev)
  • Consolidates HOST_NO_SHOW_UPDATED and ATTENDEE_NO_SHOW_UPDATED into single NO_SHOW_UPDATED action

New service:

  • NoShowUpdatedAuditActionService with array-based schema for attendees: attendeesNoShow: Array<{attendeeEmail, noShow}>
  • Deletes deprecated HostNoShowUpdatedAuditActionService and AttendeeNoShowUpdatedAuditActionService

Producer service updates:

  • BookingAuditProducerService.interface.ts: Replaces queueHostNoShowUpdatedAudit and queueAttendeeNoShowUpdatedAudit with unified queueNoShowUpdatedAudit
  • BookingAuditTaskerProducerService.ts: Implements the unified method
  • BookingEventHandlerService.ts: Replaces onHostNoShowUpdated and onAttendeeNoShowUpdated with unified onNoShowUpdated

Repository enhancements:

  • New AttendeeRepository methods for no-show queries (findByIds, findByBookingId, updateNoShow, findByBookingUidAndEmails, etc.)

UI updates:

  • BookingHistory component now supports values?: string[] in display fields for rendering multiple values
  • New DisplayFieldValue component for flexible field rendering

Type updates:

  • IBookingAuditRepository.BookingAuditAction updated to use NO_SHOW_UPDATED
  • ActionSourceSchema updated to include SYSTEM
  • BookingAuditActionSchema in bookingAuditTask.ts aligned with Prisma schema

Tests:

  • Integration tests for NoShowUpdatedAuditActionService covering host no-show, attendee no-show, and combined scenarios

Updates since last revision

Migration fix (addresses Cubic AI review feedback):

  • Fixed PostgreSQL error "unsafe use of new value of enum type" in 20260120093500_add_no_show_updated_audit_action/migration.sql
  • Removed the ADD VALUE statement that caused the transaction issue
  • Now uses a CASE expression in the ALTER TABLE ... USING clause to convert deprecated enum values (host_no_show_updated, attendee_no_show_updated) to the new unified value (no_show_updated) during the type conversion
  • This approach avoids the PostgreSQL limitation where new enum values cannot be used in the same transaction they were added

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. N/A - internal audit infrastructure only.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

This is infrastructure-only. Full testing will occur with the stacked integration PR (PR #26570).

  1. Verify the migrations apply cleanly: yarn prisma migrate deploy
  2. Verify type checking passes: yarn type-check:ci --force
  3. Verify the NoShowUpdatedAuditActionService schema validates correctly
  4. Run integration tests: VITEST_MODE=integration yarn test no-show-updated-action.integration-test.ts

Human Review Checklist

  • Migration safety: The migration now uses a CASE expression in the USING clause to convert deprecated enum values. Please verify the SQL syntax is correct.
  • Verify type consistency: BookingAuditAction is defined in multiple places (IBookingAuditRepository.ts, bookingAuditTask.ts, Prisma schema) - ensure they match
  • Verify NoShowUpdatedAuditActionService schema uses array format: attendeesNoShow: Array<{attendeeEmail, noShow}>
  • Verify IAuditActionService interface changes are backward compatible with existing action services (new values?: string[] field)
  • Verify BookingHistory component correctly renders the new values array field via DisplayFieldValue

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have checked if my changes generate no new warnings

Link to Devin run

https://app.devin.ai/sessions/fd5750de158b4cb09e577713d93cdf1a

Link to Devin run (Cubic AI feedback)

https://app.devin.ai/sessions/c472f87d284a4986ba3a651d04d24eae

Requested by

@hariombalhara


Open with Devin

- Add Prisma migrations for SYSTEM source and NO_SHOW_UPDATED audit action
- Add NoShowUpdatedAuditActionService with array-based attendeesNoShow schema
- Update BookingAuditActionServiceRegistry to include NO_SHOW_UPDATED
- Update BookingAuditTaskConsumer and BookingAuditViewerService
- Add AttendeeRepository methods for no-show queries
- Update IAuditActionService interface with values array support
- Update locales with no-show audit translation keys

Co-Authored-By: [email protected] <[email protected]>
@devin-ai-integration
Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@github-actions github-actions bot added the ❗️ migrations contains migration files label Jan 23, 2026
@hariombalhara hariombalhara marked this pull request as ready for review January 23, 2026 11:47
@hariombalhara hariombalhara requested a review from a team as a code owner January 23, 2026 11:47
@graphite-app graphite-app bot requested a review from a team January 23, 2026 11:47
@graphite-app graphite-app bot added enterprise area: enterprise, audit log, organisation, SAML, SSO core area: core, team members only labels Jan 23, 2026
@hariombalhara hariombalhara marked this pull request as draft January 23, 2026 11:53
…wUpdatedAuditActionService

- Delete HostNoShowUpdatedAuditActionService and AttendeeNoShowUpdatedAuditActionService
- Update BookingAuditProducerService.interface.ts to use queueNoShowUpdatedAudit
- Update BookingAuditTaskerProducerService.ts to use queueNoShowUpdatedAudit
- Update BookingEventHandlerService.ts to use onNoShowUpdated
- Add integration tests for NoShowUpdatedAuditActionService

Co-Authored-By: [email protected] <[email protected]>
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consolidated AttendeeNoShow and HostNoShow in this single action file because both host and attendee could update through a single action too.

@hariombalhara hariombalhara marked this pull request as ready for review January 23, 2026 12:54
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 26 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/prisma/migrations/20260120093500_add_no_show_updated_audit_action/migration.sql">

<violation number="1" location="packages/prisma/migrations/20260120093500_add_no_show_updated_audit_action/migration.sql:28">
P1: Missing data migration step - this migration will fail if any existing records use the deprecated `host_no_show_updated` or `attendee_no_show_updated` enum values. Add an UPDATE statement before the type cast to convert existing data to the new `no_show_updated` value.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

@github-actions
Copy link
Copy Markdown
Contributor

Devin AI is addressing Cubic AI's review feedback

A Devin session has been created to address the issues identified by Cubic AI.

View Devin Session

Addresses Cubic AI review feedback (confidence 9/10): The migration now
includes an UPDATE statement to convert existing records using the
deprecated 'host_no_show_updated' or 'attendee_no_show_updated' enum
values to the new unified 'no_show_updated' value before the type cast.
This prevents migration failures if any existing data uses the old values.

Co-Authored-By: unknown <>
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BookingAudit table is empty in production at the moemnt, so we are safe to do destructive changes

devin-ai-integration bot and others added 2 commits January 23, 2026 13:12
Fixes PostgreSQL error 'unsafe use of new value of enum type' by avoiding
the ADD VALUE statement and instead using a CASE expression in the ALTER
TABLE USING clause to convert deprecated enum values (host_no_show_updated,
attendee_no_show_updated) to the new unified value (no_show_updated) during
the type conversion.

Co-Authored-By: unknown <>
@github-actions
Copy link
Copy Markdown
Contributor

E2E results are ready!

Copy link
Copy Markdown
Contributor

@Udit-takkar Udit-takkar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. left few comments

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

View issue and 5 additional flags in Devin Review.

Open in Devin Review

Comment on lines 369 to +377
const doesMatchDisplayFields = (): boolean => {
return log.displayFields?.some((field) => {
return field.valueKey?.toLowerCase().includes(searchTerm.toLowerCase()) ||
field.labelKey?.toLowerCase().includes(searchTerm.toLowerCase());
}) ?? false;
return (
log.displayFields?.some((field) => {
return (
field.valueKey?.toLowerCase().includes(searchTerm.toLowerCase()) ||
field.labelKey?.toLowerCase().includes(searchTerm.toLowerCase())
);
}) ?? false
);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Search filter does not check value and values fields in displayFields

The search filter in useBookingLogsFilters only checks valueKey and labelKey when filtering audit logs, but the new displayFields type can also contain value and values properties.

Click to expand

Issue

The doesMatchDisplayFields function at lines 369-377 only checks:

field.valueKey?.toLowerCase().includes(searchTerm.toLowerCase()) ||
field.labelKey?.toLowerCase().includes(searchTerm.toLowerCase())

However, the NoShowUpdatedAuditActionService.getDisplayFields (NoShowUpdatedAuditActionService.ts:120-133) returns fields using value and values:

displayFields.push({ labelKey: "Attendees", values: attendeesFieldValues });
displayFields.push({ labelKey: "Host", value: hostFieldValue });

Impact

Users searching for attendee emails or host names in no-show audit logs will not find matching results, even though those values are displayed in the UI. The search functionality is incomplete for the new NO_SHOW_UPDATED audit action type.

Expected vs Actual

  • Expected: Searching for an attendee email like "[email protected]" should find no-show audit logs containing that attendee
  • Actual: The search returns no results because value and values fields are not checked

Recommendation: Update doesMatchDisplayFields to also check field.value and field.values:

const doesMatchDisplayFields = (): boolean => {
    return (
        log.displayFields?.some((field) => {
            return (
                field.valueKey?.toLowerCase().includes(searchTerm.toLowerCase()) ||
                field.labelKey?.toLowerCase().includes(searchTerm.toLowerCase()) ||
                field.value?.toLowerCase().includes(searchTerm.toLowerCase()) ||
                field.values?.some(v => v.toLowerCase().includes(searchTerm.toLowerCase()))
            );
        }) ?? false
    );
};
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixing in a followup

@hariombalhara hariombalhara merged commit 2802310 into main Jan 29, 2026
62 checks passed
@hariombalhara hariombalhara deleted the prepare-for-no-show-audit branch January 29, 2026 11:47
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 ready-for-e2e size/XXL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants