test(server): plan 4 — constructor ripple for the rosterUserIds/getPlaceWithTags inline

Hand-built BudgetService/BudgetMcp/TodoService call sites drop the removed
DatabaseService constructor arg (budgetRepoArgs() now appends a
TripMembersRepository so most spread call sites need no other change);
budget.service.test.ts's rosterHas() helper and svc() factory move from a
spied DatabaseService to a stubbed TripMembersRepository. The
AccommodationsService helper (tests/helpers/accommodations-service.ts) and
its two direct callers drop the same arg. PackingService call sites are
untouched (its new param is optional, so every existing hand-built instance
still resolves rosterUserIds through the DatabaseService fallback).
This commit is contained in:
jubnl
2026-09-24 06:18:32 +02:00
parent 8f2fe9d327
commit 3e37474a2c
22 changed files with 68 additions and 58 deletions
@@ -337,7 +337,7 @@ describe('Settlement tools', () => {
const dbService = new DatabaseService(testDb);
const controller = new BudgetController(
new BudgetService(dbService, new PermissionsService(await createTestAppSettingsRepo(dbService.connection), await createTestUnitOfWork(dbService.connection)), new ExchangeRatesService(), new RealtimeService(), await createTestUnitOfWork(dbService.connection), ...(await budgetRepoArgs(dbService.connection))),
new BudgetService(new PermissionsService(await createTestAppSettingsRepo(dbService.connection), await createTestUnitOfWork(dbService.connection)), new ExchangeRatesService(), new RealtimeService(), await createTestUnitOfWork(dbService.connection), ...(await budgetRepoArgs(dbService.connection))),
);
const rest = await controller.settlement(
{ id: user.id } as User,
+2 -2
View File
@@ -154,9 +154,8 @@ beforeAll(async () => {
);
packingMcp = new PackingMcp(promptPackingService, authStub, addonsStub, promptGuards);
budgetMcp = new BudgetMcp(
new BudgetService(promptDbs(), new PermissionsService(await createTestAppSettingsRepo(promptDbs().connection), await createTestUnitOfWork(promptDbs().connection)), new ExchangeRatesService(), new RealtimeService(), await createTestUnitOfWork(promptDbs().connection), ...(await budgetRepoArgs(promptDbs().connection))),
new BudgetService(new PermissionsService(await createTestAppSettingsRepo(promptDbs().connection), await createTestUnitOfWork(promptDbs().connection)), new ExchangeRatesService(), new RealtimeService(), await createTestUnitOfWork(promptDbs().connection), ...(await budgetRepoArgs(promptDbs().connection))),
new ExchangeRatesService(),
promptDbs(),
new RuntimeEnvService(),
new TripMembershipService(await createTestTripsRepo(promptDbs().connection), await createTestTripMembersRepo(promptDbs().connection)),
addonsStub,
@@ -165,6 +164,7 @@ beforeAll(async () => {
await createTestPlacesRepo(promptDbs().connection),
await createTestTripsRepo(promptDbs().connection),
new DemoService(new RuntimeEnvService(), promptEm),
await createTestTripMembersRepo(promptDbs().connection),
);
tripPromptsMcp = new TripPromptsMcp(tripsStub, readModelStub, promptPackingService, addonsStub);
});