Created
December 8, 2024 13:20
-
-
Save emag/b010fcc8e3bf458bca7bd9c70170573f to your computer and use it in GitHub Desktop.
仕訳の記帳が拒否されるパターン
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"負数の残高にはできない" in { | |
// Given | |
val initA = Map(Cash -> BigDecimal(1_000_000)) | |
val initL = Map.empty[AccountTitle, BigDecimal] | |
val entry = JournalEntry( | |
date = LocalDate.now(), | |
debit = BankAccount, | |
credit = Cash, | |
amount = BigDecimal(2_000_000), | |
description = "入金" | |
) | |
// When | |
val result = BalanceSheet.NotReady | |
.initialize(initA, initL) | |
.flatMap(_.journalize(entry)) | |
// Then | |
result shouldBe Rejected(NonEmptyChain(NegativeBalance)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment