This commit includes all previously untracked backend files: Domain: - Accounts, Attachments, BankConnections, Customers - FiscalYears, Invoices, JournalEntryDrafts - Orders, Products, UserAccess Commands & Handlers: - Full CQRS command structure for all domains Repositories: - PostgreSQL repositories for all read models - Bank transaction and ledger repositories GraphQL: - Input types, scalars, and types for all entities - Mutations and queries Infrastructure: - Banking integration (Enable Banking client) - File storage, Invoicing, Reporting, SAF-T export - Database migrations (003-029) Tests: - Integration tests for GraphQL endpoints - Domain tests - Invoicing and reporting tests Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
55 lines
1.6 KiB
C#
55 lines
1.6 KiB
C#
using Books.Api.Domain.Attachments;
|
|
using EventFlow.Commands;
|
|
|
|
namespace Books.Api.Commands.Attachments;
|
|
|
|
public class UploadAttachmentCommandHandler
|
|
: CommandHandler<AttachmentAggregate, AttachmentId, UploadAttachmentCommand>
|
|
{
|
|
public override Task ExecuteAsync(
|
|
AttachmentAggregate aggregate,
|
|
UploadAttachmentCommand command,
|
|
CancellationToken cancellationToken)
|
|
{
|
|
aggregate.Upload(
|
|
command.CompanyId,
|
|
command.FileName,
|
|
command.OriginalFileName,
|
|
command.ContentType,
|
|
command.FileSize,
|
|
command.StoragePath,
|
|
command.UploadedBy,
|
|
command.DraftId,
|
|
command.TransactionId);
|
|
|
|
return Task.CompletedTask;
|
|
}
|
|
}
|
|
|
|
public class LinkAttachmentToTransactionCommandHandler
|
|
: CommandHandler<AttachmentAggregate, AttachmentId, LinkAttachmentToTransactionCommand>
|
|
{
|
|
public override Task ExecuteAsync(
|
|
AttachmentAggregate aggregate,
|
|
LinkAttachmentToTransactionCommand command,
|
|
CancellationToken cancellationToken)
|
|
{
|
|
aggregate.LinkToTransaction(command.TransactionId);
|
|
|
|
return Task.CompletedTask;
|
|
}
|
|
}
|
|
|
|
public class DeleteAttachmentCommandHandler
|
|
: CommandHandler<AttachmentAggregate, AttachmentId, DeleteAttachmentCommand>
|
|
{
|
|
public override Task ExecuteAsync(
|
|
AttachmentAggregate aggregate,
|
|
DeleteAttachmentCommand command,
|
|
CancellationToken cancellationToken)
|
|
{
|
|
aggregate.Delete(command.DeletedBy, command.Reason);
|
|
|
|
return Task.CompletedTask;
|
|
}
|
|
}
|