import type {
  CheckoutHandoffCreateResponse,
  CheckoutIntent,
} from "@/data/schemas/auth";
import { getAuthRepository } from "@/data/repositories/auth_repository";
import type { Result } from "@/utils/result";

export function createCheckoutHandoff(
  checkoutIntent: CheckoutIntent,
): Promise<Result<CheckoutHandoffCreateResponse>> {
  return getAuthRepository().createCheckoutHandoff(checkoutIntent);
}

export function consumeCheckoutHandoff(
  handoffToken: string,
): Promise<Result<CheckoutIntent>> {
  return getAuthRepository().consumeCheckoutHandoff(handoffToken);
}
