forked from Yara724/api
Fix v3 mirror flow
This commit is contained in:
@@ -9,6 +9,7 @@ import {
|
||||
MaxLength,
|
||||
Min,
|
||||
} from "class-validator";
|
||||
import { UNIFIED_FILE_STATUS_KEYS } from "src/helpers/unified-file-status";
|
||||
|
||||
/** Allowed sort keys for V2 list endpoints (claims / blame). */
|
||||
export const LIST_SORT_BY_V2 = [
|
||||
@@ -75,4 +76,13 @@ export class ListQueryV2Dto {
|
||||
@IsString()
|
||||
@MaxLength(64)
|
||||
search?: string;
|
||||
|
||||
@ApiPropertyOptional({
|
||||
enum: UNIFIED_FILE_STATUS_KEYS,
|
||||
description:
|
||||
"Filter by calculated unified file status (blame + claim combined).",
|
||||
})
|
||||
@IsOptional()
|
||||
@IsIn([...UNIFIED_FILE_STATUS_KEYS])
|
||||
unifiedStatus?: (typeof UNIFIED_FILE_STATUS_KEYS)[number];
|
||||
}
|
||||
|
||||
36
src/common/dto/unified-file-status-report.dto.ts
Normal file
36
src/common/dto/unified-file-status-report.dto.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
import { ApiProperty } from "@nestjs/swagger";
|
||||
import {
|
||||
UNIFIED_FILE_STATUS_KEYS,
|
||||
UnifiedFileStatusDefinition,
|
||||
UnifiedFileStatusKey,
|
||||
} from "src/helpers/unified-file-status";
|
||||
|
||||
export class UnifiedFileStatusDefinitionDto implements UnifiedFileStatusDefinition {
|
||||
@ApiProperty({ enum: UNIFIED_FILE_STATUS_KEYS })
|
||||
key: UnifiedFileStatusKey;
|
||||
|
||||
@ApiProperty()
|
||||
labelEn: string;
|
||||
|
||||
@ApiProperty()
|
||||
labelFa: string;
|
||||
|
||||
@ApiProperty()
|
||||
description: string;
|
||||
}
|
||||
|
||||
export class UnifiedFileStatusReportDto {
|
||||
@ApiProperty({ type: [UnifiedFileStatusDefinitionDto] })
|
||||
statuses: UnifiedFileStatusDefinitionDto[];
|
||||
|
||||
@ApiProperty({
|
||||
description: "Counts per unified status key plus `all`",
|
||||
example: {
|
||||
all: 42,
|
||||
IN_PROGRESS: 10,
|
||||
WAITING_FOR_DAMAGE_EXPERT: 5,
|
||||
COMPLETED: 12,
|
||||
},
|
||||
})
|
||||
counts: Record<string, number>;
|
||||
}
|
||||
Reference in New Issue
Block a user