tijlleenders / ZinZen-scheduler

The calendar engine for the ZinZen web app.
https://github.com/tijlleenders/ZinZen
GNU Affero General Public License v3.0
10 stars 4 forks source link

add test budget-with-subgoal #433

Closed tijlleenders closed 9 months ago

tijlleenders commented 9 months ago

Sorry for the messy commit history.

I didn't want to loose out on the improvements from the other PRs waiting for review - and then I tried rebasing for the first time :) This PR's commits start at fix unwrap bug - a commit that wasn't necessary and is overturned later... Still haven't figured out how to clean that up so I get a commit history that reads like a story...

In terms of the strategies outlined below, the simple Goals get scheduled first anyway - so there was no special change needed for current test cases. Just filtering the Hours based on the Budget and updating the Budget when placing the simple Goal.

Basically what I did to fix this issue:

============================= Original PR/issue description:
Test where someone has a workbudget of 40h on weekdays. Below that, as a subgoal, we add a 1h 'Plan my work week'.

Since the goal is more specific than the generic budget - it should be planned first - and also reduce the budget by one hour, as it counts as work (since it's a subgoal of work).

Technically, I see a few ways of approaching this:

  1. make an activity for 'Plan my work week' - possibly with new type and somehow integrate that in the scheduling so that it's always earlier than the budget it is part of... sounds complicated?
  2. Or if we place it in the same Vec<Activity> as the budget - but at the beginning of the Vec - it will get scheduled first - as it will always have the same flexibility as the other budget Activity hours?
  3. Keep the 'Plan my work week' on a separate list, and replace/switch out the first Task hour of 'Work' budget Tasks (after they have been scheduled normally taking 40h of the week) with the simple goal title.
tijlleenders commented 9 months ago

@thinkrapido @kobe-reygel
This is a failing test case. I've not made a separate issue for it - but have added the PR to the project board parking lot - where it appears just like an issue - and can be self-assigned if you'd like to work on solving this.