Skip to main content

Order status pipeline steps for MPT Extension SDK projects.

Project description

mpt-extension-contrib-order-status

Shared order-status pipeline steps for SoftwareONE MPT extensions built on the Extension SDK. The steps switch an order to its next status using a named order template and fall back to the product default when that template is not configured, so status changes stay consistent across extensions.

It replaces the per-extension complete-order and start-processing logic previously re-implemented in the Adobe, AWS, and FinOps extensions.

See AGENTS.md for the module documentation map.

Install

pip install mpt-extension-contrib-order-status

Requires the Extension SDK (mpt-extension-sdk >= 6.3, < 7), which is pulled in as a dependency.

Public API

mpt_extension_contrib.order_status exposes two pipeline steps, one helper, and one enum:

Object Purpose
CompleteOrder(template_name=...) Switch the order to Completed with a named template, falling back to the default.
StartOrderProcessing(template_name=...) Set the Processing template on the first run, falling back to the default.
resolve_template(api_service, *, product_id, status, template_name=None) Resolve a status template by name with default fallback (the primitive both steps use).
OrderStatus StrEnum of the order statuses the library resolves templates for (PROCESSING, COMPLETED).

template_name is optional on both steps; omit it to use the product's default template for the status.

Usage

Add the steps to an order pipeline:

from mpt_extension_sdk.pipeline import BasePipeline, BaseStep

from mpt_extension_contrib.order_status import CompleteOrder, StartOrderProcessing


class PurchasePipeline(BasePipeline):
    @property
    def steps(self) -> list[BaseStep]:
        return [
            StartOrderProcessing(template_name="Purchase processing"),
            # ... order processing steps ...
            CompleteOrder(template_name="Purchase completed"),
        ]
  • StartOrderProcessing(template_name=...) — resolves the Processing template and applies it only when it differs from the one already on the order, so reprocessing is a no-op. When the product has no matching template it logs a warning and continues.
  • CompleteOrder(template_name=...) — resolves the Completed template, completes the order, and refreshes the context order. It is skipped when the order is already completed and stops the pipeline when the product has no completion template at all.

Both steps fall back to the product default template when the requested name is not found, logging that the default was used. Each step also exposes an overridable resolve_template(self, context) method for custom template selection logic. See Usage for the full setup.

Documentation

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mpt_extension_contrib_order_status-1.0.0.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file mpt_extension_contrib_order_status-1.0.0.tar.gz.

File metadata

  • Download URL: mpt_extension_contrib_order_status-1.0.0.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.27 {"installer":{"name":"uv","version":"0.11.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for mpt_extension_contrib_order_status-1.0.0.tar.gz
Algorithm Hash digest
SHA256 becbf3f8b8d35996fd5b9428e60db034dfb1d2e8c434c9b5e599cc9fb4051009
MD5 bfe2488b77342daefaeeb1f98526db8c
BLAKE2b-256 bb8e2bcb212691bf491cc49dbcf11716947d1c26eb21d03015ba3ee34d3dd118

See more details on using hashes here.

File details

Details for the file mpt_extension_contrib_order_status-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: mpt_extension_contrib_order_status-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.27 {"installer":{"name":"uv","version":"0.11.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for mpt_extension_contrib_order_status-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9b12de6c9eb8d1dd1e3a2e979978d9d99555da097ea1decb16da52bc5af3cc84
MD5 4be75184ce5541ef368333fe5c43529f
BLAKE2b-256 05306cbd2eb91e09414e92e6caf36028be85d7e0b7b1ddf3c782617b753a3675

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page