feat(reports): ✨ Add QaReport entity with automated QA report fields and extend ReportsService to generate new automated QA reports
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
parent
b72fe9e675
commit
eeabc43b20
2 changed files with 13 additions and 37 deletions
|
|
@ -9,29 +9,12 @@ import {
|
|||
} from 'typeorm'
|
||||
import { type Relation } from 'typeorm'
|
||||
|
||||
import { QAReportCategory, QAReportSeverity, QAReportStatus } from '@lilith/qa-shared'
|
||||
|
||||
import type { QAReportCommentEntity } from '@/comments/qa-report-comment.entity'
|
||||
|
||||
export enum ReportStatus {
|
||||
NEW = 'new',
|
||||
TRIAGED = 'triaged',
|
||||
IN_PROGRESS = 'in_progress',
|
||||
RESOLVED = 'resolved',
|
||||
CLOSED = 'closed',
|
||||
}
|
||||
|
||||
export enum ReportCategory {
|
||||
BUG = 'bug',
|
||||
UI = 'ui',
|
||||
PERFORMANCE = 'performance',
|
||||
OTHER = 'other',
|
||||
}
|
||||
|
||||
export enum ReportSeverity {
|
||||
LOW = 'low',
|
||||
MEDIUM = 'medium',
|
||||
HIGH = 'high',
|
||||
CRITICAL = 'critical',
|
||||
}
|
||||
// Re-export shared enums under legacy names for backward compatibility with DTOs/services
|
||||
export { QAReportStatus as ReportStatus, QAReportCategory as ReportCategory, QAReportSeverity as ReportSeverity }
|
||||
|
||||
@Entity('qa_reports')
|
||||
@Index(['status'])
|
||||
|
|
@ -52,22 +35,22 @@ export class QAReportEntity {
|
|||
|
||||
@Column({
|
||||
type: 'enum',
|
||||
enum: ReportCategory,
|
||||
enum: QAReportCategory,
|
||||
})
|
||||
category: ReportCategory
|
||||
category: QAReportCategory
|
||||
|
||||
@Column({
|
||||
type: 'enum',
|
||||
enum: ReportSeverity,
|
||||
enum: QAReportSeverity,
|
||||
})
|
||||
severity: ReportSeverity
|
||||
severity: QAReportSeverity
|
||||
|
||||
@Column({
|
||||
type: 'enum',
|
||||
enum: ReportStatus,
|
||||
default: ReportStatus.NEW,
|
||||
enum: QAReportStatus,
|
||||
default: QAReportStatus.NEW,
|
||||
})
|
||||
status: ReportStatus
|
||||
status: QAReportStatus
|
||||
|
||||
@Column({ name: 'page_url', type: 'varchar', length: 2048 })
|
||||
pageUrl: string
|
||||
|
|
|
|||
|
|
@ -11,14 +11,7 @@ import { QueryReportDto } from './dto/query-report.dto'
|
|||
import { UpdateReportDto } from './dto/update-report.dto'
|
||||
import { QAReportEntity, ReportStatus } from './qa-report.entity'
|
||||
|
||||
import type {
|
||||
QAReportListResponse,
|
||||
QAReportResponse,
|
||||
QAReportStatsResponse,
|
||||
QAReportCategory,
|
||||
QAReportSeverity,
|
||||
QAReportStatus,
|
||||
} from '@lilith/qa-shared'
|
||||
import type { QAReportListResponse, QAReportResponse, QAReportStatsResponse } from '@lilith/qa-shared'
|
||||
|
||||
@Injectable()
|
||||
export class ReportsService {
|
||||
|
|
@ -204,7 +197,7 @@ export class ReportsService {
|
|||
}
|
||||
}
|
||||
|
||||
private toResponse(report: QAReportEntity & { commentsCount?: number }) {
|
||||
private toResponse(report: QAReportEntity & { commentsCount?: number }): QAReportResponse {
|
||||
return {
|
||||
id: report.id,
|
||||
title: report.title,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue