This commit is contained in:
JiriUhlir
2026-06-18 11:05:46 +02:00
parent f44ffae9fc
commit 09db30a3ca
84 changed files with 3952 additions and 15 deletions
+35
View File
@@ -0,0 +1,35 @@
using System.Text.Json.Nodes;
using Microsoft.AspNetCore.Mvc;
using Csob.Services;
namespace Csob.Controllers;
/// <summary>
/// Common PSU consent lifecycle. Requires the ČSOB credential headers. The consent body is
/// forwarded to ČSOB as raw JSON (COBS consent shape).
/// </summary>
[ApiController]
[Route("consents")]
[Produces("application/json")]
[Tags("Consents")]
public sealed class ConsentsController : ControllerBase
{
private readonly ConsentsService _service;
public ConsentsController(ConsentsService service) => _service = service;
/// <summary>Create a consent.</summary>
[HttpPost]
public async Task<IActionResult> Create([FromBody] JsonNode request, CancellationToken ct)
=> Ok(await _service.CreateAsync(request, ct));
/// <summary>Get a consent detail.</summary>
[HttpGet("{id}")]
public async Task<IActionResult> Detail(string id, CancellationToken ct)
=> Ok(await _service.DetailAsync(id, ct));
/// <summary>Revoke a consent.</summary>
[HttpDelete("{id}")]
public async Task<IActionResult> Delete(string id, CancellationToken ct)
=> Ok(await _service.DeleteAsync(id, ct));
}