26 lines
798 B
PHP
26 lines
798 B
PHP
<?php
|
||
|
||
namespace App\Communication;
|
||
|
||
use App\Enums\Medium;
|
||
use Carbon\CarbonImmutable;
|
||
|
||
/**
|
||
* A message as the medium adapters hand it over (V2.1): raw data only. {@see $verifiedBookingId} is set by the adapter
|
||
* itself from a reference it issued and can verify (signed token, reply to one of our mails) – a claim in the text is
|
||
* never enough. {@see $consentGiven} is likewise the adapter's statement.
|
||
*/
|
||
final readonly class IncomingMessage
|
||
{
|
||
public function __construct(
|
||
public Medium $medium,
|
||
public string $sender,
|
||
public string $text,
|
||
public CarbonImmutable $receivedAt,
|
||
public string $externalId,
|
||
public ?int $verifiedBookingId = null,
|
||
public bool $consentGiven = false,
|
||
public ?string $senderName = null,
|
||
) {}
|
||
}
|