Skip to content

feat: add is_extended_promotional column and filter to components#337

Open
khozakhulile27-netizen wants to merge 33 commits into
tscircuit:mainfrom
khozakhulile27-netizen:feat/92-is-extended-promotional-column
Open

feat: add is_extended_promotional column and filter to components#337
khozakhulile27-netizen wants to merge 33 commits into
tscircuit:mainfrom
khozakhulile27-netizen:feat/92-is-extended-promotional-column

Conversation

@khozakhulile27-netizen
Copy link
Copy Markdown

Closes #92

What this adds

Some JLCPCB parts are "extended promotional" — they act as basic parts for a limited time. This PR exposes that data as a filterable column.

Changes

  • lib/db/derivedtables/component-base.ts — adds is_extended_promotional: boolean to the BaseComponent interface
  • lib/db/optimizations/component-extended-promotional-index.ts — new optimization that:
    1. Adds the is_extended_promotional column to the components table via ALTER TABLE if it doesn't exist
    2. Creates an index on it for fast filtering
  • routes/components/list.tsx — adds is_extended_promotional as an optional boolean query param that filters results

Usage

GET /components/list.json?is_extended_promotional=true

@khozakhulile27-netizen
Copy link
Copy Markdown
Author

Please review

@khozakhulile27-netizen
Copy link
Copy Markdown
Author

Please I fix everything am requesting a review

@khozakhulile27-netizen
Copy link
Copy Markdown
Author

@seveibar please review

@khozakhulile27-netizen
Copy link
Copy Markdown
Author

@seveibar - Please review this PR when you have a moment. 🙏

This PR (#337) implements the is_extended_promotional column feature for issue #92. The implementation:

  • Adds the new column to the BaseComponent interface
  • Creates proper database optimization with indexing
  • Implements the filter in the components list endpoint
  • Follows existing winterspec + zod patterns

Ready for merge! 🙂

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.

Add is_extended_promotional column to components (from data source)

1 participant