@studyportals/fawkes 7.2.1-0 → 7.2.2-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (23) hide show
  1. package/dist/src/enums/FilterCombinations.d.ts +4 -0
  2. package/dist/src/enums/FilterCombinations.js +4 -0
  3. package/dist/src/programmes/SearchIndexabilityManager.js +5 -7
  4. package/dist/src/programmes/policies/DegreeCountryAttendance.js +2 -7
  5. package/dist/src/programmes/policies/DegreeCountryDiscipline.js +3 -6
  6. package/dist/src/programmes/policies/DegreeCountryTuitionFee.js +1 -6
  7. package/dist/src/programmes/policies/DisciplineDegree.d.ts +2 -1
  8. package/dist/src/programmes/policies/DisciplineDegree.js +3 -1
  9. package/dist/src/programmes/policies/index.d.ts +4 -0
  10. package/dist/src/programmes/policies/index.js +4 -0
  11. package/dist/src/programmes/rules/DegreeAttendanceDisciplineRule.js +2 -8
  12. package/dist/src/programmes/rules/DegreeAttendanceDisciplineSpecificRule.js +0 -4
  13. package/dist/src/programmes/rules/DegreeCountryAttendanceSpecificRule.js +0 -3
  14. package/dist/src/programmes/rules/DegreeCountrySpecificRule.js +3 -3
  15. package/dist/src/programmes/rules/DegreeCountryTuitionFeeRule.js +2 -7
  16. package/dist/src/programmes/rules/DegreeCountryTuitionFeeSpecificRule.js +0 -3
  17. package/dist/src/programmes/rules/DegreeDisciplineRule.js +0 -25
  18. package/dist/src/programmes/rules/MBACountryAttendanceRule.js +2 -7
  19. package/dist/src/programmes/rules/MasterOfEducationCountryDisciplineRule.js +2 -9
  20. package/dist/src/programmes/rules/MasterOfLawsCountryAttendanceRule.js +3 -8
  21. package/dist/src/programmes/rules/MasterOfLawsCountryTuitionFeeRule.js +1 -4
  22. package/dist/src/programmes/rules/MasterOfPhilosophyCountryAttendanceRule.js +2 -7
  23. package/package.json +1 -1
@@ -22,6 +22,10 @@ export declare enum FilterCombinations {
22
22
  DISCIPLINE_TUITION_FEE_ATTENDANCE = "disciplineTuitionFeeAttendance",
23
23
  DISCIPLINE_COUNTRY_EDUCATIONAL_FORM = "disciplineCountryEducationalForm",
24
24
  DISCIPLINE_COUNTRY_DEGREE = "disciplineCountryDegree",
25
+ DEGREE_COUNTRY_DISCIPLINE = "degreeCountryDiscipline",
26
+ DEGREE_ATTENDANCE_DISCIPLINE = "degreeAttendanceDiscipline",
27
+ DEGREE_COUNTRY_TUITION_FEE = "degreeCountryTuitionFee",
28
+ DEGREE_COUNTRY_ATTENDANCE = "degreeCountryAttendance",
25
29
  DISCIPLINE = "discipline",
26
30
  UNFILTERED = "unfiltered",
27
31
  UNIVERSITY_COUNTRY = "universityCountry",
@@ -23,6 +23,10 @@ export var FilterCombinations;
23
23
  FilterCombinations["DISCIPLINE_TUITION_FEE_ATTENDANCE"] = "disciplineTuitionFeeAttendance";
24
24
  FilterCombinations["DISCIPLINE_COUNTRY_EDUCATIONAL_FORM"] = "disciplineCountryEducationalForm";
25
25
  FilterCombinations["DISCIPLINE_COUNTRY_DEGREE"] = "disciplineCountryDegree";
26
+ FilterCombinations["DEGREE_COUNTRY_DISCIPLINE"] = "degreeCountryDiscipline";
27
+ FilterCombinations["DEGREE_ATTENDANCE_DISCIPLINE"] = "degreeAttendanceDiscipline";
28
+ FilterCombinations["DEGREE_COUNTRY_TUITION_FEE"] = "degreeCountryTuitionFee";
29
+ FilterCombinations["DEGREE_COUNTRY_ATTENDANCE"] = "degreeCountryAttendance";
26
30
  FilterCombinations["DISCIPLINE"] = "discipline";
27
31
  FilterCombinations["UNFILTERED"] = "unfiltered";
28
32
  FilterCombinations["UNIVERSITY_COUNTRY"] = "universityCountry";
@@ -1,4 +1,4 @@
1
- import { Area, Attendance, AttendanceDegree, Continent, ContinentTuitionFee, Country, CountryAttendance, CountryAttendanceDegree, CountryDegree, CountryDuration, CountryDurationDegree, CountryEducationalForm, CountryFormat, CountryTuitionFee, Discipline, DisciplineArea, DisciplineAttendance, DisciplineContinent, DisciplineCountry, DisciplineCountryDegree, DisciplineCountryEducationalForm, DisciplineDegree, DisciplineDuration, DisciplineEducationalForm, DisciplineFormat, DisciplineTuitionFee, DisciplineTuitionFeeAttendance, SpecialProgrammes, TuitionFee, Unfiltered } from './policies';
1
+ import { Area, Attendance, Continent, ContinentTuitionFee, Country, CountryAttendance, CountryDuration, CountryEducationalForm, CountryFormat, CountryTuitionFee, DegreeAttendanceDiscipline, DegreeCountryAttendance, DegreeCountryDiscipline, DegreeCountryTuitionFee, Discipline, DisciplineArea, DisciplineAttendance, DisciplineContinent, DisciplineCountry, DisciplineCountryEducationalForm, DisciplineDuration, DisciplineEducationalForm, DisciplineFormat, DisciplineTuitionFee, DisciplineTuitionFeeAttendance, SpecialProgrammes, TuitionFee, Unfiltered } from './policies';
2
2
  import { DependencyTypes } from '../enums/DependencyTypes';
3
3
  export class SearchIndexabilityManager {
4
4
  policies;
@@ -13,26 +13,24 @@ export class SearchIndexabilityManager {
13
13
  this.policies = [
14
14
  new Area(dependencies),
15
15
  new Attendance(dependencies),
16
- new AttendanceDegree(dependencies),
17
16
  new Continent(dependencies),
18
17
  new ContinentTuitionFee(dependencies),
19
18
  new Country(dependencies),
20
19
  new CountryAttendance(dependencies),
21
- new CountryAttendanceDegree(dependencies),
22
- new CountryDegree(dependencies),
23
20
  new CountryDuration(dependencies),
24
- new CountryDurationDegree(dependencies),
25
21
  new CountryEducationalForm(dependencies),
26
22
  new CountryFormat(dependencies),
27
23
  new CountryTuitionFee(dependencies),
24
+ new DegreeAttendanceDiscipline(dependencies),
25
+ new DegreeCountryAttendance(dependencies),
26
+ new DegreeCountryDiscipline(dependencies),
27
+ new DegreeCountryTuitionFee(dependencies),
28
28
  new Discipline(dependencies),
29
29
  new DisciplineArea(dependencies),
30
30
  new DisciplineAttendance(dependencies),
31
31
  new DisciplineContinent(dependencies),
32
32
  new DisciplineCountry(dependencies),
33
- new DisciplineCountryDegree(dependencies),
34
33
  new DisciplineCountryEducationalForm(dependencies),
35
- new DisciplineDegree(dependencies),
36
34
  new DisciplineDuration(dependencies),
37
35
  new DisciplineEducationalForm(dependencies),
38
36
  new DisciplineFormat(dependencies),
@@ -33,7 +33,6 @@ export class DegreeCountryAttendance extends ProgrammesBaseIndexabilityPolicy {
33
33
  const countryFragments = CountryPresenter.getInstance().getFragments();
34
34
  const attendanceFragments = AttendancePresenter.getInstance().getFragments();
35
35
  const paths = [];
36
- // Get degree fragments
37
36
  const mba = degreeFragments.find(d => d.id === 'master-of-business-administration');
38
37
  const llm = degreeFragments.find(d => d.id === 'master-of-laws');
39
38
  const mphil = degreeFragments.find(d => d.id === 'master-of-philosophy');
@@ -41,11 +40,9 @@ export class DegreeCountryAttendance extends ProgrammesBaseIndexabilityPolicy {
41
40
  if (!onlineAttendance) {
42
41
  return paths;
43
42
  }
44
- // Allowed countries for specific degrees
45
- const llmAllowedCountryIds = ['82', '30', '32', '108']; // USA, UK, Canada, India
46
- const mphilAllowedCountryIds = ['82', '30', '108']; // USA, UK, India
43
+ const llmAllowedCountryIds = ['82', '30', '32', '108'];
44
+ const mphilAllowedCountryIds = ['82', '30', '108'];
47
45
  for (const pageNumber of this.indexablePageNumbers) {
48
- // MBA + online attendance accepts all countries
49
46
  if (mba) {
50
47
  for (const country of countryFragments) {
51
48
  const filterKeyValues = new Map([
@@ -59,7 +56,6 @@ export class DegreeCountryAttendance extends ProgrammesBaseIndexabilityPolicy {
59
56
  }
60
57
  }
61
58
  }
62
- // Master of Laws + online attendance accepts specific countries
63
59
  if (llm) {
64
60
  const llmCountries = countryFragments.filter(c => llmAllowedCountryIds.includes(c.id));
65
61
  for (const country of llmCountries) {
@@ -74,7 +70,6 @@ export class DegreeCountryAttendance extends ProgrammesBaseIndexabilityPolicy {
74
70
  }
75
71
  }
76
72
  }
77
- // Master of Philosophy + online attendance accepts specific countries
78
73
  if (mphil) {
79
74
  const mphilCountries = countryFragments.filter(c => mphilAllowedCountryIds.includes(c.id));
80
75
  for (const country of mphilCountries) {
@@ -29,13 +29,11 @@ export class DegreeCountryDiscipline extends ProgrammesBaseIndexabilityPolicy {
29
29
  const countryFragments = CountryPresenter.getInstance().getFragments();
30
30
  const disciplineFragments = DisciplinePresenter.getInstance().getFragments();
31
31
  const paths = [];
32
- // Define allowed degrees and their corresponding country IDs
33
32
  const degreeCountryMap = {
34
- 'master-of-science': ['82', '32', '11', '30'], // USA, Canada, Germany, UK
35
- 'master-of-business-administration': ['82', '30'], // USA, UK
36
- 'master-of-education': ['202', '32'] // Australia, Canada
33
+ 'master-of-science': ['82', '32', '11', '30'],
34
+ 'master-of-business-administration': ['82', '30'],
35
+ 'master-of-education': ['202', '32']
37
36
  };
38
- // Education discipline IDs for Master of Education
39
37
  const educationDisciplineIds = [
40
38
  '289', '290', '360', '291', '292', '333', '8', '349',
41
39
  '293', '98', '371', '363', '355', '370', '348', '97',
@@ -47,7 +45,6 @@ export class DegreeCountryDiscipline extends ProgrammesBaseIndexabilityPolicy {
47
45
  if (!degree)
48
46
  continue;
49
47
  const allowedCountries = countryFragments.filter(c => allowedCountryIds.includes(c.id));
50
- // Filter disciplines based on degree type
51
48
  let allowedDisciplines = disciplineFragments;
52
49
  if (degreeId === 'master-of-education') {
53
50
  allowedDisciplines = disciplineFragments.filter(d => educationDisciplineIds.includes(d.id));
@@ -32,18 +32,14 @@ export class DegreeCountryTuitionFee extends ProgrammesBaseIndexabilityPolicy {
32
32
  const countryFragments = CountryPresenter.getInstance().getFragments();
33
33
  const tuitionFeeFragments = TuitionFeePresenter.getInstance().getFragments();
34
34
  const paths = [];
35
- // Process MBA with affordable tuition fee (all countries)
36
35
  const mba = degreeFragments.find(d => d.id === 'master-of-business-administration');
37
- // Process Master of Laws with affordable tuition fee (specific countries)
38
36
  const llm = degreeFragments.find(d => d.id === 'master-of-laws');
39
37
  const affordableTuition = tuitionFeeFragments.find(t => t.id === TuitionFeeFilterOptionValue.ZERO_TO_TWO_THOUSAND_FIVE_HUNDRED);
40
38
  if (!affordableTuition) {
41
39
  return paths;
42
40
  }
43
- // Allowed countries for Master of Laws
44
- const llmAllowedCountryIds = ['82', '30', '32', '108']; // USA, UK, Canada, India
41
+ const llmAllowedCountryIds = ['82', '30', '32', '108'];
45
42
  for (const pageNumber of this.indexablePageNumbers) {
46
- // MBA + affordable tuition accepts all countries
47
43
  if (mba) {
48
44
  for (const country of countryFragments) {
49
45
  const filterKeyValues = new Map([
@@ -57,7 +53,6 @@ export class DegreeCountryTuitionFee extends ProgrammesBaseIndexabilityPolicy {
57
53
  }
58
54
  }
59
55
  }
60
- // Master of Laws + affordable tuition accepts specific countries
61
56
  if (llm) {
62
57
  const llmCountries = countryFragments.filter(c => llmAllowedCountryIds.includes(c.id));
63
58
  for (const country of llmCountries) {
@@ -3,13 +3,14 @@ import { OnlyFiltersSelectedRule } from '../../common/rules/OnlyFiltersSelectedR
3
3
  import { SingleValueSelectedForFilterRule } from '../../common/rules/SingleValueSelectedForFilterRule';
4
4
  import { FilterCombinations } from '../../enums/FilterCombinations';
5
5
  import { IndexableDegreeRule } from '../rules/IndexableDegreeRule';
6
+ import { DegreeDisciplineRule } from '../rules/DegreeDisciplineRule';
6
7
  import { ProgrammesBaseIndexabilityPolicy } from '../ProgrammesBaseIndexabilityPolicy';
7
8
  import { IProgrammeSeoDependencies } from '../types/IProgrammeSeoDependencies';
8
9
  export declare class DisciplineDegree extends ProgrammesBaseIndexabilityPolicy {
9
10
  readonly name: string;
10
11
  readonly description: string;
11
12
  readonly filterKeys: FilterKey[];
12
- protected readonly rules: (SingleValueSelectedForFilterRule | OnlyFiltersSelectedRule | IndexableDegreeRule)[];
13
+ protected readonly rules: (SingleValueSelectedForFilterRule | OnlyFiltersSelectedRule | IndexableDegreeRule | DegreeDisciplineRule)[];
13
14
  constructor(dependencies: IProgrammeSeoDependencies);
14
15
  protected generateUrls(): Promise<string[]>;
15
16
  get filterCombination(): FilterCombinations;
@@ -3,6 +3,7 @@ import { OnlyFiltersSelectedRule } from '../../common/rules/OnlyFiltersSelectedR
3
3
  import { SingleValueSelectedForFilterRule } from '../../common/rules/SingleValueSelectedForFilterRule';
4
4
  import { FilterCombinations } from '../../enums/FilterCombinations';
5
5
  import { IndexableDegreeRule } from '../rules/IndexableDegreeRule';
6
+ import { DegreeDisciplineRule } from '../rules/DegreeDisciplineRule';
6
7
  import { ProgrammesBaseIndexabilityPolicy } from '../ProgrammesBaseIndexabilityPolicy';
7
8
  import { DisciplinePresenter } from '../../presenters/DisciplinePresenter';
8
9
  import { DegreePresenter } from '../../presenters/DegreePresenter';
@@ -14,7 +15,8 @@ export class DisciplineDegree extends ProgrammesBaseIndexabilityPolicy {
14
15
  new SingleValueSelectedForFilterRule(FilterKey.DISCIPLINES),
15
16
  new SingleValueSelectedForFilterRule(FilterKey.DEGREE_TYPE),
16
17
  new OnlyFiltersSelectedRule([FilterKey.DISCIPLINES, FilterKey.DEGREE_TYPE]),
17
- new IndexableDegreeRule()
18
+ new IndexableDegreeRule(),
19
+ new DegreeDisciplineRule()
18
20
  ];
19
21
  constructor(dependencies) {
20
22
  super(dependencies);
@@ -12,6 +12,10 @@ export * from './CountryDurationDegree';
12
12
  export * from './CountryEducationalForm';
13
13
  export * from './CountryFormat';
14
14
  export * from './CountryTuitionFee';
15
+ export * from './DegreeAttendanceDiscipline';
16
+ export * from './DegreeCountryAttendance';
17
+ export * from './DegreeCountryDiscipline';
18
+ export * from './DegreeCountryTuitionFee';
15
19
  export * from './Discipline';
16
20
  export * from './DisciplineArea';
17
21
  export * from './DisciplineAttendance';
@@ -12,6 +12,10 @@ export * from './CountryDurationDegree';
12
12
  export * from './CountryEducationalForm';
13
13
  export * from './CountryFormat';
14
14
  export * from './CountryTuitionFee';
15
+ export * from './DegreeAttendanceDiscipline';
16
+ export * from './DegreeCountryAttendance';
17
+ export * from './DegreeCountryDiscipline';
18
+ export * from './DegreeCountryTuitionFee';
15
19
  export * from './Discipline';
16
20
  export * from './DisciplineArea';
17
21
  export * from './DisciplineAttendance';
@@ -1,7 +1,6 @@
1
1
  import { FilterKey } from '@studyportals/search-filters';
2
2
  import { BaseProgrammeRule } from '../BaseProgrammeRule';
3
3
  export class DegreeAttendanceDisciplineRule extends BaseProgrammeRule {
4
- // Degrees with online attendance that accept all disciplines
5
4
  allowedDegrees = ['master-of-arts', 'master-of-science', 'master-of-business-administration'];
6
5
  attendanceValue = 'online';
7
6
  getName() {
@@ -15,15 +14,12 @@ export class DegreeAttendanceDisciplineRule extends BaseProgrammeRule {
15
14
  const degreeTypeValue = seoInfoBase.getFilterOptionValueBy(FilterKey.DEGREE_TYPE, filterState);
16
15
  const attendanceValue = seoInfoBase.getFilterOptionValueBy(FilterKey.DELIVERY_METHOD, filterState);
17
16
  const disciplineValue = seoInfoBase.getFilterOptionValueBy(FilterKey.DISCIPLINES, filterState);
18
- // This rule only applies to allowed degrees + online
19
17
  if (!degreeTypeValue || !attendanceValue || !this.allowedDegrees.includes(degreeTypeValue) || attendanceValue !== this.attendanceValue) {
20
- return Promise.resolve(true); // Rule doesn't apply to other combinations
18
+ return Promise.resolve(true);
21
19
  }
22
- // Must have a discipline selected
23
20
  if (!disciplineValue) {
24
21
  return Promise.resolve(false);
25
22
  }
26
- // Allowed degrees + online accept all disciplines
27
23
  return Promise.resolve(true);
28
24
  }
29
25
  forSitemapGenerator(filterKeyValues) {
@@ -35,11 +31,9 @@ export class DegreeAttendanceDisciplineRule extends BaseProgrammeRule {
35
31
  }
36
32
  const degreeTypeValue = degreeTypeValues[0];
37
33
  const attendanceValue = attendanceValues[0];
38
- // This rule only applies to allowed degrees + online
39
34
  if (!degreeTypeValue || !attendanceValue || !this.allowedDegrees.includes(degreeTypeValue) || attendanceValue !== this.attendanceValue) {
40
- return Promise.resolve(true); // Rule doesn't apply to other combinations
35
+ return Promise.resolve(true);
41
36
  }
42
- // Allowed degrees + online accept all disciplines
43
37
  return Promise.resolve(true);
44
38
  }
45
39
  }
@@ -1,13 +1,11 @@
1
1
  import { FilterKey } from '@studyportals/search-filters';
2
2
  import { BaseProgrammeRule } from '../BaseProgrammeRule';
3
3
  export class DegreeAttendanceDisciplineSpecificRule extends BaseProgrammeRule {
4
- // Only specific degree types are allowed for this policy
5
4
  allowedDegrees = [
6
5
  'master-of-science',
7
6
  'master-of-arts',
8
7
  'master-of-business-administration'
9
8
  ];
10
- // Only online attendance is allowed
11
9
  allowedAttendance = 'online';
12
10
  getName() {
13
11
  return 'DegreeAttendanceDisciplineSpecificRule';
@@ -22,7 +20,6 @@ export class DegreeAttendanceDisciplineSpecificRule extends BaseProgrammeRule {
22
20
  if (!degreeTypeValue || !attendanceValue) {
23
21
  return Promise.resolve(false);
24
22
  }
25
- // Only allow specific degrees with online attendance
26
23
  return Promise.resolve(this.allowedDegrees.includes(degreeTypeValue) &&
27
24
  attendanceValue === this.allowedAttendance);
28
25
  }
@@ -34,7 +31,6 @@ export class DegreeAttendanceDisciplineSpecificRule extends BaseProgrammeRule {
34
31
  }
35
32
  const degreeTypeValue = degreeTypeValues[0];
36
33
  const attendanceValue = attendanceValues[0];
37
- // Only allow specific degrees with online attendance
38
34
  return Promise.resolve(this.allowedDegrees.includes(degreeTypeValue) &&
39
35
  attendanceValue === this.allowedAttendance);
40
36
  }
@@ -1,7 +1,6 @@
1
1
  import { FilterKey } from '@studyportals/search-filters';
2
2
  import { BaseProgrammeRule } from '../BaseProgrammeRule';
3
3
  export class DegreeCountryAttendanceSpecificRule extends BaseProgrammeRule {
4
- // Only specific degree types are allowed for this policy
5
4
  allowedDegrees = [
6
5
  'master-of-business-administration',
7
6
  'master-of-laws',
@@ -19,7 +18,6 @@ export class DegreeCountryAttendanceSpecificRule extends BaseProgrammeRule {
19
18
  if (!degreeTypeValue) {
20
19
  return Promise.resolve(false);
21
20
  }
22
- // Only allow specific degrees
23
21
  return Promise.resolve(this.allowedDegrees.includes(degreeTypeValue));
24
22
  }
25
23
  forSitemapGenerator(filterKeyValues) {
@@ -28,7 +26,6 @@ export class DegreeCountryAttendanceSpecificRule extends BaseProgrammeRule {
28
26
  return Promise.resolve(false);
29
27
  }
30
28
  const degreeTypeValue = degreeTypeValues[0];
31
- // Only allow specific degrees
32
29
  return Promise.resolve(this.allowedDegrees.includes(degreeTypeValue));
33
30
  }
34
31
  }
@@ -2,9 +2,9 @@ import { FilterKey } from '@studyportals/search-filters';
2
2
  import { BaseProgrammeRule } from '../BaseProgrammeRule';
3
3
  export class DegreeCountrySpecificRule extends BaseProgrammeRule {
4
4
  validCombinations = {
5
- 'master-of-science': ['82', '32', '11', '30'], // USA, Canada, Germany, UK
6
- 'master-of-business-administration': ['82', '30'], // USA, UK
7
- 'master-of-education': ['202', '32'] // Australia, Canada
5
+ 'master-of-science': ['82', '32', '11', '30'],
6
+ 'master-of-business-administration': ['82', '30'],
7
+ 'master-of-education': ['202', '32']
8
8
  };
9
9
  getName() {
10
10
  return 'DegreeCountrySpecificRule';
@@ -2,7 +2,6 @@ import { FilterKey } from '@studyportals/search-filters';
2
2
  import { TuitionFeeFilterOptionValue } from '@studyportals/search-filters';
3
3
  import { BaseProgrammeRule } from '../BaseProgrammeRule';
4
4
  export class DegreeCountryTuitionFeeRule extends BaseProgrammeRule {
5
- // MBA accepts all countries with affordable tuition fee
6
5
  degreeValue = 'master-of-business-administration';
7
6
  tuitionFeeValue = TuitionFeeFilterOptionValue.ZERO_TO_TWO_THOUSAND_FIVE_HUNDRED;
8
7
  getName() {
@@ -16,14 +15,12 @@ export class DegreeCountryTuitionFeeRule extends BaseProgrammeRule {
16
15
  const degreeTypeValue = seoInfoBase.getFilterOptionValueBy(FilterKey.DEGREE_TYPE, filterState);
17
16
  const countryValue = seoInfoBase.getFilterOptionValueBy(FilterKey.COUNTRY, filterState);
18
17
  const tuitionFeeValue = seoInfoBase.getFilterOptionValueBy(FilterKey.TUITION_FEE, filterState);
19
- // This rule only applies to MBA
20
18
  if (degreeTypeValue !== this.degreeValue) {
21
- return Promise.resolve(true); // Rule doesn't apply to other degrees
19
+ return Promise.resolve(true);
22
20
  }
23
21
  if (!countryValue || !tuitionFeeValue) {
24
22
  return Promise.resolve(false);
25
23
  }
26
- // MBA must have affordable tuition, reject all other tuition levels
27
24
  return Promise.resolve(tuitionFeeValue === this.tuitionFeeValue);
28
25
  }
29
26
  forSitemapGenerator(filterKeyValues) {
@@ -35,11 +32,9 @@ export class DegreeCountryTuitionFeeRule extends BaseProgrammeRule {
35
32
  }
36
33
  const degreeTypeValue = degreeTypeValues[0];
37
34
  const tuitionFeeValue = tuitionFeeValues[0];
38
- // This rule only applies to MBA
39
35
  if (degreeTypeValue !== this.degreeValue) {
40
- return Promise.resolve(true); // Rule doesn't apply to other degrees
36
+ return Promise.resolve(true);
41
37
  }
42
- // MBA must have affordable tuition, reject all other tuition levels
43
38
  return Promise.resolve(tuitionFeeValue === this.tuitionFeeValue);
44
39
  }
45
40
  }
@@ -1,7 +1,6 @@
1
1
  import { FilterKey } from '@studyportals/search-filters';
2
2
  import { BaseProgrammeRule } from '../BaseProgrammeRule';
3
3
  export class DegreeCountryTuitionFeeSpecificRule extends BaseProgrammeRule {
4
- // Only specific degree types are allowed for this policy
5
4
  allowedDegrees = [
6
5
  'master-of-business-administration',
7
6
  'master-of-laws'
@@ -18,7 +17,6 @@ export class DegreeCountryTuitionFeeSpecificRule extends BaseProgrammeRule {
18
17
  if (!degreeTypeValue) {
19
18
  return Promise.resolve(false);
20
19
  }
21
- // Only allow specific degrees
22
20
  return Promise.resolve(this.allowedDegrees.includes(degreeTypeValue));
23
21
  }
24
22
  forSitemapGenerator(filterKeyValues) {
@@ -27,7 +25,6 @@ export class DegreeCountryTuitionFeeSpecificRule extends BaseProgrammeRule {
27
25
  return Promise.resolve(false);
28
26
  }
29
27
  const degreeTypeValue = degreeTypeValues[0];
30
- // Only allow specific degrees
31
28
  return Promise.resolve(this.allowedDegrees.includes(degreeTypeValue));
32
29
  }
33
30
  }
@@ -1,15 +1,12 @@
1
1
  import { FilterKey } from '@studyportals/search-filters';
2
2
  import { BaseProgrammeRule } from '../BaseProgrammeRule';
3
3
  export class DegreeDisciplineRule extends BaseProgrammeRule {
4
- // Degrees that accept all disciplines
5
4
  degreesAcceptingAllDisciplines = [
6
5
  'master-of-arts',
7
6
  'master-of-science',
8
7
  'master-of-business-administration'
9
8
  ];
10
- // Master of Laws accepts only law-related disciplines
11
9
  masterOfLawsDegree = 'master-of-laws';
12
- // Law discipline IDs (including law and law subdisciplines)
13
10
  lawDisciplineIds = [
14
11
  '6', // Law (main discipline)
15
12
  '219', // Business Law
@@ -23,17 +20,13 @@ export class DegreeDisciplineRule extends BaseProgrammeRule {
23
20
  '49', // Patent & Intellectual Property Law
24
21
  '115' // Public Law
25
22
  ];
26
- // Master of Philosophy accepts only specific disciplines
27
23
  masterOfPhilosophyDegree = 'master-of-philosophy';
28
- // Master of Philosophy discipline IDs
29
24
  masterOfPhilosophyDisciplineIds = [
30
25
  '118', '23', '335', '71', '281', '4', '8', '293',
31
26
  '272', '330', '87', '111', '6', '332', '40', '308',
32
27
  '224', '113', '84', '38', '79', '278', '80'
33
28
  ];
34
- // Master of Education accepts only education & training disciplines
35
29
  masterOfEducationDegree = 'master-of-education';
36
- // Education & Training discipline IDs
37
30
  educationDisciplineIds = [
38
31
  '289', // Education & Training (main discipline)
39
32
  '290', // Adult Education
@@ -56,9 +49,7 @@ export class DegreeDisciplineRule extends BaseProgrammeRule {
56
49
  '295', // Teaching
57
50
  '358' // Teaching English as a Foreign Language
58
51
  ];
59
- // Master of Engineering accepts only engineering & technology disciplines
60
52
  masterOfEngineeringDegree = 'master-of-engineering';
61
- // Engineering & Technology discipline IDs
62
53
  engineeringDisciplineIds = [
63
54
  '7', // Engineering & Technology (main discipline)
64
55
  '24', // Computer Science & IT
@@ -87,9 +78,7 @@ export class DegreeDisciplineRule extends BaseProgrammeRule {
87
78
  '397', // Production and Manufacturing Engineering
88
79
  '399' // Structural Engineering
89
80
  ];
90
- // Postgraduate Diploma accepts only specific disciplines
91
81
  postgraduateDiplomaDegree = 'postgraduate-diploma';
92
- // Postgraduate Diploma discipline IDs
93
82
  postgraduateDiplomaDisciplineIds = [
94
83
  '362', '241', '108', '133', '373', '356', '282', '311', '113', '79'
95
84
  ];
@@ -106,31 +95,24 @@ export class DegreeDisciplineRule extends BaseProgrammeRule {
106
95
  if (!degreeTypeValue || !disciplineValue) {
107
96
  return Promise.resolve(false);
108
97
  }
109
- // Handle Master of Laws - only accepts law disciplines
110
98
  if (degreeTypeValue === this.masterOfLawsDegree) {
111
99
  return Promise.resolve(this.lawDisciplineIds.includes(disciplineValue));
112
100
  }
113
- // Handle Master of Philosophy - only accepts specific disciplines
114
101
  if (degreeTypeValue === this.masterOfPhilosophyDegree) {
115
102
  return Promise.resolve(this.masterOfPhilosophyDisciplineIds.includes(disciplineValue));
116
103
  }
117
- // Handle Master of Education - only accepts education & training disciplines
118
104
  if (degreeTypeValue === this.masterOfEducationDegree) {
119
105
  return Promise.resolve(this.educationDisciplineIds.includes(disciplineValue));
120
106
  }
121
- // Handle Master of Engineering - only accepts engineering & technology disciplines
122
107
  if (degreeTypeValue === this.masterOfEngineeringDegree) {
123
108
  return Promise.resolve(this.engineeringDisciplineIds.includes(disciplineValue));
124
109
  }
125
- // Handle Postgraduate Diploma - only accepts specific disciplines
126
110
  if (degreeTypeValue === this.postgraduateDiplomaDegree) {
127
111
  return Promise.resolve(this.postgraduateDiplomaDisciplineIds.includes(disciplineValue));
128
112
  }
129
- // Handle degrees that accept all disciplines
130
113
  if (this.degreesAcceptingAllDisciplines.includes(degreeTypeValue)) {
131
114
  return Promise.resolve(true);
132
115
  }
133
- // Rule doesn't apply to other degrees
134
116
  return Promise.resolve(true);
135
117
  }
136
118
  forSitemapGenerator(filterKeyValues) {
@@ -141,31 +123,24 @@ export class DegreeDisciplineRule extends BaseProgrammeRule {
141
123
  }
142
124
  const degreeTypeValue = degreeTypeValues[0];
143
125
  const disciplineValue = disciplineValues[0];
144
- // Handle Master of Laws - only accepts law disciplines
145
126
  if (degreeTypeValue === this.masterOfLawsDegree) {
146
127
  return Promise.resolve(this.lawDisciplineIds.includes(disciplineValue));
147
128
  }
148
- // Handle Master of Philosophy - only accepts specific disciplines
149
129
  if (degreeTypeValue === this.masterOfPhilosophyDegree) {
150
130
  return Promise.resolve(this.masterOfPhilosophyDisciplineIds.includes(disciplineValue));
151
131
  }
152
- // Handle Master of Education - only accepts education & training disciplines
153
132
  if (degreeTypeValue === this.masterOfEducationDegree) {
154
133
  return Promise.resolve(this.educationDisciplineIds.includes(disciplineValue));
155
134
  }
156
- // Handle Master of Engineering - only accepts engineering & technology disciplines
157
135
  if (degreeTypeValue === this.masterOfEngineeringDegree) {
158
136
  return Promise.resolve(this.engineeringDisciplineIds.includes(disciplineValue));
159
137
  }
160
- // Handle Postgraduate Diploma - only accepts specific disciplines
161
138
  if (degreeTypeValue === this.postgraduateDiplomaDegree) {
162
139
  return Promise.resolve(this.postgraduateDiplomaDisciplineIds.includes(disciplineValue));
163
140
  }
164
- // Handle degrees that accept all disciplines
165
141
  if (this.degreesAcceptingAllDisciplines.includes(degreeTypeValue)) {
166
142
  return Promise.resolve(true);
167
143
  }
168
- // Rule doesn't apply to other degrees
169
144
  return Promise.resolve(true);
170
145
  }
171
146
  }
@@ -1,7 +1,6 @@
1
1
  import { FilterKey } from '@studyportals/search-filters';
2
2
  import { BaseProgrammeRule } from '../BaseProgrammeRule';
3
3
  export class MBACountryAttendanceRule extends BaseProgrammeRule {
4
- // MBA with online attendance accepts all countries
5
4
  degreeValue = 'master-of-business-administration';
6
5
  attendanceValue = 'online';
7
6
  getName() {
@@ -15,14 +14,12 @@ export class MBACountryAttendanceRule extends BaseProgrammeRule {
15
14
  const degreeTypeValue = seoInfoBase.getFilterOptionValueBy(FilterKey.DEGREE_TYPE, filterState);
16
15
  const countryValue = seoInfoBase.getFilterOptionValueBy(FilterKey.COUNTRY, filterState);
17
16
  const attendanceValue = seoInfoBase.getFilterOptionValueBy(FilterKey.DELIVERY_METHOD, filterState);
18
- // This rule only applies to MBA
19
17
  if (degreeTypeValue !== this.degreeValue) {
20
- return Promise.resolve(true); // Rule doesn't apply to other degrees
18
+ return Promise.resolve(true);
21
19
  }
22
20
  if (!countryValue || !attendanceValue) {
23
21
  return Promise.resolve(false);
24
22
  }
25
- // MBA must have online attendance, reject all other attendance types
26
23
  return Promise.resolve(attendanceValue === this.attendanceValue);
27
24
  }
28
25
  forSitemapGenerator(filterKeyValues) {
@@ -34,11 +31,9 @@ export class MBACountryAttendanceRule extends BaseProgrammeRule {
34
31
  }
35
32
  const degreeTypeValue = degreeTypeValues[0];
36
33
  const attendanceValue = attendanceValues[0];
37
- // This rule only applies to MBA
38
34
  if (degreeTypeValue !== this.degreeValue) {
39
- return Promise.resolve(true); // Rule doesn't apply to other degrees
35
+ return Promise.resolve(true);
40
36
  }
41
- // MBA must have online attendance, reject all other attendance types
42
37
  return Promise.resolve(attendanceValue === this.attendanceValue);
43
38
  }
44
39
  }
@@ -1,7 +1,6 @@
1
1
  import { FilterKey } from '@studyportals/search-filters';
2
2
  import { BaseProgrammeRule } from '../BaseProgrammeRule';
3
3
  export class MasterOfEducationCountryDisciplineRule extends BaseProgrammeRule {
4
- // Education & Training discipline IDs
5
4
  educationDisciplineIds = [
6
5
  '289', // Education & Training (main discipline)
7
6
  '290', // Adult Education
@@ -37,18 +36,15 @@ export class MasterOfEducationCountryDisciplineRule extends BaseProgrammeRule {
37
36
  const degreeTypeValue = seoInfoBase.getFilterOptionValueBy(FilterKey.DEGREE_TYPE, filterState);
38
37
  const countryValue = seoInfoBase.getFilterOptionValueBy(FilterKey.COUNTRY, filterState);
39
38
  const disciplineValue = seoInfoBase.getFilterOptionValueBy(FilterKey.DISCIPLINES, filterState);
40
- // This rule only applies to Master of Education
41
39
  if (degreeTypeValue !== 'master-of-education') {
42
- return Promise.resolve(true); // Rule doesn't apply to other degrees
40
+ return Promise.resolve(true);
43
41
  }
44
42
  if (!countryValue || !disciplineValue) {
45
43
  return Promise.resolve(false);
46
44
  }
47
- // Must be in allowed countries (Australia or Canada)
48
45
  if (!this.allowedCountryIds.includes(countryValue)) {
49
46
  return Promise.resolve(false);
50
47
  }
51
- // Must be an education discipline
52
48
  return Promise.resolve(this.educationDisciplineIds.includes(disciplineValue));
53
49
  }
54
50
  forSitemapGenerator(filterKeyValues) {
@@ -61,15 +57,12 @@ export class MasterOfEducationCountryDisciplineRule extends BaseProgrammeRule {
61
57
  const degreeTypeValue = degreeTypeValues[0];
62
58
  const countryValue = countryValues[0];
63
59
  const disciplineValue = disciplineValues[0];
64
- // This rule only applies to Master of Education
65
60
  if (degreeTypeValue !== 'master-of-education') {
66
- return Promise.resolve(true); // Rule doesn't apply to other degrees
61
+ return Promise.resolve(true);
67
62
  }
68
- // Must be in allowed countries (Australia or Canada)
69
63
  if (!this.allowedCountryIds.includes(countryValue)) {
70
64
  return Promise.resolve(false);
71
65
  }
72
- // Must be an education discipline
73
66
  return Promise.resolve(this.educationDisciplineIds.includes(disciplineValue));
74
67
  }
75
68
  }
@@ -1,10 +1,9 @@
1
1
  import { FilterKey } from '@studyportals/search-filters';
2
2
  import { BaseProgrammeRule } from '../BaseProgrammeRule';
3
3
  export class MasterOfLawsCountryAttendanceRule extends BaseProgrammeRule {
4
- // Master of Laws with online attendance and specific countries
5
4
  degreeValue = 'master-of-laws';
6
5
  attendanceValue = 'online';
7
- allowedCountryIds = ['82', '30', '32', '108']; // USA, UK, Canada, India
6
+ allowedCountryIds = ['82', '30', '32', '108'];
8
7
  getName() {
9
8
  return 'MasterOfLawsCountryAttendanceRule';
10
9
  }
@@ -16,14 +15,12 @@ export class MasterOfLawsCountryAttendanceRule extends BaseProgrammeRule {
16
15
  const degreeTypeValue = seoInfoBase.getFilterOptionValueBy(FilterKey.DEGREE_TYPE, filterState);
17
16
  const countryValue = seoInfoBase.getFilterOptionValueBy(FilterKey.COUNTRY, filterState);
18
17
  const attendanceValue = seoInfoBase.getFilterOptionValueBy(FilterKey.DELIVERY_METHOD, filterState);
19
- // This rule only applies to Master of Laws
20
18
  if (degreeTypeValue !== this.degreeValue) {
21
- return Promise.resolve(true); // Rule doesn't apply to other degrees
19
+ return Promise.resolve(true);
22
20
  }
23
21
  if (!countryValue || !attendanceValue) {
24
22
  return Promise.resolve(false);
25
23
  }
26
- // Must be in allowed countries and have online attendance
27
24
  return Promise.resolve(this.allowedCountryIds.includes(countryValue) &&
28
25
  attendanceValue === this.attendanceValue);
29
26
  }
@@ -37,11 +34,9 @@ export class MasterOfLawsCountryAttendanceRule extends BaseProgrammeRule {
37
34
  const degreeTypeValue = degreeTypeValues[0];
38
35
  const countryValue = countryValues[0];
39
36
  const attendanceValue = attendanceValues[0];
40
- // This rule only applies to Master of Laws
41
37
  if (degreeTypeValue !== this.degreeValue) {
42
- return Promise.resolve(true); // Rule doesn't apply to other degrees
38
+ return Promise.resolve(true);
43
39
  }
44
- // Must be in allowed countries and have online attendance
45
40
  return Promise.resolve(this.allowedCountryIds.includes(countryValue) &&
46
41
  attendanceValue === this.attendanceValue);
47
42
  }
@@ -2,7 +2,6 @@ import { FilterKey } from '@studyportals/search-filters';
2
2
  import { TuitionFeeFilterOptionValue } from '@studyportals/search-filters';
3
3
  import { BaseProgrammeRule } from '../BaseProgrammeRule';
4
4
  export class MasterOfLawsCountryTuitionFeeRule extends BaseProgrammeRule {
5
- // Master of Laws with specific countries and affordable tuition fee
6
5
  degreeValue = 'master-of-laws';
7
6
  allowedCountryIds = ['82', '30', '32', '108']; // USA, UK, Canada, India
8
7
  tuitionFeeValue = TuitionFeeFilterOptionValue.ZERO_TO_TWO_THOUSAND_FIVE_HUNDRED;
@@ -17,14 +16,12 @@ export class MasterOfLawsCountryTuitionFeeRule extends BaseProgrammeRule {
17
16
  const degreeTypeValue = seoInfoBase.getFilterOptionValueBy(FilterKey.DEGREE_TYPE, filterState);
18
17
  const countryValue = seoInfoBase.getFilterOptionValueBy(FilterKey.COUNTRY, filterState);
19
18
  const tuitionFeeValue = seoInfoBase.getFilterOptionValueBy(FilterKey.TUITION_FEE, filterState);
20
- // This rule only applies to Master of Laws
21
19
  if (degreeTypeValue !== this.degreeValue) {
22
- return Promise.resolve(true); // Rule doesn't apply to other degrees
20
+ return Promise.resolve(true);
23
21
  }
24
22
  if (!countryValue || !tuitionFeeValue) {
25
23
  return Promise.resolve(false);
26
24
  }
27
- // Must be in allowed countries and have affordable tuition
28
25
  return Promise.resolve(this.allowedCountryIds.includes(countryValue) &&
29
26
  tuitionFeeValue === this.tuitionFeeValue);
30
27
  }
@@ -1,7 +1,6 @@
1
1
  import { FilterKey } from '@studyportals/search-filters';
2
2
  import { BaseProgrammeRule } from '../BaseProgrammeRule';
3
3
  export class MasterOfPhilosophyCountryAttendanceRule extends BaseProgrammeRule {
4
- // Master of Philosophy with online attendance and specific countries
5
4
  degreeValue = 'master-of-philosophy';
6
5
  attendanceValue = 'online';
7
6
  allowedCountryIds = ['82', '30', '108']; // USA, UK, India
@@ -16,14 +15,12 @@ export class MasterOfPhilosophyCountryAttendanceRule extends BaseProgrammeRule {
16
15
  const degreeTypeValue = seoInfoBase.getFilterOptionValueBy(FilterKey.DEGREE_TYPE, filterState);
17
16
  const countryValue = seoInfoBase.getFilterOptionValueBy(FilterKey.COUNTRY, filterState);
18
17
  const attendanceValue = seoInfoBase.getFilterOptionValueBy(FilterKey.DELIVERY_METHOD, filterState);
19
- // This rule only applies to Master of Philosophy
20
18
  if (degreeTypeValue !== this.degreeValue) {
21
- return Promise.resolve(true); // Rule doesn't apply to other degrees
19
+ return Promise.resolve(true);
22
20
  }
23
21
  if (!countryValue || !attendanceValue) {
24
22
  return Promise.resolve(false);
25
23
  }
26
- // Must be in allowed countries and have online attendance
27
24
  return Promise.resolve(this.allowedCountryIds.includes(countryValue) &&
28
25
  attendanceValue === this.attendanceValue);
29
26
  }
@@ -37,11 +34,9 @@ export class MasterOfPhilosophyCountryAttendanceRule extends BaseProgrammeRule {
37
34
  const degreeTypeValue = degreeTypeValues[0];
38
35
  const countryValue = countryValues[0];
39
36
  const attendanceValue = attendanceValues[0];
40
- // This rule only applies to Master of Philosophy
41
37
  if (degreeTypeValue !== this.degreeValue) {
42
- return Promise.resolve(true); // Rule doesn't apply to other degrees
38
+ return Promise.resolve(true);
43
39
  }
44
- // Must be in allowed countries and have online attendance
45
40
  return Promise.resolve(this.allowedCountryIds.includes(countryValue) &&
46
41
  attendanceValue === this.attendanceValue);
47
42
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@studyportals/fawkes",
3
- "version": "7.2.1-0",
3
+ "version": "7.2.2-0",
4
4
  "description": "A package to centralize SEO related logic for SBLP and Sitemap Generator.",
5
5
  "files": [
6
6
  "./dist"