-
Notifications
You must be signed in to change notification settings - Fork 15
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
Adding a resident-extern role #358
Conversation
7d424f0
to
3d309bd
Compare
What should we do? I really think this would be useful; now that this is going to be the new status quo. @machiato32? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes are alright. If this status really needs to stay, I guess I'll have to approve it. What do you think @kdmnk?
Also, please fix the merge conflicts @viktorcsimma |
3d309bd
to
f2d8631
Compare
Something is not OK yet; it crashes at the economic committee page. I'll check it out soon. |
Ah, sorry didn't test it, just looked at the code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can not we name this "LIMITED_RESIDENT" role internally? It is getting to be really confusing.
Alternatively, I was also thinking on making the roles time constrained. That way, we could have regular collegists, plus an additional resident role that is set to be valid for 1 year/indefinite. We can also use that for guests, instead of the guest_until attribute and solve #291. (Also, the general collegist role is also valid only until the end of their studies by default which we can set this way).
@machiato32 what do you think, does putting effort into this would worth it?
(We have some time to work on this, the earliest this will be relevant is next summer)
@@ -157,7 +157,7 @@ public function store(Request $request) | |||
return back()->with('error', "A státusz megadása kötelező!")->with('section', $request->section); | |||
} | |||
$user->setStatusFor(Semester::next(), $request->next_status, $request->next_status_note); | |||
if ($request->has('resign_residency') && $user->isResident()) { | |||
if ($request->has('resign_residency') && $user->resides()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resides() is a scope, which I think returns a query builder (test it in tinker). Check if these checks work as expected. In the tests it also seems fine, just double check it, I would not call scopes this way. I would rather make it a simple function
@@ -286,7 +289,7 @@ public function missingData(): array | |||
$missingData[] = 'Megjelölt kar'; | |||
} | |||
|
|||
if (!$user->isResident() && !$user->isExtern()) { | |||
if (!$user->resides() && !$user->isExtern()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
I'm starting to like this idea. The role_user table would have a created_at and valid_until field, and we would use a global scope to filter on those. This way, we don't delete roles just invalidate them, making a log out of the table. |
That sounds good:) Maybe we should open a new issue for that and freeze this until that gets solved. |
What should we do with this one? Should we merge it and then reverse it when working on that issue, or abandon it altogether? |
I'll close this for now. |
Closes #347. It's largely done; there might be some bugs that I haven't noticed.