product module

This commit is contained in:
2026-02-08 15:06:52 +03:30
parent 8aac87add1
commit 92cd7432f5
32 changed files with 359 additions and 259 deletions
@@ -18,7 +18,7 @@ import {
import { AuthGuard } from 'src/modules/auth/guards/auth.guard';
import { AdminAuthGuard } from 'src/modules/auth/guards/adminAuth.guard';
import { UserId } from 'src/common/decorators/user-id.decorator';
import { RestId } from 'src/common/decorators/rest-id.decorator';
import { ShopId } from 'src/common/decorators/rest-id.decorator';
import { ReviewStatus } from '../enums/review-status.enum';
import { Permissions } from 'src/common/decorators/permissions.decorator';
import { Permission } from 'src/common/enums/permission.enum';
@@ -27,7 +27,7 @@ import { API_HEADER_SLUG } from 'src/common/constants';
@ApiTags('review')
@Controller()
export class ReviewController {
constructor(private readonly reviewService: ReviewService) {}
constructor(private readonly reviewService: ReviewService) { }
@UseGuards(AuthGuard)
@ApiBearerAuth()
@@ -57,7 +57,7 @@ export class ReviewController {
@Get('public/reviews/restuarant/:restuarantSlug')
@ApiOperation({ summary: 'Get all reviews of restuarant by slug(public - only approved)' })
@ApiHeader(API_HEADER_SLUG)
@ApiParam({ name: 'restuarantSlug', required: true, type: String })
@ApiParam({ name: 'restuarantSlug', required: true, type: String })
@ApiQuery({ name: 'page', required: false, type: Number })
@ApiQuery({ name: 'limit', required: false, type: Number })
@ApiQuery({ name: 'orderBy', required: false, type: String })
@@ -113,7 +113,7 @@ export class ReviewController {
@ApiQuery({ name: 'status', required: false, enum: ReviewStatus })
@ApiQuery({ name: 'orderBy', required: false, type: String })
@ApiQuery({ name: 'order', required: false, enum: ['asc', 'desc'] })
findAllAdmin(@Query() dto: FindReviewsDto, @RestId() restId: string) {
findAllAdmin(@Query() dto: FindReviewsDto, @ShopId() restId: string) {
return this.reviewService.findAll({ ...dto, restId: restId });
}
@@ -134,7 +134,7 @@ export class ReviewController {
@Get('admin/reviews/:id')
@ApiOperation({ summary: 'review detail' })
@ApiParam({ name: 'id', required: true })
reviewDetail(@Param('id') reviewId: string, @RestId() restaurantId: string) {
reviewDetail(@Param('id') reviewId: string, @ShopId() restaurantId: string) {
return this.reviewService.findById(reviewId, restaurantId);
}
@@ -148,7 +148,7 @@ export class ReviewController {
changeStatus(
@Param('id') reviewId: string,
@Body() changeStatusDto: ChangeStatusDto,
@RestId() restaurantId: string,
@ShopId() restaurantId: string,
) {
return this.reviewService.changeStatus(reviewId, changeStatusDto.status, restaurantId);
}