Skip to content

LEGLINK-620: raise an audit event when a vendor changes - #1791

Merged
arianamihailescu merged 1 commit into
devfrom
LEGLINK-63-vendor-audit
Aug 5, 2026
Merged

LEGLINK-620: raise an audit event when a vendor changes#1791
arianamihailescu merged 1 commit into
devfrom
LEGLINK-63-vendor-audit

Conversation

@arianamihailescu

@arianamihailescu arianamihailescu commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

🛠️ Description of Changes

Added auditing

🧪 Testing Performed

Tested locally

🧑‍🔬 Unit Testing

  • [x ] I have written or updated unit tests to cover my changes
  • Coverage: 100.0%

📓 Documentation Updated

Please update any relevant sections in the project documentation that were impacted by the changes in the PR.

LEGLINK-63 requires changes to leave an audit trail, and vendor mutations left
none: VendorManager had no audit wiring at all, so associating or rotating a
signing key was invisible after the fact.

Create, update and delete now emit through CreateAuditEventCommand, the same
path FacilityManager uses. An update records the transition explicitly, null to
a secret id on association and back to null on clearing, which is the trail the
story asks for. Recording it in plain text is safe: the value is the secret's
name, not the key.

The Kafka key is the vendor id and FacilityId is left unset, since a vendor is
not facility scoped and the Audit service treats FacilityId as optional.

Two departures from FacilityManager. Property changes are compared field by
field rather than through CompareLogic, which on a Vendor would walk the
VendorVersions navigation and report noise, and which gives no way to tell that
nothing changed -- an update altering neither name nor key now emits nothing.
And the command is called directly rather than wrapped in Task.Run: it is
already async void, so the wrapper adds nondeterminism without concurrency, and
calling it directly is what makes the behaviour testable.

Tests assert on emitted messages through a recording producer in the fixture,
polling briefly because async void leaves nothing to await.

Claude-Session: https://claude.ai/code/session_01QoUHyt1ALkruCbuYxHSXiB
@arianamihailescu
arianamihailescu force-pushed the LEGLINK-63-vendor-audit branch from ef169a7 to 8a23b56 Compare August 5, 2026 19:33
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@arianamihailescu, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 58 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 4a461c4b-dd00-448b-9a42-f73c38d738d7

📥 Commits

Reviewing files that changed from the base of the PR and between edbc3e7 and 8a23b56.

📒 Files selected for processing (4)
  • DotNet/ServiceTests/IntegrationTests/Tenant/TenantIntegrationTestFixture.cs
  • DotNet/ServiceTests/IntegrationTests/Tenant/VendorAuditTests.cs
  • DotNet/Tenant/Business/Managers/VendorManager.cs
  • DotNet/Tenant/Utils/Helper.cs
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch LEGLINK-63-vendor-audit

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@arianamihailescu
arianamihailescu merged commit 642558b into dev Aug 5, 2026
20 checks passed
@arianamihailescu
arianamihailescu deleted the LEGLINK-63-vendor-audit branch August 5, 2026 19:45
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