fix: feeName can be null
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Philipp Lang 2023-03-06 10:47:23 +01:00
parent 06b3f1f89c
commit f0d0a9387d
1 changed files with 4 additions and 3 deletions

View File

@ -58,9 +58,10 @@ class InsertMemberAction
$fee = Fee::nami($member->feeId ?: -1);
if (is_null($fee)) {
$fee = Fee::create(['name' => $member->feeName, 'nami_id' => $member->feeId]);
$subscription = $fee->subscriptions()->create(['name' => $member->feeName]);
$subscription->children()->create(['name' => $member->feeName, 'amount' => 1000]);
$feeName = $member->feeName ?: 'Default';
$fee = Fee::create(['name' => $feeName, 'nami_id' => $member->feeId]);
$subscription = $fee->subscriptions()->create(['name' => $feeName]);
$subscription->children()->create(['name' => $feeName, 'amount' => 1000]);
}
return $fee->subscriptions()->first();