The logic to prevent overlapping user residencies is not working correctly. I am trying to add a non-overlapping residency to a resident that has no active residency and get the following error:
Error: This user already has an active residency [500]
at Object.addNewResidencyWithExistingResident (server/methods/residencies.js:28:11)
at packages/simple_rest.js:383:33
at packages/simple_json-routes.js:98:9
Steps to reproduce:
Create a new resident and residency
move in: 2020-10-01
move out: 2020-10-10
Add a new residency for existing resident
select the resident
move in: 2020-07-01
move out: 2020-07-10
The logic should allow the additional residency for a given resident, so long as the dates do not overlap. It should not matter whether the current residency is inactive, so long as there are no overlapping dates (and the old residency end date is prior to the newer residency start date).
Only creating a new residency for a date later than the move in date for an active residency (meaning no move out date) should be disallowed.
The logic to prevent overlapping user residencies is not working correctly. I am trying to add a non-overlapping residency to a resident that has no active residency and get the following error:
Steps to reproduce:
The logic should allow the additional residency for a given resident, so long as the dates do not overlap. It should not matter whether the current residency is inactive, so long as there are no overlapping dates (and the old residency end date is prior to the newer residency start date).
Only creating a new residency for a date later than the move in date for an active residency (meaning no move out date) should be disallowed.