-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update
Checker
to search for issues with "Inactief Lid" of organs
The `Checker` can now determine that a member cannot be "Lid" AND "Inactief Lid" of the same organ, it guesses whether or not the member should actually be "Lid" or "Inactief Lid", however, there is no guarantee this is correct. Additionally, it can detect "Inactief Lid" members who still have a special role in the organ. Co-Authored-By: rinkp <[email protected]>
- Loading branch information
Showing
12 changed files
with
384 additions
and
172 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
module/Checker/src/Model/Error/MemberActiveAndInactiveInOrgan.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
|
||
namespace Checker\Model\Error; | ||
|
||
use Checker\Model\Error; | ||
use Database\Model\{ | ||
Meeting as MeetingModel, | ||
Member as MemberModel, | ||
}; | ||
use Database\Model\SubDecision\{ | ||
Foundation as FoundationModel, | ||
Installation as InstallationModel, | ||
}; | ||
|
||
/** | ||
* Error for when a member is "Inactief Lid" and "Lid" in an organ WITHOUT any special roles. We assume that the member | ||
* should NOT be "Lid". | ||
*/ | ||
class MemberActiveAndInactiveInOrgan extends Error | ||
{ | ||
public function __construct( | ||
MeetingModel $meeting, | ||
InstallationModel $installation, | ||
) { | ||
parent::__construct( | ||
$meeting, | ||
$installation, | ||
); | ||
} | ||
|
||
/** | ||
* Get the member who is installed as "Inactief Lid" and "Lid" but without any special roles. | ||
*/ | ||
public function getMember(): MemberModel | ||
{ | ||
return $this->getSubDecision()->getMember(); | ||
} | ||
|
||
/** | ||
* Get the organ the member is installed in. | ||
*/ | ||
public function getFoundation(): FoundationModel | ||
{ | ||
return $this->getSubDecision()->getFoundation(); | ||
} | ||
|
||
public function asText(): string | ||
{ | ||
return sprintf( | ||
'Member %s (%d) is marked as "Inactief Lid" of %s but is still a "Lid".', | ||
$this->getMember()->getFullName(), | ||
$this->getMember()->getLidNr(), | ||
$this->getFoundation()->getName(), | ||
); | ||
} | ||
} |
56 changes: 56 additions & 0 deletions
56
module/Checker/src/Model/Error/MemberActiveWithRoleAndInactiveInOrgan.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
|
||
namespace Checker\Model\Error; | ||
|
||
use Checker\Model\Error; | ||
use Database\Model\{ | ||
Meeting as MeetingModel, | ||
Member as MemberModel, | ||
}; | ||
use Database\Model\SubDecision\{ | ||
Foundation as FoundationModel, | ||
Installation as InstallationModel, | ||
}; | ||
|
||
/** | ||
* Error for when a member is "Inactief Lid" and "Lid" in an organ WITH special roles. We assume that the member should | ||
* be "Lid" and NOT "Inactief Lid". | ||
*/ | ||
class MemberActiveWithRoleAndInactiveInOrgan extends Error | ||
{ | ||
public function __construct( | ||
MeetingModel $meeting, | ||
InstallationModel $installation, | ||
) { | ||
parent::__construct( | ||
$meeting, | ||
$installation, | ||
); | ||
} | ||
|
||
/** | ||
* Get the member who is installed as "Inactief Lid" and "Lid" with special roles. | ||
*/ | ||
public function getMember(): MemberModel | ||
{ | ||
return $this->getSubDecision()->getMember(); | ||
} | ||
|
||
/** | ||
* Get the organ the member is installed in. | ||
*/ | ||
public function getFoundation(): FoundationModel | ||
{ | ||
return $this->getSubDecision()->getFoundation(); | ||
} | ||
|
||
public function asText(): string | ||
{ | ||
return sprintf( | ||
'Member %s (%d) is installed as "Lid" in %s with special roles but is also installed as "Inactief Lid".', | ||
$this->getMember()->getFullName(), | ||
$this->getMember()->getLidNr(), | ||
$this->getFoundation()->getName(), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.