using System.Text.Json;
using System.Text.Json.Nodes;
using System.Text.Json.Serialization;
namespace Csob.Models;
public sealed class StandingOrderIdentification
{
public string? InstructionIdentification { get; set; }
public string? TransactionIdentification { get; set; }
}
public sealed class StandingOrderExecution
{
/// DAILY, WEEKLY, MONTHLY, BI_MONTHLY, QUARTERLY, HALFYEARLY, YEARLY, SINGLE, IRREGULAR.
public string? Interval { get; set; }
/// Day within the interval (e.g. day-of-month "25").
public string? IntervalDue { get; set; }
/// e.g. MAX_AMOUNT_EXCEEDED, UNTIL_CANCELLATION.
public string? Mode { get; set; }
public string? ModeDue { get; set; }
}
public sealed class StandingOrderDetail
{
public string? Alias { get; set; }
public StandingOrderExecution? Execution { get; set; }
/// Optional exceptions block (stoppages/breaks); shape varies, kept as raw JSON.
public JsonNode? Exceptions { get; set; }
/// Optional validity block (lastExecutionDate/maxAmount); kept as raw JSON.
public JsonNode? Validity { get; set; }
}
/// Standing-order initiation request (POST /my/standingorders).
public sealed class StandingOrderInitiationRequest
{
public StandingOrderIdentification? StandingOrderIdentification { get; set; }
public PaymentTypeInformation? PaymentTypeInformation { get; set; }
public AmountContainer Amount { get; set; } = new();
public string? RequestedExecutionDate { get; set; }
public StandingOrderDetail? StandingOrder { get; set; }
public AccountReference DebtorAccount { get; set; } = new();
public AccountReference CreditorAccount { get; set; } = new();
public RemittanceInformation? RemittanceInformation { get; set; }
[JsonExtensionData]
public Dictionary? AdditionalData { get; set; }
}