This commit is contained in:
Zeeshaun
2026-04-23 16:27:51 +00:00
parent 9daf7b0f01
commit ecd687d973
12 changed files with 8 additions and 25 deletions
@@ -10,7 +10,6 @@ using LCU.API.Internal.Operations.IncentiveApi.Services.MicroApiServices;
using LCU.Library.Internal.IncentiveApiModels.Requests; using LCU.Library.Internal.IncentiveApiModels.Requests;
using LCU.API.Internal.Operations.IncentiveApi.Services.Transformations; using LCU.API.Internal.Operations.IncentiveApi.Services.Transformations;
using LCU.Library.Internal.ApiResponse.Services; using LCU.Library.Internal.ApiResponse.Services;
using LCU.Library.Internal.Exceptions;
using LCU.Library.Internal.IncentiveApiModels.Results; using LCU.Library.Internal.IncentiveApiModels.Results;
namespace LCU.API.Internal.Operations.IncentiveApi.Services.Action; namespace LCU.API.Internal.Operations.IncentiveApi.Services.Action;
@@ -52,7 +51,6 @@ public class ActionCreditCardImportService : IActionCreditCardImportService
_actionCreditCardResult.MessageStack.Add(message); _actionCreditCardResult.MessageStack.Add(message);
_actionCreditCardResult.Success = false; _actionCreditCardResult.Success = false;
await QueueReturnResponse.QueueResponse(request, _actionCreditCardResult.Success, _actionCreditCardResult.MessageStack); await QueueReturnResponse.QueueResponse(request, _actionCreditCardResult.Success, _actionCreditCardResult.MessageStack);
throw new ServiceException(message);
} }
} }
@@ -11,7 +11,6 @@ using LCU.Library.Internal.IncentiveApiModels.Requests;
using LCU.API.Internal.Operations.IncentiveApi.Services.Transformations; using LCU.API.Internal.Operations.IncentiveApi.Services.Transformations;
using LCU.Library.Internal.IncentiveApiModels.Results; using LCU.Library.Internal.IncentiveApiModels.Results;
using LCU.Library.Internal.ApiResponse.Services; using LCU.Library.Internal.ApiResponse.Services;
using LCU.Library.Internal.Exceptions;
namespace LCU.API.Internal.Operations.IncentiveApi.Services.Action; namespace LCU.API.Internal.Operations.IncentiveApi.Services.Action;
@@ -49,7 +48,6 @@ public class ActionVehicleImportService : IActionVehicleImportService
_actionVehicleProcessResult.MessageStack.Add(message); _actionVehicleProcessResult.MessageStack.Add(message);
_actionVehicleProcessResult.Success = false; _actionVehicleProcessResult.Success = false;
await QueueReturnResponse.QueueResponse(request, _actionVehicleProcessResult.Success, _actionVehicleProcessResult.MessageStack); await QueueReturnResponse.QueueResponse(request, _actionVehicleProcessResult.Success, _actionVehicleProcessResult.MessageStack);
throw new ServiceException(message);
} }
} }
@@ -14,7 +14,6 @@ using LCU.Library.Internal.IncentiveApiModels.Requests;
using LCU.API.Internal.Operations.IncentiveApi.Services.MicroApiServices; using LCU.API.Internal.Operations.IncentiveApi.Services.MicroApiServices;
using LCU.API.Internal.Operations.IncentiveApi.Services.Transformations; using LCU.API.Internal.Operations.IncentiveApi.Services.Transformations;
using LCU.Library.Internal.ApiResponse.Services; using LCU.Library.Internal.ApiResponse.Services;
using LCU.Library.Internal.Exceptions;
using LCU.Library.Internal.IncentiveApiModels.Results; using LCU.Library.Internal.IncentiveApiModels.Results;
namespace LCU.API.Internal.Operations.IncentiveApi.Services.Allied; namespace LCU.API.Internal.Operations.IncentiveApi.Services.Allied;
@@ -69,7 +68,6 @@ public class AlliedGapMbpTransactionImportService : IAlliedGapMbpTransactionImpo
_alliedGapMbpProcessResult.MessageStack.Add(message); _alliedGapMbpProcessResult.MessageStack.Add(message);
_alliedGapMbpProcessResult.Success = false; _alliedGapMbpProcessResult.Success = false;
await QueueReturnResponse.QueueResponse(request, _alliedGapMbpProcessResult.Success, _alliedGapMbpProcessResult.MessageStack); await QueueReturnResponse.QueueResponse(request, _alliedGapMbpProcessResult.Success, _alliedGapMbpProcessResult.MessageStack);
throw new ServiceException(message);
} }
} }
@@ -6,7 +6,6 @@ using LCU.Library.Internal.IncentiveApiModels.Common;
using LCU.Library.Internal.IncentiveApiModels.Requests; using LCU.Library.Internal.IncentiveApiModels.Requests;
using LCU.Library.Internal.IncentiveApiModels.Results; using LCU.Library.Internal.IncentiveApiModels.Results;
using LCU.Library.Internal.ApiResponse.Services; using LCU.Library.Internal.ApiResponse.Services;
using LCU.Library.Internal.Exceptions;
namespace LCU.API.Internal.Operations.IncentiveApi.Services.AutoDecision; namespace LCU.API.Internal.Operations.IncentiveApi.Services.AutoDecision;
@@ -69,7 +68,6 @@ public class ActivityDecisionService : IActivityDecisionService
_incentiveProcessResult.MessageStack.Add(message); _incentiveProcessResult.MessageStack.Add(message);
_incentiveProcessResult.Success = false; _incentiveProcessResult.Success = false;
await QueueReturnResponse.QueueResponse(request, _incentiveProcessResult.Success, _incentiveProcessResult.MessageStack); await QueueReturnResponse.QueueResponse(request, _incentiveProcessResult.Success, _incentiveProcessResult.MessageStack);
throw new ServiceException(message);
} }
} }
@@ -8,7 +8,6 @@ using LCU.API.Internal.Operations.IncentiveApi.Services.MicroApiServices;
using LCU.API.Internal.Operations.IncentiveApi.Configuration; using LCU.API.Internal.Operations.IncentiveApi.Configuration;
using LCU.Library.Internal.IncentiveApiModels.Requests; using LCU.Library.Internal.IncentiveApiModels.Requests;
using LCU.Library.Internal.ApiResponse.Services; using LCU.Library.Internal.ApiResponse.Services;
using LCU.Library.Internal.Exceptions;
using ProcessResult = LCU.Library.Internal.IncentiveApiModels.Results.ProcessResult; using ProcessResult = LCU.Library.Internal.IncentiveApiModels.Results.ProcessResult;
namespace LCU.API.Internal.Operations.IncentiveApi.Services.Dayforce; namespace LCU.API.Internal.Operations.IncentiveApi.Services.Dayforce;
@@ -78,7 +77,6 @@ public class DayForceSyncService : IDayForceSyncService
_dayforceSyncProcessResult.MessageStack.Add(message); _dayforceSyncProcessResult.MessageStack.Add(message);
_dayforceSyncProcessResult.Success = false; _dayforceSyncProcessResult.Success = false;
await QueueReturnResponse.QueueResponse(request, _dayforceSyncProcessResult.Success, _dayforceSyncProcessResult.MessageStack); await QueueReturnResponse.QueueResponse(request, _dayforceSyncProcessResult.Success, _dayforceSyncProcessResult.MessageStack);
throw new ServiceException(message);
} }
} }
@@ -3,7 +3,6 @@ using LCU.Library.Internal.IncentiveApiModels.Results;
using LCU.Library.Internal.LCUServiceFactory.Services; using LCU.Library.Internal.LCUServiceFactory.Services;
using LCU.API.Internal.Operations.IncentiveApi.Services.IncentiveProcesses; using LCU.API.Internal.Operations.IncentiveApi.Services.IncentiveProcesses;
using LCU.Library.Internal.ApiResponse.Services; using LCU.Library.Internal.ApiResponse.Services;
using LCU.Library.Internal.Exceptions;
namespace LCU.API.Internal.Operations.IncentiveApi.Services; namespace LCU.API.Internal.Operations.IncentiveApi.Services;
@@ -36,11 +35,11 @@ public class DnaActivitySyncService : IDnaActivitySyncService
} }
catch (Exception exception) catch (Exception exception)
{ {
var message = $"There was an issue with {request.IncentiveProcessType}. Exception Message: {exception.Message}."; var processType = request?.IncentiveProcessType.ToString() ?? "unknown incentive process";
var message = $"There was an issue with {processType}. Exception Message: {exception.Message}.";
_incentiveProcessResult.MessageStack.Add(message); _incentiveProcessResult.MessageStack.Add(message);
_incentiveProcessResult.Success = false; _incentiveProcessResult.Success = false;
await QueueReturnResponse.QueueResponse(request, _incentiveProcessResult.Success, _incentiveProcessResult.MessageStack); await QueueReturnResponse.QueueResponse(request, _incentiveProcessResult.Success, _incentiveProcessResult.MessageStack);
throw new ServiceException(message);
} }
} }
@@ -5,7 +5,6 @@ using LCU.API.Internal.Operations.IncentiveApiLib.Repositories;
using LCU.Library.Internal.IncentiveApiModels.Requests; using LCU.Library.Internal.IncentiveApiModels.Requests;
using LCU.API.Internal.Operations.IncentiveApi.Services.MicroApiServices; using LCU.API.Internal.Operations.IncentiveApi.Services.MicroApiServices;
using LCU.Library.Internal.ApiResponse.Services; using LCU.Library.Internal.ApiResponse.Services;
using LCU.Library.Internal.Exceptions;
using LCU.Library.Internal.IncentiveApiModels.Results; using LCU.Library.Internal.IncentiveApiModels.Results;
namespace LCU.API.Internal.Operations.IncentiveApi.Services; namespace LCU.API.Internal.Operations.IncentiveApi.Services;
@@ -162,11 +161,13 @@ public class GoalDispersalService : IGoalDispersalService
catch (Exception exception) catch (Exception exception)
{ {
Log.Fatal(exception, "There was an Unhandled error Executing Month Start Dispersal"); Log.Fatal(exception, "There was an Unhandled error Executing Month Start Dispersal");
var message = $"There was an issue with handling the Goal Dispersal Service Process {request.StartDate.Month}{request.StartDate.Year}. Exception Message: {exception.Message}."; var processLabel = request == null
? "unknown"
: $"{request.StartDate.Month}{request.StartDate.Year}";
var message = $"There was an issue with handling the Goal Dispersal Service Process {processLabel}. Exception Message: {exception.Message}.";
_goalDispersalProcessResult.MessageStack.Add(message); _goalDispersalProcessResult.MessageStack.Add(message);
_goalDispersalProcessResult.Success = false; _goalDispersalProcessResult.Success = false;
await QueueReturnResponse.QueueResponse(request, _goalDispersalProcessResult.Success, _goalDispersalProcessResult.MessageStack); await QueueReturnResponse.QueueResponse(request, _goalDispersalProcessResult.Success, _goalDispersalProcessResult.MessageStack);
throw new ServiceException(message);
} }
} }
@@ -3,7 +3,6 @@ using LCU.Library.Internal.IncentiveApiModels.Results;
using LCU.Library.Internal.LCUServiceFactory.Services; using LCU.Library.Internal.LCUServiceFactory.Services;
using LCU.API.Internal.Operations.IncentiveApi.Services.NightlyIncentiveProcesses; using LCU.API.Internal.Operations.IncentiveApi.Services.NightlyIncentiveProcesses;
using LCU.Library.Internal.ApiResponse.Services; using LCU.Library.Internal.ApiResponse.Services;
using LCU.Library.Internal.Exceptions;
namespace LCU.API.Internal.Operations.IncentiveApi.Services.NightlyDecisionServices; namespace LCU.API.Internal.Operations.IncentiveApi.Services.NightlyDecisionServices;
@@ -40,7 +39,6 @@ public class NightlyActivityDecisionService : INightlyActivityDecisionService
_processResult.MessageStack.Add(message); _processResult.MessageStack.Add(message);
_processResult.Success = false; _processResult.Success = false;
await QueueReturnResponse.QueueResponse(request, _processResult.Success, _processResult.MessageStack); await QueueReturnResponse.QueueResponse(request, _processResult.Success, _processResult.MessageStack);
throw new ServiceException(message);
} }
} }
} }
@@ -5,7 +5,6 @@ using LCU.Library.Internal.IncentiveApiModels.Entities;
using LCU.Library.Internal.IncentiveApiModels.Common; using LCU.Library.Internal.IncentiveApiModels.Common;
using LCU.Library.Internal.IncentiveApiModels.Requests; using LCU.Library.Internal.IncentiveApiModels.Requests;
using LCU.Library.Internal.ApiResponse.Services; using LCU.Library.Internal.ApiResponse.Services;
using LCU.Library.Internal.Exceptions;
using ProcessResult = LCU.Library.Internal.IncentiveApiModels.Results.ProcessResult; using ProcessResult = LCU.Library.Internal.IncentiveApiModels.Results.ProcessResult;
namespace LCU.API.Internal.Operations.IncentiveApi.Services.Payout; namespace LCU.API.Internal.Operations.IncentiveApi.Services.Payout;
@@ -46,11 +45,11 @@ public class PayoutService : IPayoutService
catch (Exception exception) catch (Exception exception)
{ {
Log.Fatal(exception, "There was an Unhandled error with Monthly Incentive Payout Process"); Log.Fatal(exception, "There was an Unhandled error with Monthly Incentive Payout Process");
var message = $"There was an Unhandled error with Monthly Incentive Payout Process from {request.MonthsBack} months back from today's date. Exception Message: {exception.Message}."; var monthsBack = request?.MonthsBack.ToString() ?? "unknown";
var message = $"There was an Unhandled error with Monthly Incentive Payout Process from {monthsBack} months back from today's date. Exception Message: {exception.Message}.";
_payoutIncentiveProcessResult.MessageStack.Add(message); _payoutIncentiveProcessResult.MessageStack.Add(message);
_payoutIncentiveProcessResult.Success = false; _payoutIncentiveProcessResult.Success = false;
await QueueReturnResponse.QueueResponse(request, _payoutIncentiveProcessResult.Success, _payoutIncentiveProcessResult.MessageStack); await QueueReturnResponse.QueueResponse(request, _payoutIncentiveProcessResult.Success, _payoutIncentiveProcessResult.MessageStack);
throw new ServiceException(message);
} }
} }
@@ -4,7 +4,6 @@ using LCU.Library.Internal.IncentiveApiModels.Common;
using LCU.Library.Internal.IncentiveApiModels.Requests; using LCU.Library.Internal.IncentiveApiModels.Requests;
using LCU.Library.Internal.IncentiveApiModels.Results; using LCU.Library.Internal.IncentiveApiModels.Results;
using LCU.Library.Internal.ApiResponse.Services; using LCU.Library.Internal.ApiResponse.Services;
using LCU.Library.Internal.Exceptions;
namespace LCU.API.Internal.Operations.IncentiveApi.Services.Reporting; namespace LCU.API.Internal.Operations.IncentiveApi.Services.Reporting;
@@ -40,7 +39,6 @@ public class ReportingService : IReportingService
_reportingProcessResult.MessageStack.Add(message); _reportingProcessResult.MessageStack.Add(message);
_reportingProcessResult.Success = false; _reportingProcessResult.Success = false;
await QueueReturnResponse.QueueResponse(request, _reportingProcessResult.Success, _reportingProcessResult.MessageStack); await QueueReturnResponse.QueueResponse(request, _reportingProcessResult.Success, _reportingProcessResult.MessageStack);
throw new ServiceException(message);
} }
} }
} }
@@ -59,7 +59,6 @@ public class ImportCreditCardSalesService : IImportCreditCardSalesService
_importCreditCardResult.MessageStack.Add(message); _importCreditCardResult.MessageStack.Add(message);
_importCreditCardResult.Success = false; _importCreditCardResult.Success = false;
await QueueReturnResponse.QueueResponse(request, _importCreditCardResult.Success, _importCreditCardResult.MessageStack); await QueueReturnResponse.QueueResponse(request, _importCreditCardResult.Success, _importCreditCardResult.MessageStack);
throw new ServiceException(message);
} }
} }
@@ -48,7 +48,6 @@ public class ImportIndirectVehicleSalesService : IImportIndirectVehicleSalesServ
_importIndirectVehicleSalesResult.MessageStack.Add(message); _importIndirectVehicleSalesResult.MessageStack.Add(message);
_importIndirectVehicleSalesResult.Success = false; _importIndirectVehicleSalesResult.Success = false;
await QueueReturnResponse.QueueResponse(request, _importIndirectVehicleSalesResult.Success, _importIndirectVehicleSalesResult.MessageStack); await QueueReturnResponse.QueueResponse(request, _importIndirectVehicleSalesResult.Success, _importIndirectVehicleSalesResult.MessageStack);
throw new ServiceException(message);
} }
} }