diff --git a/README.md b/README.md index e333b7f..22606e6 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ dotnet build Confirm tests are passing locally ```sh dotnet test -``` +``` ```sh docker compose up --build -d diff --git a/docker-compose.yaml b/docker-compose.yaml index c0d8c99..c52507a 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,5 +1,6 @@ services: web: + profiles: [web, all] container_name: cypd_web build: context: ./src @@ -10,7 +11,7 @@ environment: - ASPNETCORE_ENVIRONMENT=${ASPNETCORE_ENVIRONMENT:-Development} - ASPNETCORE_URLS=http://+:8080 - - ConnectionStrings__Postgres=${POSTGRES_CONNECTION_STRING:-Host=db;Database=helloworld;Username=postgres;Password=postgres} + - ConnectionStrings__Postgres=${POSTGRES_CONNECTION_STRING:-Host=db;Database=cypd;Username=postgres;Password=postgres} - ConnectionStrings__AzureStorage=${AZURE_STORAGE_CONNECTION_STRING:-DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;QueueEndpoint=http://azurite:10001/devstoreaccount1;} - DfeSignIn__BaseUrl=${DFESIGNIN_BASEURL:-https://test-api.signin.education.gov.uk/} - DfeSignIn__ClientId=${DFESIGNIN_CLIENTID} @@ -24,6 +25,7 @@ - azurite rules_engine: + profiles: [rules_engine, all] container_name: cypd_rules_engine build: context: ./src @@ -52,7 +54,7 @@ container_name: cypd_db image: postgres:16 environment: - - POSTGRES_DB=helloworld + - POSTGRES_DB=cypd - POSTGRES_USER=postgres - POSTGRES_PASSWORD=postgres ports: diff --git a/src/DfE.CheckPerformanceData.Application/ClaimsEnrichment/IClaimsEnrichmentService.cs b/src/DfE.CheckPerformanceData.Application/ClaimsEnrichment/IClaimsEnrichmentService.cs new file mode 100644 index 0000000..c89aa25 --- /dev/null +++ b/src/DfE.CheckPerformanceData.Application/ClaimsEnrichment/IClaimsEnrichmentService.cs @@ -0,0 +1,34 @@ +using System.Security.Claims; +using System.Text.Json.Nodes; +using DfE.CheckPerformanceData.Application.DfESignInApiClient; + +namespace DfE.CheckPerformanceData.Application.ClaimsEnrichment; + +public interface IClaimsEnrichmentService +{ + Task EnrichAsync(ClaimsIdentity identity); +} + + +public class ClaimsEnrichmentService: IClaimsEnrichmentService +{ + private readonly IDfESignInApiClient _apiClient; + + public ClaimsEnrichmentService(IDfESignInApiClient apiClient) + { + _apiClient = apiClient; + } + public async Task EnrichAsync(ClaimsIdentity identity) + { + var userid = identity.FindFirst(ClaimTypes.NameIdentifier)?.Value; + + var orgJson = identity.FindFirst("organisation")?.Value ?? "{}"; + var org = JsonNode.Parse(orgJson); + var orgId = org["id"]?.ToString() ?? string.Empty; + + var organisation = await _apiClient.GetOrganisationAsync(userid, orgId); + + identity.AddClaim(new Claim("low_age", organisation.StatutoryLowAge.ToString())); + identity.AddClaim(new Claim("high_age", organisation.StatutoryHighAge.ToString())); + } +} \ No newline at end of file diff --git a/src/DfE.CheckPerformanceData.Application/DfESignInApiClient/OrganisationDto.cs b/src/DfE.CheckPerformanceData.Application/DfESignInApiClient/OrganisationDto.cs index 9949d57..80b442f 100644 --- a/src/DfE.CheckPerformanceData.Application/DfESignInApiClient/OrganisationDto.cs +++ b/src/DfE.CheckPerformanceData.Application/DfESignInApiClient/OrganisationDto.cs @@ -1,3 +1,5 @@ +using System.Text.Json.Serialization; + namespace DfE.CheckPerformanceData.Application.DfESignInApiClient; public class OrganisationDto @@ -18,6 +20,9 @@ public class OrganisationDto public int? StatutoryHighAge { get; init; } public string? LegacyId { get; init; } public string? CompanyRegistrationNumber { get; init; } + + [JsonIgnore] + public string? LAESTAB { get; set; } } diff --git a/src/DfE.CheckPerformanceData.Application/IPortalDbContext.cs b/src/DfE.CheckPerformanceData.Application/IPortalDbContext.cs index e2cc0b0..6fbbeb7 100644 --- a/src/DfE.CheckPerformanceData.Application/IPortalDbContext.cs +++ b/src/DfE.CheckPerformanceData.Application/IPortalDbContext.cs @@ -5,6 +5,6 @@ namespace DfE.CheckPerformanceData.Application; public interface IPortalDbContext { - DbSet Workflows { get; } + DbSet CheckingWindows { get; } Task SaveChangesAsync(CancellationToken cancellationToken = default); } \ No newline at end of file diff --git a/src/DfE.CheckPerformanceData.Domain/Entities/CheckingWindow.cs b/src/DfE.CheckPerformanceData.Domain/Entities/CheckingWindow.cs new file mode 100644 index 0000000..70f23ac --- /dev/null +++ b/src/DfE.CheckPerformanceData.Domain/Entities/CheckingWindow.cs @@ -0,0 +1,17 @@ +namespace DfE.CheckPerformanceData.Domain.Entities; + +public class CheckingWindow +{ + public int Id { get; set; } + public DateTime StartDate { get; set; } + public DateTime EndDate { get; set; } + public OrganisationTypes OrganisationType { get; set; } + public string Title { get; set; } +} + +public enum OrganisationTypes +{ + KS2, //3-11 + KS4, //11-16 + Post16 //16-18 +} \ No newline at end of file diff --git a/src/DfE.CheckPerformanceData.Domain/Entities/Workflow.cs b/src/DfE.CheckPerformanceData.Domain/Entities/Workflow.cs deleted file mode 100644 index f4b4807..0000000 --- a/src/DfE.CheckPerformanceData.Domain/Entities/Workflow.cs +++ /dev/null @@ -1,8 +0,0 @@ - -namespace DfE.CheckPerformanceData.Domain.Entities; - -public class Workflow -{ - public int Id { get; set; } - public string Name { get; set; } -} \ No newline at end of file diff --git a/src/DfE.CheckPerformanceData.Infrastructure/DfE.CheckPerformanceData.Infrastructure.csproj b/src/DfE.CheckPerformanceData.Infrastructure/DfE.CheckPerformanceData.Infrastructure.csproj index 594a606..721156e 100644 --- a/src/DfE.CheckPerformanceData.Infrastructure/DfE.CheckPerformanceData.Infrastructure.csproj +++ b/src/DfE.CheckPerformanceData.Infrastructure/DfE.CheckPerformanceData.Infrastructure.csproj @@ -24,8 +24,4 @@ - - - - diff --git a/src/DfE.CheckPerformanceData.Infrastructure/DfeSignIn/DfeSignInAuthExtensions.cs b/src/DfE.CheckPerformanceData.Infrastructure/DfeSignIn/DfeSignInAuthExtensions.cs index cad4519..31dd4a5 100644 --- a/src/DfE.CheckPerformanceData.Infrastructure/DfeSignIn/DfeSignInAuthExtensions.cs +++ b/src/DfE.CheckPerformanceData.Infrastructure/DfeSignIn/DfeSignInAuthExtensions.cs @@ -1,4 +1,6 @@ -using DfE.CheckPerformanceData.Infrastructure.DfeSignInApiClient; +using System.Security.Claims; +using DfE.CheckPerformanceData.Application.ClaimsEnrichment; +using DfE.CheckPerformanceData.Infrastructure.DfeSignInApiClient; using Microsoft.AspNetCore.Authentication.Cookies; using Microsoft.AspNetCore.Authentication.OpenIdConnect; using Microsoft.Extensions.Configuration; @@ -55,7 +57,20 @@ public static IServiceCollection AddDfeSignInAuthentication(this IServiceCollect { //ctx.HttpContext.Response.Headers.Add("Cache-Control", "no-store"); return Task.CompletedTask; - }; + }; + + options.Events.OnUserInformationReceived = ctx => + { + return Task.CompletedTask; + }; + + options.Events.OnTokenValidated = async ctx => + { + var enrichmentService = ctx.HttpContext.RequestServices + .GetRequiredService(); + + await enrichmentService.EnrichAsync((ClaimsIdentity)ctx.Principal!.Identity!); + }; }); return services; diff --git a/src/DfE.CheckPerformanceData.Infrastructure/DfeSignInApiClient/DfeSignInApiClient.cs b/src/DfE.CheckPerformanceData.Infrastructure/DfeSignInApiClient/DfeSignInApiClient.cs index 29220ea..2a5d058 100644 --- a/src/DfE.CheckPerformanceData.Infrastructure/DfeSignInApiClient/DfeSignInApiClient.cs +++ b/src/DfE.CheckPerformanceData.Infrastructure/DfeSignInApiClient/DfeSignInApiClient.cs @@ -1,4 +1,6 @@ using System.Net.Http.Json; +using System.Text.Json; +using System.Text.Json.Serialization; using DfE.CheckPerformanceData.Application.DfESignInApiClient; namespace DfE.CheckPerformanceData.Infrastructure.DfeSignInApiClient; @@ -14,8 +16,38 @@ public DfeSignInApiClient(HttpClient httpClient) public async Task GetOrganisationAsync(string userId, string organisationId) { - var userOrganisations = await _httpClient.GetFromJsonAsync>($"users/{userId}/organisations"); + //var organisationsJson = await _httpClient.GetStringAsync($"users/{userId}/organisations"); + var userOrganisations = await _httpClient.GetFromJsonAsync>($"users/{userId}/organisations", + new JsonSerializerOptions() + { + Converters = { new OrganisationDtoJsonConverter() } + }); return userOrganisations?.FirstOrDefault(o => o.Id == organisationId); } +} + +public class OrganisationDtoJsonConverter : JsonConverter +{ + public override OrganisationDto Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + using var document = JsonDocument.ParseValue(ref reader); + var root = document.RootElement; + + var dto = JsonSerializer.Deserialize(root.GetRawText(), new JsonSerializerOptions() { PropertyNameCaseInsensitive = true }); + + + if (root.TryGetProperty("localAuthority", out var localAuthorityElement)) + { + var orgCode = localAuthorityElement.GetProperty("code").GetString(); + var orgId = root.GetProperty("establishmentNumber").GetString(); + + dto.LAESTAB = $"{orgCode}{orgId}"; + } + + return dto; + } + + public override void Write(Utf8JsonWriter writer, OrganisationDto value, JsonSerializerOptions options) => + throw new NotImplementedException(); } \ No newline at end of file diff --git a/src/DfE.CheckPerformanceData.Infrastructure/Migrations/20260331100046_InitialCreate.Designer.cs b/src/DfE.CheckPerformanceData.Infrastructure/Migrations/20260331100046_InitialCreate.Designer.cs new file mode 100644 index 0000000..6029338 --- /dev/null +++ b/src/DfE.CheckPerformanceData.Infrastructure/Migrations/20260331100046_InitialCreate.Designer.cs @@ -0,0 +1,56 @@ +// +using System; +using DfE.CheckPerformanceData.Infrastructure.Persistence; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +#nullable disable + +namespace DfE.CheckPerformanceData.Infrastructure.Migrations +{ + [DbContext(typeof(PortalDbContext))] + [Migration("20260331100046_InitialCreate")] + partial class InitialCreate + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "10.0.5") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("DfE.CheckPerformanceData.Domain.Entities.CheckingWindow", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("EndDate") + .HasColumnType("timestamp with time zone"); + + b.Property("OrganisationType") + .HasColumnType("integer"); + + b.Property("StartDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Title") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("CheckingWindows"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/DfE.CheckPerformanceData.Infrastructure/Migrations/20260331100046_InitialCreate.cs b/src/DfE.CheckPerformanceData.Infrastructure/Migrations/20260331100046_InitialCreate.cs new file mode 100644 index 0000000..addf8f7 --- /dev/null +++ b/src/DfE.CheckPerformanceData.Infrastructure/Migrations/20260331100046_InitialCreate.cs @@ -0,0 +1,39 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +#nullable disable + +namespace DfE.CheckPerformanceData.Infrastructure.Migrations +{ + /// + public partial class InitialCreate : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "CheckingWindows", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + StartDate = table.Column(type: "timestamp with time zone", nullable: false), + EndDate = table.Column(type: "timestamp with time zone", nullable: false), + OrganisationType = table.Column(type: "integer", nullable: false), + Title = table.Column(type: "text", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_CheckingWindows", x => x.Id); + }); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "CheckingWindows"); + } + } +} diff --git a/src/DfE.CheckPerformanceData.Infrastructure/Migrations/PortalDbContextModelSnapshot.cs b/src/DfE.CheckPerformanceData.Infrastructure/Migrations/PortalDbContextModelSnapshot.cs new file mode 100644 index 0000000..6106f74 --- /dev/null +++ b/src/DfE.CheckPerformanceData.Infrastructure/Migrations/PortalDbContextModelSnapshot.cs @@ -0,0 +1,53 @@ +// +using System; +using DfE.CheckPerformanceData.Infrastructure.Persistence; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +#nullable disable + +namespace DfE.CheckPerformanceData.Infrastructure.Migrations +{ + [DbContext(typeof(PortalDbContext))] + partial class PortalDbContextModelSnapshot : ModelSnapshot + { + protected override void BuildModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "10.0.5") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("DfE.CheckPerformanceData.Domain.Entities.CheckingWindow", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("EndDate") + .HasColumnType("timestamp with time zone"); + + b.Property("OrganisationType") + .HasColumnType("integer"); + + b.Property("StartDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Title") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("CheckingWindows"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/DfE.CheckPerformanceData.Infrastructure/Persistence/PortalDbContext.cs b/src/DfE.CheckPerformanceData.Infrastructure/Persistence/PortalDbContext.cs index aef69fe..2c96531 100644 --- a/src/DfE.CheckPerformanceData.Infrastructure/Persistence/PortalDbContext.cs +++ b/src/DfE.CheckPerformanceData.Infrastructure/Persistence/PortalDbContext.cs @@ -6,5 +6,5 @@ namespace DfE.CheckPerformanceData.Infrastructure.Persistence; public class PortalDbContext(DbContextOptions options) : DbContext(options), IPortalDbContext { - public DbSet Workflows => Set(); + public DbSet CheckingWindows => Set(); } \ No newline at end of file diff --git a/src/DfE.CheckPerformanceData.Infrastructure/Seeding/DevDataSeeder.cs b/src/DfE.CheckPerformanceData.Infrastructure/Seeding/DevDataSeeder.cs new file mode 100644 index 0000000..14fc13b --- /dev/null +++ b/src/DfE.CheckPerformanceData.Infrastructure/Seeding/DevDataSeeder.cs @@ -0,0 +1,35 @@ +using DfE.CheckPerformanceData.Application; +using DfE.CheckPerformanceData.Domain.Entities; +using Microsoft.EntityFrameworkCore; + +namespace DfE.CheckPerformanceData.Infrastructure.Seeding; + +public class DevDataSeeder(IPortalDbContext dbContext) +{ + public async Task SeedAsync() + { + if (await dbContext.CheckingWindows.AnyAsync()) + return; + + await dbContext.CheckingWindows.AddRangeAsync( + new CheckingWindow() + { + Id = 1, + StartDate = DateTime.UtcNow.AddDays(-1), + EndDate = DateTime.UtcNow.AddDays(+13), + OrganisationType = OrganisationTypes.KS4, + Title = "KS4 June" + }, + new CheckingWindow() + { + Id = 2, + StartDate = DateTime.UtcNow.AddDays(-3), + EndDate = DateTime.UtcNow.AddDays(+11), + OrganisationType = OrganisationTypes.KS2, + Title = "KS2" + } + ); + + await dbContext.SaveChangesAsync(); + } +} \ No newline at end of file diff --git a/src/DfE.CheckPerformanceData.Web/Controllers/SecretController.cs b/src/DfE.CheckPerformanceData.Web/Controllers/SecretController.cs index ac478f1..b26e587 100644 --- a/src/DfE.CheckPerformanceData.Web/Controllers/SecretController.cs +++ b/src/DfE.CheckPerformanceData.Web/Controllers/SecretController.cs @@ -1,5 +1,6 @@ using System.Security.Claims; using System.Text.Json.Nodes; +using DfE.CheckPerformanceData.Application; using DfE.CheckPerformanceData.Application.DfESignInApiClient; using DfE.CheckPerformanceData.Web.Controllers.ViewModels; using Microsoft.AspNetCore.Authentication; @@ -7,16 +8,19 @@ using Microsoft.AspNetCore.Authentication.OpenIdConnect; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; namespace DfE.CheckPerformanceData.Web.Controllers; public class SecretController : Controller { private readonly IDfESignInApiClient _dfeSignInApiClient; + private readonly IPortalDbContext _dbContext; - public SecretController(IDfESignInApiClient dfeSignInApiClient) + public SecretController(IDfESignInApiClient dfeSignInApiClient, IPortalDbContext dbContext) { _dfeSignInApiClient = dfeSignInApiClient; + _dbContext = dbContext; } [Authorize] @@ -35,6 +39,10 @@ public async Task Index() UserName = User.FindFirstValue(ClaimTypes.GivenName) + " " + User.FindFirstValue(ClaimTypes.Surname), Organisation = organisation }; + + var now = DateTime.UtcNow; + var currentWindowsForUser = await _dbContext.CheckingWindows.Where(w => w.StartDate <= now && w.EndDate >= now) + .AsNoTracking().ToListAsync(); return View(vm); } diff --git a/src/DfE.CheckPerformanceData.Web/Extensions/MigrationExtensions.cs b/src/DfE.CheckPerformanceData.Web/Extensions/MigrationExtensions.cs new file mode 100644 index 0000000..4b51087 --- /dev/null +++ b/src/DfE.CheckPerformanceData.Web/Extensions/MigrationExtensions.cs @@ -0,0 +1,17 @@ +using DfE.CheckPerformanceData.Infrastructure.Persistence; +using Microsoft.EntityFrameworkCore; + +namespace DfE.CheckPerformanceData.Web.Extensions; + +public static class MigrationExtensions +{ + public static async Task MigrateDatabaseAsync(this WebApplication app) + { + // if (!app.Environment.IsDevelopment()) + // return; + + await using var scope = app.Services.CreateAsyncScope(); + var db = scope.ServiceProvider.GetRequiredService(); + await db.Database.MigrateAsync(); + } +} \ No newline at end of file diff --git a/src/DfE.CheckPerformanceData.Web/Program.cs b/src/DfE.CheckPerformanceData.Web/Program.cs index 311af06..92bcec2 100644 --- a/src/DfE.CheckPerformanceData.Web/Program.cs +++ b/src/DfE.CheckPerformanceData.Web/Program.cs @@ -1,8 +1,11 @@ using Azure.Storage.Queues; using DfE.CheckPerformanceData.Application; +using DfE.CheckPerformanceData.Application.ClaimsEnrichment; using DfE.CheckPerformanceData.Infrastructure.DfeSignIn; using DfE.CheckPerformanceData.Infrastructure.DfeSignInApiClient; using DfE.CheckPerformanceData.Infrastructure.Persistence; +using DfE.CheckPerformanceData.Infrastructure.Seeding; +using DfE.CheckPerformanceData.Web.Extensions; using GovUk.Frontend.AspNetCore; using Microsoft.EntityFrameworkCore; using Serilog; @@ -23,23 +26,28 @@ builder.Host.UseSerilog((context, services, configuration) => { var isDevelopment = context.HostingEnvironment.IsDevelopment(); - + configuration .ReadFrom.Configuration(context.Configuration) .ReadFrom.Services(services) .Enrich.FromLogContext() - .WriteTo.Console(isDevelopment - ? new ExpressionTemplate( + .WriteTo.Console(isDevelopment + ? new ExpressionTemplate( "[{@t:HH:mm:ss} {@l:u3}] {SourceContext}\n {@m}\n{@x}", theme: TemplateTheme.Code) : new CompactJsonFormatter()); }); - + builder.Services .AddDfeApiClient(builder.Configuration) .AddDfeSignInAuthentication(builder.Configuration) .AddGovUkFrontend(options => options.Rebrand = true); + if (builder.Environment.IsDevelopment()) + builder.Services.AddScoped(); + + builder.Services.AddScoped(); + builder.Services.AddDbContext(options => options.UseNpgsql(builder.Configuration.GetConnectionString("Postgres"))); @@ -57,6 +65,8 @@ var app = builder.Build(); + await app.MigrateDatabaseAsync(); + app.UseSerilogRequestLogging(options => { options.EnrichDiagnosticContext = (diagnosticContext, httpContext) => @@ -67,7 +77,7 @@ diagnosticContext.Set("UserAgent", httpContext.Request.Headers.UserAgent.ToString()); }; }); - + app.UseGovUkFrontend(); app.UseHealthChecks("/healthcheck"); @@ -79,6 +89,11 @@ // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. app.UseHsts(); } + else + { + using var scope = app.Services.CreateScope(); + await scope.ServiceProvider.GetRequiredService().SeedAsync(); + } app.UseHttpsRedirection(); app.UseRouting(); @@ -98,6 +113,9 @@ } catch (Exception e) { - Console.WriteLine(e); - throw; + Log.Fatal(e, "Application terminated unexpectedly"); +} +finally +{ + Log.CloseAndFlush(); } \ No newline at end of file diff --git a/src/DfE.CheckPerformanceData.Web/Views/Secret/Index.cshtml b/src/DfE.CheckPerformanceData.Web/Views/Secret/Index.cshtml index f1883e8..b114481 100644 --- a/src/DfE.CheckPerformanceData.Web/Views/Secret/Index.cshtml +++ b/src/DfE.CheckPerformanceData.Web/Views/Secret/Index.cshtml @@ -13,6 +13,11 @@
ID
@Model.Organisation.Id
+ +
+
LAESTAB
+
@Model.Organisation.LAESTAB
+
Name
diff --git a/src/DfE.CheckPerformanceData.Web/appsettings.json b/src/DfE.CheckPerformanceData.Web/appsettings.json index 463f06b..55aa94c 100644 --- a/src/DfE.CheckPerformanceData.Web/appsettings.json +++ b/src/DfE.CheckPerformanceData.Web/appsettings.json @@ -9,11 +9,5 @@ } } }, -// "Logging": { -// "LogLevel": { -// "Default": "Information", -// "Microsoft.AspNetCore": "Warning" -// } -// }, "AllowedHosts": "*" }