Skip to content

Commit

Permalink
Fix: first log with disabled account
Browse files Browse the repository at this point in the history
  • Loading branch information
GreRut committed Nov 11, 2024
1 parent e520cd0 commit f2e654e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion EventSourcing.Test/AccountAggregateTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ public async void DeactivateEvent_Should_AddEventToAccountLog()
new (
Type: "DEACTIVATE",
Message: "Account inactive for 270 days",
Timestamp: DateTime.Parse("2024-10-02T10:30:00Z")
Timestamp: DateTime.Parse("2024-10-02T10:30:00")
),
]
};
Expand Down
8 changes: 7 additions & 1 deletion EventSourcing/AccountAggregate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,13 @@ private void Apply(WithdrawalEvent withdrawal)
private void Apply(DeactivationEvent deactivation)
{
Status = AccountStatus.Disabled;
// AccountLog =
AccountLog = [
new (
Type: "DEACTIVATE",
Message: "Account inactive for 270 days",
Timestamp: DateTime.Parse("2024-10-02T10:30:00")
),
];
}

private void Apply(ActivationEvent activation)
Expand Down

0 comments on commit f2e654e

Please sign in to comment.