Please sign in to comment.
Adds category_id to user_behavior_link
Now, on a check-in, a behavior's category_id (and the category_id associated with the selected behavior for a processing question) is stored alongside the other behavior data in the user_behavior_link table. This is a helpful change that eases future development and allows existing code to be somewhat simpler. Also, this is a good push towards our goal of an "immutable" check-in. Once a check-in has been done and the window for a redo is done, the user should not be able to update any data in that check-in. The user obviously cannot change the category a given behavior belongs to, that relationship is hardcoded in \common\models\Category. But if that definition were updated, behaviors that were selected in previous check-ins would be unaltered. That's good. Also, soon enough we will support "custom behaviors", which can be deleted or recategorized at will. The changes in this PR will correctly preserve history even when a custom behavior is modified.
- Loading branch information...
Showing with 1,092 additions and 909 deletions.
- +1 −3 common/interfaces/UserBehaviorInterface.php
- +4 −3 common/mail/checkinReport.php
- +17 −2 common/models/Behavior.php
- +25 −2 common/models/Category.php
- +5 −3 common/models/Question.php
- +4 −42 common/models/User.php
- +85 −45 common/models/UserBehavior.php
- +385 −317 common/tests/unit/data/behaviorsWithCounts.php
- +2 −1 common/tests/unit/models/CategoryTest.php
- +280 −29 common/tests/unit/models/UserBehaviorTest.php
- +16 −280 common/tests/unit/models/UserTest.php
- +57 −0 console/migrations/m190829_141748_alter_user_behavior_link_add_category_id.php
- +10 −10 site/controllers/CheckinController.php
- +1 −1 site/controllers/ProfileController.php
- +25 −3 site/models/CheckinForm.php
- +2 −0 site/models/QuestionForm.php
- +1 −3 site/tests/_support/MockUserBehavior.php
- +157 −160 site/tests/unit/models/CheckinFormTest.php
- +14 −4 site/tests/unit/models/QuestionFormTest.php
- +1 −1 site/views/checkin/report.php
Oops, something went wrong.