1
0

fix(accounts): correct typos in account type constants (#1046)

- Fix 'none-current-asset' -> 'non-current-asset' in ACCOUNT_TYPE
- Fix 'non-ACCOUNT_PARENT_TYPE.CURRENT_ASSET' -> 'non-current-asset' copy-paste error
- Fix 'expene' -> 'expense' typo in ACCOUNT_ROOT_TYPE
- Add database migration to update existing records

Fixes #1041

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Ahmed Bouhuolia
2026-03-16 02:34:41 +02:00
committed by GitHub
parent 5caa4bce61
commit cfbfc0b746
4 changed files with 23 additions and 4 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ export const ACCOUNT_TYPE = {
INVENTORY: 'inventory', INVENTORY: 'inventory',
OTHER_CURRENT_ASSET: 'other-current-asset', OTHER_CURRENT_ASSET: 'other-current-asset',
FIXED_ASSET: 'fixed-asset', FIXED_ASSET: 'fixed-asset',
NON_CURRENT_ASSET: 'none-current-asset', NON_CURRENT_ASSET: 'non-current-asset',
ACCOUNTS_PAYABLE: 'accounts-payable', ACCOUNTS_PAYABLE: 'accounts-payable',
CREDIT_CARD: 'credit-card', CREDIT_CARD: 'credit-card',
@@ -0,0 +1,19 @@
/**
* Fix account type typos in the database.
*
* This migration corrects the following typos:
* - 'none-current-asset' -> 'non-current-asset'
*
* Related GitHub issue: #1041
*/
exports.up = function (knex) {
return knex('accounts')
.where('account_type', 'none-current-asset')
.update({ account_type: 'non-current-asset' });
};
exports.down = function (knex) {
return knex('accounts')
.where('account_type', 'non-current-asset')
.update({ account_type: 'none-current-asset' });
};
@@ -412,7 +412,7 @@ export const ACCOUNT_TYPE = {
INVENTORY: 'inventory', INVENTORY: 'inventory',
OTHER_CURRENT_ASSET: 'other-current-asset', OTHER_CURRENT_ASSET: 'other-current-asset',
FIXED_ASSET: 'fixed-asset', FIXED_ASSET: 'fixed-asset',
NON_CURRENT_ASSET: 'none-current-asset', NON_CURRENT_ASSET: 'non-current-asset',
ACCOUNTS_PAYABLE: 'accounts-payable', ACCOUNTS_PAYABLE: 'accounts-payable',
CREDIT_CARD: 'credit-card', CREDIT_CARD: 'credit-card',
@@ -26,7 +26,7 @@ export const ACCOUNT_TYPE = {
export const ACCOUNT_PARENT_TYPE = { export const ACCOUNT_PARENT_TYPE = {
CURRENT_ASSET: 'current-asset', CURRENT_ASSET: 'current-asset',
FIXED_ASSET: 'fixed-asset', FIXED_ASSET: 'fixed-asset',
NON_CURRENT_ASSET: 'non-ACCOUNT_PARENT_TYPE.CURRENT_ASSET', NON_CURRENT_ASSET: 'non-current-asset',
CURRENT_LIABILITY: 'current-liability', CURRENT_LIABILITY: 'current-liability',
LOGN_TERM_LIABILITY: 'long-term-liability', LOGN_TERM_LIABILITY: 'long-term-liability',
@@ -41,7 +41,7 @@ export const ACCOUNT_ROOT_TYPE = {
ASSET: 'asset', ASSET: 'asset',
LIABILITY: 'liability', LIABILITY: 'liability',
EQUITY: 'equity', EQUITY: 'equity',
EXPENSE: 'expene', EXPENSE: 'expense',
INCOME: 'income', INCOME: 'income',
}; };