import HttpClient from "@/utils/services/apiClient";

interface ContactStore {
    email: string
    company_name: string,
    name: string,
    phone: string,
    vehicles_number: number
}

class Contact {
    public static async post(body: ContactStore): Promise<object | null> {
        const response = await HttpClient.post(`/fleet-contact/store`, body, { baseUrl: process.env.NEXT_PUBLIC_DADYCAR_BACKEND_HOST });
        if (response === null) {
            throw new Error("Contact failed - server returned no response");
        }

        return response;
    }
}

export type { ContactStore };
export { Contact };