2026-03-19 22:09:44 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace MintyPHP\Module\Notifications\Repository;
|
|
|
|
|
|
|
|
|
|
interface NotificationRepositoryInterface
|
|
|
|
|
{
|
|
|
|
|
/** @return int|false Insert ID on success, false on failure */
|
|
|
|
|
public function create(array $data): int|false;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return list<array<string, mixed>>
|
|
|
|
|
*/
|
2026-03-20 00:05:03 +01:00
|
|
|
public function listByUser(int $userId, ?int $tenantId, int $limit, int $offset): array;
|
2026-03-19 22:09:44 +01:00
|
|
|
|
2026-03-20 00:05:03 +01:00
|
|
|
public function countUnreadByUser(int $userId, ?int $tenantId): int;
|
2026-03-19 22:09:44 +01:00
|
|
|
|
2026-03-20 00:05:03 +01:00
|
|
|
public function markRead(int $id, int $userId, ?int $tenantId): bool;
|
2026-03-19 22:09:44 +01:00
|
|
|
|
2026-03-20 00:05:03 +01:00
|
|
|
public function markAllReadByUser(int $userId, ?int $tenantId): int;
|
2026-03-19 22:09:44 +01:00
|
|
|
|
2026-03-20 00:05:03 +01:00
|
|
|
public function delete(int $id, int $userId, ?int $tenantId): bool;
|
2026-03-19 22:09:44 +01:00
|
|
|
|
|
|
|
|
public function deleteAllByUser(int $userId): int;
|
|
|
|
|
|
|
|
|
|
public function purgeReadOlderThanDays(int $days): int;
|
|
|
|
|
}
|