feat: add PostgreSQL storage provider for LawNet BFF #58
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/49-postgresql-bff-storage"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Refs: #49
Commits
feat: add PostgreSQL storage provider for LawNet BFF— factory switch, env var, testsrefactor: rename lawnet schema to app— rename schema toapp.*refactor: align DB schema with high-level plan— rewrite tocatalog/ingestschemas, canonicaljudgmenttable, source-specific tablesfix: add PostgreSQL service to CI workflow— pg18 service container + health checkfix: remove local-only files from feature chain— AGENT.md stays inlrefactor: simplify postgres-store queries— list returns result_id+citation only, inline unmatched lookupsstyle: apply prettier formattingrefactor: remove all elitigation code from postgres store— lawnet-only featurerefactor: move lawnet_judgment from V2 to V3 migration— V2 is canonical only, V3 is all lawnet tables@ -0,0 +1,220 @@# Repository Toolingshould not be committed, belongs only in the local only commit
@ -0,0 +30,4 @@metadata_payload JSONB);CREATE TABLE catalog.elitigation_judgment (this feature is only for lawnet, so don't generate the elitigation. And one migratoin file for the catalog.judgement, 1 migration file for catalog.lawnet_*.
@ -4,3 +4,3 @@POSTGRES_PASSWORD=lawnet_devDATABASE_URL=postgresql://lawnet:lawnet_dev@postgres:5432/lawnetBFF_STORAGE=filesystemadd comment for possible enumerable values
@ -0,0 +57,4 @@export class LawnetPostgresStore implements LawnetStore {constructor(private readonly pool: Pool) {}async listJudgments(Yeah, let's talk about this judgment list response, right? The SQL query is really complicated because it's asking for a bunch of information, right? And I think, I think this is not a good practice. So maybe judgment list item should only return the specific judgment array of judgment ID, right? That should be the judgment response, an array of judgment IDs. And then the front end can query each judgment ID what exactly is it.
@ -0,0 +163,4 @@return this.getElitigationOnlyJudgment(id);}private async getCanonicalJudgment(Well, we have this get canonical judgments method, and I'm wondering what exactly this for. Can you help me to explain what is the point of having get canonical judgments? I'm more in the favor of returning all the judgments for a given judgment ID to the front and then let the front display to the user instead of filtering it on the backend. That way, the UI is much more transparent.
@ -0,0 +237,4 @@};}private async getLawnetOnlyJudgment(remove this
@ -0,0 +285,4 @@};}private async getElitigationOnlyJudgment(remove thsi
@ -0,0 +369,4 @@};}private async fetchLawnetSourcesByJudgment(remove all lawnet/elit specific methods.
@ -0,0 +16,4 @@CHECK (decision_number > 0));CREATE TABLE catalog.lawnet_judgment (lawnet judgement in v3 please, v2 only catalog.judgment