From a2d43780d0393a6081737bd42ff6a65f4e56be4e Mon Sep 17 00:00:00 2001 From: John Angel Date: Wed, 18 Mar 2026 10:54:31 +0100 Subject: [PATCH] feat: Remove special needs/experience constraint from matching algo --- common/match/matching.spec.ts | 9 --------- common/match/matching.ts | 9 --------- 2 files changed, 18 deletions(-) diff --git a/common/match/matching.spec.ts b/common/match/matching.spec.ts index 5c1c9848d..719d5f63d 100644 --- a/common/match/matching.spec.ts +++ b/common/match/matching.spec.ts @@ -276,15 +276,6 @@ describe('Gender Constraint', () => { test('', [requestSix], [offerFive], [{ request: requestSix, offer: offerFive }]); }); -describe('Special Needs Constraint', () => { - // Unknown offer experience -> No Match - test('', [requestSeven], [offerOne], []); - // No offer experience -> No Match - test('', [requestSeven], [offerFour], []); - // Offer experience -> Match - test('', [requestSeven], [offerFive], [{ request: requestSeven, offer: offerFive }]); -}); - describe('Weekly Availability Constraint', () => { // For now if only one has availability set, then it's not a constraint to create the match test('', [requestFive], [offerFive], [{ request: requestFive, offer: offerFive }]); diff --git a/common/match/matching.ts b/common/match/matching.ts index 6f2e36417..f5c1b66e5 100644 --- a/common/match/matching.ts +++ b/common/match/matching.ts @@ -33,7 +33,6 @@ export type MatchRequest = Readonly<{ state: pupil_state_enum; requestAt: Date; onlyMatchWith?: gender_enum; - hasSpecialNeeds?: boolean; calendarPreferences?: CalendarPreferences; }>; @@ -49,7 +48,6 @@ export function pupilsToRequests(pupils: Pupil[]): MatchRequest[] { subjects: parseSubjectString(pupil.subjects), requestAt: pupil.firstMatchRequest, onlyMatchWith: pupil.onlyMatchWith, - hasSpecialNeeds: pupil.hasSpecialNeeds, calendarPreferences: pupil.calendarPreferences as Record as CalendarPreferences, languages: pupil.languages, }; @@ -71,7 +69,6 @@ export type MatchOffer = Readonly<{ state: student_state_enum; requestAt: Date; gender?: gender_enum; - hasSpecialExperience?: boolean; calendarPreferences?: CalendarPreferences; }>; @@ -86,7 +83,6 @@ export function studentsToOffers(students: Student[]): MatchOffer[] { subjects: parseSubjectString(student.subjects), requestAt: student.firstMatchRequest, gender: student.gender, - hasSpecialExperience: student.hasSpecialExperience, calendarPreferences: student.calendarPreferences as Record as CalendarPreferences, languages: student.languages, }; @@ -133,11 +129,6 @@ export function matchScore(request: MatchRequest, offer: MatchOffer, currentDate return NO_MATCH; } - // Only match "special needs" with "special experience" - if (request.hasSpecialNeeds && !offer.hasSpecialExperience) { - return NO_MATCH; - } - // Only match two calendar preferences set if they have at least one hour in common let overlappingHoursCount = 0; if (!!request.calendarPreferences && !!offer.calendarPreferences) {