Skip to content

Commit

Permalink
[Faculties] Fix type error
Browse files Browse the repository at this point in the history
  • Loading branch information
valtterikantanen committed Aug 16, 2024
1 parent 9a00ae5 commit d412b25
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 28 deletions.
29 changes: 1 addition & 28 deletions services/backend/src/services/faculty/facultyService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`
Expand Down Expand Up @@ -247,34 +248,6 @@ export const getGraduationStats = async (
return data
}

type Titles = Array<string[]>

type ProgrammeStats = Record<string, Record<string, Array<number[]>>>

type CreditCount = Record<string, number[]>

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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,3 +196,5 @@ export const combineFacultyStudentProgress = async (

return result
}

export type FacultyProgressData = Awaited<ReturnType<typeof combineFacultyStudentProgress>>

0 comments on commit d412b25

Please sign in to comment.