refactor(db): collapse repository rollout scaffolding into single factory

Repositories are now the only data path. Replaces the 41 current-*-repository
wrapper files, the DATABASE_LAYER_REPOSITORY_ROLLOUT flag/alias map and the
unused database/runtime adapter with repositories/factory.ts, a plain
DatabaseContext type and an in-memory TestSqliteDatabase test harness.
This commit is contained in:
LukeGus
2026-07-15 23:56:02 -05:00
parent 1e7c9ea53c
commit ef4969dd35
217 changed files with 843 additions and 4297 deletions
+3 -3
View File
@@ -63,7 +63,7 @@ describe("expandOidcUsername", () => {
});
it("expands the placeholder with the user's OIDC identifier", async () => {
vi.doMock("../database/repositories/current-user-repository.js", () => ({
vi.doMock("../database/repositories/factory.js", () => ({
createCurrentUserRepository: () => ({
findById: async () => ({ oidcIdentifier: "jdoe" }),
}),
@@ -75,7 +75,7 @@ describe("expandOidcUsername", () => {
});
it("leaves the placeholder as-is when the user has no OIDC identifier", async () => {
vi.doMock("../database/repositories/current-user-repository.js", () => ({
vi.doMock("../database/repositories/factory.js", () => ({
createCurrentUserRepository: () => ({
findById: async () => ({ oidcIdentifier: null }),
}),
@@ -89,7 +89,7 @@ describe("expandOidcUsername", () => {
});
it("returns the username unchanged when the DB lookup throws", async () => {
vi.doMock("../database/repositories/current-user-repository.js", () => ({
vi.doMock("../database/repositories/factory.js", () => ({
createCurrentUserRepository: () => {
throw new Error("DB unavailable");
},