feat(124): sms templates CRUD + order picker

- Nowa tabela sms_templates (name + body + is_active) + minimalny CRUD.
- /settings/sms-templates: lista + formularz z paleta zmiennych (pill chips).
- Wydzielono Sms\SmsVariableResolver ze wspolna logika placeholderow;
  Email\VariableResolver staje sie cienka fasada — EmailSendingService bez zmian.
- Dropdown "Wybierz szablon" w zakladce SMS na /orders/{id} z fetch
  GET /orders/{id}/sms/template + OrderProAlerts.confirm przy nadpisaniu.
- Stopka SMSPLANET dalej doklejana wylacznie przez SmsConversationService
  (Phase 122 contract preserved).
- Sidebar Ustawien: nowy link "Szablony SMS".

Migration: 20260512_000112_create_sms_templates.sql (CREATE TABLE).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-12 21:37:51 +02:00
parent 0227f2d072
commit 522c94a434
25 changed files with 1641 additions and 105 deletions

View File

@@ -5,19 +5,19 @@
See: .paul/PROJECT.md (updated 2026-05-07)
**Core value:** Sprzedawca moze obslugiwac zamowienia ze wszystkich kanalow sprzedazy i nadawac przesylki bez przelaczania sie miedzy platformami.
**Current focus:** v3.7 Invoices + operational integrations - Phase 123 Receipts Export VAT Breakdown complete (UNIFY closed).
**Current focus:** v3.7 Invoices + operational integrations - Phase 124 SMS Templates complete (UNIFY closed).
## Current Position
Milestone: v3.7 Invoices (Fakturownia integration) - In progress
Phase: 123 of TBD (Receipts Export VAT Breakdown) - Complete
Plan: 123-01 complete
Phase: 124 of TBD (SMS Templates) - Complete
Plan: 124-01 complete
Status: UNIFY complete, ready to plan next phase
Last activity: 2026-05-12 23:00:00 - UNIFY closed for .paul/phases/123-receipts-export-vat-breakdown/123-01-PLAN.md
Last activity: 2026-05-13 00:30:00 - UNIFY closed for .paul/phases/124-sms-templates/124-01-PLAN.md
Progress:
- Milestone v3.7: [#########-] ~97% (Phase 113-123 complete)
- Phase 123: [##########] 100%
- Milestone v3.7: [##########] ~98% (Phase 113-124 complete)
- Phase 124: [##########] 100%
## Loop Position
@@ -29,9 +29,9 @@ PLAN -> APPLY -> UNIFY
## Session Continuity
Last session: 2026-05-12 22:00:00
Stopped at: Phase 122 UNIFY closed (transition + git commit pending; worktree dirty with Phase 118 files)
Next action: Resolve Phase 118 UNIFY/commit, then scope a clean Phase 122 commit and pick next v3.7 phase
Last session: 2026-05-13 00:30:00
Stopped at: Phase 124 UNIFY closed (UI fixes accepted by operator)
Next action: Pick next v3.7 phase (kandydaci w ROADMAP) or transition do v3.8
Resume file: .paul/ROADMAP.md
## Pending parallel work
@@ -58,6 +58,9 @@ Note: routes/web.php, DOCS/* i .paul/codebase/* zawierały zmiany z 118+121+122
- Phase 122 follow-up: manually verify settings save/reload and real SMSPLANET test/order sends with non-empty and empty footer; manually trigger over-limit final body rejection in UI.
- Phase 123 follow-up: wystaw nowy paragon i potwierdz `items_json` zawiera `vat` per pozycja; eksport XLSX z paragonem multi-rate (np. mix 23% + 8%) — sprawdz osobne wiersze; eksport "wybrane paragony" zachowuje breakdown.
- Phase 123 deferred: RECEIPT-NET-FIX (`ReceiptService::issue()` zapisuje `total_net=total_gross`) — udokumentowane w `.paul/codebase/todo.md`.
- Phase 124 follow-up: `php bin/migrate.php` (XAMPP MySQL online) — utworzy `sms_templates`. Operator nastepnie tworzy szablony manualnie z `/settings/sms-templates`.
- Phase 124 follow-up: real smoke wysylki SMS z szablonu (zamowienie z paczka + skonfigurowana stopka SMSPLANET) — sprawdzic ze `sms_messages.body` ma stopke raz, finalna tresc <= 918 znakow.
- Phase 124 follow-up: regresja Email — wyslij e-mail z istniejacym szablonem aby potwierdzic ze refaktor `Email\VariableResolver` na fasade nie zlamal `EmailSendingService`.
- Phase 121 transition note (rozwiązane): commit 360eef1 obejmuje Phase 121 i Phase 122 razem; per-faza hunk-split nie wykonany ze względu na nakładkowe modyfikacje plików.
## Deferred to Next Milestones