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>
This commit is contained in:
1 parent
9d7cb9e71f
commit
b78260beb0
21 files changed
+2414
-6
No files matched your search
@@ -100,8 +100,9 @@ public sealed partial class EInvoiceService
|
||||
pending.Count(p => p.Status == DocumentStatus.Issued),
|
||||
all.Count(e => e.Status == EInvoiceStatus.Generated),
|
||||
all.Count(e => e.Status == EInvoiceStatus.Sent),
|
||||
all.Count(e => EInvoiceStates.IsIssued(e.Status) && e.Status != EInvoiceStatus.Refused),
|
||||
all.Count(e => EInvoiceStates.IsIssued(e.Status) && e.Status is not (EInvoiceStatus.Refused or EInvoiceStatus.NotDelivered or EInvoiceStatus.Undeliverable)),
|
||||
all.Count(e => EInvoiceStates.NeedsAction(e.Status)),
|
||||
all.Count(e => e.Status is EInvoiceStatus.NotDelivered or EInvoiceStatus.Undeliverable),
|
||||
received);
|
||||
|
||||
IEnumerable<EInvoice> rows = filter.View switch
|
||||
@@ -160,6 +161,30 @@ public sealed partial class EInvoiceService
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>The notifications received in a period, newest first (files not loaded).</summary>
|
||||
/// <param name="actor">Who looks: needs <c>einvoice.document.read</c>.</param>
|
||||
/// <param name="companyCode">The company.</param>
|
||||
/// <param name="from">From this day.</param>
|
||||
/// <param name="to">Up to this day.</param>
|
||||
/// <param name="cancellationToken">Cancellation.</param>
|
||||
/// <returns>The notifications.</returns>
|
||||
public async Task<IReadOnlyList<EInvoiceNotification>> NotificationsAsync(Actor actor, string companyCode, DateOnly from, DateOnly to, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var company = await CompanyGuard.DemandAsync(_permissions, actor, companyCode, EInvoicePermissions.Read, cancellationToken).ConfigureAwait(false);
|
||||
await using var uow = await _factory.CreateAsync(DatabaseScope.Company(company), cancellationToken).ConfigureAwait(false);
|
||||
var start = from.ToDateTime(TimeOnly.MinValue, DateTimeKind.Utc);
|
||||
var end = to.AddDays(1).ToDateTime(TimeOnly.MinValue, DateTimeKind.Utc);
|
||||
var rows = (await uow.Repository<EInvoiceNotification, long>()
|
||||
.ListAsync(Query.For<EInvoiceNotification>().Where(n => n.ReceivedAt >= start && n.ReceivedAt < end).OrderByDescending(n => n.ReceivedAt).Take(2000), cancellationToken)
|
||||
.ConfigureAwait(false)).Items;
|
||||
foreach (var row in rows)
|
||||
{
|
||||
row.Content = [];
|
||||
}
|
||||
|
||||
return rows;
|
||||
}
|
||||
|
||||
/// <summary>Checks the file a document would have, without writing it.</summary>
|
||||
/// <param name="actor">Who checks: needs <c>einvoice.document.read</c>.</param>
|
||||
/// <param name="companyCode">The company.</param>
|
||||
|
||||
Reference in new issue
Block a user