Skip to content

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

@izzyconner

Description

@izzyconner

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions