Skip to content

MPT-17589 Add Seller country, PMA, handshake status, and customer rol…#225

Merged
ruben-sebrango merged 1 commit intomainfrom
MPT-17589-add-seller-country-pma-handshake-status-and-customer-roles-status-to-the-tickets
Feb 3, 2026
Merged

MPT-17589 Add Seller country, PMA, handshake status, and customer rol…#225
ruben-sebrango merged 1 commit intomainfrom
MPT-17589-add-seller-country-pma-handshake-status-and-customer-roles-status-to-the-tickets

Conversation

@alephsur
Copy link
Contributor

@alephsur alephsur commented Feb 2, 2026

…es status to the tickets

Closes MPT-17589

  • Added seller country, PMA (pm_account_id), handshake approval status, and customer roles deployment status to CRM ticket templates and step builders across all ticket types (new account, deploy customer roles, onboard services, order fail, PLS, and terminate order)
  • Imported new parameter accessor functions get_channel_handshake_approval_status() and get_customer_roles_deployed() from parameters module for retrieving fulfillment order data
  • Updated all CRM ticket summary templates to include new HTML list items displaying the four additional fields in the Order Details sections
  • Modified default return values in parameters.py for get_customer_roles_deployed() and get_channel_handshake_approval_status() from None to empty strings for consistent formatting
  • Updated test fixtures and assertions across all CRM ticket tests to expect and validate the new fields in ServiceRequest objects
  • Changed default test value for channel_handshake_approved parameter from empty string to "no" in the fulfillment parameters factory

@alephsur alephsur requested a review from a team as a code owner February 2, 2026 16:38
@coderabbitai
Copy link

coderabbitai bot commented Feb 2, 2026

📝 Walkthrough

Walkthrough

The PR extends CRM ticket templates and summary builders to include four new fields: seller_country, pm_account_id, handshake_approved, and customer_roles_deployed. Changes are applied consistently across multiple CRM ticket step modules and their templates, with parameter utility functions updated to return empty strings instead of None by default.

Changes

Cohort / File(s) Summary
CRM Ticket Builders
swo_aws_extension/flows/steps/crm_tickets/deploy_customer_roles.py, new_account.py, onboard_services.py, order_fail.py, pls.py, terminate_order.py
Added two to four new fields (seller_country, pm_account_id, handshake_approved, customer_roles_deployed) to _build_summary methods. Imported get_channel_handshake_approval_status and get_customer_roles_deployed functions as needed, with capitalization applied to derived boolean values.
CRM Ticket Templates
swo_aws_extension/flows/steps/crm_tickets/templates/deploy_roles.py, new_account.py, onboard_services.py, order_failed.py, pls.py, terminate_order.py
Added placeholder list items in template HTML for seller_country, pm_account_id, handshake_approved, and customer_roles_deployed within Order Details sections.
Parameters Module
swo_aws_extension/parameters.py
Changed default return values in get_customer_roles_deployed and get_channel_handshake_approval_status from None to empty strings when fulfillment parameter values are missing.
Test Fixtures and Expectations
tests/conftest.py, tests/flows/steps/crm_tickets/test_*.py
Updated test expectations to include new fields in ServiceRequest construction and summary formatting. Changed default channel_handshake_approved fixture parameter from "" to "no".

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Jira Issue Key In Title ✅ Passed The PR title contains exactly one Jira issue key in correct MPT-XXXX format at the beginning.
Test Coverage Required ✅ Passed The PR modifies 13 code files and includes updates to 6 test files, demonstrating that test coverage has been considered alongside code changes.
Single Commit Required ✅ Passed The pull request contains exactly one commit, satisfying the requirement for clean git history.

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

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • MPT-17589: Cannot read properties of undefined (reading 'map')

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

@alephsur alephsur force-pushed the MPT-17589-add-seller-country-pma-handshake-status-and-customer-roles-status-to-the-tickets branch from fd18129 to 2897041 Compare February 2, 2026 16:38
@alephsur alephsur force-pushed the MPT-17589-add-seller-country-pma-handshake-status-and-customer-roles-status-to-the-tickets branch from 2897041 to 14b7365 Compare February 2, 2026 16:51
@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 2, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
27.4% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

Copy link

@coderabbitai coderabbitai bot left a 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

🤖 Fix all issues with AI agents
In `@swo_aws_extension/flows/steps/crm_tickets/terminate_order.py`:
- Around line 58-68: The CRM ticket builders pass context.pm_account_id directly
which can be None and renders as "None" in templates; update all ticket summary
builders (e.g., the dict construction in terminate_order.py where
pm_account_id=context.pm_account_id, and the equivalent places in pls.py,
order_fail.py, onboard_services.py, new_account.py, deploy_customer_roles.py) to
use a safe fallback like pm_account_id=context.pm_account_id or "" to ensure an
empty string is used when the value is missing (match the existing pattern used
for buyer_external_id and seller_country).
🧹 Nitpick comments (2)
swo_aws_extension/parameters.py (2)

296-302: Type hint is inconsistent with the new default return value.

The return type annotation is str | None, but the function now returns "" instead of None when the value is missing. This mismatch can mislead callers who might check for None to determine if the value is unset.

Consider updating the type hint to str since None is no longer a possible return value, or update the docstring to clarify the empty-string default behavior.

Suggested fix
-def get_customer_roles_deployed(source: dict[str, Any]) -> str | None:
-    """Get the customer roles deployed flag from the fulfillment parameter."""
+def get_customer_roles_deployed(source: dict[str, Any]) -> str:
+    """Get the customer roles deployed flag from the fulfillment parameter or empty string if not set."""

374-380: Type hint is inconsistent with the new default return value.

Same issue as get_customer_roles_deployed — the return type is str | None, but the function now returns "" instead of None. For consistency and clarity, consider updating the type hint to str.

Suggested fix
-def get_channel_handshake_approval_status(source: dict[str, Any]) -> str | None:
-    """Get the channel handshake approved flag from the fulfillment parameter."""
+def get_channel_handshake_approval_status(source: dict[str, Any]) -> str:
+    """Get the channel handshake approved flag from the fulfillment parameter or empty string if not set."""

@albertsola
Copy link
Contributor

@alephsur You could potentially remove the duplicated code by creating a property method called seller_country in the context

@ruben-sebrango ruben-sebrango merged commit 5fbb194 into main Feb 3, 2026
10 of 11 checks passed
@ruben-sebrango ruben-sebrango deleted the MPT-17589-add-seller-country-pma-handshake-status-and-customer-roles-status-to-the-tickets branch February 3, 2026 09:38
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.

3 participants