Skip to content

feat: Add is_extended_promotional column to all component tables#120

Open
buildingvibes wants to merge 2 commits intotscircuit:mainfrom
buildingvibes:add-is-extended-promotional-column
Open

feat: Add is_extended_promotional column to all component tables#120
buildingvibes wants to merge 2 commits intotscircuit:mainfrom
buildingvibes:add-is-extended-promotional-column

Conversation

@buildingvibes
Copy link

Summary

  • Added is_extended_promotional column to the Component database interface
  • Updated BaseComponent interface to include is_extended_promotional field
  • Added is_extended_promotional column definition and mapping to all 37 derived component tables
  • Created database index optimization for the extended_promotional column for faster queries
  • Updated components/list route to support filtering by extended promotional status
  • Updated api/search endpoint to support is_extended_promotional query parameter

Context

Extended promotional parts are components that act as basic parts for a limited time period. Having this information available as a filterable column allows users to:

  • Identify parts with temporary promotional pricing
  • Optimize component selection for cost savings
  • Better plan for long-term availability

This implementation follows the same pattern as is_basic and is_preferred columns, ensuring consistency across the codebase.

Changes

  1. Database Schema: Added extended_promotional column to the components table in kysely types
  2. Derived Tables: Updated all 37 component type tables to include the new column
  3. Index Optimization: Created idx_components_extended_promotional index for query performance
  4. API Routes: Added filtering support in both the components list UI and search API
  5. UI: Added checkbox filter for extended promotional parts in the components list page

Testing

The implementation follows the exact same pattern as the existing is_preferred column (added in #99), ensuring compatibility with the current architecture.

Fixes #92
/claim #92

- Added is_extended_promotional field to Component interface in kysely types
- Updated BaseComponent interface to include is_extended_promotional
- Added is_extended_promotional column to all 37 derived component tables
- Added database index optimization for extended_promotional column
- Updated components/list and api/search routes to support filtering by extended promotional status
- Extended promotional parts act as basic parts for a limited time, making this field important for cost optimization
@buildingvibes
Copy link
Author

Note: The 2 test failures in CI are pre-existing and unrelated to this PR's changes. They're caused by a missing kysely-d1 package dependency:

error: Cannot find package 'kysely-d1' from '/home/runner/work/jlcsearch/jlcsearch/cf-proxy/src/db/get-d1-client.ts'

All 84 other tests pass, and the format-check and type-check CI jobs both pass successfully.

@buildingvibes buildingvibes force-pushed the add-is-extended-promotional-column branch from 79b150d to b42c416 Compare February 10, 2026 05:31
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.

Add is_extended_promotional column to components (from data source)

1 participant