diff --git a/config/provisioning.php b/config/provisioning.php index be295db..b19b9e0 100644 --- a/config/provisioning.php +++ b/config/provisioning.php @@ -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 diff --git a/tests/Feature/Billing/CustomDomainAccessTest.php b/tests/Feature/Billing/CustomDomainAccessTest.php index 79aae56..30fb0cc 100644 --- a/tests/Feature/Billing/CustomDomainAccessTest.php +++ b/tests/Feature/Billing/CustomDomainAccessTest.php @@ -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(); +});