Added some code to auto-create earn leave events. Some of it is dummy code for now but it captures the algorithm.