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

@@ -95,6 +95,12 @@ use App\Modules\Settings\PrintSettingsController;
use App\Modules\Settings\ProjectMappingController;
use App\Modules\Settings\ProjectMappingRepository;
use App\Modules\Info\InfoController;
use App\Modules\Notifications\NotificationApiController;
use App\Modules\Notifications\NotificationController;
use App\Modules\Notifications\NotificationRepository;
use App\Modules\Sms\SmsConversationService;
use App\Modules\Sms\SmsMessageRepository;
use App\Modules\Sms\SmsplanetWebhookController;
use App\Modules\Users\UsersController;
return static function (Application $app): void {
@@ -220,6 +226,17 @@ return static function (Application $app): void {
new SmsplanetApiClient(),
new IntegrationsRepository($app->db())
);
$notificationRepository = new NotificationRepository($app->db());
$smsMessageRepository = new SmsMessageRepository($app->db());
$smsConversationService = new SmsConversationService(
$smsMessageRepository,
$smsplanetIntegrationRepository,
new SmsplanetApiClient(),
$notificationRepository
);
$smsplanetWebhookController = new SmsplanetWebhookController($smsConversationService);
$notificationController = new NotificationController($template, $translator, $auth, $notificationRepository);
$notificationApiController = new NotificationApiController($notificationRepository);
$integrationsHubController = new IntegrationsHubController(
$template,
$translator,
@@ -271,7 +288,7 @@ return static function (Application $app): void {
$auth,
$receiptConfigRepository
);
$invoiceConfigRepository = new InvoiceConfigRepository($app->db());
$invoiceConfigRepository = new InvoiceConfigRepository($app->db(), $fakturowniaIntegrationRepository);
$invoiceConfigController = new InvoiceConfigController(
$template,
$translator,
@@ -369,7 +386,7 @@ return static function (Application $app): void {
$allegroDeliveryMappingController
);
$printJobRepository = new PrintJobRepository($app->db());
$ordersController = new OrdersController($template, $translator, $auth, $app->orders(), $shipmentPackageRepositoryForOrders, $receiptRepository, $receiptConfigRepository, $emailSendingService, $emailTemplateRepository, $emailMailboxRepository, $app->basePath('storage'), $printJobRepository, $shopproIntegrationsRepository, $automationService, $invoiceRepository, $invoiceConfigRepository);
$ordersController = new OrdersController($template, $translator, $auth, $app->orders(), $shipmentPackageRepositoryForOrders, $receiptRepository, $receiptConfigRepository, $emailSendingService, $emailTemplateRepository, $emailMailboxRepository, $app->basePath('storage'), $printJobRepository, $shopproIntegrationsRepository, $automationService, $invoiceRepository, $invoiceConfigRepository, $smsMessageRepository, $smsConversationService);
$ordersStatisticsController = new OrdersStatisticsController(
$template,
$translator,
@@ -511,6 +528,8 @@ return static function (Application $app): void {
]));
$router->get('/cron', $publicCronHandler);
$router->get('/cron/{tokenValue}', $publicCronHandler);
$router->post('/webhooks/smsplanet/inbound', [$smsplanetWebhookController, 'inbound']);
$router->get('/webhooks/smsplanet/inbound', [$smsplanetWebhookController, 'inbound']);
$router->get('/', static function (Request $request) use ($auth): Response {
return $auth->check()
@@ -527,9 +546,14 @@ return static function (Application $app): void {
$router->get('/orders/list', [$ordersController, 'index'], [$authMiddleware]);
$router->get('/statistics/summary', [$ordersStatisticsController, 'summary'], [$authMiddleware]);
$router->get('/statistics/orders', [$ordersStatisticsController, 'index'], [$authMiddleware]);
$router->get('/notifications', [$notificationController, 'index'], [$authMiddleware]);
$router->post('/notifications/mark-read', [$notificationController, 'markRead'], [$authMiddleware]);
$router->get('/api/notifications/unread', [$notificationApiController, 'unread'], [$authMiddleware]);
$router->post('/api/notifications/mark-read', [$notificationApiController, 'markRead'], [$authMiddleware]);
$router->get('/orders/{id}', [$ordersController, 'show'], [$authMiddleware]);
$router->post('/orders/{id}/status', [$ordersController, 'updateStatus'], [$authMiddleware]);
$router->post('/orders/{id}/details/update', [$ordersController, 'updateDetails'], [$authMiddleware]);
$router->post('/orders/{id}/sms/send', [$ordersController, 'sendSms'], [$authMiddleware]);
$router->post('/orders/{id}/send-email', [$ordersController, 'sendEmail'], [$authMiddleware]);
$router->post('/orders/{id}/email-preview', [$ordersController, 'emailPreview'], [$authMiddleware]);
$router->get('/api/orders/search', [$ordersController, 'quickSearch'], [$authMiddleware]);
@@ -574,7 +598,6 @@ return static function (Application $app): void {
$router->get('/settings/integrations/fakturownia/edit', [$fakturowniaIntegrationController, 'edit'], [$authMiddleware]);
$router->post('/settings/integrations/fakturownia/save', [$fakturowniaIntegrationController, 'save'], [$authMiddleware]);
$router->post('/settings/integrations/fakturownia/test', [$fakturowniaIntegrationController, 'test'], [$authMiddleware]);
$router->post('/settings/integrations/fakturownia/delete', [$fakturowniaIntegrationController, 'delete'], [$authMiddleware]);
$router->get('/settings/integrations/hostedsms', [$hostedSmsIntegrationController, 'index'], [$authMiddleware]);
$router->post('/settings/integrations/hostedsms/save', [$hostedSmsIntegrationController, 'save'], [$authMiddleware]);
$router->post('/settings/integrations/hostedsms/test', [$hostedSmsIntegrationController, 'test'], [$authMiddleware]);