Skip to content

Commit 406c47a

Browse files
committed
feat: Enhance POD upload handling and reporting
- Added exclusion logic for invoice creators in GetInvoiceByDocNum and GetInvoicesByCustomer handlers. - Updated GetPodUploadStatusHandler to filter invoices based on creator exclusions. - Implemented validation for bulk PODs to account for creator exclusions. - Modified CreateUser and UpdateUser handlers to require assigned sections for Driver and PodOperator roles. - Introduced new GetPodUploadReport feature with query, handler, and validation. - Added PodInvoiceCreatorLocations to manage user location mappings. - Enhanced SAPServiceLayerClient to include UserSign in invoice queries. - Updated appsettings.json to configure rate limits for POD uploads. - Created Repair-PodUploadAuditAttribution script for auditing and repairing mismatched user roles in POD uploads.
1 parent 1aa547f commit 406c47a

136 files changed

Lines changed: 31317 additions & 3346 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

ShopInventory.Web/Common/AssignedSectionOptions.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ public static class AssignedSectionOptions
1212
public static string[] All { get; } =
1313
[
1414
"Cheeseman",
15+
"Cheeseman DC Richwell",
16+
"Cheeseman DC Vic Falls",
1517
"Factory",
1618
"Graniteside",
1719
"Machipisa",

ShopInventory.Web/Components/Pages/ApiExplorer.razor

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -873,33 +873,38 @@ new("GET", "/api/revmax/receipt/{receiptId}", "Get fiscal receipt")
873873

874874
var content = await response.Content.ReadAsStringAsync();
875875

876-
// Try to format JSON
877-
try
878-
{
879-
var jsonDoc = JsonDocument.Parse(content);
880-
_responseBody = JsonSerializer.Serialize(jsonDoc, new JsonSerializerOptions { WriteIndented = true });
881-
}
882-
catch
883-
{
884-
_responseBody = content;
885-
}
886-
887876
if (response.IsSuccessStatusCode)
888877
{
878+
try
879+
{
880+
var jsonDoc = JsonDocument.Parse(content);
881+
_responseBody = JsonSerializer.Serialize(jsonDoc, new JsonSerializerOptions { WriteIndented = true });
882+
}
883+
catch
884+
{
885+
_responseBody = content;
886+
}
887+
889888
Snackbar.Add($"Request successful ({_responseStatus})", Severity.Success);
890889
}
891890
else
892891
{
893-
Snackbar.Add($"Request failed ({_responseStatus})", Severity.Warning);
892+
_responseBody = ShopInventory.Web.Services.ApiErrorResponse.GetFriendlyMessage(
893+
response.StatusCode,
894+
content,
895+
"Request failed.");
896+
Snackbar.Add(_responseBody, Severity.Warning);
894897
}
895898
}
896899
catch (Exception ex)
897900
{
898901
stopwatch.Stop();
899902
_responseTime = stopwatch.ElapsedMilliseconds;
900903
_responseStatus = 0;
901-
_responseBody = $"Error: {ex.Message}";
902-
Snackbar.Add($"Request error: {ex.Message}", Severity.Error);
904+
_responseBody = ShopInventory.Web.Services.ApiErrorResponse.GetFriendlyMessage(
905+
ex,
906+
"Request failed.");
907+
Snackbar.Add(_responseBody, Severity.Error);
903908
}
904909
finally
905910
{

0 commit comments

Comments
 (0)