1
1
mirror of https://github.com/theoludwig/p61-project.git synced 2024-07-17 07:00:12 +02:00
p61-project/infrastructure/index.ts

32 lines
1005 B
TypeScript
Raw Normal View History

2024-03-15 22:48:28 +01:00
import { RetrieveHabitsTrackerUseCase } from "../domain/use-cases/RetrieveHabitsTracker"
2024-03-16 00:36:44 +01:00
import { HabitsTrackerPresenter } from "../presentation/presenters/HabitsTracker"
import { GetHabitProgressHistorySupabaseRepository } from "./repositories/supabase/lib/GetHabitProgressHistory"
2024-03-15 22:48:28 +01:00
import { GetHabitsByUserIdSupabaseRepository } from "./repositories/supabase/lib/GetHabitsByUserId"
import { supabaseClient } from "./repositories/supabase/supabase"
/**
* Repositories
*/
2024-03-16 00:36:44 +01:00
const getHabitProgressesRepository =
new GetHabitProgressHistorySupabaseRepository({
supabaseClient,
})
2024-03-15 22:48:28 +01:00
const getHabitsByUserIdRepository = new GetHabitsByUserIdSupabaseRepository({
supabaseClient,
})
/**
* Use Cases
*/
const retrieveHabitsTrackerUseCase = new RetrieveHabitsTrackerUseCase({
2024-03-16 00:36:44 +01:00
getHabitProgressHistoryRepository: getHabitProgressesRepository,
2024-03-15 22:48:28 +01:00
getHabitsByUserIdRepository,
})
/**
* Presenters
*/
export const habitsTrackerPresenter = new HabitsTrackerPresenter({
retrieveHabitsTrackerUseCase,
})