using Khaemhat.Core.Treasury;
namespace Khaemhat.Fiscal.Abstractions;
///
/// Writes the national remittance files the SEPA formats do not cover (Italy: RiBa in the CBI fixed-width layout).
/// SEPA credit transfers and direct debits are written by Khaemhat.Core.Treasury.SepaXmlWriter for every
/// country.
///
public interface IRemittanceFileWriter
{
/// Whether this writer writes a kind of remittance.
/// The kind.
/// when accepts it.
bool Supports(RemittanceKind kind);
/// Writes the file.
/// The remittance.
/// The file.
/// A value cannot be written in the format.
BankFile Write(BankFileRemittance remittance);
}
///
/// Reads the national bank statement format of the country (Italy: CBI). CSV and camt.053 are read by
/// Khaemhat.Core.Treasury for every country.
///
public interface IBankStatementReader
{
/// The format read.
StatementFormat Format { get; }
/// Whether the start of a file looks like this format.
/// The first bytes of the file (up to 4 KB).
/// when should be tried.
bool Recognizes(ReadOnlySpan head);
/// Reads a statement.
/// The file.
/// The statement.
/// The file is not in the format.
StatementFile Read(Stream content);
}
/// Late payment interest between companies (Italy: D.Lgs. 231/2002).
public interface ILatePaymentRules
{
/// The yearly rate, in percent, that applies to the days of a half-year.
/// A day.
/// The reference rate of the half-year plus the margin.
decimal RateOn(DateOnly day);
/// The law the interest comes from, for the letters (Italy: D.Lgs. 231/2002).
string LegalReference { get; }
/// The fixed compensation for recovery costs, per invoice (Italy: 40 euro, art. 6).
decimal RecoveryCompensation { get; }
}
/// Which remittance collects or pays the items of a payment method, by the code of the method in the pack.
public interface IRemittanceMethods
{
/// The kind of remittance of a method.
/// The code of the method in the e-invoice (for Italy the MPxx codes).
/// The kind, or when the method does not go in remittances.
RemittanceKind? KindOf(string? methodCode);
}