Skip to content

Add saleCostDisplay to PaidDomainSuggestion#1287

Closed
oguzkocer wants to merge 1 commit intotrunkfrom
add-sale-cost-display
Closed

Add saleCostDisplay to PaidDomainSuggestion#1287
oguzkocer wants to merge 1 commit intotrunkfrom
add-sale-cost-display

Conversation

@oguzkocer
Copy link
Copy Markdown
Contributor

Adds formatting that matches the server's combined_sale_cost_display: currency prefix from cost field, comma thousand-separators, and two decimal places only for fractional values.

Exposed as a method on PaidDomainSuggestion (for Rust callers), a free-standing UniFFI function (for cross-language export), and a Kotlin extension property on PaidDomainSuggestion.

Test cases derived from real /products/?type=domains responses to ensure the formatting matches the server exactly.


@jkmassel WPAndroid currently shows this value from the products endpoint, which we can implement. (may even need to for other screens) However, we also have the necessary components from the suggestions endpoint to construct it ourselves, saving an extra endpoint call. I figured I'd open the PR so you see it in action instead of pinging you and explaining it. So, the short story is that I am not sure if we really want to go about it this way.

@oguzkocer oguzkocer added this to the 0.2 milestone Apr 16, 2026
@wpmobilebot
Copy link
Copy Markdown
Collaborator

wpmobilebot commented Apr 16, 2026

XCFramework Build

This PR's XCFramework is available for testing. Add to your Package.swift:

.package(url: "https://github.com/automattic/wordpress-rs", branch: "pr-build/1287")

Built from 754ce82

Adds formatting that matches the server's combined_sale_cost_display:
currency prefix from cost field, comma thousand-separators, and two
decimal places only for fractional values.

Exposed as a method on PaidDomainSuggestion (for Rust callers), a
free-standing UniFFI function (for cross-language export), and a Kotlin
extension property on PaidDomainSuggestion.

Test cases derived from real /products/?type=domains responses to
ensure the formatting matches the server exactly.
@oguzkocer oguzkocer force-pushed the add-sale-cost-display branch from 568579a to 754ce82 Compare April 16, 2026 02:19
@oguzkocer oguzkocer marked this pull request as ready for review April 16, 2026 20:56
@oguzkocer oguzkocer requested a review from jkmassel April 16, 2026 20:56
@oguzkocer
Copy link
Copy Markdown
Contributor Author

We decided to keep the current logic and make a request to /products endpoint for this information. #1289

@oguzkocer oguzkocer closed this Apr 18, 2026
@oguzkocer oguzkocer deleted the add-sale-cost-display branch April 18, 2026 05:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants