OTP_EXPIRATION_TIME
This commit is contained in:
@@ -25,7 +25,7 @@ export class AuthService {
|
||||
private readonly adminRepository: AdminRepository,
|
||||
private readonly configService: ConfigService,
|
||||
) {
|
||||
this.OTP_EXPIRATION_TIME = this.configService.getOrThrow<number>('OTP_EXPIRATION_TIME');
|
||||
this.OTP_EXPIRATION_TIME = this.configService.getOrThrow<number>('OTP_EXPIRATION_TIME')??240;
|
||||
}
|
||||
private userOtpKey(restaurantSlug: string, phone: string) {
|
||||
return `otp:${restaurantSlug}:${phone}`;
|
||||
|
||||
@@ -2,8 +2,8 @@ import { Controller, Get, Param } from '@nestjs/common';
|
||||
import { CategoryService } from '../providers/category.service';
|
||||
import { ApiTags, ApiOperation, ApiOkResponse, ApiParam } from '@nestjs/swagger';
|
||||
|
||||
@ApiTags('categories')
|
||||
@Controller('categories')
|
||||
@ApiTags('public/categories')
|
||||
@Controller('public/categories')
|
||||
export class PublicCategoryController {
|
||||
constructor(private readonly categoryService: CategoryService) {}
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@ import { Controller, Get, Param } from '@nestjs/common';
|
||||
import { FoodService } from '../providers/food.service';
|
||||
import { ApiTags, ApiOperation, ApiOkResponse, ApiParam } from '@nestjs/swagger';
|
||||
|
||||
@ApiTags('foods')
|
||||
@Controller('foods')
|
||||
@ApiTags('public/foods')
|
||||
@Controller('public/foods')
|
||||
export class PublicFoodController {
|
||||
constructor(private readonly foodService: FoodService) {}
|
||||
|
||||
|
||||
@@ -1,18 +1,7 @@
|
||||
import { Controller, Get, Post, Body, Patch, Param, Delete, UseGuards } from '@nestjs/common';
|
||||
import { Controller, Get, Param, UseGuards } from '@nestjs/common';
|
||||
import { PaymentMethodService } from '../services/payment-method.service';
|
||||
import { CreatePaymentMethodDto } from '../dto/create-payment-method.dto';
|
||||
import { UpdatePaymentMethodDto } from '../dto/update-payment-method.dto';
|
||||
import {
|
||||
ApiTags,
|
||||
ApiOperation,
|
||||
ApiResponse,
|
||||
ApiCreatedResponse,
|
||||
ApiOkResponse,
|
||||
ApiNotFoundResponse,
|
||||
ApiBody,
|
||||
ApiParam,
|
||||
ApiBearerAuth,
|
||||
} from '@nestjs/swagger';
|
||||
|
||||
import { ApiTags, ApiOperation, ApiOkResponse, ApiNotFoundResponse, ApiParam, ApiBearerAuth } from '@nestjs/swagger';
|
||||
import { AdminAuthGuard } from 'src/modules/auth/guards/adminAuth.guard';
|
||||
|
||||
@UseGuards(AdminAuthGuard)
|
||||
@@ -22,14 +11,6 @@ import { AdminAuthGuard } from 'src/modules/auth/guards/adminAuth.guard';
|
||||
export class PaymentMethodController {
|
||||
constructor(private readonly paymentMethodService: PaymentMethodService) {}
|
||||
|
||||
@Post()
|
||||
@ApiOperation({ summary: 'Create a new payment method' })
|
||||
@ApiBody({ type: CreatePaymentMethodDto })
|
||||
@ApiCreatedResponse({ description: 'Payment method created successfully' })
|
||||
create(@Body() createPaymentMethodDto: CreatePaymentMethodDto) {
|
||||
return this.paymentMethodService.create(createPaymentMethodDto);
|
||||
}
|
||||
|
||||
@Get()
|
||||
@ApiOperation({ summary: 'Get all payment methods' })
|
||||
@ApiOkResponse({ description: 'List of all payment methods' })
|
||||
@@ -45,24 +26,4 @@ export class PaymentMethodController {
|
||||
findOne(@Param('id') id: string) {
|
||||
return this.paymentMethodService.findOne(id);
|
||||
}
|
||||
|
||||
@Patch(':id')
|
||||
@ApiOperation({ summary: 'Update a payment method' })
|
||||
@ApiParam({ name: 'id', type: 'string', description: 'Payment method ID' })
|
||||
@ApiBody({ type: UpdatePaymentMethodDto })
|
||||
@ApiOkResponse({ description: 'Payment method updated successfully' })
|
||||
@ApiNotFoundResponse({ description: 'Payment method not found' })
|
||||
update(@Param('id') id: string, @Body() updatePaymentMethodDto: UpdatePaymentMethodDto) {
|
||||
return this.paymentMethodService.update(id, updatePaymentMethodDto);
|
||||
}
|
||||
|
||||
@Delete(':id')
|
||||
@ApiOperation({ summary: 'Delete a payment method' })
|
||||
@ApiParam({ name: 'id', type: 'string', description: 'Payment method ID' })
|
||||
@ApiOkResponse({ description: 'Payment method deleted successfully' })
|
||||
@ApiNotFoundResponse({ description: 'Payment method not found' })
|
||||
remove(@Param('id') id: string) {
|
||||
return this.paymentMethodService.remove(id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user