<?php

namespace xlvask\interfaces;

use Exception;
use helpers\xlvask_customer;
use helpers\xlvask_vehicle;

interface xlvask_endpoints_i
{
    /**
     * Get the usage log from the xlvask API
     * @param string|null $dateFrom
     * @param string|null $regNr
     * @param string|null $vehicleId
     * @param string|null $customerId
     * @return array
     */
    public function getUsageLog(
        string|null $dateFrom = null,
        string|null $regNr = null,
        string|null $vehicleId = null,
        string|null $customerId = null,
    ): array;

    /**
     * Get the vehicles from the xlvask API
     * @param string|null $customerId
     * @param string|null $vehicleId
     * @param string|null $registrationNumber
     * @param string|null $changeDate
     * @return array
     */
    public function getVehicles(
        string|null $customerId = null,
        string|null $vehicleId = null,
        string|null $registrationNumber = null,
        string|null $changeDate = null,
    ): array;

    /**
     * Get the customers from the xlvask API
     * @param string|null $customerId
     * @param string|null $customerName
     * @param string|null $customerExternalId
     * @param string|null $vatNumber
     * @param string|null $changeDate
     * @param boolean|null $users
     * @return array
     */
    public function getCustomers(
        string|null $customerId = null,
        string|null $customerName = null,
        string|null $customerExternalId = null,
        string|null $vatNumber = null,
        string|null $changeDate = null,
        bool|null   $users = null,
    ): array;

    /**
     * Create a new customer in the xlvask API
     * @param xlvask_customer $xlvaskCustomer
     * @return array
     */
    public function createCustomer(xlvask_customer $xlvaskCustomer): array;

    /**
     * Update an existing customer in the xlvask API
     * @param xlvask_customer $xlvaskCustomer
     * @return array
     */
    public function updateCustomer(xlvask_customer $xlvaskCustomer): array;

    /**
     * Create a new vehicle in the xlvask API
     * @param xlvask_vehicle $xlvaskVehicle
     * @return array
     */
    public function createVehicle(xlvask_vehicle $xlvaskVehicle): array;

    /**
     * Update an existing vehicle in the xlvask API
     * @param xlvask_vehicle $xlvaskVehicle
     * @return array
     */
    public function updateVehicle(xlvask_vehicle $xlvaskVehicle): array;

    /**
     * Delete a vehicle from the xlvask API
     * @param xlvask_vehicle $xlvaskVehicle
     * @return array
     */
    public function deleteVehicle(xlvask_vehicle $xlvaskVehicle): array;

    /**
     * Get the auth header for the xlvask API
     * @return string
     * @throws Exception If the username is not set
     * @throws Exception If the password is not set
     */
    public function getAuthHeader(): string;
}