forked from Yara724/api
Fix searching on GET APIs
This commit is contained in:
@@ -26,6 +26,10 @@ import { CurrentUser } from "src/decorators/user.decorator";
|
||||
import { RoleEnum } from "src/Types&Enums/role.enum";
|
||||
import { ExpertBlameService } from "./expert-blame.service";
|
||||
import { ListQueryV2Dto } from "src/common/dto/list-query-v2.dto";
|
||||
import {
|
||||
UnifiedFileStatusReportDto,
|
||||
UnifiedFileStatusReportQueryDto,
|
||||
} from "src/common/dto/unified-file-status-report.dto";
|
||||
import { AllRequestDtoRsV2 } from "./dto/all-request.dto";
|
||||
import { SubmitReplyDto } from "./dto/reply.dto";
|
||||
import { ResendRequestDto } from "./dto/resend.dto";
|
||||
@@ -44,8 +48,9 @@ export class ExpertBlameV2Controller {
|
||||
description:
|
||||
"Damage experts (`expert`): tenant-scoped **DISAGREEMENT** queue (available, locked, or decided by you). " +
|
||||
"Field experts (`field_expert`): all expert-initiated blame files they created (LINK + IN_PERSON). Use expert-claim for claims after blame completion. " +
|
||||
"Optional query: `search`, `sortBy` (publicId | createdAt | requestNo | status), `sortOrder`, `page`, `limit`, `unifiedStatus` (calculated blame+claim status).",
|
||||
"Optional query: `search`, `sortBy` (publicId | createdAt | requestNo | status), `sortOrder`, `page`, `limit`, `unifiedStatus`, `fileType` (THIRD_PARTY | CAR_BODY).",
|
||||
})
|
||||
@ApiResponse({ status: 200, type: AllRequestDtoRsV2 })
|
||||
async findAll(
|
||||
@CurrentUser() actor: any,
|
||||
@Query() query: ListQueryV2Dto,
|
||||
@@ -64,11 +69,18 @@ export class ExpertBlameV2Controller {
|
||||
@ApiOperation({
|
||||
summary: "Unified file status catalog + counts (blame + linked claim)",
|
||||
description:
|
||||
"Calculatable statuses for this expert's blame portfolio. Filter lists with `unifiedStatus` query param.",
|
||||
"Calculatable statuses for this expert's blame portfolio. Filter lists with `unifiedStatus` and `fileType` query params. Optional `from` / `to` ISO dates narrow the counted portfolio.",
|
||||
})
|
||||
async getUnifiedFileStatusReportV2(@CurrentUser() actor: any) {
|
||||
@ApiResponse({ status: 200, type: UnifiedFileStatusReportDto })
|
||||
async getUnifiedFileStatusReportV2(
|
||||
@CurrentUser() actor: any,
|
||||
@Query() query: UnifiedFileStatusReportQueryDto,
|
||||
): Promise<UnifiedFileStatusReportDto> {
|
||||
try {
|
||||
return await this.expertBlameService.getUnifiedFileStatusReportV2(actor);
|
||||
return await this.expertBlameService.getUnifiedFileStatusReportV2(
|
||||
actor,
|
||||
query,
|
||||
);
|
||||
} catch (error) {
|
||||
if (error instanceof HttpException) throw error;
|
||||
throw new InternalServerErrorException(
|
||||
|
||||
Reference in New Issue
Block a user