[37.2] PostgreSQL dependency injection for LawNet BFF storage #49
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Parent
#37
Objective
Add an environment-variable‑driven storage provider switch so the same BFF routes can run against PostgreSQL or file‑system storage, implement the PostgreSQL storage provider, add the required Flyway schema, and test the Postgres path.
Dependencies
Depends on #37 and #48 (37.1).
Scope
BFF_STORAGE) that selectsfilesystemorpostgresat startup.BFF_STORAGE=filesystem.Out of scope
Done when
BFF_STORAGE=filesystemorBFF_STORAGE=postgresmakes the same BFF routes use the correct backend.Planning update
Agreed sequencing for #49:
/api/lawnet/*while preserving current filesystem-backed behavior.Agreed decisions for the #49 PostgreSQL implementation
BFF_STORAGEas the backend selector for now.LawnetStorebehavior/contract for this slice, including the citation lookup and detail shape, while moving the route namespace via #53.pg; defer Kysely and generated DB types.catalog.judgmentcatalog.lawnet_judgmentcatalog.lawnet_coramcatalog.lawnet_catchwordcatalog.lawnet_artifactcatalog.judgmentand nullablejudgment_idnow, even though live citation parsing/correlation is not part of this issue.lawnet:<source-row-id>now andjudgment:<canonical-id>later.docidas the unique source key while using an internal identityidfor BFF result IDs.bytea.kindand LawNetrendition_typeas separate concepts.limit/offsetpagination for this slice.BFF_STORAGE=postgres; standalone development should continue to default to filesystem.WEB_TEST_DATABASE_URLand skipped when absent.Explicitly deferred
docs/todos/long-term/malformed-source-record-reconciliation.md.docs/todos/long-term/kysely-database-types.md.Schema review still needed before coding
The next planning step is to review the high-level schema columns and constraints for the #49 migration, especially:
catalog.lawnet_judgment.citationremainsnot nullfor #49 because malformed records are deferred.kindallowed values for the BFF slice.rendition_typeallowed values.sha256should bebyteaas in the high-level plan or text for easier API/test assertions.listJudgments,getJudgment, citation lookup, and artifact lookup behavior.