Skip to content

Commit

Permalink
Fix: account closure
Browse files Browse the repository at this point in the history
  • Loading branch information
GreRut committed Nov 11, 2024
1 parent 2af17eb commit a6fb496
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion EventSourcing/AccountAggregate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ private void Apply(Event accountEvent)
case ActivationEvent activation:
Apply(activation);
break;
case ClosureEvent closure:
Apply(closure);
break;
default:
throw new EventTypeNotSupportedException("162 ERROR_EVENT_NOT_SUPPORTED");
}
Expand Down Expand Up @@ -117,6 +120,10 @@ private void Apply(CurrencyChangeEvent currencyChange)

private void Apply(ClosureEvent closure)
{
throw new NotImplementedException();
if (AccountLog == null)
AccountLog = new List<LogMessage>();
var logMessage = new LogMessage("CLOSURE", closure.Reason.ToString(), closure.Timestamp);
AccountLog.Add(logMessage);
Status = AccountStatus.Closed;
}
}

0 comments on commit a6fb496

Please sign in to comment.