Skip to content

perf(auth): batch invoice authorization checks#1609

Closed
muhammedilyasy wants to merge 1 commit intoantiwork:mainfrom
muhammedilyasy:perf/batch-invoice-auth
Closed

perf(auth): batch invoice authorization checks#1609
muhammedilyasy wants to merge 1 commit intoantiwork:mainfrom
muhammedilyasy:perf/batch-invoice-auth

Conversation

@muhammedilyasy
Copy link

Summary

This PR optimizes bulk invoice actions (approval/rejection) by replacing serial .exists? lookups with a single bulk .count query.

Changes

  • Optimized authorize_invoices_for_rejection and authorize_invoices_for_approval_and_pay in InvoicesController.
  • Reduces database roundtrips from O(N) to O(1).

AI Disclosure

This fix was identified and drafted using an AI coding assistant.

Bounty

Submitting for the performance bounty.

Signed-off-by: Ilyasy <132816511+muhammedilyasy@users.noreply.github.com>
Copy link
Member

@nyomanjyotisa nyomanjyotisa left a comment

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants