feat(editorial): preserve public editions and add QA review workflow

This commit is contained in:
2026-11-13 22:56:44 +02:00
parent 2f1ef2fdfc
commit b3849d850e
25 changed files with 1963 additions and 55 deletions
+25
View File
@@ -0,0 +1,25 @@
<?php
namespace Tests\Unit;
use App\Services\OpportunityReviewMateriality;
use PHPUnit\Framework\TestCase;
final class EditorialLegalVersionTest extends TestCase
{
public function test_legal_decisions_cannot_be_carried_to_a_different_content_version_in_phase_one(): void
{
$service = new OpportunityReviewMateriality;
$before = ['hash' => str_repeat('a', 64), 'payload' => [], 'resources' => []];
$after = [...$before, 'hash' => str_repeat('b', 64)];
$review = ['decision' => 'approved', 'hash' => $before['hash'], 'scope_rule' => OpportunityReviewMateriality::VERSION];
$review['scope_hash'] = $service->hash($before, 'land_legal_review', $review);
$this->assertSame(['land_legal_review'], $service->reconcile($before, $after, ['land_legal_review' => $review], ['land_legal_review'])['retained']);
$strict = $service->reconcile($before, $after, ['land_legal_review' => $review], ['land_legal_review'], exactLegalVersion: true);
$this->assertSame([], $strict['reviews']);
$this->assertSame(['land_legal_review'], $strict['reopened']);
$this->assertFalse($service->matches($after, 'land_legal_review', [...$review, 'accepted_submission_hash' => $after['hash']], true));
$this->assertTrue($service->matches($before, 'land_legal_review', $review, true));
$this->assertSame($before['hash'], $review['hash']);
}
}