Skip to content

MPT-17590 Add usage item by default in the purchase wizard#227

Merged
alephsur merged 1 commit intomainfrom
MPT-17590-add-usage-item-by-default-in-the-purchase-wizard
Feb 3, 2026
Merged

MPT-17590 Add usage item by default in the purchase wizard#227
alephsur merged 1 commit intomainfrom
MPT-17590-add-usage-item-by-default-in-the-purchase-wizard

Conversation

@alephsur
Copy link
Contributor

@alephsur alephsur commented Feb 3, 2026

Closes MPT-17590

  • Add AWS_ITEMS_SKUS constant containing "AWS Usage"
  • Add add_default_lines(client, order) to fetch product items by SKU and append default order lines (quantity=1)
  • Add validate_order(client, order) to orchestrate parameter visibility update and default line injection
  • Update extension.py to call validate_order(request.client, order) in order validation endpoint
  • Update tests and fixtures to mock and cover validate_order behavior

@alephsur alephsur requested a review from a team as a code owner February 3, 2026 10:53
@coderabbitai
Copy link

coderabbitai bot commented Feb 3, 2026

📝 Walkthrough

Walkthrough

Added a new SKU constant and reworked order validation: extension entry now calls a new validate_order orchestrator which applies parameter visibility then appends default AWS line items by fetching product items via MPTClient.

Changes

Cohort / File(s) Summary
Constants Definition
swo_aws_extension/constants.py
Added AWS_ITEMS_SKUS = ("AWS Usage",) constant.
Validation Orchestration & Client Integration
swo_aws_extension/flows/validation/base.py
Added add_default_lines(client, order) and validate_order(client, order); integrated MPTClient and get_product_items_by_skus; adjusted update_parameters_visibility usage and error/log handling; removed unnecessary deep-copy in one path.
Extension Entrypoint
swo_aws_extension/extension.py
Replaced call to update_parameters_visibility(order) with validate_order(request.client, order) and updated import.
Tests & Fixtures
tests/flows/validation/test_base.py, tests/conftest.py, tests/test_extension.py
Added/updated tests to cover add_default_lines and validate_order; renamed mock fixture from mock_update_parameters_visibility to mock_validate_order and updated usages to match new orchestrator.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • #167: Related changes to order-validation flow and the original update_parameters_visibility implementation referenced by the new orchestrator.
  • #176: Overlaps in modifications to swo_aws_extension/flows/validation/base.py and constants for AWS-related validation.
  • #190: Edits the same validation module and touches support/type constraint logic that interacts with the new orchestration.
🚥 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 MPT-17590 in the correct format at the beginning.
Test Coverage Required ✅ Passed PR modifies 3 code files and includes corresponding changes in 3 test files, meeting the requirement for test coverage.
Single Commit Required ✅ Passed The pull request contains exactly one commit (a01296d: MPT-17590 Add usage item by default in the purchase wizard), satisfying the requirement.

✏️ 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-17590: 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-17590-add-usage-item-by-default-in-the-purchase-wizard branch from 300d8d3 to 72abd90 Compare February 3, 2026 10:54
@alephsur alephsur force-pushed the MPT-17590-add-usage-item-by-default-in-the-purchase-wizard branch from 72abd90 to a01296d Compare February 3, 2026 10:59
@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 3, 2026

@alephsur alephsur merged commit ca8797c into main Feb 3, 2026
11 checks passed
@alephsur alephsur deleted the MPT-17590-add-usage-item-by-default-in-the-purchase-wizard branch February 3, 2026 11:23
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