Skip to content

Import r and e peer

A modification workflow for migrating an ImportedRAndEPeer to a RAndEPeer subscription.

import_r_and_e_peer_subscription(subscription_id)

Take an imported subscription, and turn it into an R&E Peer subscription.

Source code in gso/workflows/l3_core_service/r_and_e_peer/import_r_and_e_peer.py
@step("Create an R&E Peer subscription")
def import_r_and_e_peer_subscription(subscription_id: UUIDstr) -> State:
    """Take an imported subscription, and turn it into an R&E Peer subscription."""
    old_l3_core_service = ImportedRAndEPeer.from_subscription(subscription_id)
    new_product_id = get_product_id_by_name(ProductName.R_AND_E_PEER)
    new_subscription = RAndEPeer.from_other_product(old_l3_core_service, new_product_id)  # type: ignore[arg-type]
    new_subscription.description = (
        f"{new_subscription.product.name} service for {get_partner_by_id(new_subscription.customer_id).name}"
    )
    return {"subscription": new_subscription}

import_r_and_e_peer()

Modify an imported subscription into an R&E Peer subscription to complete the import.

Source code in gso/workflows/l3_core_service/r_and_e_peer/import_r_and_e_peer.py
@modify_workflow("Import R&E Peer")
def import_r_and_e_peer() -> StepList:
    """Modify an imported subscription into an R&E Peer subscription to complete the import."""
    return begin >> import_r_and_e_peer_subscription