Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions TransactionProcessing.MerchantFileProcessor/Program.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
using ClientProxyBase;
using FileProcessor.Client;
using HealthChecks.UI.Client;
using Microsoft.AspNetCore.Diagnostics.HealthChecks;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using NLog;
using NLog.Extensions.Logging;
using SecurityService.Client;
using Shared.Monitoring;
using Shared.Serialisation;
using TransactionProcessing.MerchantFileProcessor;
using TransactionProcessing.MerchantFileProcessor.Clients;
Expand Down Expand Up @@ -42,6 +45,7 @@
.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
.AddJsonFile($"appsettings.{builder.Environment.EnvironmentName}.json", optional: true, reloadOnChange: true)
.AddJsonFile("merchant-processing.bootstrap.json", optional: true, reloadOnChange: true)
.AddJsonFile("C:\\home\\txnproc\\config\\merchant-processing.bootstrap.local.json", optional: true, reloadOnChange: true)
.AddJsonFile("hosting.json", optional: true, reloadOnChange: true)
.AddEnvironmentVariables()
.AddCommandLine(args);
Expand Down Expand Up @@ -125,6 +129,9 @@
builder.Services.AddSingleton(serialiserSettings);
builder.Services.AddSingleton<IOperationsDashboardService, OperationsDashboardService>();

builder.Services.AddHealthChecks();
builder.Services.AddUptimeKuma();

var app = builder.Build();

using (var scope = app.Services.CreateScope())
Expand Down Expand Up @@ -156,6 +163,27 @@
app.MapConfigurationManagementEndpoints();
app.MapRazorComponents<App>();

app.MapHealthChecks("health",
new HealthCheckOptions
{
Predicate = _ => true,
ResponseWriter = Shared.HealthChecks.HealthCheckMiddleware.WriteResponse
});
app.MapHealthChecks("healthui",
new HealthCheckOptions
{
Predicate = _ => true,
ResponseWriter = UIResponseWriter.WriteHealthCheckUIResponse
});

app.Lifetime.ApplicationStarted.Register(() =>
{
app.RegisterWithUptimeKumaAsync()
.GetAwaiter()
.GetResult();
});


await app.RunAsync();
}
catch (Exception ex)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,17 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FileProcessor.Client" Version="2026.8.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="10.0.11" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="10.0.11" />
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="10.0.11" />
<PackageReference Include="FileProcessor.Client" Version="2026.9.2.153" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="10.0.12" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="10.0.12" />
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="10.0.12" />
<PackageReference Include="NLog.Extensions.Logging" Version="6.2.0" />
<PackageReference Include="SecurityService.Client" Version="2026.8.1" />
<PackageReference Include="Shared" Version="2026.8.3" />
<PackageReference Include="Shared.Logger" Version="2026.8.3" />
<PackageReference Include="Shared.Results" Version="2026.8.3" />
<PackageReference Include="TransactionProcessor.Client" Version="2026.8.1" />
<PackageReference Include="SecurityService.Client" Version="2026.9.2.179" />
<PackageReference Include="Shared" Version="2026.9.4" />
<PackageReference Include="Shared.Logger" Version="2026.9.4" />
<PackageReference Include="Shared.Results" Version="2026.9.4" />
<PackageReference Include="TransactionProcessor.Client" Version="2026.9.2.398" />
<PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="9.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
9 changes: 8 additions & 1 deletion TransactionProcessing.MerchantFileProcessor/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,15 @@
"EnableEfCoreCommandTrace": false,
"EnableHttpClientTrace": false
},
"UptimeKuma": {
"Monitor": {
"Name": "Merchant File Processor",
"Url": "http://localhost:9601/health",
"IntervalInSeconds": 60
}
},
"ConnectionStrings": {
"MerchantFileProcessor": "merchant-file-processor.db"
"MerchantFileProcessor": ""

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve a default file-processor connection string

When no machine-local override or environment variable has been provisioned, this empty value makes every fresh or local installation terminate in Program.cs at the explicit string.IsNullOrWhiteSpace(configuredConnectionString) check, before the health endpoint can start. The staging and production deployment jobs in .github/workflows/pushtomain.yml and .github/workflows/createrelease.yml only unpack and start the service and do not inject this setting, whereas the previous merchant-file-processor.db default allowed such installations to boot; retain a usable default or have those deployment paths supply the required value.

Useful? React with 👍 / 👎.

},
"ApiConfiguration": {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"MerchantProcessing": {
"Authentication": {
"ClientId": "serviceClient",
"ClientSecret": ""
"ClientSecret": "Test"
},
"FileProcessing": {
"UserId": "a51791a8-2731-490c-a8ac-639461f2a41f"
Expand Down Expand Up @@ -124,18 +124,6 @@
}
]
}
],
"Merchants": [
{
"Name": "Test Merchant 1",
"EstateId": "435613ac-a468-47a3-ac4f-649d89764c22",
"MerchantId": "ab1c99fb-1c6c-4694-9a32-b71be5d1da33",
"RunTimesUtc": [
"09:02:00",
"15:02:00"
],
"Enabled": true
}
]
}
}
26 changes: 24 additions & 2 deletions TransactionProcessing.MerchantPos/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
using SecurityService.Client;
using Shared.Serialisation;
using System.Text.Json;
using HealthChecks.UI.Client;
using Microsoft.AspNetCore.Diagnostics.HealthChecks;
using Shared.Monitoring;
using TransactionProcessing.MerchantPos.Persistence;
using TransactionProcessing.MerchantPos.Runtime;
using TransactionProcessor.Client;
Expand Down Expand Up @@ -92,7 +95,8 @@
});

