Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
MailMessageSummaryDto
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3declare(strict_types=1);
4
5/** @license For full copyright and license information, please see the LICENSE.md file. */
6
7namespace App\Modules\Mail\Domain\Model;
8
9defined('AMMONLY_APP') || exit('Direct script access is forbidden.');
10
11/**
12 * Mail Message Summary Data Transfer Object.
13 *
14 * Lightweight projection for rendering email list rows with fast metadata,
15 * flags, sender information, and preview snippets.
16 *
17 * @package App\Modules\Mail\Domain\Model
18 */
19final readonly class MailMessageSummaryDto
20{
21    /**
22     * MailMessageSummaryDto constructor.
23     *
24     * @param string        $uid            Protocol message unique identifier (UID).
25     * @param string|null   $messageId      RFC 822 Message-ID header value.
26     * @param string        $subject        Decoded email subject line.
27     * @param string        $fromName       Sender display name.
28     * @param string        $fromEmail      Sender email address.
29     * @param array<string> $to             Recipient email addresses.
30     * @param array<string> $cc             Carbon copy email addresses.
31     * @param string        $date           Formatted date string.
32     * @param int           $dateTimestamp  Unix timestamp of message internal date.
33     * @param int           $size           RFC 822 size in bytes.
34     * @param bool          $isSeen         Whether read/seen.
35     * @param bool          $isFlagged      Whether flagged/starred.
36     * @param bool          $isAnswered     Whether replied to.
37     * @param bool          $isDraft        Whether draft flag is set.
38     * @param bool          $hasAttachments Whether message contains binary attachments.
39     * @param string        $snippet        Brief plain-text preview snippet (up to 100 chars).
40     * @param string        $folder         Mailbox folder path.
41     */
42    public function __construct(
43        public string $uid,
44        public ?string $messageId,
45        public string $subject,
46        public string $fromName,
47        public string $fromEmail,
48        public array $to = [],
49        public array $cc = [],
50        public string $date = '',
51        public int $dateTimestamp = 0,
52        public int $size = 0,
53        public bool $isSeen = false,
54        public bool $isFlagged = false,
55        public bool $isAnswered = false,
56        public bool $isDraft = false,
57        public bool $hasAttachments = false,
58        public string $snippet = '',
59        public string $folder = 'INBOX',
60        public array $keywords = [],
61        public string $dateRelative = '',
62        public string $dateFull = ''
63    ) {
64    }
65}
66