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>
57 lines
1.7 KiB
C#
57 lines
1.7 KiB
C#
using Books.Api.Domain.FiscalYears;
|
|
using EventFlow.Commands;
|
|
|
|
namespace Books.Api.Commands.FiscalYears;
|
|
|
|
public class CreateFiscalYearCommand(
|
|
FiscalYearId aggregateId,
|
|
string companyId,
|
|
string name,
|
|
DateOnly startDate,
|
|
DateOnly endDate,
|
|
bool isFirstFiscalYear = false,
|
|
bool isReorganization = false)
|
|
: Command<FiscalYearAggregate, FiscalYearId>(aggregateId)
|
|
{
|
|
public string CompanyId { get; } = companyId;
|
|
public string Name { get; } = name;
|
|
public DateOnly StartDate { get; } = startDate;
|
|
public DateOnly EndDate { get; } = endDate;
|
|
|
|
/// <summary>
|
|
/// Per Årsregnskabsloven §15: First fiscal year can be shorter than 12 months (6-18 months allowed)
|
|
/// </summary>
|
|
public bool IsFirstFiscalYear { get; } = isFirstFiscalYear;
|
|
|
|
/// <summary>
|
|
/// Per Årsregnskabsloven §15: Reorganization allows fiscal year up to 18 months
|
|
/// </summary>
|
|
public bool IsReorganization { get; } = isReorganization;
|
|
}
|
|
|
|
public class CloseFiscalYearCommand(
|
|
FiscalYearId aggregateId,
|
|
string closedBy)
|
|
: Command<FiscalYearAggregate, FiscalYearId>(aggregateId)
|
|
{
|
|
public string ClosedBy { get; } = closedBy;
|
|
}
|
|
|
|
public class ReopenFiscalYearCommand(
|
|
FiscalYearId aggregateId,
|
|
string reopenedBy)
|
|
: Command<FiscalYearAggregate, FiscalYearId>(aggregateId)
|
|
{
|
|
public string ReopenedBy { get; } = reopenedBy;
|
|
}
|
|
|
|
public class LockFiscalYearCommand(
|
|
FiscalYearId aggregateId,
|
|
string lockedBy)
|
|
: Command<FiscalYearAggregate, FiscalYearId>(aggregateId)
|
|
{
|
|
public string LockedBy { get; } = lockedBy;
|
|
}
|
|
|
|
public class MarkOpeningBalancePostedCommand(FiscalYearId aggregateId)
|
|
: Command<FiscalYearAggregate, FiscalYearId>(aggregateId);
|