Skip to content

Import r and e lhcone

A modification workflow for migrating an ImportedRAndELHCOne to an RAndELHCOne subscription.

import_r_and_e_lhcone_subscription(subscription_id)

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

Source code in gso/workflows/l3_core_service/r_and_e_lhcone/import_r_and_e_lhcone.py
@step("Create an R&E LHCONE subscription")
def import_r_and_e_lhcone_subscription(subscription_id: UUIDstr) -> State:
    """Take an imported subscription, and turn it into an R&E LHCONE subscription."""
    old_l3_core_service = ImportedRAndELHCOne.from_subscription(subscription_id)
    new_product_id = get_product_id_by_name(ProductName.R_AND_E_LHCONE)
    new_subscription = RAndELHCOne.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_lhcone()

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

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