feat(server): validate the max depth level of the parent account.

This commit is contained in:
a.bouhuolia
2023-02-14 23:47:24 +02:00
parent e3a072e267
commit 8a5fbfc041
6 changed files with 80 additions and 13 deletions

View File

@@ -70,6 +70,11 @@ export class CreateAccount {
parentAccount,
baseCurrency
);
// Validates the max depth level of accounts chart.
await this.validator.validateMaxParentAccountDepthLevels(
tenantId,
accountDTO.parentAccountId
);
}
// Validates the given account type supports the multi-currency.
this.validator.validateAccountTypeSupportCurrency(accountDTO, baseCurrency);