diff --git a/src/modules/auth/services/auth.service.ts b/src/modules/auth/services/auth.service.ts index 196f0bf..063a64b 100644 --- a/src/modules/auth/services/auth.service.ts +++ b/src/modules/auth/services/auth.service.ts @@ -25,7 +25,7 @@ export class AuthService { private readonly adminRepository: AdminRepository, private readonly configService: ConfigService, ) { - this.OTP_EXPIRATION_TIME = this.configService.getOrThrow('OTP_EXPIRATION_TIME'); + this.OTP_EXPIRATION_TIME = this.configService.getOrThrow('OTP_EXPIRATION_TIME')??240; } private userOtpKey(restaurantSlug: string, phone: string) { return `otp:${restaurantSlug}:${phone}`; diff --git a/src/modules/foods/controllers/public-category.controller.ts b/src/modules/foods/controllers/public-category.controller.ts index 8b37006..514d6ca 100644 --- a/src/modules/foods/controllers/public-category.controller.ts +++ b/src/modules/foods/controllers/public-category.controller.ts @@ -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) {} diff --git a/src/modules/foods/controllers/public-food.controller.ts b/src/modules/foods/controllers/public-food.controller.ts index eb3befa..e82293b 100644 --- a/src/modules/foods/controllers/public-food.controller.ts +++ b/src/modules/foods/controllers/public-food.controller.ts @@ -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) {} diff --git a/src/modules/payments/controllers/payment-method.controller.ts b/src/modules/payments/controllers/payment-method.controller.ts index 7f748ef..8dade11 100644 --- a/src/modules/payments/controllers/payment-method.controller.ts +++ b/src/modules/payments/controllers/payment-method.controller.ts @@ -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); - } } -