Skip to content

ESD-1555: add marketplace visibility to the MVE buy request - #170

Open
Phil-Browne wants to merge 2 commits into
mainfrom
feature/ESD-1555-mve-marketplace-visibility
Open

ESD-1555: add marketplace visibility to the MVE buy request#170
Phil-Browne wants to merge 2 commits into
mainfrom
feature/ESD-1555-mve-marketplace-visibility

Conversation

@Phil-Browne

Copy link
Copy Markdown
Contributor

The SDK couldn't set marketplace visibility when ordering an MVE. BuyMVERequest had no field for it and createMVEOrder never sent one, so the buy payload omitted marketplaceVisibility even though the order API accepts it. This is the MVE mirror of the MCR fix in #169.

The buy endpoint takes an array of MegaportServiceRequest whose DESIGN variant merges DesignServiceBaseRequest (which defines marketplaceVisibility) via allOf over every product type, so the field is accepted for MVE just like Port and MCR. Confirmed against the OpenAPI spec.

  • Add MarketplaceVisibility *bool to BuyMVERequest and the MVEOrderConfig wire struct (marketplaceVisibility,omitempty).
  • Wire it through createMVEOrder, which ValidateMVEOrder also uses, so validate carries it too.
  • Tests assert the marshaled order includes the key when set (true/false) and omits it when unset.

*bool + omitempty, not plain bool: a nil pointer omits the key so existing callers keep the API default instead of being silently flipped to false, matching #169 and the Modify*Request convention.

BuyMVERequest had no marketplace-visibility field, so createMVEOrder never
sent marketplaceVisibility on buy even though the order API accepts it via the
shared DesignServiceBaseRequest base (merged into every product type). Add
MarketplaceVisibility *bool to BuyMVERequest and the MVEOrderConfig wire struct
and wire it through createMVEOrder, which ValidateMVEOrder also uses.

Mirrors the MCR fix: *bool with omitempty so a nil value omits the key and keeps
the API default rather than silently sending false.
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.

1 participant