Added MidrandBooks project

This commit is contained in:
Khwezi Mngoma
2026-05-24 13:38:47 +02:00
parent 70c6e0bfbc
commit f67f5eaf53
17 changed files with 241 additions and 46 deletions
@@ -1,35 +0,0 @@
using LiteCharms.Features.HealthChecks;
using static LiteCharms.Features.Extensions.Postgres;
namespace LiteCharms.Features.Extensions;
public static class HealthChecks
{
public static IServiceCollection AddMidrandShopQuartzHealthCheck(this IServiceCollection services)
{
services.AddHealthChecks().AddCheck<MidrandShopQuartzHealthCheck>("MidrandShopQuartz");
return services;
}
public static IServiceCollection AddMidrandShopPostgresHealthCheck(this IServiceCollection services)
{
services.AddHealthChecks().AddCheck<PostgresMidrandShopHealthCheck>(MidrandShopDbConfigName);
return services;
}
public static IServiceCollection AddHealthChecksSupport(this IServiceCollection services, IConfiguration configuration)
{
services.AddHealthChecks()
.AddCheck("Self", () => HealthCheckResult.Healthy());
//services.AddHealthChecksUI(setup =>
//{
// setup.AddHealthCheckEndpoint("Lead Generator", $"{configuration["ASPNETCORE_URLS"]}/health");
// setup.SetEvaluationTimeInSeconds(15);
//}).AddInMemoryStorage(databaseName: "healthuidb");
return services;
}
}
+1 -12
View File
@@ -1,17 +1,6 @@
using LiteCharms.Features.MidrandShop.Postgres;
namespace LiteCharms.Features.Extensions;
namespace LiteCharms.Features.Extensions;
public static class Postgres
{
public const string MidrandShopDbConfigName = "PostgresMidrandShop";
public const string SchedulerDbConfigName = "PostgresScheduler";
public static IServiceCollection AddMidrandShopDatabase(this IServiceCollection services, IConfiguration configuration)
{
services.AddPooledDbContextFactory<MidrandShopDbContext>(options =>
options.UseNpgsql(configuration.GetConnectionString(MidrandShopDbConfigName)));
return services;
}
}
+2 -2
View File
@@ -6,8 +6,8 @@ namespace LiteCharms.Features.Extensions;
public static class Quartz
{
public const string ShopSchedulerName = "shop";
public const string MidrandShopSchedulerName = "midrandshop";
public const string TechShopSchedulerName = "tech-shop";
public const string MidrandShopSchedulerName = "midrand-shop";
public static IServiceCollection AddQuartzSchedulerClient(this IServiceCollection services, string schedulerName, IConfiguration configuration)
{