diff --git a/Controllers/APIController.cs b/Controllers/APIController.cs index 71035c5..4e6942e 100644 --- a/Controllers/APIController.cs +++ b/Controllers/APIController.cs @@ -143,7 +143,7 @@ namespace CarCareTracker.Controllers }; _odometerLogic.AutoInsertOdometerRecord(odometerRecord); } - StaticHelper.NotifyAsync(_config.GetWebHookUrl(), vehicleId, User.Identity.Name, $"added service record via API {serviceRecord.Description}"); + StaticHelper.NotifyAsync(_config.GetWebHookUrl(), vehicleId, User.Identity.Name, $"Added Service Record via API - Description: {serviceRecord.Description}"); response.Success = true; response.Message = "Service Record Added"; return Json(response); @@ -211,7 +211,7 @@ namespace CarCareTracker.Controllers }; _odometerLogic.AutoInsertOdometerRecord(odometerRecord); } - StaticHelper.NotifyAsync(_config.GetWebHookUrl(), vehicleId, User.Identity.Name, $"added repair record via API {repairRecord.Description}"); + StaticHelper.NotifyAsync(_config.GetWebHookUrl(), vehicleId, User.Identity.Name, $"Added Repair Record via API - Description: {repairRecord.Description}"); response.Success = true; response.Message = "Repair Record Added"; return Json(response); @@ -279,7 +279,7 @@ namespace CarCareTracker.Controllers }; _odometerLogic.AutoInsertOdometerRecord(odometerRecord); } - StaticHelper.NotifyAsync(_config.GetWebHookUrl(), vehicleId, User.Identity.Name, $"added upgrade record via API {upgradeRecord.Description}"); + StaticHelper.NotifyAsync(_config.GetWebHookUrl(), vehicleId, User.Identity.Name, $"Added Upgrade Record via API - Description: {upgradeRecord.Description}"); response.Success = true; response.Message = "Upgrade Record Added"; return Json(response); @@ -333,7 +333,7 @@ namespace CarCareTracker.Controllers Cost = decimal.Parse(input.Cost) }; _taxRecordDataAccess.SaveTaxRecordToVehicle(taxRecord); - StaticHelper.NotifyAsync(_config.GetWebHookUrl(), vehicleId, User.Identity.Name, $"added tax record via API {taxRecord.Description}"); + StaticHelper.NotifyAsync(_config.GetWebHookUrl(), vehicleId, User.Identity.Name, $"Added Tax Record via API - Description: {taxRecord.Description}"); response.Success = true; response.Message = "Tax Record Added"; return Json(response); @@ -400,7 +400,7 @@ namespace CarCareTracker.Controllers Mileage = int.Parse(input.Odometer) }; _odometerRecordDataAccess.SaveOdometerRecordToVehicle(odometerRecord); - StaticHelper.NotifyAsync(_config.GetWebHookUrl(), vehicleId, User.Identity.Name, $"added odometer record via API {odometerRecord.Mileage.ToString()}"); + StaticHelper.NotifyAsync(_config.GetWebHookUrl(), vehicleId, User.Identity.Name, $"Added Odometer Record via API - Mileage: {odometerRecord.Mileage.ToString()}"); response.Success = true; response.Message = "Odometer Record Added"; return Json(response); @@ -482,7 +482,7 @@ namespace CarCareTracker.Controllers }; _odometerLogic.AutoInsertOdometerRecord(odometerRecord); } - StaticHelper.NotifyAsync(_config.GetWebHookUrl(), vehicleId, User.Identity.Name, $"added gas record via API {gasRecord.Mileage.ToString()}"); + StaticHelper.NotifyAsync(_config.GetWebHookUrl(), vehicleId, User.Identity.Name, $"Added Gas record via API - Mileage: {gasRecord.Mileage.ToString()}"); response.Success = true; response.Message = "Gas Record Added"; return Json(response); diff --git a/Controllers/VehicleController.cs b/Controllers/VehicleController.cs index 0e18392..c223572 100644 --- a/Controllers/VehicleController.cs +++ b/Controllers/VehicleController.cs @@ -130,10 +130,10 @@ namespace CarCareTracker.Controllers if (isNewAddition) { _userLogic.AddUserAccessToVehicle(GetUserID(), vehicleInput.Id); - StaticHelper.NotifyAsync(_config.GetWebHookUrl(), vehicleInput.Id, User.Identity.Name, $"added new vehicle {vehicleInput.Year} {vehicleInput.Make} {vehicleInput.Model}"); + StaticHelper.NotifyAsync(_config.GetWebHookUrl(), vehicleInput.Id, User.Identity.Name, $"Added Vehicle - Description: {vehicleInput.Year} {vehicleInput.Make} {vehicleInput.Model}"); } else { - StaticHelper.NotifyAsync(_config.GetWebHookUrl(), vehicleInput.Id, User.Identity.Name, $"edited vehicle {vehicleInput.Year} {vehicleInput.Make} {vehicleInput.Model}"); + StaticHelper.NotifyAsync(_config.GetWebHookUrl(), vehicleInput.Id, User.Identity.Name, $"Edited Vehicle - Description: {vehicleInput.Year} {vehicleInput.Make} {vehicleInput.Model}"); } return Json(result); } @@ -163,7 +163,7 @@ namespace CarCareTracker.Controllers _dataAccess.DeleteVehicle(vehicleId); if (result) { - StaticHelper.NotifyAsync(_config.GetWebHookUrl(), vehicleId, User.Identity.Name, "deleted vehicle"); + StaticHelper.NotifyAsync(_config.GetWebHookUrl(), vehicleId, User.Identity.Name, "Deleted Vehicle"); } return Json(result); } @@ -671,7 +671,7 @@ namespace CarCareTracker.Controllers var result = _gasRecordDataAccess.SaveGasRecordToVehicle(gasRecord.ToGasRecord()); if (result) { - StaticHelper.NotifyAsync(_config.GetWebHookUrl(), gasRecord.VehicleId, User.Identity.Name, $"saved gas record {gasRecord.Mileage.ToString()}"); + StaticHelper.NotifyAsync(_config.GetWebHookUrl(), gasRecord.VehicleId, User.Identity.Name, $"{(gasRecord.Id == default ? "Created" : "Edited")} Gas Record - Mileage: {gasRecord.Mileage.ToString()}"); } return Json(result); } @@ -719,7 +719,7 @@ namespace CarCareTracker.Controllers var result = _gasRecordDataAccess.DeleteGasRecordById(gasRecordId); if (result) { - StaticHelper.NotifyAsync(_config.GetWebHookUrl(), 0, User.Identity.Name, $"deleted gas record id {gasRecordId}"); + StaticHelper.NotifyAsync(_config.GetWebHookUrl(), 0, User.Identity.Name, $"Deleted Gas Record - Id: {gasRecordId}"); } return Json(result); } @@ -777,7 +777,7 @@ namespace CarCareTracker.Controllers var result = _serviceRecordDataAccess.SaveServiceRecordToVehicle(serviceRecord.ToServiceRecord()); if (result) { - StaticHelper.NotifyAsync(_config.GetWebHookUrl(), serviceRecord.VehicleId, User.Identity.Name, $"saved service record {serviceRecord.Description}"); + StaticHelper.NotifyAsync(_config.GetWebHookUrl(), serviceRecord.VehicleId, User.Identity.Name, $"{(serviceRecord.Id == default ? "Created" : "Edited")} Service Record - Description: {serviceRecord.Description}"); } return Json(result); } @@ -813,7 +813,7 @@ namespace CarCareTracker.Controllers var result = _serviceRecordDataAccess.DeleteServiceRecordById(serviceRecordId); if (result) { - StaticHelper.NotifyAsync(_config.GetWebHookUrl(), 0, User.Identity.Name, $"deleted service record id {serviceRecordId}"); + StaticHelper.NotifyAsync(_config.GetWebHookUrl(), 0, User.Identity.Name, $"Deleted Service Record - Id: {serviceRecordId}"); } return Json(result); } @@ -862,7 +862,7 @@ namespace CarCareTracker.Controllers var result = _collisionRecordDataAccess.SaveCollisionRecordToVehicle(collisionRecord.ToCollisionRecord()); if (result) { - StaticHelper.NotifyAsync(_config.GetWebHookUrl(), collisionRecord.VehicleId, User.Identity.Name, $"saved repair record {collisionRecord.Description}"); + StaticHelper.NotifyAsync(_config.GetWebHookUrl(), collisionRecord.VehicleId, User.Identity.Name, $"{(collisionRecord.Id == default ? "Created" : "Edited")} Repair Record - Description: {collisionRecord.Description}"); } return Json(result); } @@ -898,7 +898,7 @@ namespace CarCareTracker.Controllers var result = _collisionRecordDataAccess.DeleteCollisionRecordById(collisionRecordId); if (result) { - StaticHelper.NotifyAsync(_config.GetWebHookUrl(), 0, User.Identity.Name, $"deleted repair record id {collisionRecordId}"); + StaticHelper.NotifyAsync(_config.GetWebHookUrl(), 0, User.Identity.Name, $"Deleted Repair Record - Id: {collisionRecordId}"); } return Json(result); } @@ -973,7 +973,7 @@ namespace CarCareTracker.Controllers var result = _taxRecordDataAccess.SaveTaxRecordToVehicle(taxRecord.ToTaxRecord()); if (result) { - StaticHelper.NotifyAsync(_config.GetWebHookUrl(), taxRecord.VehicleId, User.Identity.Name, $"saved tax record {taxRecord.Description}"); + StaticHelper.NotifyAsync(_config.GetWebHookUrl(), taxRecord.VehicleId, User.Identity.Name, $"{(taxRecord.Id == default ? "Created" : "Edited")} Tax Record - Description: {taxRecord.Description}"); } return Json(result); } @@ -1010,7 +1010,7 @@ namespace CarCareTracker.Controllers var result = _taxRecordDataAccess.DeleteTaxRecordById(taxRecordId); if (result) { - StaticHelper.NotifyAsync(_config.GetWebHookUrl(), 0, User.Identity.Name, $"deleted tax record {taxRecordId}"); + StaticHelper.NotifyAsync(_config.GetWebHookUrl(), 0, User.Identity.Name, $"Deleted Tax Record - Id: {taxRecordId}"); } return Json(result); } @@ -1586,7 +1586,7 @@ namespace CarCareTracker.Controllers var result = _reminderRecordDataAccess.SaveReminderRecordToVehicle(reminderRecord.ToReminderRecord()); if (result) { - StaticHelper.NotifyAsync(_config.GetWebHookUrl(), reminderRecord.VehicleId, User.Identity.Name, $"saved reminder {reminderRecord.Description}"); + StaticHelper.NotifyAsync(_config.GetWebHookUrl(), reminderRecord.VehicleId, User.Identity.Name, $"{(reminderRecord.Id == default ? "Created" : "Edited")} Reminder - Description: {reminderRecord.Description}"); } return Json(result); } @@ -1630,7 +1630,7 @@ namespace CarCareTracker.Controllers var result = _reminderRecordDataAccess.DeleteReminderRecordById(reminderRecordId); if (result) { - StaticHelper.NotifyAsync(_config.GetWebHookUrl(), 0, User.Identity.Name, $"deleted reminder id {reminderRecordId}"); + StaticHelper.NotifyAsync(_config.GetWebHookUrl(), 0, User.Identity.Name, $"Delete Reminder - Id: {reminderRecordId}"); } return Json(result); } @@ -1679,7 +1679,7 @@ namespace CarCareTracker.Controllers var result = _upgradeRecordDataAccess.SaveUpgradeRecordToVehicle(upgradeRecord.ToUpgradeRecord()); if (result) { - StaticHelper.NotifyAsync(_config.GetWebHookUrl(), upgradeRecord.VehicleId, User.Identity.Name, $"saved upgrade record {upgradeRecord.Description}"); + StaticHelper.NotifyAsync(_config.GetWebHookUrl(), upgradeRecord.VehicleId, User.Identity.Name, $"{(upgradeRecord.Id == default ? "Created" : "Edited")} Upgrade Record - Description: {upgradeRecord.Description}"); } return Json(result); } @@ -1715,7 +1715,7 @@ namespace CarCareTracker.Controllers var result = _upgradeRecordDataAccess.DeleteUpgradeRecordById(upgradeRecordId); if (result) { - StaticHelper.NotifyAsync(_config.GetWebHookUrl(), 0, User.Identity.Name, $"deleted upgrade record id {upgradeRecordId}"); + StaticHelper.NotifyAsync(_config.GetWebHookUrl(), 0, User.Identity.Name, $"Deleted Upgrade Record - Id: {upgradeRecordId}"); } return Json(result); } @@ -1743,7 +1743,7 @@ namespace CarCareTracker.Controllers var result = _noteDataAccess.SaveNoteToVehicle(note); if (result) { - StaticHelper.NotifyAsync(_config.GetWebHookUrl(), note.VehicleId, User.Identity.Name, $"saved note {note.Description}"); + StaticHelper.NotifyAsync(_config.GetWebHookUrl(), note.VehicleId, User.Identity.Name, $"{(note.Id == default ? "Created" : "Edited")} Note - Description: {note.Description}"); } return Json(result); } @@ -1764,7 +1764,7 @@ namespace CarCareTracker.Controllers var result = _noteDataAccess.DeleteNoteById(noteId); if (result) { - StaticHelper.NotifyAsync(_config.GetWebHookUrl(), 0, User.Identity.Name, $"deleted note id {noteId}"); + StaticHelper.NotifyAsync(_config.GetWebHookUrl(), 0, User.Identity.Name, $"Deleted Note - Id: {noteId}"); } return Json(result); } @@ -1889,7 +1889,7 @@ namespace CarCareTracker.Controllers var result = _supplyRecordDataAccess.SaveSupplyRecordToVehicle(supplyRecord.ToSupplyRecord()); if (result) { - StaticHelper.NotifyAsync(_config.GetWebHookUrl(), supplyRecord.VehicleId, User.Identity.Name, $"saved supply record {supplyRecord.Description}"); + StaticHelper.NotifyAsync(_config.GetWebHookUrl(), supplyRecord.VehicleId, User.Identity.Name, $"{(supplyRecord.Id == default ? "Created" : "Edited")} Supply Record - Description: {supplyRecord.Description}"); } return Json(result); } @@ -1927,7 +1927,7 @@ namespace CarCareTracker.Controllers var result = _supplyRecordDataAccess.DeleteSupplyRecordById(supplyRecordId); if (result) { - StaticHelper.NotifyAsync(_config.GetWebHookUrl(), 0, User.Identity.Name, $"deleted supply record id {supplyRecordId}"); + StaticHelper.NotifyAsync(_config.GetWebHookUrl(), 0, User.Identity.Name, $"Deleted Supply Record - Id: {supplyRecordId}"); } return Json(result); } @@ -1958,7 +1958,7 @@ namespace CarCareTracker.Controllers var result = _planRecordDataAccess.SavePlanRecordToVehicle(planRecord.ToPlanRecord()); if (result) { - StaticHelper.NotifyAsync(_config.GetWebHookUrl(), planRecord.VehicleId, User.Identity.Name, $"saved plan record {planRecord.Description}"); + StaticHelper.NotifyAsync(_config.GetWebHookUrl(), planRecord.VehicleId, User.Identity.Name, $"{(planRecord.Id == default ? "Created" : "Edited")} Plan Record - Description: {planRecord.Description}"); } return Json(result); } @@ -2147,7 +2147,7 @@ namespace CarCareTracker.Controllers var result = _planRecordDataAccess.DeletePlanRecordById(planRecordId); if (result) { - StaticHelper.NotifyAsync(_config.GetWebHookUrl(), 0, User.Identity.Name, $"deleted plan record {planRecordId}"); + StaticHelper.NotifyAsync(_config.GetWebHookUrl(), 0, User.Identity.Name, $"Deleted Plan Record - Id: {planRecordId}"); } return Json(result); } @@ -2190,7 +2190,7 @@ namespace CarCareTracker.Controllers var result = _odometerRecordDataAccess.SaveOdometerRecordToVehicle(odometerRecord.ToOdometerRecord()); if (result) { - StaticHelper.NotifyAsync(_config.GetWebHookUrl(), odometerRecord.VehicleId, User.Identity.Name, $"saved odometer record {odometerRecord.Mileage.ToString()}"); + StaticHelper.NotifyAsync(_config.GetWebHookUrl(), odometerRecord.VehicleId, User.Identity.Name, $"{(odometerRecord.Id == default ? "Created" : "Edited")} Odometer Record - Mileage: {odometerRecord.Mileage.ToString()}"); } return Json(result); } @@ -2274,7 +2274,7 @@ namespace CarCareTracker.Controllers var result = _odometerRecordDataAccess.DeleteOdometerRecordById(odometerRecordId); if (result) { - StaticHelper.NotifyAsync(_config.GetWebHookUrl(), 0, User.Identity.Name, $"deleted odometer record {odometerRecordId}"); + StaticHelper.NotifyAsync(_config.GetWebHookUrl(), 0, User.Identity.Name, $"Deleted Odometer Record - Id: {odometerRecordId}"); } return Json(result); } @@ -2379,7 +2379,7 @@ namespace CarCareTracker.Controllers } if (result) { - StaticHelper.NotifyAsync(_config.GetWebHookUrl(), 0, User.Identity.Name, $"moved multiple {source.ToString()} to {destination.ToString()} {string.Join(",", recordIds)}"); + StaticHelper.NotifyAsync(_config.GetWebHookUrl(), 0, User.Identity.Name, $"Moved multiple {source.ToString()} to {destination.ToString()} - Ids: {string.Join(",", recordIds)}"); } return Json(result); } @@ -2421,7 +2421,7 @@ namespace CarCareTracker.Controllers } if (result) { - StaticHelper.NotifyAsync(_config.GetWebHookUrl(), 0, User.Identity.Name, $"deleted multiple {importMode.ToString()} {string.Join(",", recordIds)}"); + StaticHelper.NotifyAsync(_config.GetWebHookUrl(), 0, User.Identity.Name, $"Deleted multiple {importMode.ToString()} - Ids: {string.Join(",", recordIds)}"); } return Json(result); } @@ -2499,7 +2499,7 @@ namespace CarCareTracker.Controllers } if (result) { - StaticHelper.NotifyAsync(_config.GetWebHookUrl(), 0, User.Identity.Name, $"duplicated multiple {importMode.ToString()} {string.Join(",", recordIds)}"); + StaticHelper.NotifyAsync(_config.GetWebHookUrl(), 0, User.Identity.Name, $"Duplicated multiple {importMode.ToString()} - Ids: {string.Join(",", recordIds)}"); } return Json(result); }