Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
f6aca47
Refactor SnakeAid Service:
DuongNManh Feb 5, 2026
a2c03e8
Merge branch 'dev' of https://github.com/Snake-AID/SnakeAid.Backend i…
DuongNManh Feb 5, 2026
4d74740
feat: add GetDetailIncidentAsync method to retrieve detailed snakebit…
DuongNManh Feb 5, 2026
00e681f
chore: remove deploy workflow and add VSCode settings for dotnet solu…
the-khiem7 Feb 5, 2026
4603bfa
feat: enhance Jenkins pipeline with improved Docker build and cleanup…
the-khiem7 Feb 5, 2026
75ecb09
feat: refactor Docker build and cleanup processes in Jenkins pipeline
the-khiem7 Feb 5, 2026
7cc3342
hotfix(Jenkins): Convert from docker plugin into sh command to avoud …
the-khiem7 Feb 5, 2026
9544982
fix: update Docker build commands to use docker.build for improved co…
the-khiem7 Feb 5, 2026
32e5707
feat: add CancelIncident endpoint to allow cancellation of snakebite …
DuongNManh Feb 6, 2026
305d914
chore: update subproject commit reference in SnakeAid.Docs
the-khiem7 Feb 6, 2026
c07587e
feat: centralize Doppler configuration management and enhance app set…
the-khiem7 Feb 7, 2026
7362879
refactor(config): simplify Doppler integration and remove complex con…
the-khiem7 Feb 8, 2026
ff92c4d
build: update launch configurations, environment variables, and docs …
the-khiem7 Feb 8, 2026
112acb9
Merge pull request #38 from Snake-AID/devops/OPS002_Doppler-Config-Ce…
the-khiem7 Feb 8, 2026
737432a
Enhance session timeout service with detailed logging and monitoring …
DuongNManh Feb 9, 2026
5898926
Merge branch 'main' into dev
the-khiem7 Feb 10, 2026
661eb1a
feat: implement RescueMissionController and service for managing resc…
NeoNgyn Feb 10, 2026
c2469a1
Merge branch 'dev' into feature/SA008-Rescue_Mission
NeoNgyn Feb 10, 2026
1d6c04d
update: optimize status validation logic
NeoNgyn Feb 10, 2026
0911b55
fix: update RescueMissionStatusResponse to use mission's UpdatedAt ti…
NeoNgyn Feb 10, 2026
580226d
Merge branch 'feature/SA008-Rescue_Mission' of https://github.com/Sna…
NeoNgyn Feb 10, 2026
1480186
feat: implement RescueMissionController and service for managing resc…
NeoNgyn Feb 10, 2026
7e583e3
Refactor rescue mission handling and incident management
DuongNManh Feb 10, 2026
2051967
feat: add SnakeCatchingRequest functionality with controller, service…
NeoNgyn Feb 11, 2026
6839357
feat: add functionality to accept snake catching requests and handle …
NeoNgyn Feb 11, 2026
a899aca
feat: enhance snake catching request with detailed species identifica…
NeoNgyn Feb 11, 2026
a044469
feat: implement SnakeCatchingMissionController and service for managi…
NeoNgyn Feb 11, 2026
f11006a
feat: implement CatchingMissionDetail functionality with controller, …
NeoNgyn Feb 11, 2026
ab6f2a0
feat: implement SnakeCatchingMissionController and service methods fo…
NeoNgyn Feb 11, 2026
a78e297
feat: add GetDetailAsync method to retrieve snake catching request de…
NeoNgyn Feb 11, 2026
90b7aa3
Feature/sa009 snake catching
NeoNgyn Feb 11, 2026
45b928f
fix: abort mission Id error
DuongNManh Feb 11, 2026
28f9911
feat: add GetAllSnakeCatchingRequests method and corresponding contro…
NeoNgyn Feb 11, 2026
2ddd9cc
fix: uow method
DuongNManh Feb 11, 2026
e73273e
Merge branch 'dev' of https://github.com/Snake-AID/SnakeAid.Backend i…
DuongNManh Feb 11, 2026
30dde4b
Merge pull request #43 from Snake-AID/feature/SA008-Rescue_Pairing
DuongNManh Feb 11, 2026
68437fc
Merge branch 'dev' into feature/SA009-Snake_Catching
NeoNgyn Feb 11, 2026
4423ad0
refactor: update API routes for catching missions and requests; impro…
NeoNgyn Feb 11, 2026
926cf6a
feat: add GetAllSnakeCatchingRequests method and corresponding contro…
NeoNgyn Feb 11, 2026
be72b4d
refactor: uncomment and update RescueMissionController methods and do…
NeoNgyn Feb 11, 2026
45b2c12
refactor: uncomment and update RescueMissionController methods and do…
NeoNgyn Feb 11, 2026
2a403a6
feat: enhance FirstAidGuidelineService to support guideline content o…
NeoNgyn Feb 11, 2026
5e5678e
feat: enhance FirstAidGuidelineService to support guideline content o…
NeoNgyn Feb 11, 2026
6a0620a
refactor: update ports and configurations for consistent HTTP/HTTPS h…
the-khiem7 Feb 11, 2026
ae9a819
Merge branch 'dev' of https://github.com/Snake-AID/SnakeAid.Backend i…
the-khiem7 Feb 11, 2026
288d01c
Merge branch 'main' into dev
the-khiem7 Feb 11, 2026
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
6 changes: 3 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"cwd": "${workspaceFolder}/SnakeAid.Api",
"stopAtEntry": false,
"serverReadyAction": {
"pattern": "Now listening on:\\s+(https://[^\\s]+:7026)",
"pattern": "Now listening on:\\s+(https://[^\\s]+:8081)",
"uriFormat": "%s",
"action": "openExternally"
},
Expand All @@ -58,7 +58,7 @@
"cwd": "${workspaceFolder}/SnakeAid.Api",
"stopAtEntry": false,
"serverReadyAction": {
"pattern": "Now listening on:\\s+(http://[^\\s]+:5009)",
"pattern": "Now listening on:\\s+(http://[^\\s]+:8080)",
"uriFormat": "%s",
"action": "openExternally"
},
Expand All @@ -83,7 +83,7 @@
"cwd": "${workspaceFolder}/SnakeAid.Api",
"stopAtEntry": false,
"serverReadyAction": {
"pattern": "Now listening on:\\s+(https://[^\\s]+:7026)",
"pattern": "Now listening on:\\s+(https://[^\\s]+:8081)",
"uriFormat": "%s",
"action": "openExternally"
},
Expand Down
52 changes: 52 additions & 0 deletions SnakeAid.Api/Controllers/CatchingMissionDetailController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
using MapsterMapper;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using SnakeAid.Core.Meta;
using SnakeAid.Core.Requests.SnakeCatchingMission;
using SnakeAid.Core.Responses.SnakeCatchingMission;
using SnakeAid.Core.Validators;
using SnakeAid.Service.Interfaces;
using Swashbuckle.AspNetCore.Annotations;

namespace SnakeAid.Api.Controllers
{
[Route("api/catchingmission/details")]
[ApiController]
[Authorize]
public class CatchingMissionDetailController : BaseController<CatchingMissionDetailController>
{
private readonly ICatchingMissionDetailService _catchingMissionDetailService;

public CatchingMissionDetailController(
ILogger<CatchingMissionDetailController> logger,
IHttpContextAccessor httpContextAccessor,
IMapper mapper,
ICatchingMissionDetailService catchingMissionDetailService)
: base(logger, httpContextAccessor, mapper)
{
_catchingMissionDetailService = catchingMissionDetailService;
}

/// <summary>
/// Create a new catching mission detail
/// </summary>
/// <remarks>
/// Records the details of snakes caught during a mission, including species and quantity.
/// This should be called when recording the results of a catching mission.
/// </remarks>
[HttpPost]
[ValidateModel]
[SwaggerOperation(
Summary = "Create Catching Mission Detail",
Description = "Create a new catching mission detail record for snakes caught during a mission")]
[SwaggerResponse(200, "Created successfully", typeof(ApiResponse<CatchingMissionDetailResponse>))]
[SwaggerResponse(400, "Validation error or invalid data")]
[SwaggerResponse(401, "Unauthorized")]
[SwaggerResponse(404, "Mission or snake species not found")]
public async Task<IActionResult> CreateCatchingMissionDetail([FromBody] CreateCatchingMissionDetailRequest request)
{
var result = await _catchingMissionDetailService.CreateCatchingMissionDetailAsync(request);
return Ok(ApiResponseBuilder.BuildSuccessResponse(result, "Catching mission detail created successfully!"));
}
}
}
86 changes: 86 additions & 0 deletions SnakeAid.Api/Controllers/MonitoringController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using SnakeAid.Core.Meta;
using SnakeAid.Service.Interfaces;
using Swashbuckle.AspNetCore.Annotations;

namespace SnakeAid.Api.Controllers
{
[Route("api/monitoring")]
[ApiController]
// [Authorize] // Only authenticated users can access monitoring

Copilot AI Feb 11, 2026

Copy link

Choose a reason for hiding this comment

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

Monitoring endpoints are exposed without authorization. This leaks operational state (timeouts, queue sizes, health) and can aid attackers. Re-enable [Authorize] (and ideally restrict to an admin role/policy) or gate these endpoints to Development environments only.

Suggested change
// [Authorize] // Only authenticated users can access monitoring
[Authorize] // Only authenticated users can access monitoring

Copilot uses AI. Check for mistakes.
public class MonitoringController : ControllerBase
{
private readonly ISessionTimeoutService _timeoutService;
private readonly ILogger<MonitoringController> _logger;

public MonitoringController(
ISessionTimeoutService timeoutService,
ILogger<MonitoringController> logger)
{
_timeoutService = timeoutService;
_logger = logger;
}


/// Get session timeout service status
[HttpGet("session-timeout-status")]
[SwaggerOperation(Summary = "Session Timeout Status", Description = "Get current status of session timeout monitoring service")]
[SwaggerResponse(200, "Service status retrieved", typeof(ApiResponse<object>))]
public IActionResult GetSessionTimeoutStatus()
{
try
{
var (totalSessions, expiredCount, pendingCount) = _timeoutService.GetQueueStatus();
var isHealthy = _timeoutService.IsHealthy();

var status = new
{
IsHealthy = isHealthy,
TotalSessionsMonitored = totalSessions,
ExpiredSessionsInQueue = expiredCount,
PendingSessionsInQueue = pendingCount,
CheckedAt = DateTime.UtcNow,
ServiceStatus = isHealthy ? "Healthy" : "Unhealthy"
};

var response = ApiResponseBuilder.BuildSuccessResponse(status, "Session timeout service status retrieved");
return Ok(response);
}
catch (Exception ex)
{
_logger.LogError(ex, "Error retrieving session timeout status: {Message}", ex.Message);
var response = ApiResponseBuilder.BuildErrorResponse("Failed to retrieve session timeout status");
return StatusCode(500, response);
}
}


/// Health check endpoint for session timeout service
[HttpGet("health/session-timeout")]
[SwaggerOperation(Summary = "Session Timeout Health Check", Description = "Simple health check for session timeout monitoring")]
[SwaggerResponse(200, "Service is healthy")]
[SwaggerResponse(503, "Service is unhealthy")]
public IActionResult SessionTimeoutHealthCheck()
{
try
{
var isHealthy = _timeoutService.IsHealthy();

if (isHealthy)
{
return Ok(new { Status = "Healthy", CheckedAt = DateTime.UtcNow });
}
else
{
return StatusCode(503, new { Status = "Unhealthy", CheckedAt = DateTime.UtcNow });
}
}
catch (Exception ex)
{
_logger.LogError(ex, "Session timeout health check failed: {Message}", ex.Message);
return StatusCode(503, new { Status = "Unhealthy", Error = ex.Message, CheckedAt = DateTime.UtcNow });
}
}
}
}
Loading