From 656964e18dab391cd549c1ef54a06635b0a13c5d Mon Sep 17 00:00:00 2001 From: morteza-mortezai Date: Sun, 8 Mar 2026 09:24:39 +0330 Subject: [PATCH] auth --- src/modules/auth/providers/auth.service.ts | 6 +++--- src/modules/barname/barname.service.ts | 16 ++++++++++++++-- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/modules/auth/providers/auth.service.ts b/src/modules/auth/providers/auth.service.ts index 37707b9..079b551 100755 --- a/src/modules/auth/providers/auth.service.ts +++ b/src/modules/auth/providers/auth.service.ts @@ -26,7 +26,7 @@ export class AuthService { private readonly notificationQueue: NotificationQueue, private readonly smsService: SmsService, private readonly em: EntityManager, - ) {} + ) { } //****************** */ //****************** */ async initiateRegistration(requestOtpDto: RequestOtpDto, businessId: string) { @@ -140,9 +140,9 @@ export class AuthService { const otpCode = await this.otpService.generateAndSetInCache(phone, "LOGIN"); // await this.smsService.sendSmsVerifyCode(phone, otpCode); - + // TODO : remove otp return { - message: AuthMessage.OTP_SENT, + message: AuthMessage.OTP_SENT + otpCode, }; } diff --git a/src/modules/barname/barname.service.ts b/src/modules/barname/barname.service.ts index 18806be..a1f4e9a 100644 --- a/src/modules/barname/barname.service.ts +++ b/src/modules/barname/barname.service.ts @@ -32,7 +32,19 @@ export class BarnameService { if (!company) throw new BadRequestException(CompanyMessage.COMPANY_NOT_FOUND); const bill = this.em.create(Barname, - { carType, exitAt, origin, plaque, business, description, driverName, driverPhone, company, attachments }); + { + carType, + exitAt, + origin, + plaque, + business, + description, + driverName, + driverPhone, + company, + attachments, + status: BarnameStatus.PENDING + }); await this.em.persistAndFlush(bill); @@ -41,7 +53,7 @@ export class BarnameService { async updateBarnameAsWatcher(id: string, dto: UpdateBarnameAsWatcherDto, business: Business, role: RoleEnum) { - if(role != RoleEnum.WATCHER){ + if (role != RoleEnum.WATCHER) { throw new ForbiddenException("you are not allowed") } const { exitedAt, watcherDescription } = dto;