Added delete records.
This commit is contained in:
@@ -229,6 +229,34 @@ namespace CarCareTracker.Controllers
|
||||
return Json(OperationResponse.Failed(ex.Message));
|
||||
}
|
||||
}
|
||||
[HttpDelete]
|
||||
[Route("/api/vehicle/servicerecords/delete")]
|
||||
public IActionResult DeleteServiceRecord(int id)
|
||||
{
|
||||
var existingRecord = _serviceRecordDataAccess.GetServiceRecordById(id);
|
||||
if (existingRecord == null || existingRecord.Id == default)
|
||||
{
|
||||
Response.StatusCode = 400;
|
||||
return Json(OperationResponse.Failed("Invalid Record Id"));
|
||||
}
|
||||
//security check.
|
||||
if (!_userLogic.UserCanEditVehicle(GetUserID(), existingRecord.VehicleId))
|
||||
{
|
||||
Response.StatusCode = 401;
|
||||
return Json(OperationResponse.Failed("Access Denied, you don't have access to this vehicle."));
|
||||
}
|
||||
//restore any requisitioned supplies.
|
||||
if (existingRecord.RequisitionHistory.Any())
|
||||
{
|
||||
_vehicleLogic.RestoreSupplyRecordsByUsage(existingRecord.RequisitionHistory, existingRecord.Description);
|
||||
}
|
||||
var result = _serviceRecordDataAccess.DeleteServiceRecordById(existingRecord.Id);
|
||||
if (result)
|
||||
{
|
||||
StaticHelper.NotifyAsync(_config.GetWebHookUrl(), WebHookPayload.FromGenericRecord(existingRecord, "servicerecord.delete.api", User.Identity.Name));
|
||||
}
|
||||
return Json(OperationResponse.Conditional(result, "Service Record Deleted"));
|
||||
}
|
||||
[HttpPut]
|
||||
[Route("/api/vehicle/servicerecords/update")]
|
||||
[Consumes("application/json")]
|
||||
@@ -362,6 +390,34 @@ namespace CarCareTracker.Controllers
|
||||
return Json(OperationResponse.Failed(ex.Message));
|
||||
}
|
||||
}
|
||||
[HttpDelete]
|
||||
[Route("/api/vehicle/repairrecords/delete")]
|
||||
public IActionResult DeleteRepairRecord(int id)
|
||||
{
|
||||
var existingRecord = _collisionRecordDataAccess.GetCollisionRecordById(id);
|
||||
if (existingRecord == null || existingRecord.Id == default)
|
||||
{
|
||||
Response.StatusCode = 400;
|
||||
return Json(OperationResponse.Failed("Invalid Record Id"));
|
||||
}
|
||||
//security check.
|
||||
if (!_userLogic.UserCanEditVehicle(GetUserID(), existingRecord.VehicleId))
|
||||
{
|
||||
Response.StatusCode = 401;
|
||||
return Json(OperationResponse.Failed("Access Denied, you don't have access to this vehicle."));
|
||||
}
|
||||
//restore any requisitioned supplies.
|
||||
if (existingRecord.RequisitionHistory.Any())
|
||||
{
|
||||
_vehicleLogic.RestoreSupplyRecordsByUsage(existingRecord.RequisitionHistory, existingRecord.Description);
|
||||
}
|
||||
var result = _collisionRecordDataAccess.DeleteCollisionRecordById(existingRecord.Id);
|
||||
if (result)
|
||||
{
|
||||
StaticHelper.NotifyAsync(_config.GetWebHookUrl(), WebHookPayload.FromGenericRecord(existingRecord, "repairrecord.delete.api", User.Identity.Name));
|
||||
}
|
||||
return Json(OperationResponse.Conditional(result, "Repair Record Deleted"));
|
||||
}
|
||||
[HttpPut]
|
||||
[Route("/api/vehicle/repairrecords/update")]
|
||||
[Consumes("application/json")]
|
||||
@@ -495,6 +551,34 @@ namespace CarCareTracker.Controllers
|
||||
return Json(OperationResponse.Failed(ex.Message));
|
||||
}
|
||||
}
|
||||
[HttpDelete]
|
||||
[Route("/api/vehicle/upgraderecords/delete")]
|
||||
public IActionResult DeleteUpgradeRecord(int id)
|
||||
{
|
||||
var existingRecord = _upgradeRecordDataAccess.GetUpgradeRecordById(id);
|
||||
if (existingRecord == null || existingRecord.Id == default)
|
||||
{
|
||||
Response.StatusCode = 400;
|
||||
return Json(OperationResponse.Failed("Invalid Record Id"));
|
||||
}
|
||||
//security check.
|
||||
if (!_userLogic.UserCanEditVehicle(GetUserID(), existingRecord.VehicleId))
|
||||
{
|
||||
Response.StatusCode = 401;
|
||||
return Json(OperationResponse.Failed("Access Denied, you don't have access to this vehicle."));
|
||||
}
|
||||
//restore any requisitioned supplies.
|
||||
if (existingRecord.RequisitionHistory.Any())
|
||||
{
|
||||
_vehicleLogic.RestoreSupplyRecordsByUsage(existingRecord.RequisitionHistory, existingRecord.Description);
|
||||
}
|
||||
var result = _upgradeRecordDataAccess.DeleteUpgradeRecordById(existingRecord.Id);
|
||||
if (result)
|
||||
{
|
||||
StaticHelper.NotifyAsync(_config.GetWebHookUrl(), WebHookPayload.FromGenericRecord(existingRecord, "upgraderecord.delete.api", User.Identity.Name));
|
||||
}
|
||||
return Json(OperationResponse.Conditional(result,"Upgrade Record Deleted"));
|
||||
}
|
||||
[HttpPut]
|
||||
[Route("/api/vehicle/upgraderecords/update")]
|
||||
[Consumes("application/json")]
|
||||
@@ -650,6 +734,29 @@ namespace CarCareTracker.Controllers
|
||||
return Json(OperationResponse.Failed(ex.Message));
|
||||
}
|
||||
}
|
||||
[HttpDelete]
|
||||
[Route("/api/vehicle/taxrecords/delete")]
|
||||
public IActionResult DeleteTaxRecord(int id)
|
||||
{
|
||||
var existingRecord = _taxRecordDataAccess.GetTaxRecordById(id);
|
||||
if (existingRecord == null || existingRecord.Id == default)
|
||||
{
|
||||
Response.StatusCode = 400;
|
||||
return Json(OperationResponse.Failed("Invalid Record Id"));
|
||||
}
|
||||
//security check.
|
||||
if (!_userLogic.UserCanEditVehicle(GetUserID(), existingRecord.VehicleId))
|
||||
{
|
||||
Response.StatusCode = 401;
|
||||
return Json(OperationResponse.Failed("Access Denied, you don't have access to this vehicle."));
|
||||
}
|
||||
var result = _taxRecordDataAccess.DeleteTaxRecordById(existingRecord.Id);
|
||||
if (result)
|
||||
{
|
||||
StaticHelper.NotifyAsync(_config.GetWebHookUrl(), WebHookPayload.FromTaxRecord(existingRecord, "taxrecord.delete.api", User.Identity.Name));
|
||||
}
|
||||
return Json(OperationResponse.Conditional(result, "Tax Record Deleted"));
|
||||
}
|
||||
[HttpPut]
|
||||
[Route("/api/vehicle/taxrecords/update")]
|
||||
[Consumes("application/json")]
|
||||
@@ -785,6 +892,29 @@ namespace CarCareTracker.Controllers
|
||||
return Json(OperationResponse.Failed(ex.Message));
|
||||
}
|
||||
}
|
||||
[HttpDelete]
|
||||
[Route("/api/vehicle/odometerrecords/delete")]
|
||||
public IActionResult DeleteOdometerRecord(int id)
|
||||
{
|
||||
var existingRecord = _odometerRecordDataAccess.GetOdometerRecordById(id);
|
||||
if (existingRecord == null || existingRecord.Id == default)
|
||||
{
|
||||
Response.StatusCode = 400;
|
||||
return Json(OperationResponse.Failed("Invalid Record Id"));
|
||||
}
|
||||
//security check.
|
||||
if (!_userLogic.UserCanEditVehicle(GetUserID(), existingRecord.VehicleId))
|
||||
{
|
||||
Response.StatusCode = 401;
|
||||
return Json(OperationResponse.Failed("Access Denied, you don't have access to this vehicle."));
|
||||
}
|
||||
var result = _odometerRecordDataAccess.DeleteOdometerRecordById(existingRecord.Id);
|
||||
if (result)
|
||||
{
|
||||
StaticHelper.NotifyAsync(_config.GetWebHookUrl(), WebHookPayload.FromOdometerRecord(existingRecord, "odometerrecord.delete.api", User.Identity.Name));
|
||||
}
|
||||
return Json(OperationResponse.Conditional(result, "Odometer Record Deleted"));
|
||||
}
|
||||
[HttpPut]
|
||||
[Route("/api/vehicle/odometerrecords/update")]
|
||||
[Consumes("application/json")]
|
||||
@@ -933,6 +1063,29 @@ namespace CarCareTracker.Controllers
|
||||
return Json(OperationResponse.Failed(ex.Message));
|
||||
}
|
||||
}
|
||||
[HttpDelete]
|
||||
[Route("/api/vehicle/gasrecords/delete")]
|
||||
public IActionResult DeleteGasRecord(int id)
|
||||
{
|
||||
var existingRecord = _gasRecordDataAccess.GetGasRecordById(id);
|
||||
if (existingRecord == null || existingRecord.Id == default)
|
||||
{
|
||||
Response.StatusCode = 400;
|
||||
return Json(OperationResponse.Failed("Invalid Record Id"));
|
||||
}
|
||||
//security check.
|
||||
if (!_userLogic.UserCanEditVehicle(GetUserID(), existingRecord.VehicleId))
|
||||
{
|
||||
Response.StatusCode = 401;
|
||||
return Json(OperationResponse.Failed("Access Denied, you don't have access to this vehicle."));
|
||||
}
|
||||
var result = _gasRecordDataAccess.DeleteGasRecordById(existingRecord.Id);
|
||||
if (result)
|
||||
{
|
||||
StaticHelper.NotifyAsync(_config.GetWebHookUrl(), WebHookPayload.FromGasRecord(existingRecord, "gasrecord.delete.api", User.Identity.Name));
|
||||
}
|
||||
return Json(OperationResponse.Conditional(result, "Odometer Record Deleted"));
|
||||
}
|
||||
[HttpPut]
|
||||
[Route("/api/vehicle/gasrecords/update")]
|
||||
[Consumes("application/json")]
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace CarCareTracker.Controllers
|
||||
}
|
||||
if (planRecord.DeletedRequisitionHistory.Any())
|
||||
{
|
||||
RestoreSupplyRecordsByUsage(planRecord.DeletedRequisitionHistory, planRecord.Description);
|
||||
_vehicleLogic.RestoreSupplyRecordsByUsage(planRecord.DeletedRequisitionHistory, planRecord.Description);
|
||||
}
|
||||
var result = _planRecordDataAccess.SavePlanRecordToVehicle(planRecord.ToPlanRecord());
|
||||
if (result)
|
||||
@@ -311,7 +311,7 @@ namespace CarCareTracker.Controllers
|
||||
//restore any requisitioned supplies if it has not been converted to other record types.
|
||||
if (existingRecord.RequisitionHistory.Any() && existingRecord.Progress != PlanProgress.Done)
|
||||
{
|
||||
RestoreSupplyRecordsByUsage(existingRecord.RequisitionHistory, existingRecord.Description);
|
||||
_vehicleLogic.RestoreSupplyRecordsByUsage(existingRecord.RequisitionHistory, existingRecord.Description);
|
||||
}
|
||||
var result = _planRecordDataAccess.DeletePlanRecordById(existingRecord.Id);
|
||||
if (result)
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace CarCareTracker.Controllers
|
||||
}
|
||||
if (collisionRecord.DeletedRequisitionHistory.Any())
|
||||
{
|
||||
RestoreSupplyRecordsByUsage(collisionRecord.DeletedRequisitionHistory, collisionRecord.Description);
|
||||
_vehicleLogic.RestoreSupplyRecordsByUsage(collisionRecord.DeletedRequisitionHistory, collisionRecord.Description);
|
||||
}
|
||||
//push back any reminders
|
||||
if (collisionRecord.ReminderRecordId.Any())
|
||||
@@ -112,7 +112,7 @@ namespace CarCareTracker.Controllers
|
||||
//restore any requisitioned supplies.
|
||||
if (existingRecord.RequisitionHistory.Any())
|
||||
{
|
||||
RestoreSupplyRecordsByUsage(existingRecord.RequisitionHistory, existingRecord.Description);
|
||||
_vehicleLogic.RestoreSupplyRecordsByUsage(existingRecord.RequisitionHistory, existingRecord.Description);
|
||||
}
|
||||
var result = _collisionRecordDataAccess.DeleteCollisionRecordById(existingRecord.Id);
|
||||
if (result)
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace CarCareTracker.Controllers
|
||||
}
|
||||
if (serviceRecord.DeletedRequisitionHistory.Any())
|
||||
{
|
||||
RestoreSupplyRecordsByUsage(serviceRecord.DeletedRequisitionHistory, serviceRecord.Description);
|
||||
_vehicleLogic.RestoreSupplyRecordsByUsage(serviceRecord.DeletedRequisitionHistory, serviceRecord.Description);
|
||||
}
|
||||
//push back any reminders
|
||||
if (serviceRecord.ReminderRecordId.Any())
|
||||
@@ -112,7 +112,7 @@ namespace CarCareTracker.Controllers
|
||||
//restore any requisitioned supplies.
|
||||
if (existingRecord.RequisitionHistory.Any())
|
||||
{
|
||||
RestoreSupplyRecordsByUsage(existingRecord.RequisitionHistory, existingRecord.Description);
|
||||
_vehicleLogic.RestoreSupplyRecordsByUsage(existingRecord.RequisitionHistory, existingRecord.Description);
|
||||
}
|
||||
var result = _serviceRecordDataAccess.DeleteServiceRecordById(existingRecord.Id);
|
||||
if (result)
|
||||
|
||||
@@ -73,44 +73,7 @@ namespace CarCareTracker.Controllers
|
||||
}
|
||||
return results;
|
||||
}
|
||||
private void RestoreSupplyRecordsByUsage(List<SupplyUsageHistory> supplyUsage, string usageDescription)
|
||||
{
|
||||
foreach (SupplyUsageHistory supply in supplyUsage)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (supply.Id == default)
|
||||
{
|
||||
continue; //no id, skip current supply.
|
||||
}
|
||||
var result = _supplyRecordDataAccess.GetSupplyRecordById(supply.Id);
|
||||
if (result != null && result.Id != default)
|
||||
{
|
||||
//supply exists, re-add the quantity and cost
|
||||
result.Quantity += supply.Quantity;
|
||||
result.Cost += supply.Cost;
|
||||
var requisitionRecord = new SupplyUsageHistory
|
||||
{
|
||||
Id = supply.Id,
|
||||
Date = DateTime.Now.Date,
|
||||
Description = $"Restored from {usageDescription}",
|
||||
Quantity = supply.Quantity,
|
||||
Cost = supply.Cost
|
||||
};
|
||||
result.RequisitionHistory.Add(requisitionRecord);
|
||||
//save
|
||||
_supplyRecordDataAccess.SaveSupplyRecordToVehicle(result);
|
||||
}
|
||||
else
|
||||
{
|
||||
_logger.LogError($"Unable to find supply with id {supply.Id}");
|
||||
}
|
||||
} catch (Exception ex)
|
||||
{
|
||||
_logger.LogError($"Error restoring supply with id {supply.Id} : {ex.Message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[TypeFilter(typeof(CollaboratorFilter))]
|
||||
[HttpGet]
|
||||
public IActionResult GetSupplyRecordsByVehicleId(int vehicleId)
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace CarCareTracker.Controllers
|
||||
}
|
||||
if (upgradeRecord.DeletedRequisitionHistory.Any())
|
||||
{
|
||||
RestoreSupplyRecordsByUsage(upgradeRecord.DeletedRequisitionHistory, upgradeRecord.Description);
|
||||
_vehicleLogic.RestoreSupplyRecordsByUsage(upgradeRecord.DeletedRequisitionHistory, upgradeRecord.Description);
|
||||
}
|
||||
//push back any reminders
|
||||
if (upgradeRecord.ReminderRecordId.Any())
|
||||
@@ -112,7 +112,7 @@ namespace CarCareTracker.Controllers
|
||||
//restore any requisitioned supplies.
|
||||
if (existingRecord.RequisitionHistory.Any())
|
||||
{
|
||||
RestoreSupplyRecordsByUsage(existingRecord.RequisitionHistory, existingRecord.Description);
|
||||
_vehicleLogic.RestoreSupplyRecordsByUsage(existingRecord.RequisitionHistory, existingRecord.Description);
|
||||
}
|
||||
var result = _upgradeRecordDataAccess.DeleteUpgradeRecordById(existingRecord.Id);
|
||||
if (result)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using CarCareTracker.External.Interfaces;
|
||||
using CarCareTracker.Controllers;
|
||||
using CarCareTracker.External.Interfaces;
|
||||
using CarCareTracker.Helper;
|
||||
using CarCareTracker.Models;
|
||||
|
||||
@@ -18,6 +19,7 @@ namespace CarCareTracker.Logic
|
||||
List<ReminderRecordViewModel> GetReminders(List<Vehicle> vehicles, bool isCalendar);
|
||||
List<PlanRecord> GetPlans(List<Vehicle> vehicles, bool excludeDone);
|
||||
bool UpdateRecurringTaxes(int vehicleId);
|
||||
void RestoreSupplyRecordsByUsage(List<SupplyUsageHistory> supplyUsage, string usageDescription);
|
||||
}
|
||||
public class VehicleLogic: IVehicleLogic
|
||||
{
|
||||
@@ -31,6 +33,8 @@ namespace CarCareTracker.Logic
|
||||
private readonly IPlanRecordDataAccess _planRecordDataAccess;
|
||||
private readonly IReminderHelper _reminderHelper;
|
||||
private readonly IVehicleDataAccess _dataAccess;
|
||||
private readonly ISupplyRecordDataAccess _supplyRecordDataAccess;
|
||||
private readonly ILogger<VehicleLogic> _logger;
|
||||
|
||||
public VehicleLogic(
|
||||
IServiceRecordDataAccess serviceRecordDataAccess,
|
||||
@@ -42,7 +46,9 @@ namespace CarCareTracker.Logic
|
||||
IReminderRecordDataAccess reminderRecordDataAccess,
|
||||
IPlanRecordDataAccess planRecordDataAccess,
|
||||
IReminderHelper reminderHelper,
|
||||
IVehicleDataAccess dataAccess
|
||||
IVehicleDataAccess dataAccess,
|
||||
ISupplyRecordDataAccess supplyRecordDataAccess,
|
||||
ILogger<VehicleLogic> logger
|
||||
) {
|
||||
_serviceRecordDataAccess = serviceRecordDataAccess;
|
||||
_gasRecordDataAccess = gasRecordDataAccess;
|
||||
@@ -54,6 +60,8 @@ namespace CarCareTracker.Logic
|
||||
_reminderRecordDataAccess = reminderRecordDataAccess;
|
||||
_reminderHelper = reminderHelper;
|
||||
_dataAccess = dataAccess;
|
||||
_supplyRecordDataAccess = supplyRecordDataAccess;
|
||||
_logger = logger;
|
||||
}
|
||||
public VehicleRecords GetVehicleRecords(int vehicleId)
|
||||
{
|
||||
@@ -374,5 +382,44 @@ namespace CarCareTracker.Logic
|
||||
}
|
||||
return false; //no outdated recurring tax records.
|
||||
}
|
||||
public void RestoreSupplyRecordsByUsage(List<SupplyUsageHistory> supplyUsage, string usageDescription)
|
||||
{
|
||||
foreach (SupplyUsageHistory supply in supplyUsage)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (supply.Id == default)
|
||||
{
|
||||
continue; //no id, skip current supply.
|
||||
}
|
||||
var result = _supplyRecordDataAccess.GetSupplyRecordById(supply.Id);
|
||||
if (result != null && result.Id != default)
|
||||
{
|
||||
//supply exists, re-add the quantity and cost
|
||||
result.Quantity += supply.Quantity;
|
||||
result.Cost += supply.Cost;
|
||||
var requisitionRecord = new SupplyUsageHistory
|
||||
{
|
||||
Id = supply.Id,
|
||||
Date = DateTime.Now.Date,
|
||||
Description = $"Restored from {usageDescription}",
|
||||
Quantity = supply.Quantity,
|
||||
Cost = supply.Cost
|
||||
};
|
||||
result.RequisitionHistory.Add(requisitionRecord);
|
||||
//save
|
||||
_supplyRecordDataAccess.SaveSupplyRecordToVehicle(result);
|
||||
}
|
||||
else
|
||||
{
|
||||
_logger.LogError($"Unable to find supply with id {supply.Id}");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError($"Error restoring supply with id {supply.Id} : {ex.Message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,13 +56,13 @@ namespace CarCareTracker.Models
|
||||
var recordType = actionTypeParts[0];
|
||||
var recordAction = actionTypeParts[1];
|
||||
var thirdPart = actionTypeParts[2];
|
||||
if (recordAction == "delete")
|
||||
if (recordAction == "add")
|
||||
{
|
||||
recordAction = "DELETED";
|
||||
recordAction = "ADDED";
|
||||
}
|
||||
else
|
||||
{
|
||||
recordAction = $"{recordAction.ToUpper()}ED";
|
||||
recordAction = $"{recordAction.ToUpper()}D";
|
||||
}
|
||||
if (thirdPart == "api")
|
||||
{
|
||||
|
||||
@@ -132,9 +132,8 @@
|
||||
Updates Odometer Record
|
||||
</div>
|
||||
<div class="col-3">
|
||||
Id - Id of Odometer Record
|
||||
<br />
|
||||
Body(form-data): {<br />
|
||||
Id - Id of Odometer Record<br />
|
||||
date - Date to be entered<br />
|
||||
initialOdometer - Initial Odometer reading<br />
|
||||
odometer - Odometer reading<br />
|
||||
@@ -144,6 +143,20 @@
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row api-method">
|
||||
<div class="col-1">
|
||||
<span class="badge text-bg-danger">DELETE</span>
|
||||
</div>
|
||||
<div class="col-5 copyable">
|
||||
<code>/api/vehicle/odometerrecords/delete</code>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
Deletes Odometer Record
|
||||
</div>
|
||||
<div class="col-3">
|
||||
Id - Id of Odometer Record
|
||||
</div>
|
||||
</div>
|
||||
<div class="row api-method">
|
||||
<div class="col-1">
|
||||
<span class="badge bg-success">GET</span>
|
||||
@@ -193,9 +206,8 @@
|
||||
Updates Service Record
|
||||
</div>
|
||||
<div class="col-3">
|
||||
Id - Id of Service Record
|
||||
<br />
|
||||
Body(form-data): {<br />
|
||||
Id - Id of Service Record<br />
|
||||
date - Date to be entered<br />
|
||||
odometer - Odometer reading<br />
|
||||
description - Description<br />
|
||||
@@ -206,6 +218,20 @@
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row api-method">
|
||||
<div class="col-1">
|
||||
<span class="badge text-bg-danger">DELETE</span>
|
||||
</div>
|
||||
<div class="col-5 copyable">
|
||||
<code>/api/vehicle/servicerecords/delete</code>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
Deletes Service Record
|
||||
</div>
|
||||
<div class="col-3">
|
||||
Id - Id of Service Record
|
||||
</div>
|
||||
</div>
|
||||
<div class="row api-method">
|
||||
<div class="col-1">
|
||||
<span class="badge bg-success">GET</span>
|
||||
@@ -255,9 +281,8 @@
|
||||
Updates Repair Record
|
||||
</div>
|
||||
<div class="col-3">
|
||||
Id - Id of Repair Record
|
||||
<br />
|
||||
Body(form-data): {<br />
|
||||
Id - Id of Repair Record <br />
|
||||
date - Date to be entered<br />
|
||||
odometer - Odometer reading<br />
|
||||
description - Description<br />
|
||||
@@ -268,6 +293,20 @@
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row api-method">
|
||||
<div class="col-1">
|
||||
<span class="badge text-bg-danger">DELETE</span>
|
||||
</div>
|
||||
<div class="col-5 copyable">
|
||||
<code>/api/vehicle/repairrecords/delete</code>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
Deletes Repair Record
|
||||
</div>
|
||||
<div class="col-3">
|
||||
Id - Id of Repair Record
|
||||
</div>
|
||||
</div>
|
||||
<div class="row api-method">
|
||||
<div class="col-1">
|
||||
<span class="badge bg-success">GET</span>
|
||||
@@ -317,9 +356,8 @@
|
||||
Updates Upgrade Record
|
||||
</div>
|
||||
<div class="col-3">
|
||||
Id - Id of Upgrade Record
|
||||
<br />
|
||||
Body(form-data): {<br />
|
||||
Id - Id of Upgrade Record<br />
|
||||
date - Date to be entered<br />
|
||||
odometer - Odometer reading<br />
|
||||
description - Description<br />
|
||||
@@ -330,6 +368,20 @@
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row api-method">
|
||||
<div class="col-1">
|
||||
<span class="badge text-bg-danger">DELETE</span>
|
||||
</div>
|
||||
<div class="col-5 copyable">
|
||||
<code>/api/vehicle/upgraderecords/delete</code>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
Deletes Upgrade Record
|
||||
</div>
|
||||
<div class="col-3">
|
||||
Id - Id of Upgrade Record
|
||||
</div>
|
||||
</div>
|
||||
<div class="row api-method">
|
||||
<div class="col-1">
|
||||
<span class="badge bg-success">GET</span>
|
||||
@@ -392,9 +444,8 @@
|
||||
Updates Tax Record
|
||||
</div>
|
||||
<div class="col-3">
|
||||
Id - Id of Tax Record
|
||||
<br />
|
||||
Body(form-data): {<br />
|
||||
Id - Id of Tax Record<br />
|
||||
date - Date to be entered<br />
|
||||
description - Description<br />
|
||||
cost - Cost<br />
|
||||
@@ -404,6 +455,20 @@
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row api-method">
|
||||
<div class="col-1">
|
||||
<span class="badge text-bg-danger">DELETE</span>
|
||||
</div>
|
||||
<div class="col-5 copyable">
|
||||
<code>/api/vehicle/taxrecords/delete</code>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
Deletes Tax Record
|
||||
</div>
|
||||
<div class="col-3">
|
||||
Id - Id of Tax Record
|
||||
</div>
|
||||
</div>
|
||||
<div class="row api-method">
|
||||
<div class="col-1">
|
||||
<span class="badge bg-success">GET</span>
|
||||
@@ -459,9 +524,8 @@
|
||||
Updates Gas Record
|
||||
</div>
|
||||
<div class="col-3">
|
||||
Id - Id of Gas Record
|
||||
<br />
|
||||
Body(form-data): {<br />
|
||||
Id - Id of Gas Record<br />
|
||||
date - Date to be entered<br />
|
||||
odometer - Odometer reading<br />
|
||||
fuelConsumed - Fuel Consumed<br />
|
||||
@@ -474,6 +538,20 @@
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row api-method">
|
||||
<div class="col-1">
|
||||
<span class="badge text-bg-danger">DELETE</span>
|
||||
</div>
|
||||
<div class="col-5 copyable">
|
||||
<code>/api/vehicle/gasrecords/delete</code>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
Deletes Gas Record
|
||||
</div>
|
||||
<div class="col-3">
|
||||
Id - Id of Gas Record
|
||||
</div>
|
||||
</div>
|
||||
<div class="row api-method">
|
||||
<div class="col-1">
|
||||
<span class="badge bg-success">GET</span>
|
||||
|
||||
Reference in New Issue
Block a user