Add JoFotara linking modal and fix company limit

This commit is contained in:
Hamza-Ayed
2026-04-18 00:47:37 +03:00
parent ce7b1fc5d8
commit 77434fa815
3 changed files with 113 additions and 13 deletions

View File

@@ -27,7 +27,7 @@ export class AuthService {
private jwtService: JwtService,
private configService: ConfigService,
private dataSource: DataSource,
) {}
) { }
/**
* تسجيل مستخدم جديد (مدير مكتب)
@@ -60,7 +60,7 @@ export class AuthService {
const subscription = queryRunner.manager.create(Subscription, {
tenant_id: savedTenant.id,
plan: SubscriptionPlan.BASIC,
max_companies: 1,
max_companies: 3, // -1 means unlimited
max_invoices_per_month: 200,
price_jod: 15, // Basic price
status: SubscriptionStatus.ACTIVE,
@@ -109,10 +109,10 @@ export class AuthService {
throw new UnauthorizedException('Invalid credentials');
}
const payload = {
sub: user.id,
tenantId: user.tenant_id,
role: user.role
const payload = {
sub: user.id,
tenantId: user.tenant_id,
role: user.role
};
const accessToken = await this.jwtService.signAsync(payload);
@@ -152,10 +152,10 @@ export class AuthService {
throw new UnauthorizedException('Access Denied');
}
const payload = {
sub: user.id,
tenantId: user.tenant_id,
role: user.role
const payload = {
sub: user.id,
tenantId: user.tenant_id,
role: user.role
};
const accessToken = await this.jwtService.signAsync(payload);