33 lines
984 B
PHP
33 lines
984 B
PHP
<?php
|
||
|
||
namespace App\Channels\Events;
|
||
|
||
use App\Models\Channel;
|
||
use Carbon\CarbonImmutable;
|
||
|
||
/**
|
||
* Where a channel event came from (docs/Prozessarchitektur/Architektur/02 §8.2): channel, transport and whether its
|
||
* origin is technically authenticated (a signed webhook, an API call with credentials). It says nothing about whether a
|
||
* business action really happened – that is evidence, which only the landlord or a checked receipt provides (M3).
|
||
*/
|
||
final readonly class Provenance
|
||
{
|
||
public const AUTHENTICATED = 'authenticated';
|
||
|
||
public const UNAUTHENTICATED = 'unauthenticated';
|
||
|
||
public function __construct(
|
||
public Channel $channel,
|
||
public string $transport,
|
||
public string $authenticity,
|
||
public ?string $externalReference,
|
||
public string $evidenceRef,
|
||
public CarbonImmutable $receivedAt,
|
||
) {}
|
||
|
||
public function isAuthenticated(): bool
|
||
{
|
||
return $this->authenticity === self::AUTHENTICATED;
|
||
}
|
||
}
|