Skip to content

fix(domain): surface premium domain fees in available/suggest/quote - #294

Merged
jpage-godaddy merged 3 commits into
mainfrom
premium-not-shown
Sep 28, 2026
Merged

jpage-godaddy merged 3 commits into
mainfrom
premium-not-shown

Conversation

@jpage-godaddy

@jpage-godaddy jpage-godaddy commented Sep 28, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • domain available/domain suggest parsed pricing but never read the API's inventory/fees fields, so a premium domain's one-time acquisition surcharge (e.g. an Afternic fast-transfer domain) was invisible until quote time.
  • domain quote already computed inventory/fees correctly, but they were missing from default_fields — which cli-engine projects every default output (human table and default --output json alike) down to. Same masking bug previously fixed for renewalPrice (GDDEVPLAT-133). Even a genuine premium quote showed only the base registration price, silently omitting a surcharge that can run into the thousands of dollars.
  • Shares the existing fees_to_json helper (moved from quote into domain::common) across all three commands.
  • (Refined during review) domain suggest's human table had no columns for fees1Year/fees2Year either — added, so the surcharge is visible there too, not just in --output json. Also corrected the inventory field's schema comment across all three commands: it's present whenever the API returns an inventory source at all (REGISTRY/REGISTRY_PREMIUM/PREMIUM), not only for premium domains.

Test plan

  • cargo check --workspace
  • cargo clippy --workspace -- -D warnings
  • cargo test --workspace (976 passed)
  • cargo fmt --check
  • ./rust/scripts/check-module-size.sh
  • Verified live against a real premium domain (bingoboard.com): before the fix, gddy domain quote/domain available showed only the $22.99 base price; after the fix, both surface the $3,500.00 ONE_TIME_PREMIUM_DOMAIN_PURCHASE fee and inventory: PREMIUM, in both human and JSON output.

🤖 Generated with Claude Code

`domain available` and `domain suggest` parsed pricing but never read
the API's `inventory`/`fees` fields, so a premium domain's one-time
acquisition surcharge (e.g. an Afternic fast-transfer domain) was
completely invisible until `quote` time.

`domain quote` already computed `inventory`/`fees` correctly, but they
were missing from `default_fields`, which `cli-engine` projects every
default output (human table and default `--output json` alike) down
to — the same masking bug previously fixed for `renewalPrice`
(GDDEVPLAT-133). So even a genuine premium quote showed only the base
registration price, silently omitting a surcharge that can run into
the thousands of dollars.

Shares the existing `fees_to_json` helper (moved from `quote` into
`domain::common`) across all three commands.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

domain suggest does not render the new fee fields in its human-readable table.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
What changed in this PR

This PR surfaces premium-domain inventory and acquisition fees across domain availability, suggestions, and quotes.

Changes:

  • Shares fee serialization through domain::common.
  • Adds inventory and term fees to command outputs and default fields.
  • Adds regression coverage for fee formatting and projections.
File Summary
rust/​src/​domain/​common.rs Shared fee serialization helper.
rust/​src/​domain/​available.rs Exposes premium inventory and term fees.
rust/​src/​domain/​suggest.rs Exposes premium inventory and per-term fees; human table columns remain incomplete.
rust/​src/​domain/​quote.rs Includes inventory and fees in default output.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread rust/src/domain/suggest.rs

@kperkins-godaddy kperkins-godaddy 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.

We can tidy this up more tomorrow.

`fees1Year`/`fees2Year` were emitted into JSON but had no
corresponding view_columns() entry, so the human table silently
dropped a premium suggestion's surcharge even though `--output json`
carried it.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

No blocking issues were identified; remaining findings are minor documentation nits.

Review effort: Lite
Findings: None

Resolved since last review (1)
Previously missed (2)

In code that hasn't changed since last review

Low severity Document all possible inventory values

rust/​src/​domain/​available.rs:30

This description is narrower than the value emitted by the handler and the API contract: body.inventory is copied for every returned inventory type, including ordinary REGISTRY (and REGISTRY_PREMIUM), not only premium domains. Since this comment is exposed as output/schema guidance, please describe the three possible inventory values accurately.

Low severity Clarify inventory is not premium-only

rust/​src/​domain/​suggest.rs:33

This says inventory is only present for premium suggestions, but suggestion_to_json emits any API inventory value and the API includes ordinary REGISTRY suggestions. The schema/help comment should match the actual output rather than implying this field is absent for standard domains.

`inventory` is present whenever the API returns an inventory source
at all — REGISTRY, REGISTRY_PREMIUM, or PREMIUM — not only for
premium domains. The prior wording implied the field itself was
absent for an ordinary domain, when only the surcharge is.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@jpage-godaddy

Copy link
Copy Markdown
Collaborator Author

Fixed in 859a8e4: addressed the two "Previously missed" findings from Copilot's review body (no separate resolvable thread existed for these):

  • available.rs/suggest.rs/quote.rs: corrected the inventory field's schema comment — it's present whenever the API returns an inventory source at all (REGISTRY, REGISTRY_PREMIUM, or PREMIUM), not only for premium domains. Only the latter two carry a surcharge, in fees. Fixed quote.rs's pre-existing comment too, for consistency, since it had the same inaccuracy and I was already touching the file.

@jpage-godaddy
jpage-godaddy requested a lite review from Copilot September 28, 2026 02:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

All reviewed changes are covered and no unresolved blocking issues remain.

Review effort: Lite
Findings: None

@jpage-godaddy
jpage-godaddy merged commit ef30da1 into main Sep 28, 2026
6 checks passed
@jpage-godaddy
jpage-godaddy deleted the premium-not-shown branch September 28, 2026 02:26
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.

3 participants