fix(exports): stabilize published types and compatibility with updated dependencies
This commit is contained in:
@@ -262,6 +262,9 @@ export class ChartOfAccounts {
|
||||
* Search accounts
|
||||
*/
|
||||
public async searchAccounts(searchTerm: string): Promise<Account[]> {
|
||||
if (!this.skrType) {
|
||||
throw new Error('SKR type not set. Initialize SKR03 or SKR04 first.');
|
||||
}
|
||||
return await Account.searchAccounts(searchTerm, this.skrType);
|
||||
}
|
||||
|
||||
@@ -287,10 +290,11 @@ export class ChartOfAccounts {
|
||||
|
||||
// Apply text search if provided
|
||||
if (filter?.searchTerm) {
|
||||
const lowerSearchTerm = filter.searchTerm.toLowerCase();
|
||||
const searchTerm = filter.searchTerm;
|
||||
const lowerSearchTerm = searchTerm.toLowerCase();
|
||||
return accounts.filter(
|
||||
(account) =>
|
||||
account.accountNumber.includes(filter.searchTerm) ||
|
||||
account.accountNumber.includes(searchTerm) ||
|
||||
account.accountName.toLowerCase().includes(lowerSearchTerm) ||
|
||||
account.description.toLowerCase().includes(lowerSearchTerm),
|
||||
);
|
||||
@@ -468,9 +472,10 @@ export class ChartOfAccounts {
|
||||
await this.createCustomAccount(accountData);
|
||||
importedCount++;
|
||||
} catch (error) {
|
||||
const errorMessage = error instanceof Error ? error.message : String(error);
|
||||
this.logger.log(
|
||||
'warn',
|
||||
`Failed to import account ${parts[0]}: ${error.message}`,
|
||||
`Failed to import account ${parts[0]}: ${errorMessage}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user