feat(backend): add WeatherService

Manage per-user WeatherSource instances via FeedSourceProvider,
following the same pattern as LocationService. Wire into
FeedEngineService so weather data is included in the feed.

Co-authored-by: Ona <no-reply@ona.com>
This commit is contained in:
2026-02-13 19:16:33 +00:00
parent 31a82c1d9f
commit e5f1273baf
7 changed files with 214 additions and 20 deletions

View File

@@ -1,9 +1,11 @@
import { initTRPC, TRPCError } from "@trpc/server"
import { createLocationRouter } from "../location/router.ts"
import type { LocationService } from "../location/service.ts"
import type { WeatherService } from "../weather/service.ts"
import type { Context } from "./context.ts"
import { createLocationRouter } from "../location/router.ts"
interface AuthedContext {
user: NonNullable<Context["user"]>
session: NonNullable<Context["session"]>
@@ -34,6 +36,7 @@ export type TRPC = ReturnType<typeof createTRPC>
export interface TRPCRouterDeps {
locationService: LocationService
weatherService: WeatherService
}
export function createTRPCRouter({ locationService }: TRPCRouterDeps) {