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 {Client} from '@prisma/client';
import {ClientRepository} from '../repositories/ClientRepository';
import {ClientRepository, ClientWithStats} from '../repositories/ClientRepository';
import {NotFoundError, ValidationError, ForbiddenError, ConflictError} from '../utils/errors';
export interface CreateClientDTO {
@@ -60,7 +60,7 @@ export class ClientService {
/**
* Get clients with statistics
*/
async getWithStats(userId: string): Promise<any[]> {
async getWithStats(userId: string): Promise<ClientWithStats[]> {
return this.clientRepository.getWithStats(userId);
}
@@ -107,7 +107,7 @@ export class ClientService {
*/
async delete(id: string, userId: string): Promise<void> {
// Verify ownership
const client = await this.getById(id, userId);
await this.getById(id, userId);
// Check if client has invoices - we still allow deletion due to cascade
// but you might want to prevent deletion if there are invoices