-
Notifications
You must be signed in to change notification settings - Fork 252
Renamed merchant screening and monitoring plugin display names #3451
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Renamed merchant screening and monitoring plugin display names #3451
Conversation
|
WalkthroughThis update standardizes terminology across the codebase by renaming "Merchant Monitoring" to "Web Presence" and "Merchant Screening" to "MATCH Screening" in UI components, plugin configurations, workflow definitions, and API documentation. No logic, control flow, or exported entity signatures were modified; only display names and descriptive strings were updated. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant UI_Component
participant Plugin_Config
participant Workflow_Definition
participant API_Docs
User->>UI_Component: Sees "Web Presence" (was "Merchant Monitoring")
UI_Component->>Plugin_Config: Uses updated displayName "Web Presence"
Plugin_Config->>Workflow_Definition: Reflects new naming in workflow plugins
User->>API_Docs: Reads "Web Presence" in endpoint descriptions
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (6)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (4)
services/workflows-service/prisma/data-migrations (1)
1-1
: Confirm the new migration commit is pulled and applied in all environmentsUpdating the submodule pointer is necessary, but it has no effect until every consuming environment (CI, staging, prod) actually checks out the new commit and runs
prisma migrate deploy
(or equivalent).Please verify that:
git submodule update --init --recursive
is executed in the CI pipeline after the merge.- Any new SQL produced by
e6383e2…
is applied or gated behind the usual migration-runner.If these steps are already covered, feel free to ignore.
apps/backoffice-v2/src/pages/Home/components/DynamicMetricsSection/DynamicMetricsSection.tsx (1)
38-40
: Hard-coded heading – consider i18n
"Web Presence Risk Analytics"
is hard-coded; previous text was hard-coded too, but since you're already touching this line, it’s a good opportunity to lift the copy into the translation layer (react-i18next
,@lingui
, etc.) to keep consistency with the rest of the Backoffice.apps/backoffice-v2/src/pages/Home/components/PortfolioRiskStatistics/PortfolioRiskStatistics.tsx (1)
47-50
: Header updated but body copy still says “merchant monitoring”Line 50 still reads:
<p className={'mb-8'}>Risk levels of all merchant monitoring reports.</p>If the product terminology is fully shifting to “Web Presence”, update the accompanying description for coherence.
- <p className={'mb-8'}>Risk levels of all merchant monitoring reports.</p> + <p className={'mb-8'}>Risk levels of all web-presence reports.</p>apps/backoffice-v2/src/common/utils/get-phone-number-formatter/get-phone-number-formatter.unit.test.ts (1)
1-43
: Expand test coverage for better validation.The test structure and approach are solid, following arrange-act-assert pattern and using appropriate vitest framework. The tests cover the main use case from the PR (preventing emails from being processed as phone numbers).
Consider adding tests for edge cases that the regex is designed to handle:
+ describe('when invalid formats are passed', () => { + it.each([ + ['empty string', ''], + ['just plus sign', '+'], + ['just hyphens', '---'], + ['double hyphens', '+972--052-625-3312'], + ['starts with hyphen', '-972052625331'], + ['ends with hyphen', '+972052625331-'], + ['hyphen before plus', '972-+052625331'], + ])('should return undefined for %s', (_, value) => { + const result = getPhoneNumberFormatter(value); + expect(result).toBeUndefined(); + }); + });Also consider testing the actual parsed phone number format for valid inputs:
describe('when a phone number with a country code is passed', () => { it('should return a formatter', () => { const value = '+9720526253312'; const result = getPhoneNumberFormatter(value); - expect(result).toBeDefined(); + expect(result).toBeDefined(); + expect(result?.country).toBe('IL'); // Assuming this is an Israeli number }); });
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (12)
apps/backoffice-v2/src/common/components/molecules/ProcessTracker/trackers/merchant-monitoring/MerchantMonitoringTracker.tsx
(1 hunks)apps/backoffice-v2/src/common/utils/get-phone-number-formatter/get-phone-number-formatter.ts
(1 hunks)apps/backoffice-v2/src/common/utils/get-phone-number-formatter/get-phone-number-formatter.unit.test.ts
(1 hunks)apps/backoffice-v2/src/pages/Home/components/DynamicMetricsSection/DynamicMetricsSection.tsx
(1 hunks)apps/backoffice-v2/src/pages/Home/components/PortfolioRiskStatistics/PortfolioRiskStatistics.tsx
(1 hunks)apps/workflows-dashboard/src/pages/WorkflowDefinition/WorkflowDefinition.tsx
(3 hunks)packages/workflow-core/src/lib/plugins/external-plugin/vendor-consts.ts
(1 hunks)services/workflows-service/prisma/data-migrations
(1 hunks)services/workflows-service/src/workflow-defintion/demo-workflow/eu/kyb-workflow-definition.ts
(2 hunks)services/workflows-service/src/workflow-defintion/demo-workflow/us/kyb-workflow-definition.ts
(2 hunks)services/workflows-service/src/workflow-defintion/demo-workflow/workflow-definition-with-associated.ts
(1 hunks)services/workflows-service/src/workflow/workflow.controller.external.ts
(2 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
`apps/backoffice-v2/**/*.{ts,tsx}`: Use functional components with TypeScript. I...
apps/backoffice-v2/**/*.{ts,tsx}
: Use functional components with TypeScript.
Implement smart/dumb component pattern.
Place components in feature-based directories.
Use compound components for complex UIs.
Follow atomic design principles.
Use React Query for server state and API calls.
Use Context for shared state.
Implement state machines for complex flows.
Use local state for UI-only state.
Follow unidirectional data flow.
Use strict TypeScript configuration.
Define interfaces for all props.
Use discriminated unions for state.
Leverage type inference.
Use Radix UI for accessible components.
Implement proper ARIA attributes.
Follow consistent styling patterns.
Use composition over inheritance.
Keep components small and focused.
Use React Hook Form for forms.
Implement Zod for validation.
Handle form submission states.
Show validation feedback.
Use controlled inputs when needed.
Implement proper loading states for data fetching.
Handle error states gracefully.
Cache responses appropriately.
Type API responses.
Use error boundaries.
Implement fallback UI.
Handle async errors.
Show user-friendly error messages.
Log errors appropriately.
Use React.memo wisely.
Implement proper code splitting.
Use lazy loading for routes.
Optimize re-renders.
Profile performance regularly.
Write unit tests for components.
Use React Testing Library.
Mock external dependencies in tests.
Maintain good test coverage.
Follow feature-based organization.
Use index files for exports.
Keep related files together.
Use consistent naming.
Implement barrel exports.
Use Tailwind CSS for styling.
Follow utility-first approach for styling.
Use CSS variables for theming.
Keep styles maintainable.
Use CSS modules when needed.
Document complex logic.
Write clear component documentation.
Keep documentation up to date.
Use JSDoc when helpful.
Follow ESLint rules.
Use consistent formatting.
Write clear variable names.
Keep functions pure.
Use meaningful types.
Validate user input.
Implement proper authentication.
Handle sensitive data carefully.
Follow security best practices.
Use HTTPS for API calls.
Follow WCAG guidelines for accessibility.
Use semantic HTML.
Test with screen readers.
Ensure keyboard navigation.
Provide proper focus management.
📄 Source: CodeRabbit Inference Engine (.cursor/rules/backoffice-v2.mdc)
List of files the instruction was applied to:
apps/backoffice-v2/src/pages/Home/components/DynamicMetricsSection/DynamicMetricsSection.tsx
apps/backoffice-v2/src/common/components/molecules/ProcessTracker/trackers/merchant-monitoring/MerchantMonitoringTracker.tsx
apps/backoffice-v2/src/pages/Home/components/PortfolioRiskStatistics/PortfolioRiskStatistics.tsx
apps/backoffice-v2/src/common/utils/get-phone-number-formatter/get-phone-number-formatter.ts
apps/backoffice-v2/src/common/utils/get-phone-number-formatter/get-phone-number-formatter.unit.test.ts
`apps/workflows-dashboard/**/*.{ts,tsx}`: Use functional components with TypeScr...
apps/workflows-dashboard/**/*.{ts,tsx}
: Use functional components with TypeScript.
Follow feature-based architecture.
Implement container/presenter pattern.
Use compound components when needed.
Keep components focused and small.
Separate business logic into hooks and place hooks in feature directories.
Use custom hooks for reusable logic and follow the 'use' prefix convention.
Keep hooks single-purpose.
Use React Query for API state and data fetching.
Implement Context for shared state.
Use local state for UI elements.
Follow flux architecture.
Keep state normalized.
Use strict mode in TypeScript.
Define clear interfaces and use type inference.
Export types separately.
Use discriminated unions.
Use data visualization libraries for dashboard components.
Implement proper loading, empty, and error states in dashboard components.
Use proper grid layouts in dashboard components.
Implement proper caching for data fetching.
Type API responses.
Implement clear workflow states and handle transitions properly.
Show progress indicators and validate workflow steps.
Handle workflow edge cases.
Use error boundaries and show user-friendly errors.
Log errors appropriately and implement fallbacks.
Handle async errors.
Optimize renders and use virtualization for lists.
Implement code splitting and use lazy loading.
Monitor performance.
Write unit and integration tests, and mock API responses.
Test workflows and error states thoroughly.
Use feature folders and keep related files together.
Use clear naming and implement barrel exports.
Follow consistent file structure.
Use Tailwind CSS and follow the design system.
Use CSS variables and keep styles maintainable.
Use CSS modules when needed.
Use React Hook Form for forms and implement validation.
Show feedback, handle submissions, and use controlled inputs in forms.
Document complex logic and write clear comments.
Keep documentation updated and use JSDoc.
Document APIs.
Follow ESLint rules and use consistent style.
Write clear, maintainable code and review regularly.
Follow WCAG and use semantic HTML for accessibility.
Add ARIA labels, test keyboard navigation, and support screen readers.
Validate inputs and handle authentication properly for security.
Protect sensitive data, follow security best practices, and use secure APIs.
Follow React best practices and keep code DRY.
Handle edge cases and write clean code.
Review code regularly.
Use proper charts and show clear metrics in dashboard.
Implement filters, handle large datasets, and support sorting in dashboard.
Show clear workflow status, use proper icons, implement transitions, show progress, and handle errors in workflow visualization.
📄 Source: CodeRabbit Inference Engine (.cursor/rules/workflows-dashboard.mdc)
List of files the instruction was applied to:
apps/workflows-dashboard/src/pages/WorkflowDefinition/WorkflowDefinition.tsx
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Analyze (javascript)
🔇 Additional comments (8)
packages/workflow-core/src/lib/plugins/external-plugin/vendor-consts.ts (2)
513-517
:pluginKind
appears inconsistent with the enclosing factory keyThe object is returned under the
'merchant-monitoring'
branch, yetpluginKind
is still set to'api'
.
Down-stream consumers that rely onpluginKind === 'merchant-monitoring'
for routing or analytics will silently miss this plugin.- pluginKind: 'api', + pluginKind: 'merchant-monitoring',Please double-check the contract expected by any schema validations, type-guards, or UI filters before changing.
515-515
: Rename looks good –displayName
now matches the new wording (“Web Presence”).apps/backoffice-v2/src/common/components/molecules/ProcessTracker/trackers/merchant-monitoring/MerchantMonitoringTracker.tsx (1)
15-17
: LGTM – title aligned with the new terminologyservices/workflows-service/src/workflow-defintion/demo-workflow/workflow-definition-with-associated.ts (1)
279-283
: Display name updated consistently – no further issues spotted.services/workflows-service/src/workflow-defintion/demo-workflow/us/kyb-workflow-definition.ts (1)
266-266
: Approved: Consistent display name updatesThe display name changes from "Merchant Monitoring" to "Web Presence" and "Merchant Screening" to "MATCH Screening" improve naming clarity while preserving all functional aspects of the plugins.
Also applies to: 282-282
services/workflows-service/src/workflow/workflow.controller.external.ts (1)
259-259
: Approved: API documentation consistencyThe updates to the Swagger documentation and example workflow configuration correctly reflect the new "Web Presence" display name, maintaining consistency with the plugin changes.
Also applies to: 305-305
services/workflows-service/src/workflow-defintion/demo-workflow/eu/kyb-workflow-definition.ts (1)
264-264
: Approved: Regional consistency maintainedThe display name updates match those in the US workflow definition, ensuring consistent naming across different regional configurations while preserving plugin functionality.
Also applies to: 280-280
apps/workflows-dashboard/src/pages/WorkflowDefinition/WorkflowDefinition.tsx (1)
139-139
: Approved: UI consistency with backend changesThe vendor details updates align perfectly with the backend workflow definition changes, ensuring users see consistent "Web Presence" and "MATCH Screening" terminology throughout the application interface.
Also applies to: 150-150, 170-170
if (!/^(?!-)(?!\+?$)(?!-+$)(?!.*-\+)(?!.*--)\+?[\d-]+(?<!-)$/.test(value)) { | ||
return; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Document the complex regex pattern for maintainability.
The regex validation is a good addition to prevent invalid inputs like emails from being processed as phone numbers. However, the pattern is quite complex with multiple negative lookaheads and lookbehinds, making it difficult to understand and maintain.
Consider adding a comment explaining the regex logic or extracting it to a named constant:
+// Regex to validate phone number format:
+// - Must not start or end with hyphen
+// - Must not be empty or just a plus sign
+// - Must not contain double hyphens or hyphen before plus
+// - Must contain only digits, hyphens, and optional leading plus
+const PHONE_NUMBER_PATTERN = /^(?!-)(?!\+?$)(?!-+$)(?!.*-\+)(?!.*--)\+?[\d-]+(?<!-)$/;
+
export const getPhoneNumberFormatter = (value: string) => {
try {
- if (!/^(?!-)(?!\+?$)(?!-+$)(?!.*-\+)(?!.*--)\+?[\d-]+(?<!-)$/.test(value)) {
+ if (!PHONE_NUMBER_PATTERN.test(value)) {
return;
}
🤖 Prompt for AI Agents
In
apps/backoffice-v2/src/common/utils/get-phone-number-formatter/get-phone-number-formatter.ts
around lines 9 to 11, the regex pattern used for phone number validation is
complex and hard to understand. To improve maintainability, add a clear comment
above the regex explaining its purpose and the key parts of the pattern.
Alternatively, extract the regex into a well-named constant with a descriptive
name and add the explanatory comment there.
Summary by CodeRabbit