Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 0 additions & 65 deletions migrations/add_performance_indexes.sql

This file was deleted.

34 changes: 0 additions & 34 deletions migrations/rollback_performance_indexes.sql

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { SubmitAssessmentToAiDto } from '../ai_assessment/dto/submit_assessment_
type TrackerInsertObject = {
questionSetId: string;
userId: string;
parentId?: string;
fileUrls: string[];
status: 'RECEIVED' | 'PROCESSING' | 'COMPLETED' | 'FAILED';
metadata: Record<string, any>;
Expand Down Expand Up @@ -246,9 +247,16 @@ export class AnswerSheetSubmissionsService {
const urlObj = new URL(url);
return urlObj.pathname.slice(1); // removes the leading '/'
});

// Handle parentId logic: If not provided or empty, use questionSetId
const parentId = input.parentId && input.parentId.trim() !== ''
? input.parentId
: input.questionSetId;

return {
questionSetId: input.questionSetId,
userId: input.userId,
parentId: parentId,
fileUrls: fileUrls,
status: 'RECEIVED',
metadata: input.metadata,
Expand Down Expand Up @@ -388,6 +396,11 @@ export class AnswerSheetSubmissionsService {
params.push(searchFilter.questionSetId);
}

if (searchFilter?.parentId) {
conditions.push(`"parent_id" = $${params.length + 1}`);
params.push(searchFilter.parentId);
}

if (searchFilter?.status) {
conditions.push(`"status" = $${params.length + 1}`);
params.push(searchFilter.status);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ export class AnswerSheetSubmissionsCreateDto {
@IsString()
questionSetId: string;

@IsOptional()
@IsString()
parentId?: string;

@IsArray()
@IsString({ each: true })
fileUrls: string[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ export class AnswerSheetSubmissions {
@Column({ name: 'question_set_id' })
questionSetId: string;

@Column({ name: 'parent_id', type: 'text', nullable: true })
parentId: string;

@Column('text', { array: true, name: 'file_urls' })
fileUrls: string[];

Expand Down