Files
csob/Services/StandingOrdersService.cs
T
JiriUhlir 09db30a3ca first
2026-06-18 11:05:46 +02:00

35 lines
1.6 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using System.Text.Json.Nodes;
using Csob.Client;
using Csob.Models;
namespace Csob.Services;
/// <summary>PISP standing-order initiation, detail/status, cancellation and the sign (SCA) flow.</summary>
public sealed class StandingOrdersService
{
private readonly CsobApiAccessor _accessor;
public StandingOrdersService(CsobApiAccessor accessor) => _accessor = accessor;
public Task<JsonNode?> InitiateAsync(StandingOrderInitiationRequest request, CancellationToken ct)
=> _accessor.Client.PostAsync(CsobApiPaths.StandingOrders, request, ct);
public Task<JsonNode?> DetailAsync(string id, CancellationToken ct)
=> _accessor.Client.GetAsync(CsobApiPaths.StandingOrder(id), null, ct);
public Task<JsonNode?> StatusAsync(string id, CancellationToken ct)
=> _accessor.Client.GetAsync(CsobApiPaths.StandingOrderStatus(id), null, ct);
public Task<JsonNode?> CancelAsync(string id, CancellationToken ct)
=> _accessor.Client.DeleteAsync(CsobApiPaths.StandingOrder(id), ct);
public Task<JsonNode?> StartSignAsync(string id, string signId, JsonNode? body, CancellationToken ct)
=> _accessor.Client.PostAsync(CsobApiPaths.StandingOrderSign(id, signId), body, ct);
public Task<JsonNode?> SignStatusAsync(string id, string signId, CancellationToken ct)
=> _accessor.Client.GetAsync(CsobApiPaths.StandingOrderSign(id, signId), null, ct);
public Task<JsonNode?> FinalizeSignAsync(string id, string signId, JsonNode? body, CancellationToken ct)
=> _accessor.Client.PutAsync(CsobApiPaths.StandingOrderSign(id, signId), body, ct);
}