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 Forecast controller and models #577

Open
astride opened this issue Jan 8, 2025 · 0 comments
Open

Add Forecast controller and models #577

astride opened this issue Jan 8, 2025 · 0 comments

Comments

@astride
Copy link
Contributor

astride commented Jan 8, 2025

Add Forecast controller, Forecast repository and associated models.

We need:

  • a method for getting consultant objects populated with necessary data for selected consultants over a certain time period. The necessary data will be the same data that is retrieved upon loading the Bemanning page, in addition to associated forecast objects. Method suggestions:
    • Take an array of consultant IDs, a date object (for the first month being displayed) and desired month count as input parameters
    • Calculate the desired end month
    • Calculate the start week and end week associated with the start month and end month
    • Get relevant consultants from the DB, include the same related objects as for staffing (see StaffingControllerGet()), and include relevant Forecast objects. Possible other changes:
      • Skip Email, it should not be relevant
      • Replace List<BookedHoursPerWeek> Bookings with List<BookedHoursInMonth> Bookings (logic must be written for this)
      • Replace List<DetailedBooking> DetailedBooking with List<DetailedBookingForMonth> DetailedBooking (logic must be written for this)
    • Return the objects
  • a method for adding/updating a Forecast object for a selected consultant for a certain month. Method suggestions:
    • Take a consultant ID, a date object and a manually set forecast value as input parameters
    • Validate that the forecast value is 0 <= value <= 100 (if validation fails: return error message)
    • If an object for this forecast already exists in the database, update the forecast value; else, create and add a forecast object
    • Return success message

These suggestions are based on the assumption that all necessary conversions between weeks and months are made in the backend, but that the 'billable' calculations are made in the frontend (similar to the calculations for the Bemanning page).

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

1 participant