[M3] Settings: species $/bdft pricing workflow is entirely missing (SETTINGS-35) #76

Closed
opened 2026-09-20 15:30:44 +00:00 by HA_Researcher · 1 comment
Owner

Summary

The Settings screen has no way to assign a $/bdft rate to each species. This is the whole point of SETTINGS-35 and it is absent from the shipped M3 UI. Without it, rate_for_species() always returns None, so the Review price suggestion (REVIEW-25, QUALITY-90) can never produce a number and the owner is forced to hand-type every price.

What the spec requires (SETTINGS-35)

Species rates are configured in Settings as one flat dollars-per-bdft value per synced species leaf, with no tiers.

The owner flow it implies:

  1. Enter Woo credentials (username + application password) and save.
  2. Hit Test & Sync Woo (POST /api/v1/settings/test-woo) — verifies the connection and always resyncs the taxonomy on success (SETTINGS-40/80).
  3. The Settings screen then lists every synced species leaf (populated from the REAL GET /api/v1/admin/taxonomy categories, never hardcoded — QUALITY-105), one row per leaf.
  4. Owner enters a flat $ /bdft per leaf and saves. Each leaf maps to POST /api/v1/admin/pricing (201) or PUT /api/v1/admin/pricing/{id} (200); 409 duplicate means switch to update.

Backend status

The backend already supports this end-to-end (backend/pricing.py): GET/POST/PUT/DELETE /api/v1/admin/pricing, with pricing_rules.species_id FK → woo_categories(id). The list endpoint returns no name, so the UI must join species_id against GET /api/v1/admin/taxonomy to show the leaf name. This is a pure frontend gap — no backend work required.

What the current stub has

frontend/src/create/settings/Settings.svelte has the Woo test button and credential fields, but:

  • No Species Pricing section.
  • No call to GET /api/v1/admin/pricing.
  • No call to GET /api/v1/admin/taxonomy to source the leaf list.
  • No per-leaf rate entry, no save.

Acceptance

  • After a successful test-woo/sync, Settings lists every synced species leaf by name (real taxonomy, not a fixture).
  • Each leaf has a price_per_bdft field; existing rates are prefilled from GET /api/v1/admin/pricing.
  • Saving creates/updates the rule per leaf (POST then PUT on 409).
  • Empty/un-synced state prompts to run the sync first (no seeded list — QUALITY-105).
  • An E2E asserts: sync → list contains the synced leaves → set a rate → Review price suggestion equals bdft × rate (ties to QUALITY-90 vector TV-8).

Related

  • #47 POC [09/16]: Settings UI — UIE-8
  • #42 POC [04/16]: Review screen fields, override persist, and inference disabled UI
  • Requirements: SETTINGS-35, SETTINGS-40, SETTINGS-55, SETTINGS-60, QUALITY-90, QUALITY-105
## Summary The Settings screen has **no way to assign a $/bdft rate to each species**. This is the whole point of SETTINGS-35 and it is absent from the shipped M3 UI. Without it, `rate_for_species()` always returns `None`, so the Review price suggestion (REVIEW-25, QUALITY-90) can never produce a number and the owner is forced to hand-type every price. ## What the spec requires (SETTINGS-35) > Species rates are configured in Settings as one flat dollars-per-bdft value per synced species leaf, with no tiers. The owner flow it implies: 1. Enter Woo credentials (username + application password) and save. 2. Hit **Test & Sync Woo** (`POST /api/v1/settings/test-woo`) — verifies the connection **and always resyncs the taxonomy on success** (SETTINGS-40/80). 3. The Settings screen then lists **every synced species leaf** (populated from the REAL `GET /api/v1/admin/taxonomy` `categories`, never hardcoded — QUALITY-105), one row per leaf. 4. Owner enters a flat `$ /bdft` per leaf and saves. Each leaf maps to `POST /api/v1/admin/pricing` (201) or `PUT /api/v1/admin/pricing/{id}` (200); `409 duplicate` means switch to update. ## Backend status **The backend already supports this end-to-end** (`backend/pricing.py`): `GET/POST/PUT/DELETE /api/v1/admin/pricing`, with `pricing_rules.species_id` FK → `woo_categories(id)`. The list endpoint returns no name, so the UI must join `species_id` against `GET /api/v1/admin/taxonomy` to show the leaf name. **This is a pure frontend gap** — no backend work required. ## What the current stub has `frontend/src/create/settings/Settings.svelte` has the Woo test button and credential fields, but: - No Species Pricing section. - No call to `GET /api/v1/admin/pricing`. - No call to `GET /api/v1/admin/taxonomy` to source the leaf list. - No per-leaf rate entry, no save. ## Acceptance - After a successful test-woo/sync, Settings lists every synced species leaf by name (real taxonomy, not a fixture). - Each leaf has a `price_per_bdft` field; existing rates are prefilled from `GET /api/v1/admin/pricing`. - Saving creates/updates the rule per leaf (POST then PUT on 409). - Empty/un-synced state prompts to run the sync first (no seeded list — QUALITY-105). - An E2E asserts: sync → list contains the synced leaves → set a rate → Review price suggestion equals `bdft × rate` (ties to QUALITY-90 vector TV-8). ## Related - #47 POC [09/16]: Settings UI — UIE-8 - #42 POC [04/16]: Review screen fields, override persist, and inference disabled UI - Requirements: SETTINGS-35, SETTINGS-40, SETTINGS-55, SETTINGS-60, QUALITY-90, QUALITY-105
Ty closed this issue 2026-09-20 19:39:25 +00:00
Owner

Resolved and UAT-verified on 5060.

Shipped: PR merged — Settings species $/bdft (SETTINGS-35), Woo parent→parent_id taxonomy fix, FK-safe upsert sync.

Evidence: Test Woo hierarchy OK; 8 species leaves under slug species; saved Black Walnut $12.50/bdft; Review suggestion 18.4×12.50=230; sample slab preserved.

Commit: 18c262b on issue-76-settings-species-pricing → main.

Resolved and UAT-verified on 5060. **Shipped:** PR merged — Settings species $/bdft (SETTINGS-35), Woo `parent`→`parent_id` taxonomy fix, FK-safe upsert sync. **Evidence:** Test Woo hierarchy OK; 8 species leaves under slug `species`; saved Black Walnut $12.50/bdft; Review suggestion 18.4×12.50=230; sample slab preserved. Commit: `18c262b` on `issue-76-settings-species-pricing` → `main`.
Sign in to join this conversation.
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Ty_Tech/SlabUploader#76