Step-5: Extend the application
Once the generated application is downloaded or cloned from Git, the developer makes all the necessary changes to the application to meet the requirements specified in Step-1.
As mentioned in Step-1, to meet the application requirements, an employee and a manager should be able to perform the following tasks:
Task-1: Should be able to create Timesheetdetails for each day.
Task-2: Should be able to submit a Timesheet for a Timesheet period (1st-15th or 16th to end of month in our sample application) when the Timesheet is in Open or Rejected status
Task-3: Should be able to set daily reminders to receive an email at a specific time during the day
Task-1: Should be able to view a list of timesheets submitted by employees for each specific time period
Task-2: Should be able to view the details of each submitted timesheet
Task-3: Should be able to approve or reject each timesheet, providing notes
Except for Employee Task-1, the generated application does not have the functionality out-of-the-box to allow an employee and a manager to perform the remaining tasks.
In the generated application, even for performing the Employee Task-1, creating Timesheetdetails for each day, the employee needs to provide the following information to create each Timesheetdetails entry.
- Task or Timeofftype
There are several problems in creating Timesheetdetails entries:
To create a Timesheetdetails entry, the employee is required to provide information in the Timesheet field. Therefore, the Admin has to create Timesheet entries for each period and for each employee, which is an onerous task.
Secondly, logic has to be added to the Timesheetdetails Create and Update screens that would allow the employee to only enter the hours for a Task or Timeofftype fields, but not both.
The employee has to manually create each Timesheetdetails entry, one after the other.
To alleviate the above problems, it would be nice to have a custom UI screen that would provide the following functionality:
Allow the employee to enter all the Timesheetdetails entries for each day in a calendar using a single screen and save them
Provide separate sections for entering the Timesheetdetails for Task and Timeofftype entries
Once the employee saves the entries for the day, if the Timesheet for the time period and user does not exist, automatically create a Timesheet for the time period based on the current date and the username of the logged in user.
Associate the saved Timesheetdetails for the day with the existing or newly created Timesheet.
The above approach eliminates the three problems listed above:
(i) there is no need for the Admin to manually create a Timesheet for each period and each employee
(ii) it saves time for employees in entering Timesheetdetails for each day and
(iii) there is no need to code logic in the Timesheetdetails Create and Update screens to ensure that the employee did not enter hours for both Task and Timeofftype for each Timesheetdetails entity because we have separate sections for each of these two types of Timesheetdetails entities.
Therefore, the developer needs to extend the generated application and develop the above mentioned screen and the supporting back-end functionality for Task-1, along with screens/back-end code to accomplish Employee Task-2 & Task-3 and Manager Task-1, Task-2, and Task-3 mentioned in this section.
The specific code changes that need to be made by the developer to the generated application to meet the requirements are specified in the Timesheet Code Changes tutorial.
Updated about 2 years ago