From bcd26a256633ecbf80f0c0994f975d716dd28bdb Mon Sep 17 00:00:00 2001 From: KKAYFISH Date: Thu, 26 Oct 2023 09:12:16 -0700 Subject: [PATCH] EMBCESSMOD-4682: Updated schedule to SAT-SUN and added epoch date for invoices missing supplier numbers --- .../Events/ReconcileInvoiceDataBackgroundTask.cs | 2 +- .../API/EMBC.ESS/Resources/Payments/PaymentRepository.cs | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ess/src/API/EMBC.ESS/Managers/Events/ReconcileInvoiceDataBackgroundTask.cs b/ess/src/API/EMBC.ESS/Managers/Events/ReconcileInvoiceDataBackgroundTask.cs index b687fb279..8a6ff36e1 100644 --- a/ess/src/API/EMBC.ESS/Managers/Events/ReconcileInvoiceDataBackgroundTask.cs +++ b/ess/src/API/EMBC.ESS/Managers/Events/ReconcileInvoiceDataBackgroundTask.cs @@ -10,7 +10,7 @@ public class ReconcileInvoiceDataBackgroundTask : IBackgroundTask { private readonly EventsManager eventsManager; - public string Schedule => "0 */10 13-3 * * MON-FRI"; //Every 10 minutes, between 06:00 AM and 08:59 PM, Monday through Friday + public string Schedule => "0 */10 13-3 * * SAT-SUN"; //Every 10 minutes, between 06:00 AM and 08:59 PM, Saturday and Sunday public int DegreeOfParallelism => 1; diff --git a/ess/src/API/EMBC.ESS/Resources/Payments/PaymentRepository.cs b/ess/src/API/EMBC.ESS/Resources/Payments/PaymentRepository.cs index 2f30d746c..be89bd1be 100644 --- a/ess/src/API/EMBC.ESS/Resources/Payments/PaymentRepository.cs +++ b/ess/src/API/EMBC.ESS/Resources/Payments/PaymentRepository.cs @@ -147,6 +147,15 @@ private async Task Handle(ReconcileEtransferRequest await ctx.SaveChangesAsync(ct); } } + else + { + //No Valid Supplier/SiteNumber + //SET to epoch date to flag records. This will prevent it from being picked up again + payment.era_invoicedate = new DateTime(2999, 12, 31); + //Save the data + ctx.UpdateObject(payment); + await ctx.SaveChangesAsync(ct); + } } } ctx.DetachAll();