-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Context
In Timesheet.tsx, there's a calculated variable disabled, which determines if a user is able to edit and submit the timesheet.
// use this to control whether the timesheet is disabled or not
const disabled = false;
Right now, cases where they will not be able to disable it are:
- A supervisor cannot edit or submit before an associate has submitted their timesheet
- A user cannot submit the timesheet once the corresponding deadline has passed
Description
The backend /timesheet endpoint should now return additional fields in the Timesheet schema to track deadlines, in addition to the Start field that is currently included.
DueDateAssociate: an epoch representing the day and time that this timesheet must be submitted by the associateDueDateSupervisor: an epoch representing the day and time that this timesheet must be reviewed by the supervisor
You will need to update the TimesheetEntry schema to include this new change, in both the Dynamo schemas and the internal shared schemas (if the shared schemas ticket still isn't out when you start working on this, please bug Izzy to get it pushed). Update any zod parsers to parse for it optionally.
Then, once the schemas have been updated, we will also need to update the return value of the backend timesheets in the GET request response to default to the following values if not DueDates are received from the database date:
DueDateAssociateshould be defaulted to 7 days after theStartdateDueDateSupervisorshould be default to 10 days after theStartdate
Conditions of Satisfaction
- If a timesheet is requested from the database that contains a
DueDateAssociatefield, theDueDateAssociatefield should be present in the API's response - If a timesheet is requested from the database that contains a
DueDateSupervisorfield, theDueDateSupervisorfield should be present in the API's response - If a timesheet is requested from the database that does not contains a
DueDateAssociatefield, theDueDateAssociatefield should be present in the API's response and be an epoch equivalent to 7 days after theStartof that timesheet - If a timesheet is requested from the database that does not contains a
DueDateSupervisorfield, theDueDateSupervisorfield should be present in the API's response and be an epoch equivalent to 10 days after theStartof that timesheet
