Audit 18.09.: Zahlungsdatum nur bei Zahlung, Neupartner-IDs im Snapshot, Pausenende folgt dem Termin
F1: partner_paid_at wird beim Rechnungskauf (paymentStatusPaidAction mit paid=false) nicht mehr gesetzt, sondern erst bei der Rechnungszahlung; der Backfill nimmt das Aktivierungsdatum nur noch ohne jede Registrierungsbestellung (offene Rechnung bleibt leer). F2: Snapshots speichern je Linie new_partner_ids, die Neupartner-Liste zeigt genau diese; aeltere Snapshots ohne IDs rechnen mit der damaligen Regel (Registrierungsmonat, scopeNewPartnerInByActiveDate), damit Kachel und Liste uebereinstimmen. Keine Payload-Versionsaenderung, kein Neuaufbau noetig. F3: Liefertag-/Termin-Aenderung waehrend einer Pause zieht paused_until mit; eine Ausfuehrung loescht auch den paused_by_*-Grund. F4: expiredCount der Firstlines-Seite (Controller, View, Sprachen) zum bereits committeten Test nachgezogen. F5: Backfills schreiben ohne updated_at (toBase()->update, timestamps=false). Kuendigungsbestaetigung abo_cancel_confirm wird im Selfservice serverseitig verlangt. AboStatusExplainer laedt die Historie je Abo und Aktion nur einmal. Stellungnahme und Deploy-Folgen im Audit-Dokument, Regressionstests je Befund. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
parent
b7e8bbd951
commit
03416b0afe
27 changed files with 560 additions and 21 deletions
|
|
@ -611,13 +611,18 @@ class BackofficeDashboardService
|
|||
$customerAboIds = $this->aboIds($userIds, 'member_id', 'ot');
|
||||
$partnerAboIdsNew = $this->aboIds($userIds, 'user_id', 'me', $month, $year);
|
||||
$customerAboIdsNew = $this->aboIds($userIds, 'member_id', 'ot', $month, $year);
|
||||
// Neupartner ebenfalls als IDs festhalten: die Regel (Zahlungsmonat seit
|
||||
// 16.09.2026) kann sich aendern, die Liste hinter der eingefrorenen Kachel
|
||||
// muss trotzdem genau die damals gezaehlten Partner zeigen (Audit 18.09., F2).
|
||||
$newPartnerIds = $this->newPartnerIds($users, $month, $year);
|
||||
|
||||
return [
|
||||
'line' => $line,
|
||||
'label' => 'Linie '.$line,
|
||||
'user_ids' => $userIds,
|
||||
'consultants' => $this->activeConsultants($users),
|
||||
'new_partners' => $this->newPartners($users, $month, $year),
|
||||
'new_partners' => count($newPartnerIds),
|
||||
'new_partner_ids' => $newPartnerIds,
|
||||
'team_partner_abos' => count($partnerAboIds),
|
||||
'team_partner_abos_new' => count($partnerAboIdsNew),
|
||||
'team_customer_abos' => count($customerAboIds),
|
||||
|
|
@ -701,10 +706,22 @@ class BackofficeDashboardService
|
|||
* @param Collection<int, User> $users
|
||||
*/
|
||||
private function newPartners(Collection $users, int $month, int $year): int
|
||||
{
|
||||
return count($this->newPartnerIds($users, $month, $year));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Collection<int, User> $users
|
||||
* @return int[]
|
||||
*/
|
||||
private function newPartnerIds(Collection $users, int $month, int $year): array
|
||||
{
|
||||
return $users
|
||||
->filter(fn (User $user) => $user->isNewPartnerIn($month, $year))
|
||||
->count();
|
||||
->pluck('id')
|
||||
->map(fn ($id) => (int) $id)
|
||||
->values()
|
||||
->all();
|
||||
}
|
||||
|
||||
private function activeAboQuery(): Builder
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue