Closed martinmo closed 1 year ago
AccountancyEntry
instances are supposed to be immutable (as that's how bookkeeping works), so I guess we need to make sure we don't write any non-new entries.
AccountancyEntry.isNew()
and reject parameter with an IllegalArgumentException
(Spring's Assert
class might be helpful here).Accountancy.add(…)
with an already existing AccountancyEntry
and verify it's rejected in AccountancyTests
.
In
Accountancy
, theadd(…)
method currently has two purposes: 1) adding a new entry and 2) updating/saving an existing entry. However, the latter purpose isn't clear to Salespoint framework users, neither from the method name (i.e., something likesave(…)
would be better) nor from the javadoc. TheAccountancyEntryRepository
, which has asave(…)
method, is package private.