import {
  RegisterUserUseCase,
  CancelSubscriptionUseCase,
  ReactivateSubscriptionUseCase,
} from '@crafted/domain';

import {
  PrismaUserRepository,
  PrismaSubscriptionRepository,
  SupabaseAuthAdapter,
  ResendEmailAdapter,
  StripeAdapter,
} from '@crafted/infrastructure';

const userRepo = new PrismaUserRepository();
const subscriptionRepo = new PrismaSubscriptionRepository();
const authAdapter = new SupabaseAuthAdapter();
const emailAdapter = new ResendEmailAdapter();
const stripeAdapter = new StripeAdapter();

export const registerUserUseCase = new RegisterUserUseCase(
  userRepo,
  authAdapter,
  emailAdapter
);

export const cancelSubscriptionUseCase = new CancelSubscriptionUseCase(
  subscriptionRepo,
  stripeAdapter
);

export const reactivateSubscriptionUseCase = new ReactivateSubscriptionUseCase(
  subscriptionRepo,
  stripeAdapter
);