builder.Services.AddHealthChecks();

builder.Services.AddUptimeKuma();

var app = builder.Build();

using (var scope = app.Services.CreateScope())
Expand All @@ -117,7 +121,25 @@
Results.Json(await factory.BuildAsync()));

app.MapRazorPages();
app.MapHealthChecks("/health");
app.MapHealthChecks("health",
new HealthCheckOptions
{
Predicate = _ => true,
ResponseWriter = Shared.HealthChecks.HealthCheckMiddleware.WriteResponse
});
app.MapHealthChecks("healthui",
new HealthCheckOptions
{
Predicate = _ => true,
ResponseWriter = UIResponseWriter.WriteHealthCheckUIResponse
});

app.Lifetime.ApplicationStarted.Register(() =>
{
app.RegisterWithUptimeKumaAsync()
.GetAwaiter()
.GetResult();
});

await app.RunAsync();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@
<None Include="appsettings.development.json" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="10.0.11" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="10.0.11" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="10.0.11" />
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="10.0.12" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="10.0.12" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="10.0.12" />
<PackageReference Include="NLog.Web.AspNetCore" Version="6.2.0" />
<PackageReference Include="SecurityService.Client" Version="2026.8.1" />
<PackageReference Include="Shared" Version="2026.8.3" />
<PackageReference Include="Shared.Logger" Version="2026.8.3" />
<PackageReference Include="TransactionProcessor.Client" Version="2026.8.1" />
<PackageReference Include="TransactionProcessorACL.DataTransferObjects" Version="2026.8.1" />
<PackageReference Include="SecurityService.Client" Version="2026.9.2.179" />
<PackageReference Include="Shared" Version="2026.9.4" />
<PackageReference Include="Shared.Logger" Version="2026.9.4" />
<PackageReference Include="TransactionProcessor.Client" Version="2026.9.2.398" />
<PackageReference Include="TransactionProcessorACL.DataTransferObjects" Version="2026.9.2.157" />
<PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="9.0.0"/>
</ItemGroup>
<ItemGroup>
<Content Update="hosting.json">
Expand Down
7 changes: 7 additions & 0 deletions TransactionProcessing.MerchantPos/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"UptimeKuma": {
"Monitor": {
"Name": "Merchant POS",
"Url": "http://localhost:9600/health",
"IntervalInSeconds": 60
}
}
}

Loading