From 2d1b61a74d5f6cc4ae447d67b4ce7618c06962dd Mon Sep 17 00:00:00 2001 From: "detail-app[bot]" <180357370+detail-app[bot]@users.noreply.github.com> Date: Mon, 28 Sep 2026 22:11:53 +0000 Subject: [PATCH] chore: remove unused generateFileForProjects function --- src/automation/tasks/fileGenerate.ts | 39 ---------------------------- 1 file changed, 39 deletions(-) diff --git a/src/automation/tasks/fileGenerate.ts b/src/automation/tasks/fileGenerate.ts index d6de082..e2b72f1 100644 --- a/src/automation/tasks/fileGenerate.ts +++ b/src/automation/tasks/fileGenerate.ts @@ -61,45 +61,6 @@ async function generateFileForIndividuals( } } -async function generateFileForProjects( - fileType: FileType, - event: Event, - projects: DeepProject[], - existingFiles: File[] -): Promise { - const prisma = Container.get(PrismaClient); - const now = DateTime.now(); - - for (const project of projects) { - // Check if the event is over if the condition is Completed - const weeks = Math.max(0, ...project.students.map(s => s.weeks)); - if ( - fileType.generationCondition === FileTypeGenerationCondition.COMPLETED - && now < DateTime.fromJSDate(event.startsAt).plus({ weeks: weeks || event.defaultWeeks || 4 }) - ) { continue; } - - // Check if the file has already been created - if (existingFiles.some(f => f.projectId === project.id)) { continue; } - - DEBUG(`Creating file ${fileType.id} for project ${project.id}`); - - const pollingUrl = await generateMedia( - fileType.templateId, - fileType.type, - fileType.layers as object, - { project, event } - ); - - await prisma.file.create({ - data: { - pollingUrl, - projectId: project.id, - fileTypeId: fileType.id, - } - }); - } -} - export default async function fileGenerate(): Promise { const prisma = Container.get(PrismaClient); const now = new Date();