Incentive (E1): Recruiting-Challenge mit Geldpraemie, Auszahlungs-Export und parallelen Incentives

Neue Felder amount_per_partner, bonus_rank_1..3 und include_sales_points an
incentives. Mit ausgeschalteten Umsatzpunkten zaehlt die Wertung nur die
Einmalpunkte je Neupartner, die Rangliste entspricht damit der Anzahl
Neupartner mit Starterpaket. IncentivePayoutService rechnet Neupartner mal
Betrag plus Rang-Bonus fuer qualifizierte Gewinner; Admin-Detailseite bekommt
Praemienspalte, Summen und XLSX-Export fuer die Auszahlung.

Sidenav und Dashboard zeigen alle aktiven Incentives, damit Montenegro und
die Challenge parallel laufen koennen. Teaser, Rangliste und Details zeigen
bei Geldpraemie die Praemien-Kachel und "Deine Praemie bisher" und blenden
Abo-Bloecke aus, wenn Abos keine Rolle spielen. Montenegro bleibt unveraendert.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Kevin 2026-09-18 12:10:27 +00:00
parent 4899e3a890
commit b28f51bf62
27 changed files with 1418 additions and 129 deletions

View file

@ -7,6 +7,7 @@ use App\Http\Controllers\Controller;
use App\Models\Incentive;
use App\Models\IncentiveParticipant;
use App\Models\UserAbo;
use App\Services\Incentive\IncentivePayoutService;
use App\Services\Incentive\IncentivePointsLogRepairService;
use App\Services\Incentive\IncentiveTracker;
use App\User;
@ -68,6 +69,16 @@ class IncentiveController extends Controller
$participateHasTrackableAbos = $this->userHasTrackableAbosForIncentive($user, $incentive);
}
$payoutService = new IncentivePayoutService;
$participantPayout = $incentive->hasCashPayout() && $participant
? $payoutService->forParticipant($incentive, $participant)
: null;
$rankingPayouts = $incentive->hasCashPayout()
? $ranking->getCollection()->mapWithKeys(fn (IncentiveParticipant $row) => [
$row->id => $payoutService->forParticipant($incentive, $row),
])
: collect();
return view('user.incentive.show', [
'incentive' => $incentive,
'participant' => $participant,
@ -75,6 +86,8 @@ class IncentiveController extends Controller
'ranking' => $ranking,
'participateHasTrackableAbos' => $participateHasTrackableAbos,
'isVipView' => $user->isVIP(),
'participantPayout' => $participantPayout,
'rankingPayouts' => $rankingPayouts,
]);
}