Recruiting Challenge: Firmenkonto ohne Rang und Praemie, Bedingungen Punkt 4 ergaenzt
Kundenentscheid 25.09.2026 zu den Regeln 4 bis 7: - Firmenkonto (mivita.company_user_id) steht in keiner Rangliste und bekommt keine Praemie; getrackt wird weiter, damit ein ueber den Firmenlink registrierter Partner nach dem Umhaengen mit umzieht - Bedingungen Punkt 4 (de/en/es/fr): auch Kunden, die Berater werden, zaehlen; massgeblich ist der aktuell hinterlegte Sponsor - Test: Anmeldung ueber den Firmenlink, Umhaengen, Wertung beim neuen Sponsor - Doku: Regeln 4 bis 7 entschieden Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
e390d3b816
commit
f2aa30243f
8 changed files with 65 additions and 12 deletions
|
|
@ -508,3 +508,36 @@ describe('Storno der Starterpaket-Bestellung (Kundenentscheid 25.09.2026)', func
|
|||
expect($participant->fresh()->total_points)->toBe(600);
|
||||
})->with(['nachtlauf' => false, 'neuaufbau' => true]);
|
||||
});
|
||||
|
||||
describe('Anmeldung ueber den falschen Link (Kundenentscheid 25.09.2026)', function () {
|
||||
it('zaehlt nach dem Umhaengen vom Firmenkonto beim neuen Sponsor, das Firmenkonto bekommt weder Rang noch Praemie', function () {
|
||||
$incentive = repairTestCreateIncentive();
|
||||
$company = repairTestCreateUser();
|
||||
config(['mivita.company_user_id' => $company->id]);
|
||||
$sponsor = repairTestCreateUser();
|
||||
$sponsorParticipant = IncentiveParticipant::factory()->create([
|
||||
'incentive_id' => $incentive->id,
|
||||
'user_id' => $sponsor->id,
|
||||
]);
|
||||
|
||||
// Registriert ueber den Firmenlink: Live-Tracking legt die Wertung beim Firmenkonto an
|
||||
$partner = repairTestCreateUser($company->id);
|
||||
$order = repairTestCreateStarterKitOrder($partner, $company, '2026-05-05 10:00:00');
|
||||
IncentiveTracker::trackNewPartner($order);
|
||||
|
||||
$companyParticipant = IncentiveParticipant::where('incentive_id', $incentive->id)->where('user_id', $company->id)->firstOrFail();
|
||||
$companyParticipant->update(['accepted_terms_at' => now()]);
|
||||
IncentiveTracker::updateRanking($incentive);
|
||||
expect($companyParticipant->fresh()->qualified_partners)->toBe(1)
|
||||
->and($companyParticipant->fresh()->rank)->toBeNull();
|
||||
|
||||
// Admin haengt den Partner auf den richtigen Sponsor um
|
||||
$partner->forceFill(['m_sponsor' => $sponsor->id])->save();
|
||||
$this->artisan('incentive:calculate', ['incentive_id' => (string) $incentive->id])->assertSuccessful();
|
||||
|
||||
expect($sponsorParticipant->fresh()->qualified_partners)->toBe(1)
|
||||
->and($sponsorParticipant->fresh()->rank)->toBe(1)
|
||||
->and($companyParticipant->fresh()->qualified_partners)->toBe(0)
|
||||
->and(IncentiveParticipant::excludedUserIds())->toContain($company->id);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue