#pragma warning disable CC0068 // Unused Method #pragma warning disable IDE0051 // Remove unused private members #pragma warning disable CC0057 // Unused parameters #pragma warning disable IDE0060 // Remove unused parameter private void Handle(V1.AccountCreated @event) { Id = @event.AccountId; OwnerId = UserId.FromGuid(@event.OwnerId); Period = Period.FromStartAndEndDate(@event.StartDate, @event.EndDate); State = AccountState.CreateOpen(); Currency = CurrencyCode.FromString(@event.CurrencyCode); }
/// <summary>Create a new account</summary> /// <param name="accountId">ID of the account</param> /// <param name="userId">Owner ID of the account</param> /// <param name="period">The period this account is valid</param> /// <param name="currency">The currency of the payments registered in the bookings</param> public static AccountRoot Create(AccountId accountId, UserId userId, Period period, CurrencyCode currency) { var account = new AccountRoot(); account.Apply(new V1.AccountCreated(accountId, userId, period.StartDate, period.EndDate, currency.Value)); return(account); }