Fixed: Joined at date can be null
This commit is contained in:
parent
2975b77da0
commit
04cfd95892
|
@ -19,7 +19,7 @@ class PullMemberAction
|
||||||
{
|
{
|
||||||
use AsAction;
|
use AsAction;
|
||||||
|
|
||||||
public function handle(int $groupId, int $memberId): Member
|
public function handle(int $groupId, int $memberId): ?Member
|
||||||
{
|
{
|
||||||
$member = $this->api()->member($groupId, $memberId);
|
$member = $this->api()->member($groupId, $memberId);
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ class PullMemberAction
|
||||||
return Member::updateOrCreate(['nami_id' => $member->id], [
|
return Member::updateOrCreate(['nami_id' => $member->id], [
|
||||||
'firstname' => $member->firstname,
|
'firstname' => $member->firstname,
|
||||||
'lastname' => $member->lastname,
|
'lastname' => $member->lastname,
|
||||||
'joined_at' => $member->joinedAt,
|
'joined_at' => $member->joinedAt ?: now(),
|
||||||
'birthday' => $member->birthday,
|
'birthday' => $member->birthday,
|
||||||
'send_newspaper' => $member->sendNewspaper,
|
'send_newspaper' => $member->sendNewspaper,
|
||||||
'address' => $member->address,
|
'address' => $member->address,
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit fca340c520916db554b6bfa4562dd14ef97d1b35
|
Subproject commit e96d3dfe8eba1cbcb0eedc67ade07337170a7507
|
|
@ -91,4 +91,15 @@ class PullMemberActionTest extends TestCase
|
||||||
'region_id' => null,
|
'region_id' => null,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testFetchesMembersWhenJoinedAtDateIsNull(): void
|
||||||
|
{
|
||||||
|
app(MemberFake::class)->shows(1000, 1001, [
|
||||||
|
'eintrittsdatum' => null,
|
||||||
|
]);
|
||||||
|
|
||||||
|
app(PullMemberAction::class)->handle(1000, 1001);
|
||||||
|
|
||||||
|
$this->assertDatabaseCount('members', 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue