The DoubleEntry::Validation::LineCheck::perform! process checks the running balance (in the double_entry_lines table) and cached balance (in the double_entry_account_balances table). If this process finds a calculation error in the running balance, it corrects the problem by locking the account in question (preventing new transactions on an incorrect balance) and then processing each line recorded, one-by-one recalculating the running balance. Considering that this recalculation process may take considerable time for accounts with millions of associated double_entry_lines rows, for some business cases it maybe unacceptable to prevent new transactions for the duration of the correction process.
Change
Don't perform corrections by default. Instead just log the balance issues in the database. Teams can then plan for any required balance corrections using the new AccountFixer class:
Context
The
DoubleEntry::Validation::LineCheck::perform!
process checks the running balance (in thedouble_entry_lines
table) and cached balance (in thedouble_entry_account_balances
table). If this process finds a calculation error in the running balance, it corrects the problem by locking the account in question (preventing new transactions on an incorrect balance) and then processing each line recorded, one-by-one recalculating the running balance. Considering that this recalculation process may take considerable time for accounts with millions of associateddouble_entry_lines
rows, for some business cases it maybe unacceptable to prevent new transactions for the duration of the correction process.Change
Don't perform corrections by default. Instead just log the balance issues in the database. Teams can then plan for any required balance corrections using the new
AccountFixer
class:If desired, the original automatic correction behaviour can be obtained by providing an
AccountFixer
instance to the line check process: