Files
Khaemhat/src/Khaemhat.Fiscal.Italy/Sdi/SdiCoopPushReader.cs
T
Alby96andClaude Opus 5.5 b78260beb0 feat: e-invoice screens and SdICoop push endpoint (#74 #75 #76 #77 #79)
The SDI dashboard (mockup 058) with its six counters, the documents to
generate, generate+send, manual receipts import, history, courtesy copy
and mark-as-sent; the channels page (mockup 059) with settings, test,
pause and routing rules; the received invoices, the notifications and
the conservation packages. The SdICoop web service receives pushes at
/sdicoop/{company}, authenticated by the key of the channel, through a
new IEInvoicePushReader feature so the web layer stays country-neutral.
The menu gives each e-invoice page its own permission and keeps the
intent declarations under M10.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 12:54:09 +01:00

25 lines
872 B
C#

using Khaemhat.Fiscal.Abstractions;
namespace Khaemhat.Fiscal.Italy.Sdi;
/// <summary>The SdICoop messages the SDI sends to the company, as pushes of the channel <c>SDICOOP</c> (issue #76).</summary>
public sealed class SdiCoopPushReader : IEInvoicePushReader
{
private const string Soap = "text/xml; charset=utf-8";
/// <inheritdoc />
public string Channel => SdiCoopTransport.ChannelCode;
/// <inheritdoc />
public EInvoicePush? Read(string? contentType, byte[] body)
{
ArgumentNullException.ThrowIfNull(body);
return SdiCoopMessages.Read(contentType, body) is { } inbound
? new EInvoicePush(inbound.ExchangeId, inbound.Files, Soap, SdiCoopMessages.Answer(inbound))
: null;
}
/// <inheritdoc />
public (string ContentType, string Body) Refusal() => (Soap, SdiCoopMessages.Answer(null));
}