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
@@ -2,7 +2,7 @@ import { Controller, Get, Post, Body, UseGuards, Res, Req, Patch, Param } from '
import { PagerService } from '../providers/pager.service';
import { CreatePagerDto } from '../dto/create-pager.dto';
import { OptionalAuthGuard } from '../../../auth/guards/optinalAuth.guard';
import { RestId } from 'src/common/decorators/rest-id.decorator';
import { ShopId } from 'src/common/decorators/rest-id.decorator';
import { UserId } from 'src/common/decorators/user-id.decorator';
import { RestSlug } from 'src/common/decorators/rest-slug.decorator';
import { ApiTags, ApiOperation, ApiBody, ApiHeader, ApiBearerAuth, ApiParam } from '@nestjs/swagger';
@@ -31,7 +31,7 @@ export class PagerController {
@Req() request: FastifyRequest,
@Res() reply: FastifyReply,
@RestSlug() slug: string,
@RestId() restId?: string,
@ShopId() restId?: string,
@UserId() userId?: string,
) {
// Convert empty strings to undefined for cleaner validation
@@ -79,7 +79,7 @@ export class PagerController {
@ApiBearerAuth()
@Get('admin/pager')
@ApiOperation({ summary: 'Get all pager requests for the shop' })
async findAllAdmin(@RestId() restId: string) {
async findAllAdmin(@ShopId() restId: string) {
return this.pagerService.findAllByRestaurantId(restId);
}
@@ -92,7 +92,7 @@ export class PagerController {
@ApiBody({ type: UpdatePagerStatusDto })
async updateStatus(
@Param('pagerId') pagerId: string,
@RestId() restId: string,
@ShopId() restId: string,
@AdminId() adminId: string,
@Body() dto: UpdatePagerStatusDto,
) {