feat: GSTIN validation, SAC codes, export utilities, CLI, and advanced HSN lookups (Issue #4)#6
Merged
Merged
Conversation
…CLI, advanced lookups - Add gstin.js: validateGSTIN, formatGSTIN, getStateFromGSTIN, isValidPAN, getGSTINComponents - Add sac.js + data/sac_codes.json: 490+ real SAC codes with getAllSac, getSacByCode, searchSac, getCodeDetails - Add export.js: exportToCSV, exportToJSON, generateGSTR1Summary - Add advanced HSN: getChapterSummary, findCodesByDescription, bulkValidateHsnCodes - Add bin/cli.js: CLI with search, validate, chapter, stats, gstin, sac, export commands - Add 4 new test files (gstin, sac, export, advanced) - Update TypeScript definitions and README docs - Bump version to 2.2.0 Closes #4 https://claude.ai/code/session_01V2bGsWhrzxeEpoV8BJyZMi
…te job - Add data/gst_rates.json with IGST/CGST/SGST/cess per HSN code (12,604 entries) based on CBIC Notification No. 09/2025-CT(Rate), effective 22 Sep 2025 - Add scripts/update-gst-rates.js: download-or-fallback pipeline for rate data - Add .github/workflows/update-gst-rates.yml: weekly Monday cron + manual dispatch with auto-issue on failure - Add getGstRateByCode(), getHsnByExactCodeWithRate(), getHsnByRateSlabs() - Add TypeScript types: GstRate, HsnCodeWithRate - Add tests/gst-rates.test.js - Bump version to 2.3.0 Closes #2 https://claude.ai/code/session_01V2bGsWhrzxeEpoV8BJyZMi
Merged gst.js calculation utilities (from dev/PR #5) with all PR #6 features: GSTIN validation, SAC codes, export utils, CLI, advanced HSN lookups, and GST rate data. All 105 tests passing. https://claude.ai/code/session_01V2bGsWhrzxeEpoV8BJyZMi
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
Implements all feasible features from Issue #4, bumping the package to v2.2.0. All 77 tests pass.
1. GSTIN & PAN validation (
gstin.js)validateGSTIN— structural + MOD-36 checksum validation, returns state code/name, PAN, entity number, check digitisValidPAN,formatGSTIN,getStateFromGSTIN,getGSTINComponents2. SAC codes (
sac.js+data/sac_codes.json)getAllSac,getSacByCode,searchSac(matchType + pagination),getCodeDetails(HSN/SAC unified lookup, no circular dependency)3. Export utilities (
export.js)exportToCSV(delimiter/headers, RFC-style escaping),exportToJSON,generateGSTR1Summary(rate-wise CGST/SGST/IGST/cess breakdown)4. Advanced HSN lookups (
index.js)getChapterSummary,findCodesByDescription(AND keyword match),bulkValidateHsnCodes5. CLI (
bin/cli.js)hsn search | validate | chapter | stats | gstin | sac | export | help— installed as thehsnbinAlso
gstin,sac,export,advanced(77 tests total, all passing)package.jsonv2.2.0 +bin+files;data/metadata.jsonupdatedTest plan
npm test— 77/77 passinggstin,validate,sac)27AAPFU0939F1ZV→VCloses #4
https://claude.ai/code/session_01V2bGsWhrzxeEpoV8BJyZMi
Generated by Claude Code