Skip to content

ZIP-643: adds TIC search to the SDK#9

Merged
ericlakich merged 1 commit into
mainfrom
ZIP-643/tic-search
Apr 20, 2026
Merged

ZIP-643: adds TIC search to the SDK#9
ericlakich merged 1 commit into
mainfrom
ZIP-643/tic-search

Conversation

@ericlakich
Copy link
Copy Markdown
Contributor

@ericlakich ericlakich commented Apr 17, 2026

This pull request introduces new AI-powered product code (TIC) search and recommendation features to the SDK, along with supporting types, validation, and comprehensive tests. These additions allow users to search for and receive recommendations for product codes based on natural language descriptions, improving the ease and accuracy of tax code selection.

New Product Code (TIC) Search & Recommendation Features

  • Added searchProductCodes() method to ZiptaxClient for searching product codes by natural language description, returning all matching TICs ranked and scored by relevance.
  • Added recommendProductCode() method to ZiptaxClient for getting an AI-powered product code recommendation, returning the best-match TIC with higher accuracy.
  • Introduced input validation helper validateProductQuery() to ensure product queries are non-empty strings and ≤500 characters.

Type & Model Additions

  • Added new types: ProductCodeSearchRequest, ProductCodeSearchResult, ProductCodeSearchResponse, ProductCodeRecommendation, and ProductCodeRecommendationResponse to support the new endpoints.
  • Exported the new types from the SDK entry point.

Testing

  • Added comprehensive unit tests for both searchProductCodes() and recommendProductCode(), including validation checks and response structure assertions.

Documentation & Versioning

  • Updated CHANGELOG.md to document the new features in version 0.2.3-beta.
  • Bumped package version to 0.2.3-beta in package.json.

Open with Devin

Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 1 potential issue.

View 3 additional findings in Devin Review.

Open in Devin Review

Comment thread src/models/responses.ts
Comment on lines +425 to +428
/** Full description of the recommended TIC (snake_case to match API) */
tic_description: string;
/** Original product description sent in the query (snake_case to match API) */
product_description: string;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔴 ProductCodeRecommendation uses snake_case fields violating CLAUDE.md naming convention

The ProductCodeRecommendation interface introduces tic_description and product_description fields in snake_case. CLAUDE.md mandates under "Key Design Decisions" that the naming convention is "camelCase for all fields" and under "Important Type Conventions" that "ZipTax Responses: Use camelCase (e.g., baseRates, taxSummaries)". The only documented exception is Account Metrics (V60AccountMetrics), which is explicitly called out as using snake_case. These new endpoints go through the ZipTax HTTP client (this.httpClient at src/client.ts:206 and src/client.ts:239), making them ZipTax responses subject to the camelCase convention. Every other field in this same interface (ticId, naturalLabel) correctly uses camelCase, making the inconsistency within a single interface even more problematic.

Prompt for agents
The ProductCodeRecommendation interface at src/models/responses.ts:413-429 has two snake_case fields (tic_description and product_description) that violate the CLAUDE.md naming convention requiring camelCase for ZipTax response types. The only documented exception is V60AccountMetrics.

Two approaches to fix:
1. If the API actually returns snake_case for these fields, rename them to camelCase (ticDescription, productDescription) and add a response transformation layer, or update CLAUDE.md to document this as another exception.
2. If the API returns camelCase, simply rename the fields to ticDescription and productDescription.

Also update the test mock data in tests/client.test.ts (lines 486-488 and 540-542) to use the corrected field names.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@ericlakich ericlakich merged commit 8f7fbf8 into main Apr 20, 2026
14 checks passed
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.

1 participant