Office Pro war Start zum Kauf angeboten, waehrend die Preistafel es dort ausschloss

main
nexxo 2026-08-02 01:46:22 +02:00
parent 2c30d1fb86
commit 11a7c52862
2 changed files with 38 additions and 1 deletions

View File

@ -353,7 +353,21 @@ return [
'addons' => [
'extra_backups' => ['price_cents' => 500, 'sold_as' => 'entitlement'],
'priority_support' => ['price_cents' => 2900, 'sold_as' => 'entitlement'],
'collabora_pro' => ['price_cents' => 1900, 'sold_as' => 'entitlement'],
// Die PRO-Stufe eines Office, das im Paket schon drin ist — „mehr
// gleichzeitige Bearbeiter und die erweiterten Funktionen". Sie setzt
// also voraus, dass überhaupt eines da ist.
//
// Ohne `unavailable_on` bot das Portal sie einem Start-Kunden für 22,80 €
// an, während die Preistafel in derselben Zeile ein „—" zeigte — und die
// Fußnote dort sagt wörtlich „in diesem Paket nicht verfügbar". Zwei
// Aussagen über dieselbe Sache auf einer Seite, und die teurere war die
// falsche. Dieselbe Sperre wie bei `custom_domain`, aus demselben Grund:
// was ein Paket KAUFEN darf, steht hier und nicht im Katalog.
'collabora_pro' => [
'price_cents' => 1900,
'sold_as' => 'entitlement',
'unavailable_on' => ['start'],
],
// The owner's commercial figure, to be adjusted once the first ones are
// sold. Listed here because the public sheet has to answer what a plan
// without an own domain costs to give one — an unpriced feature can only

View File

@ -9,6 +9,7 @@ use App\Models\Order;
use App\Models\Subscription;
use App\Models\SubscriptionAddon;
use App\Models\User;
use App\Services\Billing\AddonCatalogue;
use App\Services\Billing\CustomDomainAccess;
use App\Services\Billing\DowngradeCheck;
use App\Services\Billing\PlanCatalogue;
@ -260,3 +261,25 @@ it('keeps the rule in one place, where it can only be changed once', function ()
'app/Services/Billing/CustomDomainAccess.php',
]);
});
/**
* Office Pro ist die ERWEITERUNG eines Office, das im Paket schon steckt.
*
* Start hat keines die Preistafel zeigt dort ein „—", und ihre eigene
* Fußnote definiert das als „in diesem Paket nicht verfügbar". Das Portal bot
* die Pro-Stufe trotzdem für 22,80 an, weil `collabora_pro` als einziges
* Modul mit Paketbezug keinen `unavailable_on`-Eintrag hatte. Zwei Aussagen
* über dieselbe Sache auf einer Seite, und die teurere war die falsche.
*/
it('does not sell the office upgrade to a package that has no office', function () {
$catalogue = app(AddonCatalogue::class);
$start = Subscription::factory()->create(['plan' => 'start']);
$team = Subscription::factory()->create(['plan' => 'team']);
expect($catalogue->availabilityRefusal($start, 'collabora_pro'))->not->toBeNull()
// Und die Kehrseite: wo ein Office drin ist, bleibt die Erweiterung
// buchbar. Eine Sperre, die zu weit greift, wäre derselbe Fehler in
// die andere Richtung.
->and($catalogue->availabilityRefusal($team, 'collabora_pro'))->toBeNull();
});