Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions common/match/matching.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 }]);
Expand Down
9 changes: 0 additions & 9 deletions common/match/matching.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ export type MatchRequest = Readonly<{
state: pupil_state_enum;
requestAt: Date;
onlyMatchWith?: gender_enum;
hasSpecialNeeds?: boolean;
calendarPreferences?: CalendarPreferences;
}>;

Expand All @@ -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<string, any> as CalendarPreferences,
languages: pupil.languages,
};
Expand All @@ -71,7 +69,6 @@ export type MatchOffer = Readonly<{
state: student_state_enum;
requestAt: Date;
gender?: gender_enum;
hasSpecialExperience?: boolean;
calendarPreferences?: CalendarPreferences;
}>;

Expand All @@ -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<string, any> as CalendarPreferences,
languages: student.languages,
};
Expand Down Expand Up @@ -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) {
Expand Down
Loading