Benenne Artikel im Shop und in den Listen nach ihrem Inhalt statt nach der Kennung
Die Produktseite zeigte im Leistungsumfang die Kennung, obwohl die Redaktion den Namen aus dem Inhalt übernimmt. ProductOptions und PublicationReadiness lösen den Namen jetzt wie die Redaktion auf: eigener Name, sonst Name des Inhalts, zuletzt Kennung. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
d49b178ebd
commit
4520dba2f0
3 files changed
+38
-8
No files matched your search
@@ -9,6 +9,7 @@
|
||||
use App\Domain\Catalog\EditorialContentKind;
|
||||
use App\Domain\Catalog\OfferService;
|
||||
use App\Domain\Catalog\RightsProfileVersion;
|
||||
use App\Domain\Commerce\ProductOptions;
|
||||
use App\Filament\Resources\Bundles\Pages\ViewBundle;
|
||||
use App\Filament\Resources\LicenseArticles\Pages\ViewLicenseArticle;
|
||||
use App\Filament\Resources\Offers\Pages\ViewOffer;
|
||||
@@ -204,6 +205,22 @@ public function test_the_bundle_offer_lists_the_scope_and_is_found_in_the_shop()
|
||||
$this->get(route('public.program', $starter, false))->assertOk()->assertSee('Starterpaket (zwei Programme und Einführung)')->assertSee('59,00');
|
||||
}
|
||||
|
||||
public function test_the_scope_names_an_article_by_its_content_and_not_by_its_code(): void
|
||||
{
|
||||
$root = $this->article('shop-grenzen')->currentRelease->rootCompositionVersion;
|
||||
$article = app(ArticleService::class)->create('nur-kennung-abnahme');
|
||||
app(ArticleService::class)->publishRelease($article, $root, 'Erster Stand dieses Lizenzartikels.');
|
||||
$offer = app(OfferService::class)->create('Namensprobe');
|
||||
app(OfferService::class)->activate($offer, [['target' => $article->refresh(), 'rights' => $this->rights()]], ['grant_kind' => 'kauf', 'price_cents' => 1500, 'holder_kind' => 'person']);
|
||||
app(OfferService::class)->assignProduct($offer, $this->program('Grenzen setzen im Verein')->id, 'Namensprobe');
|
||||
|
||||
$scope = collect(app(ProductOptions::class)->forComposition($this->program('Grenzen setzen im Verein')))->firstWhere('name', 'Namensprobe')['scope'];
|
||||
|
||||
$this->assertSame('Grenzen setzen im Verein', $scope[0]['article']);
|
||||
$this->get(route('public.program', $this->program('Grenzen setzen im Verein'), false))->assertOk()->assertDontSee('nur-kennung-abnahme');
|
||||
$this->assertStringContainsString('Grenzen setzen im Verein (nur-kennung-abnahme) · Stand 1', app(PublicationReadiness::class)->articleOptions()[$article->id]);
|
||||
}
|
||||
|
||||
private function rights(): RightsProfileVersion
|
||||
{
|
||||
return RightsProfileVersion::query()->orderBy('id')->firstOrFail();
|
||||
|
||||
Reference in new issue
Block a user