2026-08-05 21:35:22 +03:30
|
|
|
import { ConfigService } from '@nestjs/config';
|
|
|
|
|
import { JwtService } from '@nestjs/jwt';
|
|
|
|
|
import { PrismaService } from '../prisma/prisma.service';
|
2026-08-08 14:55:26 +03:30
|
|
|
import { SmsService } from '../sms/sms.service';
|
2026-08-05 21:35:22 +03:30
|
|
|
import { AdminLoginDto, RequestOtpDto, UpdateProfileDto, VerifyOtpDto } from './dto/auth.dto';
|
|
|
|
|
export declare class AuthService {
|
|
|
|
|
private readonly prisma;
|
|
|
|
|
private readonly jwt;
|
|
|
|
|
private readonly config;
|
2026-08-08 14:55:26 +03:30
|
|
|
private readonly sms;
|
|
|
|
|
constructor(prisma: PrismaService, jwt: JwtService, config: ConfigService, sms: SmsService);
|
2026-08-05 21:35:22 +03:30
|
|
|
requestOtp(dto: RequestOtpDto): Promise<{
|
2026-08-08 14:55:26 +03:30
|
|
|
debugCode?: string | undefined;
|
2026-08-05 21:35:22 +03:30
|
|
|
success: boolean;
|
|
|
|
|
message: string;
|
|
|
|
|
expiresAt: Date;
|
|
|
|
|
}>;
|
2026-08-08 14:55:26 +03:30
|
|
|
private exposesDebugCode;
|
2026-08-05 21:35:22 +03:30
|
|
|
verifyOtp(dto: VerifyOtpDto): Promise<{
|
|
|
|
|
accessToken: string;
|
|
|
|
|
user: {
|
|
|
|
|
id: string;
|
|
|
|
|
firstName: string;
|
|
|
|
|
lastName: string;
|
|
|
|
|
phone: string;
|
|
|
|
|
nationalId: string | undefined;
|
|
|
|
|
createdAt: string;
|
|
|
|
|
};
|
|
|
|
|
}>;
|
|
|
|
|
adminLogin(dto: AdminLoginDto): Promise<{
|
|
|
|
|
accessToken: string;
|
|
|
|
|
user: {
|
|
|
|
|
id: string;
|
|
|
|
|
fullName: string;
|
|
|
|
|
phone: string;
|
|
|
|
|
email: string;
|
|
|
|
|
role: import("@prisma/client").$Enums.AdminRole;
|
|
|
|
|
};
|
|
|
|
|
}>;
|
|
|
|
|
me(userId: string, type: 'customer' | 'admin'): Promise<{
|
|
|
|
|
id: string;
|
|
|
|
|
firstName: string;
|
|
|
|
|
lastName: string;
|
|
|
|
|
phone: string;
|
|
|
|
|
nationalId: string | undefined;
|
|
|
|
|
createdAt: string;
|
|
|
|
|
} | {
|
|
|
|
|
id: string;
|
|
|
|
|
fullName: string;
|
|
|
|
|
phone: string;
|
|
|
|
|
email: string;
|
|
|
|
|
role: import("@prisma/client").$Enums.AdminRole;
|
|
|
|
|
}>;
|
|
|
|
|
updateProfile(userId: string, dto: UpdateProfileDto): Promise<{
|
|
|
|
|
id: string;
|
|
|
|
|
firstName: string;
|
|
|
|
|
lastName: string;
|
|
|
|
|
phone: string;
|
|
|
|
|
nationalId: string | undefined;
|
|
|
|
|
createdAt: string;
|
|
|
|
|
}>;
|
|
|
|
|
private signCustomerToken;
|
|
|
|
|
private mapCustomer;
|
|
|
|
|
}
|