MPT-17589 Add Seller country, PMA, handshake status, and customer rol…#225
Conversation
📝 WalkthroughWalkthroughThe PR extends CRM ticket templates and summary builders to include four new fields: Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
Comment |
fd18129 to
2897041
Compare
…es status to the tickets
2897041 to
14b7365
Compare
|
There was a problem hiding this comment.
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 ofNonewhen the value is missing. This mismatch can mislead callers who might check forNoneto determine if the value is unset.Consider updating the type hint to
strsinceNoneis 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 isstr | None, but the function now returns""instead ofNone. For consistency and clarity, consider updating the type hint tostr.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."""
|
@alephsur You could potentially remove the duplicated code by creating a property method called seller_country in the context |


…es status to the tickets
Closes MPT-17589
get_channel_handshake_approval_status()andget_customer_roles_deployed()from parameters module for retrieving fulfillment order dataparameters.pyforget_customer_roles_deployed()andget_channel_handshake_approval_status()fromNoneto empty strings for consistent formattingchannel_handshake_approvedparameter from empty string to "no" in the fulfillment parameters factory