books/backend/Books.Api/Commands/Customers/CustomerCommands.cs

71 lines
2.3 KiB
C#
Raw Normal View History

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);