feat: unenrolment should be available only over 48h before occurrence#693
Conversation
KK-1436. Configure `KUKKUU_ENROLMENT_UNENROL_HOURS_BEFORE` with environment variable and use it to limit unenrolments too late before an occurrence start time. The default value is set to 48h. Use 0 as a value to disable this new feature. The UI changes are implemented in City-of-Helsinki/kukkuu-ui#693.
|
Some texts are still needed to informate about the 48h limit
|
|
KUKKUU-UI branch is deployed to platta: https://kukkuu-ui-pr693.dev.hel.ninja 🚀🚀🚀 |
TestCafe result is success for https://kukkuu-ui-pr693.dev.hel.ninja 😆🎉🎉🎉 |
KK-1436. Configure `KUKKUU_ENROLMENT_UNENROL_HOURS_BEFORE` with environment variable and use it to limit unenrolments too late before an occurrence start time. The default value is set to 48h. Use 0 as a value to disable this new feature. The UI changes are implemented in City-of-Helsinki/kukkuu-ui#693.
caa17dd to
b701695
Compare
b701695 to
a20f491
Compare
|
KUKKUU-UI branch is deployed to platta: https://kukkuu-ui-pr693.dev.hel.ninja 🚀🚀🚀 |
TestCafe result is failed for https://kukkuu-ui-pr693.dev.hel.ninja 😿💢💥💥 |
|
KUKKUU-UI branch is deployed to platta: https://kukkuu-ui-pr693.dev.hel.ninja 🚀🚀🚀 |
TestCafe result is failed for https://kukkuu-ui-pr693.dev.hel.ninja 😿💢💥💥 |
| expect(container).toMatchSnapshot(); | ||
| }); | ||
|
|
||
| describe('unenrolment is possible only 48 before the occurrence', async () => { |
There was a problem hiding this comment.
Does this work because of the ceiling rounding method used in differenceInHours in shouldAllowUnenrolment? I mean that the current time is not frozen here, and as the tests should take less than an hour the difference should evaluate to the same hour value?
There was a problem hiding this comment.
Now there is 10s cap that should ensure that (and no ceiling rounding).
karisal-anders
left a comment
There was a problem hiding this comment.
The hardcoded 48 values should be changed to use AppConfig.enrolmentCancellationTimeLimitHours except in AppConfig.enrolmentCancellationTimeLimitHours itself as the fallback value.
Maybe a test case for AppConfig.enrolmentCancellationTimeLimitHours returning 48 could be added if the tests are assuming that it must be such for the tests to pass, or the tests could be made so that AppConfig.enrolmentCancellationTimeLimitHours returns 48 in them (e.g. mocking the function's return value or VITE_ENROLMENT_CANCELLATION_TIME_LIMIT_HOURS to 48). Without either of these there is a hidden dependency on the default value of AppConfig.enrolmentCancellationTimeLimitHours being 48 in some of the test cases. Testing for it would at least document the dependency.
And was my assumption of why the tests pass correct related to the use of ceil rounding method in differentInHours i.e. this comment.
I assume Ratkaisutoimisto would want to code review this PR before merging is possible.
365d875 to
d1d89cc
Compare
|
KUKKUU-UI branch is deployed to platta: https://kukkuu-ui-pr693.dev.hel.ninja 🚀🚀🚀 |
TestCafe result is success for https://kukkuu-ui-pr693.dev.hel.ninja 😆🎉🎉🎉 |
d1d89cc to
e56d8f5
Compare
|
KUKKUU-UI branch is deployed to platta: https://kukkuu-ui-pr693.dev.hel.ninja 🚀🚀🚀 |
KK-1436. Add `AppConfig.enrolmentCancellationTimeLimitHours` that can be used to configure the time (in hours) that limits the cancellation time. Add description texts related to enrolment cancellation.
e56d8f5 to
354a4cc
Compare
|
|
KUKKUU-UI branch is deployed to platta: https://kukkuu-ui-pr693.dev.hel.ninja 🚀🚀🚀 |
TestCafe result is success for https://kukkuu-ui-pr693.dev.hel.ninja 😆🎉🎉🎉 |
KK-1436. Configure `KUKKUU_ENROLMENT_UNENROL_HOURS_BEFORE` with environment variable and use it to limit unenrolments too late before an occurrence start time. The default value is set to 48h. Use 0 as a value to disable this new feature. The UI changes are implemented in City-of-Helsinki/kukkuu-ui#693.
KK-1436. Configure `KUKKUU_ENROLMENT_UNENROL_HOURS_BEFORE` with environment variable and use it to limit unenrolments too late before an occurrence start time. The default value is set to 48h. Use 0 as a value to disable this new feature. The UI changes are implemented in City-of-Helsinki/kukkuu-ui#693.








KK-1436.
Add
AppConfig.enrolmentCancellationTimeLimitHoursthat can be used to configure the time (in hours) that limits the cancellation time.