using System.Text.Json.Nodes;
namespace Csob.Models;
// Reusable building blocks shared by the typed PISP request bodies. Field names follow the COBS
// JSON contract (camelCase via System.Text.Json web defaults). Deeply variable sub-trees (party
// identification, structured remittance) are typed as JsonNode so any valid COBS payload passes
// through unchanged.
/// Monetary amount with ISO 4217 currency.
public sealed class Amount
{
public decimal Value { get; set; }
public string Currency { get; set; } = "CZK";
}
/// Wrapper matching the amount object whose instructedAmount holds the value/currency.
public sealed class AmountContainer
{
public Amount InstructedAmount { get; set; } = new();
}
/// Account number identification. For domestic/SEPA writes only iban is required.
public sealed class AccountIdentification
{
public string? Iban { get; set; }
public string? Other { get; set; }
}
/// Account reference with optional currency (debtorAccount/creditorAccount).
public sealed class AccountReference
{
public AccountIdentification Identification { get; set; } = new();
public string? Currency { get; set; }
}
public sealed class ServiceLevel
{
/// Payment scheme: DMCT (domestic), ESCT (SEPA), XBCT (cross-border), EXCT, NXCT.
public string? Code { get; set; }
}
public sealed class PaymentTypeInformation
{
/// NORM (default), HIGH (express) or INST (instant).
public string? InstructionPriority { get; set; }
public ServiceLevel? ServiceLevel { get; set; }
}
public sealed class FinancialInstitutionIdentification
{
public string? Bic { get; set; }
}
public sealed class Agent
{
public FinancialInstitutionIdentification? FinancialInstitutionIdentification { get; set; }
}
public sealed class PostalAddress
{
public string? StreetName { get; set; }
public string? BuildingNumber { get; set; }
public string? PostCode { get; set; }
public string? TownName { get; set; }
public string? Country { get; set; }
}
/// A party (debtor/creditor/ultimate*). Identification is variable, so kept as raw JSON.
public sealed class Party
{
public string? Name { get; set; }
public PostalAddress? PostalAddress { get; set; }
public JsonNode? Identification { get; set; }
}
///
/// Remittance information. unstructured is free text (Czech symbols may be encoded as
/// /VS/.../SS/.../KS/...); structured varies (its reference may be a string or
/// an array) so it is passed through as raw JSON.
///
public sealed class RemittanceInformation
{
public string? Unstructured { get; set; }
public JsonNode? Structured { get; set; }
}
public sealed class Purpose
{
public string? Proprietary { get; set; }
}