TenantAtlas/apps/platform/app/Support/ReviewPacks/CustomerOutputGateDecision.php
ahmido dd7139ebe3 Spec392 customer output gating (#463)
Implements Spec392 customer output gating for review pack downloads, rendered reports, management PDFs, and customer workspace CTAs.

Validation:
- php vendor/bin/pest --filter=Spec392: 12 passed / 58 assertions
- php vendor/bin/pest --filter='ReviewPack|CustomerReviewWorkspace|StoredReport': 283 passed / 1 skipped / 2053 assertions
- affected browser matrix: 12 passed / 420 assertions
- php vendor/bin/pint --dirty: pass
- git diff --check: pass

Notes:
- Deprecated limited-download semantics remain removed.
- Unsafe customer-facing output returns 403/no output.
- Internal preview/report access is operator-only.

Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de>
Reviewed-on: #463
2026-06-20 20:54:50 +00:00

31 lines
839 B
PHP

<?php
declare(strict_types=1);
namespace App\Support\ReviewPacks;
final class CustomerOutputGateDecision
{
/**
* @param array<string, mixed> $readiness
* @param array<string, mixed> $guidance
*/
public function __construct(
public readonly string $state,
public readonly string $guidanceState,
public readonly bool $hasReadyArtifact,
public readonly bool $canStreamCustomerOutput,
public readonly bool $canStreamInternalPreview,
public readonly string $reason,
public readonly array $readiness = [],
public readonly array $guidance = [],
) {}
public function canStream(bool $internalPreview): bool
{
return $internalPreview
? $this->canStreamInternalPreview
: $this->canStreamCustomerOutput;
}
}