mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-05 04:53:02 +00:00
43 lines
1.1 KiB
TypeScript
43 lines
1.1 KiB
TypeScript
// tslint:disable:no-default-export
|
|
// tslint:disable:no-magic-numbers
|
|
import {SCConfigFile} from '@openstapps/core';
|
|
import {RecursivePartial} from '@openstapps/logger/lib/common';
|
|
import moment from 'moment';
|
|
import {inRangeInclusive} from './default';
|
|
|
|
const ssRange = [4, 9];
|
|
const wsRange = [10, 3];
|
|
const month = moment()
|
|
.month();
|
|
const year = moment()
|
|
.year();
|
|
const wsYearOffset = (month < wsRange[0] ? -1 : 0);
|
|
const wsAcronym = `WiSe ${(year + wsYearOffset).toString()
|
|
.slice(-2)}/${(year + 1 + wsYearOffset).toString()
|
|
.slice(-2)}`;
|
|
const ssAcronym = `SoSe ${(year + (month <= wsRange[1] ? -1 : 0)).toString()
|
|
.slice(-2)}`;
|
|
|
|
/**
|
|
* This is the default configuration for the university of Kassel
|
|
*/
|
|
const config: RecursivePartial<SCConfigFile> = {
|
|
internal: {
|
|
boostings: {
|
|
default: [
|
|
{
|
|
factor: 1,
|
|
fields: {
|
|
'academicTerms.acronym': {
|
|
[ssAcronym]: inRangeInclusive(month, ssRange) ? 1.1 : 1.05,
|
|
[wsAcronym]: inRangeInclusive(month, wsRange) ? 1.1 : 1.05,
|
|
},
|
|
},
|
|
},
|
|
],
|
|
},
|
|
},
|
|
};
|
|
|
|
export default config;
|