Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add in 'DueDateAssociate' and 'DueDateSupervisor' fields to internal (non-Dynamo) schemas; add in value defaulting on backend if no due date(s) are specified in Dynamo data #21

Open
4 tasks
izzyconner opened this issue Apr 3, 2024 · 0 comments
Assignees

Comments

@izzyconner
Copy link
Contributor

izzyconner commented Apr 3, 2024

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 associate
  • DueDateSupervisor: an epoch representing the day and time that this timesheet must be reviewed by the supervisor

Image

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:

  • DueDateAssociate should be defaulted to 7 days after the Start date
  • DueDateSupervisor should be default to 10 days after the Start date

Conditions of Satisfaction

  • If a timesheet is requested from the database that contains a DueDateAssociate field, the DueDateAssociate field should be present in the API's response
  • If a timesheet is requested from the database that contains a DueDateSupervisor field, the DueDateSupervisor field should be present in the API's response
  • If a timesheet is requested from the database that does not contains a DueDateAssociate field, the DueDateAssociate field should be present in the API's response and be an epoch equivalent to 7 days after the Start of that timesheet
  • If a timesheet is requested from the database that does not contains a DueDateSupervisor field, the DueDateSupervisor field should be present in the API's response and be an epoch equivalent to 10 days after the Start of that timesheet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants