Skip to content

feat: GSTIN validation, SAC codes, export utilities, CLI, and advanced HSN lookups (Issue #4)#6

Merged
karthi-21 merged 3 commits into
devfrom
claude/elegant-dijkstra-a8o8l
Jun 3, 2026
Merged

feat: GSTIN validation, SAC codes, export utilities, CLI, and advanced HSN lookups (Issue #4)#6
karthi-21 merged 3 commits into
devfrom
claude/elegant-dijkstra-a8o8l

Conversation

@karthi-21
Copy link
Copy Markdown
Owner

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 digit
  • isValidPAN, formatGSTIN, getStateFromGSTIN, getGSTINComponents
  • Full Indian state-code map

2. SAC codes (sac.js + data/sac_codes.json)

  • 490+ real Indian GST SAC codes (services), including 4-digit group headings
  • 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), bulkValidateHsnCodes

5. CLI (bin/cli.js)

  • hsn search | validate | chapter | stats | gstin | sac | export | help — installed as the hsn bin

Also

  • New test files: gstin, sac, export, advanced (77 tests total, all passing)
  • TypeScript definitions for all new functions/interfaces
  • README documentation sections for every new feature
  • package.json v2.2.0 + bin + files; data/metadata.json updated

Test plan

  • npm test — 77/77 passing
  • CLI smoke-tested (gstin, validate, sac)
  • GSTIN checksum verified against 27AAPFU0939F1ZVV

Closes #4

https://claude.ai/code/session_01V2bGsWhrzxeEpoV8BJyZMi


Generated by Claude Code

…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
@karthi-21 karthi-21 changed the base branch from main to dev June 3, 2026 01:58
@karthi-21 karthi-21 marked this pull request as ready for review June 3, 2026 02:01
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
@karthi-21 karthi-21 merged commit ff71000 into dev Jun 3, 2026
3 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.

Feature Request: Expand to Full GST Toolkit – SAC Codes, Validation, Export & More

2 participants