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>
73 lines
2.2 KiB
C#
73 lines
2.2 KiB
C#
using Books.Api.Domain.JournalEntryDrafts;
|
|
using EventFlow.Commands;
|
|
|
|
namespace Books.Api.Commands.JournalEntryDrafts;
|
|
|
|
public class CreateJournalEntryDraftCommandHandler
|
|
: CommandHandler<JournalEntryDraftAggregate, JournalEntryDraftId, CreateJournalEntryDraftCommand>
|
|
{
|
|
public override Task ExecuteAsync(
|
|
JournalEntryDraftAggregate aggregate,
|
|
CreateJournalEntryDraftCommand command,
|
|
CancellationToken cancellationToken)
|
|
{
|
|
aggregate.Create(
|
|
command.CompanyId,
|
|
command.Name,
|
|
command.CreatedBy,
|
|
command.VoucherNumber,
|
|
command.ExtractionData);
|
|
|
|
return Task.CompletedTask;
|
|
}
|
|
}
|
|
|
|
public class UpdateJournalEntryDraftCommandHandler
|
|
: CommandHandler<JournalEntryDraftAggregate, JournalEntryDraftId, UpdateJournalEntryDraftCommand>
|
|
{
|
|
public override Task ExecuteAsync(
|
|
JournalEntryDraftAggregate aggregate,
|
|
UpdateJournalEntryDraftCommand command,
|
|
CancellationToken cancellationToken)
|
|
{
|
|
aggregate.Update(
|
|
command.Name,
|
|
command.DocumentDate,
|
|
command.Description,
|
|
command.FiscalYearId,
|
|
command.Lines,
|
|
command.AttachmentIds);
|
|
|
|
return Task.CompletedTask;
|
|
}
|
|
}
|
|
|
|
public class MarkJournalEntryDraftPostedCommandHandler
|
|
: CommandHandler<JournalEntryDraftAggregate, JournalEntryDraftId, MarkJournalEntryDraftPostedCommand>
|
|
{
|
|
public override Task ExecuteAsync(
|
|
JournalEntryDraftAggregate aggregate,
|
|
MarkJournalEntryDraftPostedCommand command,
|
|
CancellationToken cancellationToken)
|
|
{
|
|
aggregate.MarkPosted(
|
|
command.TransactionId,
|
|
command.PostedBy);
|
|
|
|
return Task.CompletedTask;
|
|
}
|
|
}
|
|
|
|
public class DiscardJournalEntryDraftCommandHandler
|
|
: CommandHandler<JournalEntryDraftAggregate, JournalEntryDraftId, DiscardJournalEntryDraftCommand>
|
|
{
|
|
public override Task ExecuteAsync(
|
|
JournalEntryDraftAggregate aggregate,
|
|
DiscardJournalEntryDraftCommand command,
|
|
CancellationToken cancellationToken)
|
|
{
|
|
aggregate.Discard(command.DiscardedBy);
|
|
|
|
return Task.CompletedTask;
|
|
}
|
|
}
|