openfun / joanie

👛 A headless ERP for education to manage course enrollment/subscription, payment and certificates delivery.
MIT License
20 stars 2 forks source link

Allow to configure how the withdrawal date is computed #789

Closed lunika closed 3 weeks ago

lunika commented 1 month ago

Feature Request

Is your feature request related to a problem or unsupported use case? Please describe.

The method computing the withdrawal date for the payment schedule is only relevant for a french calendar with the french law. We should allow to choose the calendar to use and how many days to the withdrawal.

Describe the solution you'd like

Add two new settings. One for the calendar to use and an other one for the withdrawal days and use them in this function https://github.com/openfun/joanie/blob/9503173fde2931701e17513b242aedae2a97354d/src/backend/joanie/core/utils/payment_schedule.py#L30-L55

The calendar is a class, so we have to manage them like a backend or use the import_string django helper.