[37.1] BFF storage contract and file-system mock for LawNet #51

Merged
dernbu merged 4 commits from feat/37.1-bff-storage into main 2026-06-14 09:32:35 +02:00
Owner

Summary

Defines the BFF storage contract for LawNet catalog listing and case detail lookup, implements file-system storage with mock data, and adds tests — all without PostgreSQL or UI changes.

What's included

  • TypeScript types for judgment documents, corams, catchwords, artifacts (LawNet + eLitigation)
  • LawnetStore interface — contract for listJudgments, getJudgment, getJudgmentByCitation, getArtifact
  • FileSystemStore — reads catalog/artifact fixtures from disk
  • 6 mock fixture judgments with realistic metadata, corams, catchwords, and artifact references
  • Mock HTML/SLR/PDF artifacts for local development
  • 4 API routes (GET):
    • /api/judgments?limit=&offset=
    • /api/judgments/:resultId
    • /api/judgments/citation/:year/:courtCode/:decisionNumber
    • /api/artifacts/:source/:artifactId
  • 16 tests covering store contract, shape validation, and edge cases

Verified

  • pnpm typecheck — clean
  • pnpm test — 17 tests pass (1 existing + 16 new)
  • pnpm lint — clean
  • pnpm dev — starts without Docker/PostgreSQL
## Summary Defines the BFF storage contract for LawNet catalog listing and case detail lookup, implements file-system storage with mock data, and adds tests — all without PostgreSQL or UI changes. ### What's included - **TypeScript types** for judgment documents, corams, catchwords, artifacts (LawNet + eLitigation) - **`LawnetStore` interface** — contract for `listJudgments`, `getJudgment`, `getJudgmentByCitation`, `getArtifact` - **`FileSystemStore`** — reads catalog/artifact fixtures from disk - **6 mock fixture judgments** with realistic metadata, corams, catchwords, and artifact references - **Mock HTML/SLR/PDF artifacts** for local development - **4 API routes** (`GET`): - `/api/judgments?limit=&offset=` - `/api/judgments/:resultId` - `/api/judgments/citation/:year/:courtCode/:decisionNumber` - `/api/artifacts/:source/:artifactId` - **16 tests** covering store contract, shape validation, and edge cases ### Verified - `pnpm typecheck` — clean - `pnpm test` — 17 tests pass (1 existing + 16 new) - `pnpm lint` — clean - `pnpm dev` — starts without Docker/PostgreSQL
feat: BFF storage contract and file-system mock with fixtures and tests
Some checks failed
CI / lint (pull_request) Failing after 57s
CI / typecheck (pull_request) Successful in 53s
CI / test (pull_request) Successful in 57s
CI / check-compose (pull_request) Successful in 4s
a4040996ac
@ -0,0 +1,41 @@
import "@tanstack/react-start/server-only";
Author
Owner

I think we shouldn't take the class abstraction and then add another layer that converts it into functions. The API handler should just call getStore and then invoke the method on the result, not use a roundabout way of abstracting the store. Yeah, this is bad practice.

I think we shouldn't take the class abstraction and then add another layer that converts it into functions. The API handler should just call `getStore` and then invoke the method on the result, not use a roundabout way of abstracting the store. Yeah, this is bad practice.
fix: remove redundant Buffer.from, widen HTML mime check, fix source_count
Some checks failed
CI / typecheck (pull_request) Successful in 1m2s
CI / lint (pull_request) Failing after 55s
CI / test (pull_request) Successful in 56s
CI / check-compose (pull_request) Successful in 4s
9fb387ad55
refactor: remove unnecessary lawnet.server indirection, routes call getStore directly
Some checks failed
CI / lint (pull_request) Failing after 55s
CI / typecheck (pull_request) Successful in 56s
CI / test (pull_request) Successful in 55s
CI / check-compose (pull_request) Successful in 4s
e4541afff0
chore: apply prettier formatting
All checks were successful
CI / lint (pull_request) Successful in 57s
CI / typecheck (pull_request) Successful in 56s
CI / test (pull_request) Successful in 58s
CI / check-compose (pull_request) Successful in 4s
16f9b95971
dernbu force-pushed feat/37.1-bff-storage from 16f9b95971
All checks were successful
CI / lint (pull_request) Successful in 57s
CI / typecheck (pull_request) Successful in 56s
CI / test (pull_request) Successful in 58s
CI / check-compose (pull_request) Successful in 4s
to 517982459a
Some checks failed
CI / test (pull_request) Failing after 23s
CI / check-compose (pull_request) Successful in 4s
CI / lint (pull_request) Failing after 23s
CI / typecheck (pull_request) Failing after 23s
Deploy / deploy-production (push) Has been cancelled
Deploy / deploy-staging (push) Has been cancelled
2026-06-14 09:32:00 +02:00
Compare
dernbu merged commit 517982459a into main 2026-06-14 09:32:35 +02:00
dernbu deleted branch feat/37.1-bff-storage 2026-06-14 09:32:35 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
dernbu/lawnet-scraper!51
No description provided.