From d412b2589a54b97cf0944d2c1e8f43e7b3a67c54 Mon Sep 17 00:00:00 2001 From: Valtteri Kantanen Date: Fri, 16 Aug 2024 18:35:59 +0300 Subject: [PATCH] [Faculties] Fix type error --- .../src/services/faculty/facultyService.ts | 29 +------------------ .../faculty/facultyStudentProgress.ts | 2 ++ 2 files changed, 3 insertions(+), 28 deletions(-) diff --git a/services/backend/src/services/faculty/facultyService.ts b/services/backend/src/services/faculty/facultyService.ts index a700b06bfd..b73502ce7b 100644 --- a/services/backend/src/services/faculty/facultyService.ts +++ b/services/backend/src/services/faculty/facultyService.ts @@ -3,6 +3,7 @@ import moment from 'moment' import { Graduated, Name, ProgrammeFilter, SpecialGroups, YearType } from '../../types' import { redisClient } from '../redis' import { getDegreeProgrammesOfFaculty } from './faculty' +import { FacultyProgressData } from './facultyStudentProgress' const createRedisKeyForFacultyProgrammes = (id: string, programmeFilter: ProgrammeFilter) => { return `FACULTY_PROGRAMMES_${id}_${programmeFilter}` @@ -247,34 +248,6 @@ export const getGraduationStats = async ( return data } -type Titles = Array - -type ProgrammeStats = Record>> - -type CreditCount = Record - -type FacultyProgressData = { - id: string - years: string[] - yearlyBachelorTitles: Titles - yearlyBcMsTitles: Titles - yearlyMasterTitles: Titles - yearlyLicentiateTitles: Titles - programmeNames: ProgrammeNames - bachelorsProgStats: ProgrammeStats - bcMsProgStats: ProgrammeStats - licentiateProgStats: ProgrammeStats - mastersProgStats: ProgrammeStats - doctoralProgStats: ProgrammeStats - creditCounts: { - bachelor: CreditCount - bachelorMaster: CreditCount - master: CreditCount - licentiate: CreditCount - doctor: CreditCount - } -} - export const setFacultyProgressStats = async ( data: FacultyProgressData, specialGroups: SpecialGroups, diff --git a/services/backend/src/services/faculty/facultyStudentProgress.ts b/services/backend/src/services/faculty/facultyStudentProgress.ts index 48264368fa..d44b2c5c06 100644 --- a/services/backend/src/services/faculty/facultyStudentProgress.ts +++ b/services/backend/src/services/faculty/facultyStudentProgress.ts @@ -196,3 +196,5 @@ export const combineFacultyStudentProgress = async ( return result } + +export type FacultyProgressData = Awaited>