Notification
Corex\Notifications\Notification · class · Core layer
The shared notification record — the condition, not one person’s view of it. Per-user read/ dismiss/snooze state lives in a separate row; resolution (the condition ending) is recorded here. Immutable and secret-free by construction: metadata is rejected if it carries a token, credential, or key (the same discipline as {@see \Corex\Activity\ActivityEvent}). Repeated occurrences of the same condition update one record via its dedup key (FR-011), never a flood of rows.
Public API
Section titled “Public API”create(string $type, string $category, string $severity, string $sourceModule, string $titleKey, string $messageKey, array $rendered, string $dedupKey, NotificationRecipient $recipient, DateTimeImmutable $occurredAt, ?string $sourceType, ?string $sourceId, ?NotificationAction $action, ?DateTimeImmutable $expiresAt, ?string $environment, ?int $actorId, array $metadata): self
Section titled “create(string $type, string $category, string $severity, string $sourceModule, string $titleKey, string $messageKey, array $rendered, string $dedupKey, NotificationRecipient $recipient, DateTimeImmutable $occurredAt, ?string $sourceType, ?string $sourceId, ?NotificationAction $action, ?DateTimeImmutable $expiresAt, ?string $environment, ?int $actorId, array $metadata): self”withId(int $id): self
Section titled “withId(int $id): self”withOccurrence(DateTimeImmutable $at): self
Section titled “withOccurrence(DateTimeImmutable $at): self”Record another occurrence of the same condition.