Skip to content

pricing: Market check, our prices against a live store through FB Connect - #145

Merged
futurebuildai merged 18 commits into
refactor/v1from
refactor/market-check
Oct 14, 2026
Merged

futurebuildai merged 18 commits into
refactor/v1from
refactor/market-check

Conversation

@futurebuildai

Copy link
Copy Markdown
Contributor

Item 112 c. A Market check screen under Pricing: the dealer picks SKUs and runs a check; Gable's server calls the FB Connect pricing flow by its webhook with the yard and the items, and the screen shows our price, the competitor's title and price, the difference and position (recomputed here, never the flow's), and a suggested price that keeps the margin floor.

Server (core/internal/marketcheck)

  • GET and PUT /api/v1/admin/market-check/settings (admin, owner; machine key scope admin:settings): address, sealed write only webhook id (enc:v1: with the payment vault, refused in words with no vault key), flow name, store label, id and ZIP, band and margin floor percents. The id is never answered.
  • POST /api/v1/pricing/market-check (admin, owner; the pricing rules' walls): one to twelve distinct products, batches of three, four at once, no redirects, 1 MB answer cap, fixed failure words, untrusted rows cleaned, link allowlist, our own figures, integer cents rounding written once (compute.go). Cost is never sent or answered. Neither the id nor the address reaches a log line, an error, an audit row or a response.
  • Key allowlist: run and settings write refused to a branch bound key; settings read a stated limit. Contract fragment, census, contract change row, walk, and docs/integrations/MARKET-CHECK-FLOW.md.

Desk

  • /pricing/market-check (link on the Pricing page) with the pick chips, search, run states, summary line and table; Tech Admin gains a Market check tab with a write only webhook id (Saved, Replace, Clear).

Tests

  • Go against an httptest stub of the flow and a real Postgres wire test (sealed at rest, roles, pool of four with three contenders); Vitest for the screen states and the card.

🤖 Generated with Claude Code

futurebuildai and others added 18 commits October 14, 2026 08:27
…able

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: colton <colton@futurebuild.ai>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: colton <colton@futurebuild.ai>
…ire tests

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: colton <colton@futurebuild.ai>
… walk

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: colton <colton@futurebuild.ai>
Signed-off-by: colton <colton@futurebuild.ai>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: colton <colton@futurebuild.ai>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: colton <colton@futurebuild.ai>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: colton <colton@futurebuild.ai>
The run called fetchWithAuth with its default 10 second timeout, so a cold
FB Connect run was aborted and cancelled the server's batches.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: colton <colton@futurebuild.ai>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: colton <colton@futurebuild.ai>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: colton <colton@futurebuild.ai>
…r tiles

Falls back to the first catalogue products when the route is absent; the
SKU prefix assumption is gone, and the page says which source it used.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: colton <colton@futurebuild.ai>
Without the counter tiles the pick is the six fixed length boards (all three
board fields set, not random length) with the most available, then the
first catalogue products when there are none.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: colton <colton@futurebuild.ai>
…r, 8 to 16 feet

Engineered wood (LVL) has fixed length and large stock but is not
dimensional lumber: nominal thickness 2, width 4 to 12, length 8 to 16
feet, not random length, then the six with the most available.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: colton <colton@futurebuild.ai>
…, dial guard, changed address, small ones)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: colton <colton@futurebuild.ai>
…, dial guard, a changed address clears the id, the small ones

The server's 15 second write timeout cut a run that waited longer on the
flow: the run now sets its own response deadline past one batch. The stored
address and id are re-validated at run time, the client refuses link local,
unspecified and multicast addresses (and private ones for a public name) at
dial time, a changed address clears the saved id, one run at a time per
caller, and the price is the counter's own expression.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: colton <colton@futurebuild.ai>
…dmin tab link, contract and docs

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: colton <colton@futurebuild.ai>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: colton <colton@futurebuild.ai>
@futurebuildai
futurebuildai merged commit c1e3307 into refactor/v1 Oct 14, 2026
17 of 18 checks passed
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