Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 11 additions & 14 deletions adobe_vipm/flows/fulfillment/reseller_transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,13 @@
from adobe_vipm.airtable.models import get_transfer_by_authorization_membership_or_customer
from adobe_vipm.flows.constants import ERR_ADOBE_RESSELLER_CHANGE_PREVIEW, TEMPLATE_NAME_TRANSFER
from adobe_vipm.flows.context import Context
from adobe_vipm.flows.fulfillment import transfer
from adobe_vipm.flows.fulfillment.shared import (
SetupDueDate,
StartOrderProcessing,
SyncAgreement,
switch_order_to_failed,
)
from adobe_vipm.flows.fulfillment.transfer import (
CompleteTransferOrder,
GetAdobeCustomer,
ValidateAgreementDeployments,
ValidateGCMainAgreement,
get_agreement_deployments,
get_main_agreement,
)
from adobe_vipm.flows.helpers import (
FetchResellerChangeData,
SetupContext,
Expand Down Expand Up @@ -58,11 +51,15 @@ def fulfill_reseller_change_order(mpt_client, order):
ValidateResellerChange(is_validation=False),
CommitResellerChange(),
CheckAdobeResellerTransfer(),
GetAdobeCustomer(),
transfer.GetAdobeCustomer(),
UpdateAutorenewalSubscriptions(),
ValidateGCMainAgreement(),
ValidateAgreementDeployments(),
CompleteTransferOrder(),
transfer.ValidateGCMainAgreement(),
transfer.ValidateAgreementDeployments(),
transfer.ProcessTransferOrder(),
transfer.CreateTransferAssets(),
transfer.CreateTransferSubscriptions(),
transfer.SetCommitmentDates(),
transfer.CompleteTransferOrder(),
SyncAgreement(),
)

Expand All @@ -84,13 +81,13 @@ def __call__(self, client, context, next_step):
context.reseller_change_code,
)

context.gc_main_agreement = get_main_agreement(
context.gc_main_agreement = transfer.get_main_agreement(
context.product_id,
context.authorization_id,
context.reseller_change_code,
)

context.existing_deployments = get_agreement_deployments(
context.existing_deployments = transfer.get_agreement_deployments(
context.product_id, context.order.get("agreement", {}).get("id", "")
)

Expand Down
12 changes: 10 additions & 2 deletions tests/flows/fulfillment/test_reseller_change.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@
)
from adobe_vipm.flows.fulfillment.transfer import (
CompleteTransferOrder,
CreateTransferAssets,
CreateTransferSubscriptions,
GetAdobeCustomer,
ProcessTransferOrder,
SetCommitmentDates,
ValidateAgreementDeployments,
ValidateGCMainAgreement,
)
Expand Down Expand Up @@ -216,6 +220,10 @@ def test_fulfill_reseller_change_order(mocker, mock_mpt_client):
UpdateAutorenewalSubscriptions,
ValidateGCMainAgreement,
ValidateAgreementDeployments,
ProcessTransferOrder,
CreateTransferAssets,
CreateTransferSubscriptions,
SetCommitmentDates,
CompleteTransferOrder,
SyncAgreement,
]
Expand All @@ -240,11 +248,11 @@ def test_setup_reseller_change_context_success(
)
mocked_get_transfer.return_value = None
mocked_get_main_agreement = mocker.patch(
"adobe_vipm.flows.fulfillment.reseller_transfer.get_main_agreement"
"adobe_vipm.flows.fulfillment.transfer.get_main_agreement"
)
mocked_get_main_agreement.return_value = None
mocked_get_agreement_deployments = mocker.patch(
"adobe_vipm.flows.fulfillment.reseller_transfer.get_agreement_deployments"
"adobe_vipm.flows.fulfillment.transfer.get_agreement_deployments"
)
mocked_get_agreement_deployments.return_value = []
order = order_factory(order_parameters=reseller_change_order_parameters_factory())
Expand Down