feat(129): order user notes module

CRUD notatek autorskich operatora per zamowienie z badge [N] na liscie
zamowien. Reuse istniejacej tabeli `order_notes` przez nowy
`note_type='user'` z `user_id` (FK->users SET NULL) i `author_name`
(snapshot). Sekcja `#notes` w "Wiadomosci i zalaczniki" w
`/orders/{id}` z inline edit form + delete przez
`OrderProAlerts.confirm`. Autoryzacja DB-level
(`WHERE user_id = :user_id`, rowCount=0 ⇒ 403) — bez admin override
(brak systemu rol w aplikacji).

- Migracja `20260514_000116_*.sql` (ADD COLUMN user_id + author_name +
  FK + indeks `idx_order_notes_type_order`); idempotentne z DDL
  no-op fallback.
- `OrderNotesService` (CRUD + walidacja body ≤ 2000 znakow); subquery
  `user_notes_count` w paginate; badge HTML w `toTableRow()`.
- 3 routy POST /orders/{id}/notes(/update|/delete).
- SCSS module `_order-notes.scss` + vanilla JS `order-notes.js`
  (inline edit toggle + delete confirm; idempotent guard).
- 9 kluczy i18n PL; PROJECT.md + ROADMAP.md + tech_changelog.md +
  db_schema.md zaktualizowane.

Follow-up: `php bin/migrate.php` + manualny smoke test (autor vs inny
user + badge na /orders/list).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-14 15:20:05 +02:00
parent c78ac335ee
commit 48351b5f36
20 changed files with 1261 additions and 25 deletions

View File

@@ -190,6 +190,15 @@ return [
'address_invoice' => 'Dane do faktury',
'address_delivery' => 'Dane wysylki',
'notes_title' => 'Wiadomosci i zalaczniki',
'notes_user_title' => 'Notatki',
'notes_user_empty' => 'Brak notatek.',
'notes_user_add_placeholder' => 'Wpisz notatke...',
'notes_user_save' => 'Zapisz',
'notes_user_edit' => 'Edytuj',
'notes_user_delete' => 'Usun',
'notes_user_cancel' => 'Anuluj',
'notes_user_confirm_delete' => 'Usunac notatke?',
'notes_imported_title' => 'Wiadomosci ze zrodla',
'history_title' => 'Historia statusow',
'fields' => [
'status' => 'Status',