@{
    ViewData["Title"] = "LubeLogger API";
}
<div class="row">
    <div class="d-flex justify-content-center">
        <h6 class="display-6 mt-2">API</h6>
    </div>
</div>
<div class="row">
    <div class="d-flex justify-content-center">
        <p class="lead">If authentication is enabled, use the credentials of the user for Basic Auth(RFC2617)</p>
    </div>
</div>
<hr />
<div class="row">
    <div class="col-1">
        <h6>Method</h6>
    </div>
    <div class="col-5">
        <h6>Endpoint</h6>
    </div>
    <div class="col-3">
        <h6>Description</h6>
    </div>
    <div class="col-3">
        <h6>Parameters</h6>
    </div>
</div>
<div class="row">
    <div class="col-1">
        GET
    </div>
    <div class="col-5">
        <code>/api/vehicles</code>
    </div>
    <div class="col-3">
        Returns a list of vehicles
    </div>
    <div class="col-3">
        No Params
    </div>
</div>
<div class="row">
    <div class="col-1">
        GET
    </div>
    <div class="col-5">
        <code>/api/vehicle/servicerecords</code>
    </div>
    <div class="col-3">
        Returns a list of service records for the vehicle
    </div>
    <div class="col-3">
        vehicleId - Id of Vehicle
    </div>
</div>
<div class="row">
    <div class="col-1">
        POST
    </div>
    <div class="col-5">
        <code>/api/vehicle/servicerecords/add</code>
    </div>
    <div class="col-3">
        Adds Service Record to the vehicle
    </div>
    <div class="col-3">
        vehicleId - Id of Vehicle
        <br />
        Body(form-data): {<br />
        date - Date to be entered<br />
        odometer - Odometer reading<br />
        description - Description<br/>
        cost - Cost<br />
        notes - notes(optional)<br />
        }
    </div>
</div>
<div class="row">
    <div class="col-1">
        GET
    </div>
    <div class="col-5">
        <code>/api/vehicle/repairrecords</code>
    </div>
    <div class="col-3">
        Returns a list of repair records for the vehicle
    </div>
    <div class="col-3">
        vehicleId - Id of Vehicle
    </div>
</div>
<div class="row">
    <div class="col-1">
        POST
    </div>
    <div class="col-5">
        <code>/api/vehicle/repairrecords/add</code>
    </div>
    <div class="col-3">
        Adds Repair Record to the vehicle
    </div>
    <div class="col-3">
        vehicleId - Id of Vehicle
        <br />
        Body(form-data): {<br />
        date - Date to be entered<br />
        odometer - Odometer reading<br />
        description - Description<br />
        cost - Cost<br />
        notes - notes(optional)<br />
        }
    </div>
</div>
<div class="row">
    <div class="col-1">
        GET
    </div>
    <div class="col-5">
        <code>/api/vehicle/upgraderecords</code>
    </div>
    <div class="col-3">
        Returns a list of upgrade records for the vehicle
    </div>
    <div class="col-3">
        vehicleId - Id of Vehicle
    </div>
</div>
<div class="row">
    <div class="col-1">
        POST
    </div>
    <div class="col-5">
        <code>/api/vehicle/upgraderecords/add</code>
    </div>
    <div class="col-3">
        Adds Upgrade Record to the vehicle
    </div>
    <div class="col-3">
        vehicleId - Id of Vehicle
        <br />
        Body(form-data): {<br />
        date - Date to be entered<br />
        odometer - Odometer reading<br />
        description - Description<br />
        cost - Cost<br />
        notes - notes(optional)<br />
        }
    </div>
</div>
<div class="row">
    <div class="col-1">
        GET
    </div>
    <div class="col-5">
        <code>/api/vehicle/taxrecords</code>
    </div>
    <div class="col-3">
        Returns a list of tax records for the vehicle
    </div>
    <div class="col-3">
        vehicleId - Id of Vehicle
    </div>
</div>
<div class="row">
    <div class="col-1">
        POST
    </div>
    <div class="col-5">
        <code>/api/vehicle/taxrecords/add</code>
    </div>
    <div class="col-3">
        Adds Tax Record to the vehicle
    </div>
    <div class="col-3">
        vehicleId - Id of Vehicle
        <br />
        Body(form-data): {<br />
        date - Date to be entered<br />
        description - Description<br />
        cost - Cost<br />
        notes - notes(optional)<br />
        }
    </div>
</div>
<div class="row">
    <div class="col-1">
        GET
    </div>
    <div class="col-5">
        <code>/api/vehicle/gasrecords</code>
    </div>
    <div class="col-3">
        Returns a list of gas records for the vehicle
    </div>
    <div class="col-3">
        vehicleId - Id of Vehicle
        <br />
        useMPG(bool) - Use Imperial Units and Calculation
        <br />
        useUKMPG(bool) - Use UK Imperial Calculation
    </div>
</div>
<div class="row">
    <div class="col-1">
        POST
    </div>
    <div class="col-5">
        <code>/api/vehicle/gasrecords/add</code>
    </div>
    <div class="col-3">
        Adds Gas Record to the vehicle
    </div>
    <div class="col-3">
        vehicleId - Id of Vehicle
        <br />
        Body(form-data): {<br />
        date - Date to be entered<br />
        odometer - Odometer reading<br />
        fuelConsumed - Fuel Consumed<br />
        cost - Cost<br />
        isFillToFull(bool) - Filled To Full<br />
        missedFuelUp(bool) - Missed Fuel Up<br />
        notes - notes(optional)<br />
        }
    </div>
</div>
<div class="row">
    <div class="col-1">
        GET
    </div>
    <div class="col-5">
        <code>/api/vehicle/reminders</code>
    </div>
    <div class="col-3">
        Returns a list of reminders for the vehicle
    </div>
    <div class="col-3">
        vehicleId - Id of Vehicle
    </div>
</div>
@if (User.IsInRole(nameof(UserData.IsRootUser)))
{
    <div class="row">
        <div class="col-1">
            GET
        </div>
        <div class="col-5">
            <code>/api/makebackup</code>
        </div>
        <div class="col-3">
            Creates a snapshot/backup of the DB at the time and returns a URL to download it.
        </div>
        <div class="col-3">
            No Params(must be root user)
        </div>
    </div>
}
<div class="row">
    <div class="col-1">
        GET
    </div>
    <div class="col-5">
        <code>/api/vehicle/odometerrecords</code>
    </div>
    <div class="col-3">
        Returns a list of odometer records for the vehicle
    </div>
    <div class="col-3">
        vehicleId - Id of Vehicle
    </div>
</div>
<div class="row">
    <div class="col-1">
        POST
    </div>
    <div class="col-5">
        <code>/api/vehicle/odometerrecords/add</code>
    </div>
    <div class="col-3">
        Adds Odometer Record to the vehicle
    </div>
    <div class="col-3">
        vehicleId - Id of Vehicle
        <br />
        Body(form-data): {<br />
            date - Date to be entered<br />
        odometer - Odometer reading<br />
        notes - notes(optional)<br />
        }
    </div>
</div>