Update backend API configuration and schema for improved functionality

- Modified TypeScript configuration to disable strict mode and allow importing TypeScript extensions.
- Updated Prisma schema to enhance the User model with a new debtAccounts field and refined asset/liability types.
- Adjusted environment variable parsing for PORT to use coercion for better type handling.
- Refactored various controllers and repositories to utilize type imports for better clarity and maintainability.
- Enhanced service layers with new methods for retrieving assets by type and calculating invoice statistics.
- Introduced new types for invoice statuses and asset types to ensure consistency across the application.
This commit is contained in:
2025-12-08 02:57:38 -05:00
parent cd93dcbfd2
commit 700832550c
27 changed files with 277 additions and 163 deletions

View File

@@ -1,18 +1,6 @@
import {FastifyRequest, FastifyReply} from 'fastify';
import type {FastifyRequest, FastifyReply} from 'fastify';
import {UnauthorizedError} from '../utils/errors';
/**
* Extend Fastify Request with user property
*/
declare module 'fastify' {
interface FastifyRequest {
user?: {
id: string;
email: string;
};
}
}
/**
* Authentication Middleware
* Verifies JWT token and attaches user to request

View File

@@ -1,4 +1,4 @@
import {FastifyError, FastifyReply, FastifyRequest} from 'fastify';
import type {FastifyError, FastifyReply, FastifyRequest} from 'fastify';
import {AppError} from '../utils/errors';
import {ZodError} from 'zod';