import { api } from "@/lib/api-client";
import type {
  RegisterRequest,
  RegisterResponse,
  VerifyEmailRequest,
  ResendOtpRequest,
  CheckEmailResponse,
  GoalsResponse,
  OnboardingData,
} from "@/types";
import type { ApiSuccessResponse } from "@/types";

export const signupService = {
  register: (data: RegisterRequest) =>
    api.post<RegisterResponse>("/auth/register", data),

  verifyEmail: (data: VerifyEmailRequest) =>
    api.post<ApiSuccessResponse>("/auth/verify-email", data),

  resendOtp: (data: ResendOtpRequest) =>
    api.post<ApiSuccessResponse>("/auth/resend-otp", data),

  checkEmail: (email: string) =>
    api.post<CheckEmailResponse>("/auth/check-email", { email }),

  getGoals: () =>
    api.get<GoalsResponse>("/onboarding/goals"),

  completeOnboarding: (data: OnboardingData) =>
    api.post<ApiSuccessResponse>("/onboarding/complete", data),
};
