Skip to content
This repository has been archived by the owner on Dec 26, 2022. It is now read-only.

feat: doctolib.de germany compatibility #85

Merged
merged 5 commits into from
Dec 10, 2021

Conversation

hschaeidt
Copy link
Collaborator

@hschaeidt hschaeidt commented Nov 27, 2021

I am currently working on the full compatibility of both sites https://doctolib.fr/ and https://doctolib.de/ at the same time.

However, it seems that booking flows significantly differentiate between both platforms, as the health systems may vary from country to country.

Features:

  • Support most of the booking flows of both platforms
  • Extend the search terms to support both languages
  • Change the search terms to be inclusive instead of exclusive for better search result confidence
  • Remove the necessity of waiting for booking flow elements, by predefining precisely the possible flows in the code -> faster code execution until the date selection

Bugfixes:

  • Fix the date calculation and make it compatible with both regions
  • Get rid of the general public motive, as the vaccine is now open to the general public for a while

ToDo:

  • Add translations for the german language, maybe we can build that on top of @nanls efforts in [WIP] internationalization #33
  • Extract the rest of the workflow code into independent functions, to be more flexible on integrating more workflows if needed
  • Think about, if this whole thing is somehow testable :)

const selectedDay = parseInt(parts[1]);
const selectedYear = estimateYear(currentMonth, selectedMonth);
const selectedTime = parts[3];

const date = new Date(
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The date here is not really used for anything anymore, but this should fix it, there were little issues in the regex and the usage of parts. Additionally, the part with the year could have been incorrect when being at the end of a year, like now. The estimateYear function adds a year to the current one if the selected month is smaller than the current. This should work as long as we assume, that taking appointments in the past or in over a year should not be possible.

If I understand the code directly it was used before the 31st May 2020 to only search for available shots tomorrow. Should we remove the whole check?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure! This rule doesn't exist in France anymore.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll leave it in for now, because it seems useful for #86 :)

@hschaeidt hschaeidt force-pushed the doctolib_germany_compa branch from 069ffdc to 23bb64e Compare December 10, 2021 10:11
@hschaeidt hschaeidt changed the title Draft: feat: doctolib.de germany compatibility feat: doctolib.de germany compatibility Dec 10, 2021
@hschaeidt
Copy link
Collaborator Author

This PR is ready now. I rebased and tested it again. Unfortunately, I didn't have enough time to work on it for the last 2 weeks. For the 2 open Todos, I'd like to work on them in separate PRs. What do you think?

@dunglas dunglas merged commit 132631e into dunglas:main Dec 10, 2021
@dunglas
Copy link
Owner

dunglas commented Dec 10, 2021

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants