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,
|
|
|
|
})
|