Reformat all code as per my preferred formatting.

This commit is contained in:
2026-07-17 17:14:44 +02:00
parent 29d179a23a
commit 249a166d07
13 changed files with 181 additions and 169 deletions
@@ -10,8 +10,10 @@ public record BalancedJournal
public static BalancedJournal Create(Guid id, string description, DateTimeOffset createdAt, List<JournalLine> lines)
{
var debits = lines.Where(l => l.Type == EntryType.Debit).Sum(l => l.Amount);
var credits = lines.Where(l => l.Type == EntryType.Credit).Sum(l => l.Amount);
var debits = lines.Where(l => l.Type == EntryType.Debit)
.Sum(l => l.Amount);
var credits = lines.Where(l => l.Type == EntryType.Credit)
.Sum(l => l.Amount);
if (debits != credits)
{
@@ -26,7 +28,8 @@ public record BalancedJournal
public static BalancedJournal CreateReversal(JournalEntry original, string reason, DateTimeOffset now)
{
var reversedLines = original.Lines.Select(l =>
l with { Type = l.Type == EntryType.Debit ? EntryType.Credit : EntryType.Debit })
l with { Type = l.Type == EntryType.Debit ? EntryType.Credit : EntryType.Debit }
)
.ToList();
return Create(Guid.NewGuid(), reason, now, reversedLines);
@@ -7,9 +7,7 @@ public record JournalEntry
public DateTimeOffset CreatedAt { get; init; }
public List<JournalLine> Lines { get; init; } = [];
internal JournalEntry()
{
}
internal JournalEntry() { }
internal JournalEntry(Guid id, string description, DateTimeOffset createdAt, List<JournalLine> lines)
{