diff --git a/Directory.Packages.props b/Directory.Packages.props
index e3f1b39..8079011 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -5,21 +5,21 @@
-
-
-
+
+
+
-
+
-
-
-
+
+
+
diff --git a/Dockerfile b/Dockerfile
index 36858ea..2bfd702 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,5 +1,5 @@
# Build stage
-FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
+FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
WORKDIR /app
# Copy solution and all .csproj files
@@ -14,6 +14,7 @@ COPY tests/TheOfficeAPI.Level2.Tests.Integration/*.csproj ./tests/TheOfficeAPI.L
COPY tests/TheOfficeAPI.Level3.Tests.Unit/*.csproj ./tests/TheOfficeAPI.Level3.Tests.Unit/
COPY tests/TheOfficeAPI.Level3.Tests.Integration/*.csproj ./tests/TheOfficeAPI.Level3.Tests.Integration/
COPY tests/TheOfficeAPI.Tests.E2E/*.csproj ./tests/TheOfficeAPI.Tests.E2E/
+COPY tests/TheOfficeAPI.Common.Tests.Unit/*.csproj ./tests/TheOfficeAPI.Common.Tests.Unit/
# Restore dependencies
RUN dotnet restore TheOfficeAPI.sln
@@ -28,7 +29,7 @@ RUN dotnet publish src/TheOfficeAPI/TheOfficeAPI.csproj \
--no-restore
# Runtime stage
-FROM mcr.microsoft.com/dotnet/aspnet:9.0
+FROM mcr.microsoft.com/dotnet/aspnet:10.0
WORKDIR /app
# Copy compiled files
diff --git a/TheOfficeAPI.sln b/TheOfficeAPI.sln
index 50ccada..3c33469 100644
--- a/TheOfficeAPI.sln
+++ b/TheOfficeAPI.sln
@@ -1,4 +1,4 @@
-
+
Microsoft Visual Studio Solution File, Format Version 12.00
#
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TheOfficeAPI", "src/TheOfficeAPI/TheOfficeAPI.csproj", "{B1D1A596-0809-4313-8A9F-AFBC87A87458}"
@@ -13,15 +13,15 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TheOfficeAPI.Level1.Tests.I
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TheOfficeAPI.Level2.Tests.Unit", "tests/TheOfficeAPI.Level2.Tests.Unit/TheOfficeAPI.Level2.Tests.Unit.csproj", "{E3FA0913-3456-7890-1234-D362FE48FE0D}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TheOfficeAPI.Level2.Tests.Integration", "tests/TheOfficeAPI.Level2.Tests.Integration/TheOfficeAPI.Level2.Tests.Integration.csproj", "{00000000-0000-0000-0000-000000000000}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TheOfficeAPI.Level2.Tests.Integration", "tests/TheOfficeAPI.Level2.Tests.Integration/TheOfficeAPI.Level2.Tests.Integration.csproj", "{9078F4DA-6AD0-4024-8764-679B805E0C28}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TheOfficeAPI.Level3.Tests.Unit", "tests/TheOfficeAPI.Level3.Tests.Unit/TheOfficeAPI.Level3.Tests.Unit.csproj", "{00000000-0000-0000-0000-000000000000}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TheOfficeAPI.Level3.Tests.Unit", "tests/TheOfficeAPI.Level3.Tests.Unit/TheOfficeAPI.Level3.Tests.Unit.csproj", "{DB0B4A87-CBA6-4B04-98FD-479E0E4A1E84}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TheOfficeAPI.Level3.Tests.Integration", "tests/TheOfficeAPI.Level3.Tests.Integration/TheOfficeAPI.Level3.Tests.Integration.csproj", "{00000000-0000-0000-0000-000000000000}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TheOfficeAPI.Level3.Tests.Integration", "tests/TheOfficeAPI.Level3.Tests.Integration/TheOfficeAPI.Level3.Tests.Integration.csproj", "{3586BC66-210E-47DD-ABCE-8DC3D0638291}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TheOfficeAPI.Tests.E2E", "tests/TheOfficeAPI.Tests.E2E/TheOfficeAPI.Tests.E2E.csproj", "{00000000-0000-0000-0000-000000000000}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TheOfficeAPI.Tests.E2E", "tests/TheOfficeAPI.Tests.E2E/TheOfficeAPI.Tests.E2E.csproj", "{EDE0ED8F-C286-4FFC-80BC-1972BE240130}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TheOfficeAPI.Common.Tests.Unit", "tests/TheOfficeAPI.Common.Tests.Unit/TheOfficeAPI.Common.Tests.Unit.csproj", "{00000000-0000-0000-0000-000000000000}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TheOfficeAPI.Common.Tests.Unit", "tests/TheOfficeAPI.Common.Tests.Unit/TheOfficeAPI.Common.Tests.Unit.csproj", "{91D7F9AC-B773-4409-90BB-C743351DB612}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -53,7 +53,25 @@ Global
{E3FA0913-3456-7890-1234-D362FE48FE0D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E3FA0913-3456-7890-1234-D362FE48FE0D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E3FA0913-3456-7890-1234-D362FE48FE0D}.Release|Any CPU.Build.0 = Release|Any CPU
- {00000000-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {00000000-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {9078F4DA-6AD0-4024-8764-679B805E0C28}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {9078F4DA-6AD0-4024-8764-679B805E0C28}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {9078F4DA-6AD0-4024-8764-679B805E0C28}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {9078F4DA-6AD0-4024-8764-679B805E0C28}.Release|Any CPU.Build.0 = Release|Any CPU
+ {DB0B4A87-CBA6-4B04-98FD-479E0E4A1E84}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {DB0B4A87-CBA6-4B04-98FD-479E0E4A1E84}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {DB0B4A87-CBA6-4B04-98FD-479E0E4A1E84}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {DB0B4A87-CBA6-4B04-98FD-479E0E4A1E84}.Release|Any CPU.Build.0 = Release|Any CPU
+ {3586BC66-210E-47DD-ABCE-8DC3D0638291}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {3586BC66-210E-47DD-ABCE-8DC3D0638291}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {3586BC66-210E-47DD-ABCE-8DC3D0638291}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {3586BC66-210E-47DD-ABCE-8DC3D0638291}.Release|Any CPU.Build.0 = Release|Any CPU
+ {EDE0ED8F-C286-4FFC-80BC-1972BE240130}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {EDE0ED8F-C286-4FFC-80BC-1972BE240130}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {EDE0ED8F-C286-4FFC-80BC-1972BE240130}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {EDE0ED8F-C286-4FFC-80BC-1972BE240130}.Release|Any CPU.Build.0 = Release|Any CPU
+ {91D7F9AC-B773-4409-90BB-C743351DB612}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {91D7F9AC-B773-4409-90BB-C743351DB612}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {91D7F9AC-B773-4409-90BB-C743351DB612}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {91D7F9AC-B773-4409-90BB-C743351DB612}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
diff --git a/src/TheOfficeAPI/Common/Services/HealthCheckService.cs b/src/TheOfficeAPI/Common/Services/HealthCheckService.cs
index 214d35c..9f18f0f 100644
--- a/src/TheOfficeAPI/Common/Services/HealthCheckService.cs
+++ b/src/TheOfficeAPI/Common/Services/HealthCheckService.cs
@@ -8,6 +8,8 @@ namespace TheOfficeAPI.Common.Services;
///
public class HealthCheckService
{
+ private const string HealthyStatus = "Healthy";
+
private readonly DateTime _startTime;
private readonly string _version;
@@ -24,7 +26,7 @@ public HealthCheckResponse GetLivenessStatus()
{
return new HealthCheckResponse
{
- Status = "Healthy",
+ Status = HealthyStatus,
Timestamp = DateTime.UtcNow,
Message = "Application is alive"
};
@@ -37,7 +39,7 @@ public DetailedHealthCheckResponse GetReadinessStatus()
{
var response = new DetailedHealthCheckResponse
{
- Status = "Healthy",
+ Status = HealthyStatus,
Timestamp = DateTime.UtcNow,
Message = "Application is ready to serve traffic",
Uptime = DateTime.UtcNow - _startTime,
@@ -46,7 +48,7 @@ public DetailedHealthCheckResponse GetReadinessStatus()
{
["application"] = new ComponentHealth
{
- Status = "Healthy",
+ Status = HealthyStatus,
Description = "Application is running normally",
Data = new Dictionary
{
@@ -56,7 +58,7 @@ public DetailedHealthCheckResponse GetReadinessStatus()
},
["dataService"] = new ComponentHealth
{
- Status = "Healthy",
+ Status = HealthyStatus,
Description = "In-memory data service is available",
Data = new Dictionary
{
@@ -77,7 +79,7 @@ public HealthCheckResponse GetHealthStatus()
{
return new HealthCheckResponse
{
- Status = "Healthy",
+ Status = HealthyStatus,
Timestamp = DateTime.UtcNow,
Message = "OK"
};
diff --git a/src/TheOfficeAPI/Level0/Controllers/HealthController.cs b/src/TheOfficeAPI/Level0/Controllers/HealthController.cs
index 27b2669..e763550 100644
--- a/src/TheOfficeAPI/Level0/Controllers/HealthController.cs
+++ b/src/TheOfficeAPI/Level0/Controllers/HealthController.cs
@@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Mvc;
+using TheOfficeAPI.Common.Models;
using TheOfficeAPI.Common.Services;
namespace TheOfficeAPI.Level0.Controllers;
@@ -23,7 +24,7 @@ public HealthController(HealthCheckService healthCheckService)
/// Health status
/// Service is healthy
[HttpGet]
- [ProducesResponseType(StatusCodes.Status200OK)]
+ [ProducesResponseType(typeof(HealthCheckResponse), StatusCodes.Status200OK)]
public IActionResult Get()
{
var health = _healthCheckService.GetHealthStatus();
@@ -40,7 +41,7 @@ public IActionResult Get()
/// is still running. If this fails, the container should be restarted.
///
[HttpGet("live")]
- [ProducesResponseType(StatusCodes.Status200OK)]
+ [ProducesResponseType(typeof(HealthCheckResponse), StatusCodes.Status200OK)]
public IActionResult GetLiveness()
{
var health = _healthCheckService.GetLivenessStatus();
@@ -57,7 +58,7 @@ public IActionResult GetLiveness()
/// is ready to receive traffic. If this fails, traffic should not be routed to this instance.
///
[HttpGet("ready")]
- [ProducesResponseType(StatusCodes.Status200OK)]
+ [ProducesResponseType(typeof(DetailedHealthCheckResponse), StatusCodes.Status200OK)]
public IActionResult GetReadiness()
{
var health = _healthCheckService.GetReadinessStatus();
diff --git a/src/TheOfficeAPI/Level0/Controllers/OfficeApiController.cs b/src/TheOfficeAPI/Level0/Controllers/OfficeApiController.cs
index 00c0dfa..750a70c 100644
--- a/src/TheOfficeAPI/Level0/Controllers/OfficeApiController.cs
+++ b/src/TheOfficeAPI/Level0/Controllers/OfficeApiController.cs
@@ -118,6 +118,7 @@ public Level0Controller(TheOfficeService theOfficeService)
///
///
[HttpPost("theOffice")]
+ [ProducesResponseType(typeof(ApiResponse