Closed haietza closed 6 years ago
@patrickbeekman @rivendell10 @caldwellc1 I'm reopening this pull request with the code working for date validation on startTime <= endTime. I found issues with trying to get the maxNumberOfDays value from the ref eventType for the reservation in order to calculate that the endTime was within that range. The only way I could find to get that data was to run a query within the validate function, but that did not return the value to the validator before the reservation document was saved, so the calculation was always incorrect. I could not get the validator to work with the return statement inside the query function. After a few days on this, I think we need to use the simplicity agile principle and go with the basic date validation for now. I have added an issue for future work to revisit the maxNumberOfDays date validation so it can be implemented in the future.
Also, all tests are passing now when run as a suite.
Hold on guys ... I just realized I did not add the controller unit tests yet. This was just to get the existing tests running. Sorry again! I'll get the tests added and @mention you all when it's pushed.
@patrickbeekman @caldwellc1 @rivendell10 Okay, the controller unit tests are there now and are passing. Thanks for your patience!
@patrickbeekman Let's keep this pull request for the create reservation feature. Can you reset this branch back to my last commit, then create a new branch and pull request for the list reservation feature? Just to keep things a bit simpler and more clear?
@haietza Hey I'm sorry I forgot that would probably be a good idea. I can try and do that, I'm just worried that I'll mess something up with git and lose my work somehow haha. So to do it I should first checkout and create a new branch from this one? Then I can come back here and reset to your commit? Then go back to the new branch and create a pull request for that?
@patrickbeekman Yes, if you checkout a new branch from what you have, that will save your work on the new branch. Then you should be able to checkout this branch, do a git reset 7b6f22, then force push it back up to github, and that should put everything on this branch back. If something doesn't work or you need me to give it a try, just shout. Thanks a bunch!
Okay should be done now!
Resolves #18. Resolves #4. Resolves #10.
Unit tests are passing when run individually, but not as suite. I believe it has something to do with race conditions and the asynchronous running of the code. I will continue to research the issue, but don't want that to hold up progress on the remaining features that depend on this.