Mache den Lizenzartikel zur Produktseite und leite die Seite aus dem Angebot ab
CI Feature / test (push) Failing after 3m16s
CI Feature / test (push) Failing after 3m16s
Die Produktseite ist die Seite des Artikels (/shop/{id}), den die Option als einzige
Position verkauft, oder die Paketseite. Sie wird nicht mehr einem Programm zugeordnet.
Ein Kauf braucht genau eine Position und einen Preis, sonst lässt er sich nicht aktivieren.
Module und Programme werden dadurch nicht öffentlich (Karten und /programme unverändert).
Tests: Die Tests, die eine Programmseite als Produktseite voraussetzten, prüfen jetzt die
Artikelseite; die Zuordnung „eigene Paketseite oder Programmseite“ entfällt (ADR-52).
Ein Altbestandstest sichert die Programmseite für Angebote mit mehreren Positionen.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
1950dc377b
commit
08f7d0c63d
22 files changed
+544
-275
No files matched your search
@@ -3,7 +3,6 @@
|
||||
namespace Tests\Feature;
|
||||
|
||||
use App\Domain\Catalog\Bundle;
|
||||
use App\Domain\Catalog\DomainRuleException;
|
||||
use App\Domain\Catalog\Offer;
|
||||
use App\Domain\Catalog\OfferService;
|
||||
use App\Domain\Commerce\Cart;
|
||||
@@ -38,7 +37,7 @@ private function standaloneOffer(string $name, int $cents, string $scope = 'einz
|
||||
$rights = app(OfferService::class)->currentActiveVersion($this->privateKonflikte())->lines()->first()->rights;
|
||||
$offers = app(OfferService::class);
|
||||
$offer = $offers->create($name);
|
||||
$offers->assignProduct($offer, null, $name, true);
|
||||
$offers->setOptionLabel($offer, $name);
|
||||
$offers->activate($offer, [['target' => $version, 'rights' => $rights]], [
|
||||
'grant_kind' => 'kauf', 'price_cents' => $cents, 'holder_kind' => 'person', 'licence_scope' => $scope, 'trainer_count' => $trainers,
|
||||
]);
|
||||
@@ -100,30 +99,14 @@ public function test_the_package_page_is_gone_without_a_purchasable_option(): vo
|
||||
$this->get(route('public.package', $this->bundle()))->assertOk();
|
||||
|
||||
app(OfferService::class)->end($offer);
|
||||
$this->get(route('public.package', $this->bundle()))->assertOk(); // Das Demo-Angebot „Starterpaket: Privatlizenz“ verkauft dasselbe Paket weiter.
|
||||
|
||||
app(OfferService::class)->end($this->offerNamed('Starterpaket: Privatlizenz'));
|
||||
|
||||
$this->get(route('public.package', $this->bundle()))->assertNotFound();
|
||||
$this->get(route('shop'))->assertDontSee(route('public.package', $this->bundle()), false);
|
||||
}
|
||||
|
||||
public function test_an_offer_with_an_own_package_page_consists_of_exactly_one_package_version(): void
|
||||
{
|
||||
$offers = app(OfferService::class);
|
||||
$offer = $offers->create('Falsch');
|
||||
$offers->assignProduct($offer, null, 'Falsch', true);
|
||||
$rights = $offers->currentActiveVersion($this->privateKonflikte())->lines()->first()->rights;
|
||||
|
||||
$this->expectException(DomainRuleException::class);
|
||||
$offers->activate($offer, [['target' => $this->article('shop-konflikte'), 'rights' => $rights]], ['grant_kind' => 'kauf', 'price_cents' => 1000]);
|
||||
}
|
||||
|
||||
public function test_a_package_has_either_an_own_page_or_a_program_page(): void
|
||||
{
|
||||
$offer = app(OfferService::class)->create('Beides');
|
||||
|
||||
$this->expectException(DomainRuleException::class);
|
||||
app(OfferService::class)->assignProduct($offer, $this->program('Konflikte im Training')->id, 'Beides', true);
|
||||
}
|
||||
|
||||
public function test_the_package_page_does_not_exist_outside_the_shop(): void
|
||||
{
|
||||
$this->standaloneOffer('Starterpaket solo', 5500);
|
||||
|
||||
Reference in new issue
Block a user