import type {
  OnboardingCompleteInput,
  OnboardingCompleteResponse,
  OnboardingResendOtpInput,
  OnboardingResendOtpResponse,
  OnboardingStartInput,
  OnboardingStartResponse,
  OnboardingVerifyOtpInput,
  OnboardingVerifyOtpResponse,
} from '@repo/api-contract';
import { http } from '../http';

export async function start(payload: OnboardingStartInput) {
  const response = await http.post<OnboardingStartResponse>('/api/onboarding/start', payload);
  return response.data;
}

export async function verifyOtp(payload: OnboardingVerifyOtpInput) {
  const response = await http.post<OnboardingVerifyOtpResponse>(
    '/api/onboarding/verify-otp',
    payload
  );
  return response.data;
}

export async function resendOtp(payload: OnboardingResendOtpInput) {
  const response = await http.post<OnboardingResendOtpResponse>(
    '/api/onboarding/resend-otp',
    payload
  );
  return response.data;
}

export async function complete(payload: OnboardingCompleteInput) {
  const response = await http.post<OnboardingCompleteResponse>('/api/onboarding/complete', payload);
  return response.data;
}
