feat: add payment module and factory

This commit is contained in:
mahyargdz
2025-02-03 15:41:53 +03:30
parent 8fb587f976
commit 31368610dd
48 changed files with 931 additions and 81 deletions
+12 -1
View File
@@ -22,6 +22,7 @@ export class AuthService {
private readonly tokensService: TokensService,
) {}
//****************** */
//****************** */
async initiateRegistration(requestOtpDto: RequestOtpDto) {
const { phone } = requestOtpDto;
const existUser = await this.usersService.findOneWithPhone(phone);
@@ -44,6 +45,7 @@ export class AuthService {
};
}
//****************** */
//****************** */
async completeRegistration(completeRegistrationDto: CompleteRegistrationDto) {
const { phone, code } = completeRegistrationDto;
const isValid = await this.otpService.verifyOtp(phone, code, "REGISTER");
@@ -62,7 +64,7 @@ export class AuthService {
};
}
//****************** */
//****************** */
async loginWithPassword(loginDto: LoginPasswordDTO) {
const { email, password } = loginDto;
@@ -76,6 +78,7 @@ export class AuthService {
};
}
//****************** */
//****************** */
async adminLoginWithPassword(loginDto: LoginPasswordDTO) {
const { email, password } = loginDto;
@@ -92,6 +95,8 @@ export class AuthService {
}
//****************** */
//****************** */
async checkUserExist(checkUserExistDto: CheckUserExistDto) {
const user = await this.usersService.findOneWithEmail(checkUserExistDto.email);
if (!user) throw new BadRequestException(UserMessage.USER_NOT_FOUND);
@@ -99,6 +104,8 @@ export class AuthService {
}
//****************** */
//****************** */
async requestLoginOtp(requestOtpDto: RequestOtpDto, isAdmin: boolean = false) {
const { phone } = requestOtpDto;
const user = await this.usersService.findOneWithPhone(phone);
@@ -126,6 +133,8 @@ export class AuthService {
}
//****************** */
//****************** */
async verifyLoginOtp(verifyOtpDto: VerifyOtpDto) {
const { code, phone } = verifyOtpDto;
@@ -139,6 +148,8 @@ export class AuthService {
}
//****************** */
//****************** */
async adminVerifyLoginOtp(verifyOtpDto: VerifyOtpDto) {
const { code, phone } = verifyOtpDto;