Skip to content

feat: add is_extended_promotional column to components#127

Open
openclaw-dev-ops wants to merge 1 commit intotscircuit:mainfrom
openclaw-dev-ops:feat/add-is-extended-promotional
Open

feat: add is_extended_promotional column to components#127
openclaw-dev-ops wants to merge 1 commit intotscircuit:mainfrom
openclaw-dev-ops:feat/add-is-extended-promotional

Conversation

@openclaw-dev-ops
Copy link

Adds is_extended_promotional boolean column across all component tables, derived from the existing basic and preferred columns in the source data.

What are Extended Promotional parts?

JLCPCB "Extended Promotional" parts are normally-extended components temporarily offered at basic pricing (no $3 assembly fee). They are identified by basic = 0 AND preferred = 1 in the upstream cache.sqlite3 from yaqwsx/jlcparts.

Changes

  • DB optimization: Adds a computed is_extended_promotional column to the components table (GENERATED ALWAYS AS (basic = 0 AND preferred = 1)) with an index
  • BaseComponent + DerivedTableSpec: Added to interface and type constraint
  • All 38 derived tables: Added to extraColumns and mapToTable
  • Routes: Filter support via ?is_extended_promotional=true on /components/list and /api/search
  • UI: Checkbox filter for "Extended Promotional" in the components list page
  • Generated types + cf-proxy: Updated Kysely interfaces and handler configs

Data source

The preferred column already exists in the database (added via PR #99). Extended promotional = preferred=1 AND basic=0. No external API calls needed — this is purely derived from existing data.

/claim #92

Add is_extended_promotional boolean derived from basic=0 AND preferred=1,
identifying JLCPCB extended parts offered at basic pricing.

- Add computed column on components table via DB optimization
- Add to BaseComponent interface and DerivedTableSpec constraint
- Add to all 38 derived table specs (extraColumns + mapToTable)
- Add filter support in /components/list and /api/search routes
- Add UI checkbox for Extended Promotional filter
- Update generated Kysely types and cf-proxy types/handlers

Closes tscircuit#92
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.

1 participant