adds CREDIT_DEBIT_NOT_EQUAL error

This commit is contained in:
Nana Kofi Larbi Mantey
2024-10-20 19:04:10 +00:00
parent c8c2786893
commit bbc19df6b4

View File

@@ -33,6 +33,10 @@ export class CommandManualJournalValidators {
if (totalCredit <= 0 || totalDebit <= 0) {
throw new ServiceError(ERRORS.CREDIT_DEBIT_NOT_EQUAL_ZERO);
}
if (totalCredit !== totalDebit) {
throw new ServiceError(ERRORS.CREDIT_DEBIT_NOT_EQUAL);
}
}
private roundToTwoDecimals(value: number): number {