Skip to content

feat: flatten domain suggest term pricing and prefix next-actions with gddy#90

Open
jpage-godaddy wants to merge 2 commits into
rust-portfrom
domain-suggestion-prices
Open

feat: flatten domain suggest term pricing and prefix next-actions with gddy#90
jpage-godaddy wants to merge 2 commits into
rust-portfrom
domain-suggestion-prices

Conversation

@jpage-godaddy

@jpage-godaddy jpage-godaddy commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Flatten domain suggest's 1yr/2yr TermPrice entries into scalar price1Year/renewalPrice1Year/price2Year/renewalPrice2Year/currency fields, matching the headline-price convention already used by domain available/domain quote.
  • Prefix every suggested next-action command with the gddy binary name (via a new crate::next_action wrapper) so next-step text is directly copy-pasteable, e.g. gddy domain quote <domain> instead of domain quote <domain>.

Feedback threads for context:

Test plan

  • cargo check --package godaddy-cli
  • cargo clippy --package godaddy-cli -- -D warnings
  • cargo test --package godaddy-cli (226 passed)
  • cargo fmt -- --check
  • Verified live: cargo run -- root next actions render with gddy prefix (e.g. gddy auth status)

…h gddy

Flatten domain suggest's 1yr/2yr TermPrice entries into scalar
price1Year/renewalPrice1Year/price2Year/renewalPrice2Year/currency
fields, matching the headline-price convention already used by
`domain available`/`domain quote`.

Prefix every suggested next-action command with the `gddy` binary
name (via a new crate::next_action wrapper) so next-step text is
directly copy-pasteable, e.g. `gddy domain quote <domain>` instead
of `domain quote <domain>`.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves CLI UX and output consistency by (1) flattening domain suggest’s multi-term pricing array into scalar, table-friendly fields and (2) ensuring all suggested “next actions” are copy/paste-ready by prefixing commands with the gddy binary name via a shared wrapper.

Changes:

  • Flatten domain suggest pricing into price1Year, renewalPrice1Year, price2Year, renewalPrice2Year, and currency, and add focused unit tests for the transformation.
  • Introduce crate::next_action::next_action and switch existing NextAction::new(...) callsites to use it so commands are prefixed with gddy.
  • Add term_for_period helper to support selecting specific term lengths from TermPrice[].

Reviewed changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
rust/src/payments/mod.rs Switch next-action construction to next_action(...) so suggested commands include gddy.
rust/src/pat/mod.rs Prefix PAT command next-action with gddy via shared helper.
rust/src/next_action.rs New helper that prefixes suggested next-action commands with APP_ID (gddy).
rust/src/main.rs Root next actions now use next_action(...); module wired into the crate.
rust/src/hosting/nodejs/mod.rs Update all hosting/nodejs next actions to use the gddy-prefixed helper.
rust/src/domain/suggest.rs Flatten pricing fields, update schema/default fields, and add tests for JSON shaping.
rust/src/domain/quote.rs Prefix domain quote next actions with gddy.
rust/src/domain/purchase.rs Prefix purchase flow next actions with gddy.
rust/src/domain/operation.rs Prefix operation-status next actions with gddy.
rust/src/domain/nameservers.rs Prefix nameserver update next actions with gddy.
rust/src/domain/list.rs Prefix domain list next actions with gddy.
rust/src/domain/get.rs Prefix domain get next actions with gddy.
rust/src/domain/contacts.rs Prefix contacts group next actions with gddy.
rust/src/domain/common.rs Add term_for_period helper used by domain suggest pricing flattening.
rust/src/domain/available.rs Prefix available next actions with gddy.
rust/src/domain/agreements.rs Prefix agreements next actions with gddy.
rust/src/dns/mod.rs Ensure DNS “verify with list” next action is gddy-prefixed.
rust/src/application/commands/mod.rs Prefix application command next actions with gddy.
rust/src/api_explorer/mod.rs Prefix API explorer next actions with gddy.
rust/src/actions_catalog/mod.rs Prefix actions-catalog next actions with gddy.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread rust/src/domain/suggest.rs Outdated
Comment thread rust/src/domain/common.rs
Addresses Copilot review feedback on PR #90: a suggestion term with
only a renewal price (no indicative price) previously emitted
renewalPriceNYear with no currency field. Also corrects a stale doc
comment on headline_price (no longer shared with suggest).

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 20 out of 20 changed files in this pull request and generated no new comments.

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.

2 participants