feat(121+122): smsplanet conversation, notifications, default footer

Phase 121 — SMSPLANET Conversation + Notifications:
- migration 20260512_000110 adds smsplanet conversation + notifications tables
- src/Modules/Sms (SmsConversationService, SmsMessageRepository, SmsplanetWebhookController)
- src/Modules/Notifications (Repository, Controller, ApiController)
- order SMS tab, notification center, sender mode, inbound webhook
- public notifications.js + layouts/app.php integration

Phase 122 — SMSPLANET Default SMS Footer:
- migration 20260512_000111 adds smsplanet_integration_settings.default_footer
- footer appended to test SMS and order SMS, validated against 918 char limit
- settings textarea + compact order SMS note when footer configured

Bundled (could not split per-phase without hunk staging):
- routes/web.php (also carries Phase 118 fakturownia redirects)
- DOCS/{ARCHITECTURE,DB_SCHEMA,TECH_CHANGELOG}.md (118 + 121 + 122 entries)
- .paul/codebase/{architecture,db_schema,tech_changelog}.md (118 + 121 + 122)
- .paul/STATE.md, ROADMAP.md, changelog/2026-05-12.md (UNIFY closure)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-05-12 20:37:41 +02:00
parent 8f14851d85
commit 360eef128d
34 changed files with 2538 additions and 128 deletions

View File

@@ -0,0 +1,67 @@
<?php
$items = is_array($notifications ?? null) ? $notifications : [];
$pageData = is_array($pagination ?? null) ? $pagination : ['page' => 1, 'per_page' => 30, 'total' => 0];
$page = max(1, (int) ($pageData['page'] ?? 1));
$perPage = max(1, (int) ($pageData['per_page'] ?? 30));
$total = max(0, (int) ($pageData['total'] ?? 0));
$totalPages = max(1, (int) ceil($total / $perPage));
?>
<section class="card notifications-page">
<div class="notifications-page__head">
<div>
<h2 class="section-title"><?= $e($t('notifications.title')) ?></h2>
<p class="muted mt-8"><?= $e($t('notifications.description')) ?></p>
</div>
<?php if ((int) ($unreadCount ?? 0) > 0): ?>
<form method="post" action="/notifications/mark-read">
<input type="hidden" name="_token" value="<?= $e((string) ($csrfToken ?? '')) ?>">
<button class="btn btn--secondary btn--sm" type="submit"><?= $e($t('notifications.actions.mark_all_read')) ?></button>
</form>
<?php endif; ?>
</div>
<div class="notifications-list mt-16">
<?php if ($items === []): ?>
<div class="muted"><?= $e($t('notifications.empty')) ?></div>
<?php endif; ?>
<?php foreach ($items as $notification): ?>
<?php
$id = (int) ($notification['id'] ?? 0);
$targetUrl = trim((string) ($notification['target_url'] ?? ''));
$isUnread = trim((string) ($notification['read_at'] ?? '')) === '';
?>
<article class="notification-row<?= $isUnread ? ' notification-row--unread' : '' ?>">
<div class="notification-row__main">
<div class="notification-row__title"><?= $e((string) ($notification['title'] ?? '')) ?></div>
<div class="notification-row__body"><?= $e((string) ($notification['body'] ?? '')) ?></div>
<div class="notification-row__meta"><?= $e((string) ($notification['created_at'] ?? '')) ?></div>
</div>
<div class="notification-row__actions">
<?php if ($targetUrl !== ''): ?>
<a class="btn btn--secondary btn--sm" href="<?= $e($targetUrl) ?>"><?= $e($t('notifications.actions.open')) ?></a>
<?php endif; ?>
<?php if ($isUnread): ?>
<form method="post" action="/notifications/mark-read">
<input type="hidden" name="_token" value="<?= $e((string) ($csrfToken ?? '')) ?>">
<input type="hidden" name="id" value="<?= $e((string) $id) ?>">
<button class="btn btn--secondary btn--sm" type="submit"><?= $e($t('notifications.actions.mark_read')) ?></button>
</form>
<?php endif; ?>
</div>
</article>
<?php endforeach; ?>
</div>
<?php if ($totalPages > 1): ?>
<div class="pagination mt-16">
<?php if ($page > 1): ?>
<a class="btn btn--secondary btn--sm" href="/notifications?page=<?= $page - 1 ?>">&larr;</a>
<?php endif; ?>
<span class="muted"><?= $e((string) $page) ?>/<?= $e((string) $totalPages) ?></span>
<?php if ($page < $totalPages): ?>
<a class="btn btn--secondary btn--sm" href="/notifications?page=<?= $page + 1 ?>">&rarr;</a>
<?php endif; ?>
</div>
<?php endif; ?>
</section>