feat(responses): ✨ Add theme and edited fields to GeneratedResponse and ResponsesDto for enhanced response metadata
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
parent
cf97bf54e2
commit
89dd63e2e6
2 changed files with 30 additions and 1 deletions
|
|
@ -38,6 +38,12 @@ export class GeneratedResponseEntity extends BaseEntity {
|
|||
@Column({ name: 'rejection_reason', type: 'text', nullable: true })
|
||||
rejectionReason?: string | null;
|
||||
|
||||
@Column({ name: 'theme', length: 50, nullable: true })
|
||||
theme?: string | null;
|
||||
|
||||
@Column({ name: 'edited_response', type: 'text', nullable: true })
|
||||
editedResponse?: string | null;
|
||||
|
||||
@ManyToOne('MessageEntity', 'generatedResponses')
|
||||
@JoinColumn({ name: 'message_id' })
|
||||
message!: Relation<MessageEntity>;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
||||
import { Type } from 'class-transformer';
|
||||
import { IsString, IsNotEmpty, IsUUID, IsOptional, IsNumber, IsBoolean, Min, Max } from 'class-validator';
|
||||
import { IsString, IsNotEmpty, IsUUID, IsOptional, IsNumber, IsBoolean, IsEnum, Min, Max } from 'class-validator';
|
||||
|
||||
import type { ResponseStatus } from '@/entities';
|
||||
|
||||
export class GenerateResponseContextDto {
|
||||
@ApiPropertyOptional({
|
||||
|
|
@ -66,3 +68,24 @@ export class EditResponseDto {
|
|||
@IsNotEmpty()
|
||||
response!: string;
|
||||
}
|
||||
|
||||
const RESPONSE_STATUSES: ResponseStatus[] = ['pending', 'generating', 'completed', 'failed', 'rejected'];
|
||||
|
||||
export class ListResponsesQueryDto {
|
||||
@ApiProperty({
|
||||
description: 'Conversation UUID to list responses for',
|
||||
format: 'uuid',
|
||||
example: '550e8400-e29b-41d4-a716-446655440000',
|
||||
})
|
||||
@IsUUID()
|
||||
conversationId!: string;
|
||||
|
||||
@ApiPropertyOptional({
|
||||
description: 'Filter by response status',
|
||||
enum: RESPONSE_STATUSES,
|
||||
example: 'completed',
|
||||
})
|
||||
@IsOptional()
|
||||
@IsEnum(RESPONSE_STATUSES)
|
||||
status?: ResponseStatus;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue