Final backend fixes and path stabilization

This commit is contained in:
Hamza-Ayed
2026-04-17 00:14:47 +03:00
parent e457313e8f
commit 6fb67282ba
7 changed files with 14 additions and 12 deletions

View File

@@ -5,10 +5,10 @@
*/
import { Module } from '@nestjs/common';
import { ConfigModule } from '@nestjs/config';
import { ConfigModule, ConfigService } from '@nestjs/config';
import { TypeOrmModule } from '@nestjs/typeorm';
import { ThrottlerModule, ThrottlerGuard } from '@nestjs/throttler';
import { APP_GUARD } from '@nestjs/core';
import { APP_GUARD, APP_INTERCEPTOR } from '@nestjs/core';
import { BullModule } from '@nestjs/bull';
import { envValidationSchema } from './config/env.validation';

View File

@@ -14,12 +14,12 @@ import { JwtService } from '@nestjs/jwt';
import { ConfigService } from '@nestjs/config';
import { DataSource } from 'typeorm';
import * as bcrypt from 'bcrypt';
import { User } from '../../users/entities/user.entity';
import { Tenant, TenantStatus } from '../../tenants/entities/tenant.entity';
import { UserRole } from '../../users/enums/role.enum';
import { User } from '../users/entities/user.entity';
import { Tenant, TenantStatus } from '../tenants/entities/tenant.entity';
import { UserRole } from '../users/enums/role.enum';
import { RegisterDto } from './dto/register.dto';
import { LoginDto } from './dto/login.dto';
import { Subscription, SubscriptionPlan, SubscriptionStatus } from '../../subscriptions/entities/subscription.entity';
import { Subscription, SubscriptionPlan, SubscriptionStatus } from '../subscriptions/entities/subscription.entity';
@Injectable()
export class AuthService {

View File

@@ -40,7 +40,7 @@ export class CompaniesService {
const company = this.companyRepository.create({
...dto,
tenant_id: tenantId,
});
} as Partial<Company>);
return this.companyRepository.save(company);
}

View File

@@ -82,7 +82,7 @@ export class GeminiExtractorService {
const cleanedJson = responseText.replace(/```json|```/g, '').trim();
return JSON.parse(cleanedJson);
} catch (error) {
} catch (error: any) {
this.logger.error(`AI Extraction failed: ${error.message}`);
throw new InternalServerErrorException('AI Extraction failed');
}

View File

@@ -50,7 +50,7 @@ export class JoFotaraGatewayService {
);
return response.data;
} catch (error) {
} catch (error: any) {
this.logger.error(`JoFotara API Error: ${error.response?.data || error.message}`);
throw new InternalServerErrorException(
`Failed to submit invoice to JoFotara: ${error.response?.data?.message || 'Unknown Error'}`,
@@ -72,7 +72,7 @@ export class JoFotaraGatewayService {
},
});
return response.data;
} catch (error) {
} catch (error: any) {
throw new InternalServerErrorException('Failed to check invoice status');
}
}

View File

@@ -35,7 +35,7 @@ export class UsersService {
...dto,
password_hash: passwordHash,
tenant_id: tenantId,
});
} as Partial<User>);
return this.userRepository.save(user);
}

View File

@@ -2,7 +2,9 @@
"extends": "./tsconfig",
"compilerOptions": {
"outDir": "./dist",
"baseUrl": "./"
"baseUrl": "./",
"experimentalDecorators": true,
"emitDecoratorMetadata": true
},
"exclude": ["node_modules", "test", "dist", "**/*spec.ts"]
}