Skip to content

Add a bulk filing catalog export with per-court revisions - #469

Open
nonprofittechy wants to merge 1 commit into
mainfrom
feature/filing-catalog-export
Open

nonprofittechy wants to merge 1 commit into
mainfrom
feature/filing-catalog-export

Conversation

@nonprofittechy

Copy link
Copy Markdown
Member

Why

LITEFile builds a search index over every court → case category → case type → filing code path. Today it gets that by crawling the per-category and per-case-type list APIs, which takes a long time for a full jurisdiction. This adds a bulk export, so a client downloads only the courts whose codes changed.

API

GET /jurisdictions/{jurisdiction}/codes/filing_catalog

{"version": 1, "jurisdiction": "illinois",
 "courts": [{"code": "adams", "name": "Adams County", "revision": "3f2a…"}]}

GET /jurisdictions/{jurisdiction}/codes/filing_catalog/courts/{court_id}

{"version": 1, "jurisdiction": "illinois",
 "court": {"code": "adams", "name": "Adams County", "revision": "3f2a…"},
 "categories":   [{"code": "…", "name": "…"}],
 "case_types":   [{"code": "…", "name": "…", "case_category": "…", "initial": true}],
 "filing_types": [{"code": "…", "name": "…", "case_category": "…", "case_type": "…", "timing": "Initial"}]}

If the court has no complete catalog, this returns a 404.

The rows come straight from the installed tables, with the same filters as the existing list endpoints:

  • no CriminalCase categories;
  • iscourtuseonly='False';
  • filing timing must be Initial, Subsequent or Both.

The "" vs null difference in case_category / case_type is passed through unchanged. Clients need it to reproduce the existing specific-before-generic filing list fallback.

Contract

  • revision is an md5 of the court name plus the installed versions of casecategorycodes.zip, casetypecodes.zip and filingcodes.zip. A client re-downloads a court only when its revision changes.
  • Fail closed: if a fileable court is missing any of those three versions, the manifest returns an error instead of a partial list. A client keeps its previous data rather than caching a court with missing codes. Non-fileable locations that have no catalog are just left out.
  • No snapshot across requests: clients should fetch the manifest again after downloading courts and abort if anything changed. LITEFile does this.
  • Depends on Commit each court's code deletes with its reload #468 for installedversion to be accurate while refresh / replaceAll are running.

Testing

FilingCatalogExportTest (Docker/Testcontainers):

  • a revision changes only for the court whose versions or name changed;
  • an incomplete fileable court makes the manifest fail;
  • the export applies the filters above and keeps the relationships.

This is a starting point, so feel free to reshape it. The JSON shape and the revision rule above are the parts LITEFile depends on.

🤖 Generated with Claude Code

GET /jurisdictions/{j}/codes/filing_catalog lists every court with a
complete installed catalog and a revision hash. A client compares
revisions and fetches /filing_catalog/courts/{court_id} only for
courts that changed, instead of crawling the per-category list APIs.

Reads installed code tables only; makes no Tyler requests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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