Fix prevention moreps
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
This commit is contained in:
parent
d64ea85be6
commit
c95658ae65
|
@ -360,8 +360,10 @@ class Member extends Model implements Geolocatable
|
|||
}
|
||||
|
||||
if ($this->more_ps_at === null) {
|
||||
if ($this->ps_at === null || $this->ps_at->diffInYears($date) >= 5) {
|
||||
if ($this->ps_at === null) {
|
||||
$preventions[] = Prevention::PS;
|
||||
} else if ($this->ps_at->diffInYears($date) >= 5) {
|
||||
$preventions[] = Prevention::MOREPS;
|
||||
}
|
||||
} else {
|
||||
if ($this->more_ps_at === null || $this->more_ps_at->diffInYears($date) >= 5) {
|
||||
|
|
|
@ -154,6 +154,11 @@ class PreventionTest extends TestCase
|
|||
'attrs' => ['has_vk' => false, 'efz' => now(), 'ps_at' => now()],
|
||||
'preventions' => [Prevention::VK],
|
||||
];
|
||||
|
||||
yield [
|
||||
'attrs' => ['has_vk' => true, 'efz' => now(), 'ps_at' => now()->subYears(7)],
|
||||
'preventions' => [Prevention::MOREPS],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue