Skip to content

[$100] Add "duration" field to Job and ResourceBooking models #113

Closed
@maxceem

Description

@maxceem
  • Add duration field to Job and ResourceBooking models. This field would define the duration in weeks.
  • This field is optional and should contain an integer value equal or greater than 1 - add Joi validation.
  • As we already have startDate and endDate fields we should keep all of these 3 fields consistent. If 2 of these fields are defined, we should automatically calculate the third one.
    • start + duration => calculate end
    • end + duration => calculate start
    • start + end => calculate duration (we should validate that calculated duration is more than 1 and it's an integer value or throw validation error).
    • start + end + duration => check if (end - start = duration) and if no, then throw validation error because data is inconsistent.
    • please, create some reusable logic for this, could it be done on the Model level if it makes sense so we never forget to add it?
  • Update Swagger and Postman
  • Update ES Processor
  • Create migration script
  • Mention which requests to call to update ES mapping

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions