@studyportals/fawkes 7.2.1 → 7.2.2-4

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 (42) hide show
  1. package/README.md +176 -176
  2. package/dist/src/enums/FilterCombinations.d.ts +4 -0
  3. package/dist/src/enums/FilterCombinations.js +4 -0
  4. package/dist/src/programmes/SearchIndexabilityManager.js +5 -7
  5. package/dist/src/programmes/policies/CountryAttendanceDegree.js +1 -1
  6. package/dist/src/programmes/policies/CountryDurationDegree.js +1 -1
  7. package/dist/src/programmes/policies/CountryEducationalForm.js +1 -1
  8. package/dist/src/programmes/policies/DegreeCountryAttendance.js +2 -7
  9. package/dist/src/programmes/policies/DegreeCountryDiscipline.js +3 -6
  10. package/dist/src/programmes/policies/DegreeCountryTuitionFee.js +1 -6
  11. package/dist/src/programmes/policies/DisciplineCountryDegree.js +1 -1
  12. package/dist/src/programmes/policies/DisciplineCountryEducationalForm.js +1 -1
  13. package/dist/src/programmes/policies/DisciplineDegree.d.ts +2 -1
  14. package/dist/src/programmes/policies/DisciplineDegree.js +3 -1
  15. package/dist/src/programmes/policies/DisciplineEducationalForm.js +1 -1
  16. package/dist/src/programmes/policies/index.d.ts +4 -0
  17. package/dist/src/programmes/policies/index.js +4 -0
  18. package/dist/src/programmes/rules/DegreeAttendanceDisciplineRule.js +2 -8
  19. package/dist/src/programmes/rules/DegreeAttendanceDisciplineSpecificRule.js +0 -4
  20. package/dist/src/programmes/rules/DegreeCountryAttendanceSpecificRule.js +0 -3
  21. package/dist/src/programmes/rules/DegreeCountrySpecificRule.js +3 -3
  22. package/dist/src/programmes/rules/DegreeCountryTuitionFeeRule.js +2 -7
  23. package/dist/src/programmes/rules/DegreeCountryTuitionFeeSpecificRule.js +0 -3
  24. package/dist/src/programmes/rules/DegreeDisciplineRule.js +2 -25
  25. package/dist/src/programmes/rules/MBACountryAttendanceRule.js +2 -7
  26. package/dist/src/programmes/rules/MasterOfEducationCountryDisciplineRule.js +2 -9
  27. package/dist/src/programmes/rules/MasterOfLawsCountryAttendanceRule.js +3 -8
  28. package/dist/src/programmes/rules/MasterOfLawsCountryTuitionFeeRule.js +1 -4
  29. package/dist/src/programmes/rules/MasterOfPhilosophyCountryAttendanceRule.js +2 -7
  30. package/dist/src/programmes/rules/OnlineAttendanceRule.d.ts +1 -0
  31. package/dist/src/programmes/rules/OnlineAttendanceRule.js +3 -0
  32. package/package.json +95 -95
  33. package/dist/src/common/IPolicyMetaData.d.ts +0 -6
  34. package/dist/src/common/IPolicyMetaData.js +0 -1
  35. package/dist/src/programmes/rules/DegreeAttendanceSpecificRule.d.ts +0 -10
  36. package/dist/src/programmes/rules/DegreeAttendanceSpecificRule.js +0 -42
  37. package/dist/src/programmes/rules/MasterOfArtsDisciplineRule.d.ts +0 -10
  38. package/dist/src/programmes/rules/MasterOfArtsDisciplineRule.js +0 -41
  39. package/dist/src/programmes/rules/MasterOfScienceDisciplineRule.d.ts +0 -10
  40. package/dist/src/programmes/rules/MasterOfScienceDisciplineRule.js +0 -41
  41. package/dist/src/sitemap-generator/IPageNumberProvider.d.ts +0 -3
  42. package/dist/src/sitemap-generator/IPageNumberProvider.js +0 -1
package/README.md CHANGED
@@ -1,176 +1,176 @@
1
- # fawkes
2
-
3
- This project is used to centralize indexability logic for our Search
4
- microservices and Sitemap Generator. The main purpose is to completely remove
5
- discrepancies between pages indexed by Search and page URLs stored in Sitemap.
6
-
7
- Link to documentation: https://studyportals.atlassian.net/wiki/x/BwAdvw
8
-
9
- ## Base structure
10
-
11
- - organisations-seo (used by Organisation Search)
12
- - scholarships-seo (used by Scholarship Search)
13
- - sitemap-generator-seo (used by Sitemap Generator)
14
- - src
15
- - common
16
- - organisations
17
- - scholarships
18
- - sitemap-generator
19
-
20
- # Automatic Documentation System
21
-
22
- ## Overview
23
-
24
- This system automatically generates and maintains documentation for Fawkes
25
- indexing rules across multiple projects. It creates a hierarchical structure of
26
- Confluence pages that document all indexing policies and rules, ensuring that
27
- the documentation is always up-to-date with the actual codebase.
28
-
29
- Link to documentation:
30
- [Fawkes Indexing Rules Documentation](https://studyportals.atlassian.net/wiki/spaces/T/pages/3494969354/Fawkes+Indexing+Rules+Documentation)
31
-
32
- ## Features
33
-
34
- - **Dynamic Documentation**: Automatically extracts indexing rules and policies
35
- directly from the codebase
36
- - **Multi-Page Structure**: Creates a main index page with separate pages for
37
- each project
38
- - **Hierarchical Organization**: Structures content as Projects → Policies →
39
- Rules
40
- - **Automatic Page Creation**: Intelligently creates or updates pages as needed
41
- - **Cross-Page Navigation**: Provides intuitive navigation between all pages
42
-
43
- ## Architecture
44
-
45
- The system follows SOLID design principles to ensure maintainability and
46
- extensibility:
47
-
48
- - **Single Responsibility**: Each class has one specific responsibility
49
- - **Open/Closed**: Easily extendable without modifying existing code
50
- - **Liskov Substitution**: Interchangeable components through well-defined
51
- interfaces
52
- - **Interface Segregation**: Clean, focused interfaces
53
- - **Dependency Inversion**: High-level modules depend on abstractions
54
-
55
- ### Key Components
56
-
57
- 1. **Content Builder**: Extracts project, policy, and rule data from the Fawkes
58
- system
59
- 2. **Policy Fetchers**: Project-specific components that fetch and format policy
60
- data
61
- 3. **Document Builder**: Generates structured HTML content for Confluence pages
62
- 4. **Confluence Updater**: Handles creation and updating of Confluence pages
63
- 5. **Token Retriever**: Securely retrieves API token for Confluence access
64
-
65
- ## How It Works
66
-
67
- 1. The system starts by collecting all project data using the `ContentBuilder`
68
- 2. For each project, it extracts policies and rules using project-specific
69
- fetchers
70
- 3. The `DocumentBuilder` generates the content for the main index page and each
71
- project page
72
- 4. The `ConfluenceUpdater` creates or updates pages in Confluence as needed
73
- 5. Each project page links back to the main index, and the main index links to
74
- all project pages
75
-
76
- ## Setup and Configuration
77
-
78
- ### Environment Variables
79
-
80
- The system requires the following environment variables:
81
-
82
- ```
83
- CONFLUENCE_EMAIL=your-email@example.com
84
- CONFLUENCE_API_TOKEN=your-api-token
85
- CONFLUENCE_BASE_URL=https://your-instance.atlassian.net
86
- CONFLUENCE_SPACE_KEY=YOUR_SPACE_KEY
87
- CONFLUENCE_MAIN_PAGE_TITLE=Fawkes Indexing Rules Documentation
88
- ```
89
-
90
- > **Important Note on Credentials**: Currently, the system uses personal
91
- > credentials (email and API token) for Confluence access. This is a temporary
92
- > solution and should be replaced with a team or service account in the future
93
- > to avoid dependency on a specific individual's account.
94
-
95
- ### Deployment and Triggering
96
-
97
- The system runs as an AWS Lambda function and is automatically triggered as part
98
- of the CI/CD pipeline. This ensures documentation is always updated whenever new
99
- code is deployed:
100
-
101
- ```yaml
102
- # buildspec.yml (excerpt)
103
- post_build:
104
- commands:
105
- - |
106
- if [ -z "$PR_ID" ]; then
107
- LAMBDA_NAME="FawkesConfluenceUpdater-$STAGE"
108
- echo "Invoking Lambda function $LAMBDA_NAME"
109
- echo '{"source":"cicd-pipeline","timestamp":"'$(date -u +"%Y-%m-%dT%H:%M:%SZ")'"}' > payload.json
110
- aws lambda invoke --function-name $LAMBDA_NAME --invocation-type Event --payload fileb://payload.json response.json || echo "Lambda invocation failed, but continuing"
111
- fi
112
- ```
113
-
114
- **Trigger Flow:**
115
-
116
- 1. When code is pushed to the `main` branch, the CI/CD pipeline is triggered
117
- 2. After successful deployment of a new Fawkes version, the post-build phase
118
- executes
119
- 3. The Lambda function is invoked with a simple payload containing the source
120
- and timestamp
121
- 4. The Lambda function authenticates with Confluence and executes the
122
- documentation generation process
123
- 5. This only happens for production deployments (not PR builds)
124
-
125
- This automated approach ensures documentation stays in sync with the actual
126
- codebase without manual intervention.
127
-
128
- ## Scalability and Extension
129
-
130
- ### Adding New Projects
131
-
132
- To add documentation for a new project:
133
-
134
- 1. Create a new class that implements the `IPolicyFetcher` interface
135
- 2. Implement the `getProjectName()` and `fetchPolicies()` methods
136
- 3. Register the new fetcher in the `ContentBuilder` constructor
137
-
138
- Example:
139
-
140
- ```typescript
141
- export class NewProjectPolicyFetcher implements IPolicyFetcher {
142
- getProjectName(): string {
143
- return 'New Project Name';
144
- }
145
-
146
- fetchPolicies(): IPolicy[] {
147
- // Implement policy fetching logic
148
- return [...policies];
149
- }
150
- }
151
-
152
- // Then update ContentBuilder:
153
- constructor(fetchers?: IPolicyFetcher[]) {
154
- this.policyFetchers = fetchers || [
155
- // Existing fetchers
156
- new NewProjectPolicyFetcher()
157
- ];
158
- }
159
- ```
160
-
161
- ### Customizing Page Content
162
-
163
- The `DocumentBuilder` class contains methods for generating page content. To
164
- customize the format:
165
-
166
- 1. Modify the `buildMainDocument()` method for changes to the main index page
167
- 2. Modify the `buildProjectDocument()` method for changes to project pages
168
- 3. Modify the `buildPolicySection()` and `buildRulesTable()` methods for changes
169
- to policy and rule sections
170
-
171
- ## Conclusion
172
-
173
- This documentation system ensures that Fawkes indexing rules are always
174
- well-documented and accessible to the team. By automatically generating
175
- documentation directly from the codebase, it eliminates the risk of
176
- documentation becoming outdated or inconsistent with the actual implementation.
1
+ # fawkes
2
+
3
+ This project is used to centralize indexability logic for our Search
4
+ microservices and Sitemap Generator. The main purpose is to completely remove
5
+ discrepancies between pages indexed by Search and page URLs stored in Sitemap.
6
+
7
+ Link to documentation: https://studyportals.atlassian.net/wiki/x/BwAdvw
8
+
9
+ ## Base structure
10
+
11
+ - organisations-seo (used by Organisation Search)
12
+ - scholarships-seo (used by Scholarship Search)
13
+ - sitemap-generator-seo (used by Sitemap Generator)
14
+ - src
15
+ - common
16
+ - organisations
17
+ - scholarships
18
+ - sitemap-generator
19
+
20
+ # Automatic Documentation System
21
+
22
+ ## Overview
23
+
24
+ This system automatically generates and maintains documentation for Fawkes
25
+ indexing rules across multiple projects. It creates a hierarchical structure of
26
+ Confluence pages that document all indexing policies and rules, ensuring that
27
+ the documentation is always up-to-date with the actual codebase.
28
+
29
+ Link to documentation:
30
+ [Fawkes Indexing Rules Documentation](https://studyportals.atlassian.net/wiki/spaces/T/pages/3494969354/Fawkes+Indexing+Rules+Documentation)
31
+
32
+ ## Features
33
+
34
+ - **Dynamic Documentation**: Automatically extracts indexing rules and policies
35
+ directly from the codebase
36
+ - **Multi-Page Structure**: Creates a main index page with separate pages for
37
+ each project
38
+ - **Hierarchical Organization**: Structures content as Projects → Policies →
39
+ Rules
40
+ - **Automatic Page Creation**: Intelligently creates or updates pages as needed
41
+ - **Cross-Page Navigation**: Provides intuitive navigation between all pages
42
+
43
+ ## Architecture
44
+
45
+ The system follows SOLID design principles to ensure maintainability and
46
+ extensibility:
47
+
48
+ - **Single Responsibility**: Each class has one specific responsibility
49
+ - **Open/Closed**: Easily extendable without modifying existing code
50
+ - **Liskov Substitution**: Interchangeable components through well-defined
51
+ interfaces
52
+ - **Interface Segregation**: Clean, focused interfaces
53
+ - **Dependency Inversion**: High-level modules depend on abstractions
54
+
55
+ ### Key Components
56
+
57
+ 1. **Content Builder**: Extracts project, policy, and rule data from the Fawkes
58
+ system
59
+ 2. **Policy Fetchers**: Project-specific components that fetch and format policy
60
+ data
61
+ 3. **Document Builder**: Generates structured HTML content for Confluence pages
62
+ 4. **Confluence Updater**: Handles creation and updating of Confluence pages
63
+ 5. **Token Retriever**: Securely retrieves API token for Confluence access
64
+
65
+ ## How It Works
66
+
67
+ 1. The system starts by collecting all project data using the `ContentBuilder`
68
+ 2. For each project, it extracts policies and rules using project-specific
69
+ fetchers
70
+ 3. The `DocumentBuilder` generates the content for the main index page and each
71
+ project page
72
+ 4. The `ConfluenceUpdater` creates or updates pages in Confluence as needed
73
+ 5. Each project page links back to the main index, and the main index links to
74
+ all project pages
75
+
76
+ ## Setup and Configuration
77
+
78
+ ### Environment Variables
79
+
80
+ The system requires the following environment variables:
81
+
82
+ ```
83
+ CONFLUENCE_EMAIL=your-email@example.com
84
+ CONFLUENCE_API_TOKEN=your-api-token
85
+ CONFLUENCE_BASE_URL=https://your-instance.atlassian.net
86
+ CONFLUENCE_SPACE_KEY=YOUR_SPACE_KEY
87
+ CONFLUENCE_MAIN_PAGE_TITLE=Fawkes Indexing Rules Documentation
88
+ ```
89
+
90
+ > **Important Note on Credentials**: Currently, the system uses personal
91
+ > credentials (email and API token) for Confluence access. This is a temporary
92
+ > solution and should be replaced with a team or service account in the future
93
+ > to avoid dependency on a specific individual's account.
94
+
95
+ ### Deployment and Triggering
96
+
97
+ The system runs as an AWS Lambda function and is automatically triggered as part
98
+ of the CI/CD pipeline. This ensures documentation is always updated whenever new
99
+ code is deployed:
100
+
101
+ ```yaml
102
+ # buildspec.yml (excerpt)
103
+ post_build:
104
+ commands:
105
+ - |
106
+ if [ -z "$PR_ID" ]; then
107
+ LAMBDA_NAME="FawkesConfluenceUpdater-$STAGE"
108
+ echo "Invoking Lambda function $LAMBDA_NAME"
109
+ echo '{"source":"cicd-pipeline","timestamp":"'$(date -u +"%Y-%m-%dT%H:%M:%SZ")'"}' > payload.json
110
+ aws lambda invoke --function-name $LAMBDA_NAME --invocation-type Event --payload fileb://payload.json response.json || echo "Lambda invocation failed, but continuing"
111
+ fi
112
+ ```
113
+
114
+ **Trigger Flow:**
115
+
116
+ 1. When code is pushed to the `main` branch, the CI/CD pipeline is triggered
117
+ 2. After successful deployment of a new Fawkes version, the post-build phase
118
+ executes
119
+ 3. The Lambda function is invoked with a simple payload containing the source
120
+ and timestamp
121
+ 4. The Lambda function authenticates with Confluence and executes the
122
+ documentation generation process
123
+ 5. This only happens for production deployments (not PR builds)
124
+
125
+ This automated approach ensures documentation stays in sync with the actual
126
+ codebase without manual intervention.
127
+
128
+ ## Scalability and Extension
129
+
130
+ ### Adding New Projects
131
+
132
+ To add documentation for a new project:
133
+
134
+ 1. Create a new class that implements the `IPolicyFetcher` interface
135
+ 2. Implement the `getProjectName()` and `fetchPolicies()` methods
136
+ 3. Register the new fetcher in the `ContentBuilder` constructor
137
+
138
+ Example:
139
+
140
+ ```typescript
141
+ export class NewProjectPolicyFetcher implements IPolicyFetcher {
142
+ getProjectName(): string {
143
+ return 'New Project Name';
144
+ }
145
+
146
+ fetchPolicies(): IPolicy[] {
147
+ // Implement policy fetching logic
148
+ return [...policies];
149
+ }
150
+ }
151
+
152
+ // Then update ContentBuilder:
153
+ constructor(fetchers?: IPolicyFetcher[]) {
154
+ this.policyFetchers = fetchers || [
155
+ // Existing fetchers
156
+ new NewProjectPolicyFetcher()
157
+ ];
158
+ }
159
+ ```
160
+
161
+ ### Customizing Page Content
162
+
163
+ The `DocumentBuilder` class contains methods for generating page content. To
164
+ customize the format:
165
+
166
+ 1. Modify the `buildMainDocument()` method for changes to the main index page
167
+ 2. Modify the `buildProjectDocument()` method for changes to project pages
168
+ 3. Modify the `buildPolicySection()` and `buildRulesTable()` methods for changes
169
+ to policy and rule sections
170
+
171
+ ## Conclusion
172
+
173
+ This documentation system ensures that Fawkes indexing rules are always
174
+ well-documented and accessible to the team. By automatically generating
175
+ documentation directly from the codebase, it eliminates the risk of
176
+ documentation becoming outdated or inconsistent with the actual implementation.
@@ -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),
@@ -10,7 +10,7 @@ import { AttendancePresenter } from '../../presenters/AttendancePresenter';
10
10
  import { DegreePresenter } from '../../presenters/DegreePresenter';
11
11
  export class CountryAttendanceDegree extends ProgrammesBaseIndexabilityPolicy {
12
12
  name = 'Country Attendance Degree Policy';
13
- description = `Determines indexing rules for pages filtered by country,
13
+ description = `Determines indexing rules for pages filtered by country,
14
14
  study format (online, on-campus, etc.), and degree type.`;
15
15
  filterKeys = [FilterKey.COUNTRY, FilterKey.DELIVERY_METHOD, FilterKey.DEGREE_TYPE];
16
16
  rules = [
@@ -10,7 +10,7 @@ import { DegreePresenter } from '../../presenters/DegreePresenter';
10
10
  import { DurationPresenter } from '../../presenters/DurationPresenter';
11
11
  export class CountryDurationDegree extends ProgrammesBaseIndexabilityPolicy {
12
12
  name = 'Country Duration Degree Policy';
13
- description = `Determines indexing rules for pages filtered by country,
13
+ description = `Determines indexing rules for pages filtered by country,
14
14
  duration (1 year, 2 years, etc.), and degree type.`;
15
15
  filterKeys = [FilterKey.COUNTRY, FilterKey.DURATION, FilterKey.DEGREE_TYPE];
16
16
  rules = [
@@ -8,7 +8,7 @@ import { CountryPresenter } from '../../presenters/CountryPresenter';
8
8
  import { EducationalFormPresenter } from '../../presenters/EducationalFormPresenter';
9
9
  export class CountryEducationalForm extends ProgrammesBaseIndexabilityPolicy {
10
10
  name = 'Country Educational Form Policy';
11
- description = `Determines indexing rules for pages filtered by both country,
11
+ description = `Determines indexing rules for pages filtered by both country,
12
12
  and educational form (academic, semester, summer school, etc.).`;
13
13
  filterKeys = [FilterKey.COUNTRY, FilterKey.EDUCATIONAL_FORM];
14
14
  rules = [
@@ -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) {
@@ -9,7 +9,7 @@ import { CountryPresenter } from '../../presenters/CountryPresenter';
9
9
  import { DegreePresenter } from '../../presenters/DegreePresenter';
10
10
  export class DisciplineCountryDegree extends ProgrammesBaseIndexabilityPolicy {
11
11
  name = 'Discipline Country Degree Policy';
12
- description = `Determines indexing rules for pages filtered by discipline,
12
+ description = `Determines indexing rules for pages filtered by discipline,
13
13
  country, and degree type.`;
14
14
  filterKeys = [FilterKey.DISCIPLINES, FilterKey.COUNTRY, FilterKey.DEGREE_TYPE];
15
15
  rules = [
@@ -9,7 +9,7 @@ import { CountryPresenter } from '../../presenters/CountryPresenter';
9
9
  import { EducationalFormPresenter } from '../../presenters/EducationalFormPresenter';
10
10
  export class DisciplineCountryEducationalForm extends ProgrammesBaseIndexabilityPolicy {
11
11
  name = 'Discipline Country Educational Form Policy';
12
- description = `Determines indexing rules for pages filtered by discipline,
12
+ description = `Determines indexing rules for pages filtered by discipline,
13
13
  country, and educational form (academic, semester, summer school, etc.).`;
14
14
  filterKeys = [FilterKey.DISCIPLINES, FilterKey.COUNTRY, FilterKey.EDUCATIONAL_FORM];
15
15
  rules = [
@@ -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);
@@ -8,7 +8,7 @@ import { DisciplinePresenter } from '../../presenters/DisciplinePresenter';
8
8
  import { EducationalFormPresenter } from '../../presenters/EducationalFormPresenter';
9
9
  export class DisciplineEducationalForm extends ProgrammesBaseIndexabilityPolicy {
10
10
  name = 'Discipline Educational Form Policy';
11
- description = `Determines indexing rules for pages filtered by both discipline,
11
+ description = `Determines indexing rules for pages filtered by both discipline,
12
12
  and educational form (academic, semester, summer school, etc.).`;
13
13
  filterKeys = [FilterKey.DISCIPLINES, FilterKey.EDUCATIONAL_FORM];
14
14
  rules = [
@@ -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';