books/backend/Books.Api/Commands/Customers/CustomerCommands.cs
Nicolaj Hartmann 1f75c5d791 Add all backend domain, commands, repositories, and tests
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>
2026-01-30 22:19:42 +01:00

70 lines
2.3 KiB
C#

using Books.Api.Domain.Customers;
using EventFlow.Commands;
namespace Books.Api.Commands.Customers;
public class CreateCustomerCommand(
CustomerId aggregateId,
string companyId,
string customerNumber,
CustomerType customerType,
string name,
string? cvr,
string? address,
string? postalCode,
string? city,
string country,
string? email,
string? phone,
int paymentTermsDays,
string? defaultRevenueAccountId,
string subLedgerAccountId)
: Command<CustomerAggregate, CustomerId>(aggregateId)
{
public string CompanyId { get; } = companyId;
public string CustomerNumber { get; } = customerNumber;
public CustomerType CustomerType { get; } = customerType;
public string Name { get; } = name;
public string? Cvr { get; } = cvr;
public string? Address { get; } = address;
public string? PostalCode { get; } = postalCode;
public string? City { get; } = city;
public string Country { get; } = country;
public string? Email { get; } = email;
public string? Phone { get; } = phone;
public int PaymentTermsDays { get; } = paymentTermsDays;
public string? DefaultRevenueAccountId { get; } = defaultRevenueAccountId;
public string SubLedgerAccountId { get; } = subLedgerAccountId;
}
public class UpdateCustomerCommand(
CustomerId aggregateId,
string name,
string? cvr,
string? address,
string? postalCode,
string? city,
string country,
string? email,
string? phone,
int paymentTermsDays,
string? defaultRevenueAccountId)
: Command<CustomerAggregate, CustomerId>(aggregateId)
{
public string Name { get; } = name;
public string? Cvr { get; } = cvr;
public string? Address { get; } = address;
public string? PostalCode { get; } = postalCode;
public string? City { get; } = city;
public string Country { get; } = country;
public string? Email { get; } = email;
public string? Phone { get; } = phone;
public int PaymentTermsDays { get; } = paymentTermsDays;
public string? DefaultRevenueAccountId { get; } = defaultRevenueAccountId;
}
public class DeactivateCustomerCommand(CustomerId aggregateId)
: Command<CustomerAggregate, CustomerId>(aggregateId);
public class ReactivateCustomerCommand(CustomerId aggregateId)
: Command<CustomerAggregate, CustomerId>(aggregateId);