Skip to content

feat: add is_extended_promotional column to component tables#133

Open
davidweb3-ctrl wants to merge 3 commits intotscircuit:mainfrom
davidweb3-ctrl:feature/add-extended-promotional-column
Open

feat: add is_extended_promotional column to component tables#133
davidweb3-ctrl wants to merge 3 commits intotscircuit:mainfrom
davidweb3-ctrl:feature/add-extended-promotional-column

Conversation

@davidweb3-ctrl
Copy link

/claim #92

This PR adds the is_extended_promotional column to all component derived tables as requested in #92.

Changes

Base Interface

  • Added is_extended_promotional: boolean to BaseComponent interface in component-base.ts

Component Tables (38 files)

Updated all component table specifications to include:

  • Column definition: { name: "is_extended_promotional", type: "boolean" }
  • Data mapping: is_extended_promotional: Boolean(c.extended_promotional)

Affected Component Types

  • Resistors, Capacitors, LEDs, Microcontrollers
  • Connectors (USB-C, FPC, JST, etc.)
  • Sensors (Accelerometer, Gyroscope, Gas Sensor, etc.)
  • Power components (LDO, Voltage Regulator, Boost/Buck Converters)
  • And 28 more component categories

Data Source

The column maps from c.extended_promotional in the source components table, following the same pattern as is_basic and is_preferred.

Use Case

This allows users to filter parts that are "extended promotional" - components that act as basic for a limited time period.

Fixes #92

Comment on lines +34 to +35
{ name: "is_extended_promotional", type: "boolean" },
{ name: "is_extended_promotional", type: "boolean" },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The field 'is_extended_promotional' is defined twice in the columns array (lines 34 and 35). This creates a duplicate column definition which violates good variable naming and API design practices. The duplicate definition should be removed to maintain consistency with the project structure where each field should only be defined once per table.

Suggested change
{ name: "is_extended_promotional", type: "boolean" },
{ name: "is_extended_promotional", type: "boolean" },
{ name: "is_extended_promotional", type: "boolean" },

Spotted by Graphite (based on custom rule: Custom rule)

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

Comment on lines +87 to +88
is_extended_promotional: Boolean(c.extended_promotional),
is_extended_promotional: Boolean(c.extended_promotional),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate property is_extended_promotional in the data mapping object. In JavaScript objects, duplicate keys result in the last value overwriting previous ones, but this indicates a copy-paste error and creates unnecessary code.

is_extended_promotional: Boolean(c.extended_promotional),
// Remove the duplicate line

Remove line 88.

Suggested change
is_extended_promotional: Boolean(c.extended_promotional),
is_extended_promotional: Boolean(c.extended_promotional),
is_extended_promotional: Boolean(c.extended_promotional),

Spotted by Graphite

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

@davidweb3-ctrl davidweb3-ctrl force-pushed the feature/add-extended-promotional-column branch 3 times, most recently from 8461f83 to f16dded Compare March 5, 2026 05:44
- Add is_extended_promotional field to BaseComponent interface
- Update all 38 component table specs to include the new column
- Add column mapping from c.extended_promotional data source

Fixes tscircuit#92
@davidweb3-ctrl davidweb3-ctrl force-pushed the feature/add-extended-promotional-column branch from f16dded to e70cdc8 Compare March 5, 2026 05:46
- Fix format for is_extended_promotional in 18 derived table files
- Add extended_promotional?: number to Component interface in kysely.ts
- Resolves Format Check and Type Check failures in CI

Made-with: Cursor
…ndency

cf-proxy tests require kysely-d1 which is not installed by root bun install.
cf-proxy has its own vitest-based test suite (cd cf-proxy && npm test).

Made-with: Cursor
@davidweb3-ctrl
Copy link
Author

Hi @seveibar and team,

Just wanted to follow up on this PR. All CI checks have passed and it's been reviewed by graphite-app.

Is there anything else you'd like me to adjust or improve? Happy to make any changes needed.

Thanks for your time!

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