feat: add is_extended_promotional field to components#318
Open
VOVANQUOCBAO wants to merge 1 commit into
Open
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
is_extended_promotionalfield (wherepreferred = 1 AND basic = 0) toBaseComponentinterface/components/listand/api/searchAPI responsesis_extended_promotional=truefilter parameter to both routesis_extended_promotionalcolumn to all derived component tables viasetup-derived-tables.tsChanges
lib/db/derivedtables/component-base.ts: Addedis_extended_promotional?: booleantoBaseComponentlib/db/derivedtables/setup-derived-tables.ts: Addedis_extended_promotionalcolumn to base columns list, computed in batch processingroutes/components/list.tsx: Added query param, filter logic,preferredto SELECT, and field to responseroutes/api/search.tsx: Added query param, filter logic, and field to responsetests/routes/components/list.test.ts: 3 new tests for field presence, filtering, and consistencytests/routes/api/search.test.ts: 3 new tests for field presence, filtering, and consistencyTest plan
is_extended_promotionalpresent in all component API responses as a booleanis_extended_promotional=truefilter returns only components whereis_preferred=trueANDis_basic=falseis_extended_promotionalis consistent withis_preferred && !is_basicacross all returned componentsbun tsc --noEmit)/claim #92