Skip to content

feat: add is_extended_promotional field to components#318

Open
VOVANQUOCBAO wants to merge 1 commit into
tscircuit:mainfrom
VOVANQUOCBAO:fix/issue-92-is-extended-promotional
Open

feat: add is_extended_promotional field to components#318
VOVANQUOCBAO wants to merge 1 commit into
tscircuit:mainfrom
VOVANQUOCBAO:fix/issue-92-is-extended-promotional

Conversation

@VOVANQUOCBAO
Copy link
Copy Markdown

Summary

  • Adds is_extended_promotional field (where preferred = 1 AND basic = 0) to BaseComponent interface
  • Exposes field in /components/list and /api/search API responses
  • Adds is_extended_promotional=true filter parameter to both routes
  • Adds is_extended_promotional column to all derived component tables via setup-derived-tables.ts

Changes

  • lib/db/derivedtables/component-base.ts: Added is_extended_promotional?: boolean to BaseComponent
  • lib/db/derivedtables/setup-derived-tables.ts: Added is_extended_promotional column to base columns list, computed in batch processing
  • routes/components/list.tsx: Added query param, filter logic, preferred to SELECT, and field to response
  • routes/api/search.tsx: Added query param, filter logic, and field to response
  • tests/routes/components/list.test.ts: 3 new tests for field presence, filtering, and consistency
  • tests/routes/api/search.test.ts: 3 new tests for field presence, filtering, and consistency

Test plan

  • is_extended_promotional present in all component API responses as a boolean
  • is_extended_promotional=true filter returns only components where is_preferred=true AND is_basic=false
  • is_extended_promotional is consistent with is_preferred && !is_basic across all returned components
  • TypeScript type check passes (bun tsc --noEmit)
  • Biome lint/format check passes

/claim #92

Adds is_extended_promotional (preferred=1 AND basic=0) to:
- BaseComponent interface
- setup-derived-tables.ts base columns (all derived tables)
- /components/list and /api/search routes (filter + response)
- Tests for field presence, filtering, and consistency

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