Skip to content

feat(condo): DOMA-13328 allow b2b service users to use RegisterExternalPaymentsService#7703

Open
abshnko wants to merge 1 commit into
mainfrom
feat/condo/DOMA-13328/add-access-for-miniapps-to-registerExternalPayments-service
Open

feat(condo): DOMA-13328 allow b2b service users to use RegisterExternalPaymentsService#7703
abshnko wants to merge 1 commit into
mainfrom
feat/condo/DOMA-13328/add-access-for-miniapps-to-registerExternalPayments-service

Conversation

@abshnko
Copy link
Copy Markdown
Member

@abshnko abshnko commented Jun 4, 2026

Summary by CodeRabbit

Release Notes

  • New Features

    • Added access control permissions for B2B applications to register external payments.
  • Tests

    • Added tests for B2B app access control on external payment registration.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 4, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2e67a94b-3041-4ba3-89f5-f29e10608916

📥 Commits

Reviewing files that changed from the base of the PR and between 0bd3927 and 6ece89b.

📒 Files selected for processing (5)
  • apps/condo/domains/acquiring/access/RegisterExternalPaymentsService.js
  • apps/condo/domains/acquiring/schema/RegisterExternalPaymentsService.test.js
  • apps/condo/domains/miniapp/schema/B2BAppAccessRightSet.test.js
  • apps/condo/domains/miniapp/utils/b2bAppServiceUserAccess/config.js
  • apps/condo/migrations/20260604191233-0536_b2bappaccessrightset_canexecuteregisterexternalpayments_and_more.js

📝 Walkthrough

Walkthrough

This PR adds a new canExecuteRegisterExternalPayments access-right field to the B2B app access control system. A database migration creates the column on the access rights table, configuration registers it as available, authorization logic is refactored to use B2B service user permissions as a fallback, and test coverage validates both the default permission state and B2B service user access paths.

Changes

B2B External Payment Registration Access Rights

Layer / File(s) Summary
Database schema and B2B service user configuration
apps/condo/migrations/20260604191233-0536_b2bappaccessrightset_canexecuteregisterexternalpayments_and_more.js, apps/condo/domains/miniapp/utils/b2bAppServiceUserAccess/config.js
Migration adds canExecuteRegisterExternalPayments boolean column to B2BAppAccessRightSet and B2BAppAccessRightSetHistoryRecord with transactional up/down SQL, including analytics view recreation. B2B service user access configuration registers the new permission as an available schema entry.
Authorization logic with B2B service user fallback
apps/condo/domains/acquiring/access/RegisterExternalPaymentsService.js
canRegisterExternalPayments is refactored to accept a unified args parameter, extract authentication and context internally, await the primary integration access check, and fall back to B2B app service user authorization if the primary check fails.
B2B service user access tests and permission assertion
apps/condo/domains/miniapp/schema/B2BAppAccessRightSet.test.js, apps/condo/domains/acquiring/schema/RegisterExternalPaymentsService.test.js
Existing B2BAppAccessRightSet test adds assertion that canExecuteRegisterExternalPayments is false by default. RegisterExternalPaymentsService test suite adds B2B miniapp test helpers and two test cases: one grants the permission and verifies successful registration, the other denies it and asserts access-denied error.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Suggested reviewers

  • dkoviazin
  • YEgorLu

Poem

🐰 A new permission sprouts in the schema trees,
B2B apps now guard their payment keys,
With fallback paths when access is denied,
The migration and tests keep auth verified!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: enabling B2B service users to access and use the RegisterExternalPaymentsService through new access control logic and schema updates.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 feat/condo/DOMA-13328/add-access-for-miniapps-to-registerExternalPayments-service

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration.


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 and usage tips.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jun 4, 2026

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants