first commit

This commit is contained in:
Dhananjaya99
2026-09-28 11:44:26 +05:30
parent 721743ae6b
commit bffc9b1686
424 changed files with 46474 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
using Fitness_core_BE.DTOs.PlatformBilling;
using Fitness_core_BE.Helpers;
using Fitness_core_BE.Interfaces.Services;
using Fitness_core_BE.Models.IOs;
using Microsoft.AspNetCore.Mvc;
using static Fitness_core_BE.Helpers.ApiResponseHelper;
namespace Fitness_core_BE.Controllers
{
// Trusted-machine-caller surface for the scheduled subscription-billing worker — not a
// human/agent session, so it's gated by RequireWorkerKeyAttribute (X-Worker-Key) instead
// of CustomMiddleware/JwtMiddleware.
[ApiController]
[Route("api/internal/billing")]
[RequireWorkerKey]
public class WorkerBillingController : ControllerBase
{
private readonly IPlatformBillingService _platformBilling;
public WorkerBillingController(IPlatformBillingService platformBilling)
{
_platformBilling = platformBilling;
}
[HttpPost("run-subscription-charges")]
public async Task<ActionResult<ApiResponse<SubscriptionChargeRunResult>>> RunSubscriptionCharges()
{
return Response(await _platformBilling.RunAndChargeSubscriptionBillingAsync(HttpContext.RequestAborted));
}
}
}