mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-25 14:17:31 +00:00
fix(mail-ingest): read a transfer booking with a numeric code instead of filing it as a forwarding confirmation
Outside Gmail and Outlook senders, only a subject naming mail forwarding counts, so a bare 'transfert' in a shuttle or airport transfer confirmation no longer hides the booking.
This commit is contained in:
@@ -51,6 +51,13 @@ describe('classifyMail', () => {
|
||||
]) {
|
||||
expect(classifyMail(mail({ Subject: subject }, body)), subject).toEqual({ kind: 'read' });
|
||||
}
|
||||
const coded = mail(
|
||||
{ From: 'resa@navette.example', Subject: 'Transfert Orly - Paris : confirmation de réservation' },
|
||||
'Votre code de réservation : 58213467. Rendez-vous le 2030-03-02 à 10:00.',
|
||||
);
|
||||
expect(classifyMail(coded)).toEqual({ kind: 'read' });
|
||||
const relayed = mail({ Subject: 'Transfert de courrier : confirmez' }, 'Votre code : 612345678');
|
||||
expect(classifyMail(relayed)).toEqual({ kind: 'forwarding_confirmation', code: '612345678' });
|
||||
});
|
||||
|
||||
it('reads a long subject and From header in linear time', () => {
|
||||
|
||||
Reference in New Issue
Block a user