Enhance ESLint configuration and improve code consistency

- Added '@typescript-eslint/no-unused-vars' rule to ESLint configuration for better variable management in TypeScript files.
- Updated database.ts to ensure consistent logging format.
- Refactored AuthController and CashflowController to improve variable naming and maintainability.
- Added spacing for better readability in multiple controller methods.
- Adjusted error handling in middleware and repository files for improved clarity.
- Enhanced various service and repository methods to ensure consistent return types and error handling.
- Made minor formatting adjustments across frontend components for improved user experience.
This commit is contained in:
2025-12-11 02:19:05 -05:00
parent 40210c454e
commit df2cf418ea
48 changed files with 247 additions and 61 deletions

View File

@@ -1,5 +1,5 @@
import {DebtCategory} from '@prisma/client';
import {DebtCategoryRepository} from '../repositories/DebtCategoryRepository';
import {DebtCategoryRepository, DebtCategoryWithStats} from '../repositories/DebtCategoryRepository';
import {NotFoundError, ValidationError, ForbiddenError, ConflictError} from '../utils/errors';
export interface CreateDebtCategoryDTO {
@@ -84,7 +84,7 @@ export class DebtCategoryService {
/**
* Get categories with statistics
*/
async getWithStats(userId: string): Promise<any[]> {
async getWithStats(userId: string): Promise<DebtCategoryWithStats[]> {
return this.categoryRepository.getWithStats(userId);
}
@@ -128,7 +128,7 @@ export class DebtCategoryService {
* Delete a category
*/
async delete(id: string, userId: string): Promise<void> {
const category = await this.getById(id, userId);
await this.getById(id, userId);
// Check if category has accounts
// Note: Cascade delete will remove all accounts and payments