feat(accounts): add account settings service

- Add AccountsSettingsService for managing account-related settings
- Update validators, create and edit services to use settings
- Add constants for account configuration
- Update frontend utils and translations

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Ahmed Bouhuolia
2026-02-25 19:27:53 +02:00
parent b5d1a2c9d0
commit d35915b16b
8 changed files with 94 additions and 14 deletions

View File

@@ -15,10 +15,16 @@ export const AccountDialogAction = {
*/
export const transformApiErrors = (errors) => {
const fields = {};
if (errors.find((e) => e.type === 'account_code_required')) {
fields.code = intl.get('account_code_is_required');
}
if (errors.find((e) => e.type === 'NOT_UNIQUE_CODE')) {
fields.code = intl.get('account_code_is_not_unique');
}
if (errors.find((e) => e.type === 'ACCOUNT.NAME.NOT.UNIQUE')) {
if (errors.find((e) => e.type === 'account_code_not_unique')) {
fields.code = intl.get('account_code_is_not_unique');
}
if (errors.find((e) => e.type === 'account_name_not_unqiue')) {
fields.name = intl.get('account_name_is_already_used');
}
if (

View File

@@ -462,6 +462,7 @@
"should_total_of_credit_and_debit_be_equal": "Should total of credit and debit be equal.",
"no_accounts": "No Accounts",
"the_accounts_have_been_successfully_inactivated": "The accounts have been successfully inactivated.",
"account_code_is_required": "Account code is required.",
"account_code_is_not_unique": "Account code is not unique.",
"are_sure_to_publish_this_expense": "Are you sure you want to publish this expense?",
"once_delete_these_journals_you_will_not_able_restore_them": "Once you delete these journals, you won't be able to retrieve them later. Are you sure you want to delete them?",