Commit Graph

95 Commits

Author SHA1 Message Date
ee1c5e5cfd update 2026-05-11 00:09:23 +02:00
33ee1a1cf5 feat(115): wystawianie faktury z zamowienia (lokalne + delegowane Fakturownia)
Phase 115 complete (vertical slice "zamowienie z NIP -> faktura PDF"):
- Task 1: InvoiceRepository + InvoiceService (dual-flow orchestrator) +
  InvoiceIssueException + FakturowniaApiClient::createInvoice + buildPdfUrl
- Task 2: InvoiceController + OrdersController::toggleInvoiceRequested +
  OrdersRepository::setInvoiceRequested + auto-import invoice_requested z
  Allegro (invoice.required) i shopPRO (5-key flexible parser) + show.php
  (toggle w zakladce Platnosci + warunkowy przycisk Wystaw fakture)
- Task 3: Lista wystawionych /settings/accounting/invoices/issued z filtrami
  + invoice_preview + invoice_pdf Dompdf template + hub link
- Task 3b (dodany): NIP lookup przez MF Biala Lista (publiczne API, bez
  rejestracji) — MfWhitelistApiClient w src/Core/Http/ + /api/nip/lookup +
  przycisk "Pobierz z GUS" w formularzu

Auto-fixes podczas smoke testu (5):
- GUS endpoint Fakturowni nie istnial (HTML 404 -> "json is not valid");
  switch na MF Biala Liste
- PHP 8.5 curl_close() deprecation wycieka HTML przed JSON; usuniete z
  MfWhitelistApiClient i FakturowniaApiClient (3 miejsca)
- Fakturownia 422 payment_to_kind_days (nieistniejace pole) -> usuniete
- Generic "error" w 422 -> parser plaskuje errors: {pole: [...]} +
  error_log z 1000 znakow raw body
- Fakturownia security odrzuca seller_*/department_id jako "create new
  department"; usuniete z payloadu (Fakturownia uzywa danych konta)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-10 23:34:50 +02:00
6129042ff6 feat(114): accounting configs refactor + invoice configs CRUD
Phase 114 complete (v3.7 Invoices):
- /settings/accounting jako hub-rozdroze (Paragony / Faktury)
- /settings/accounting/receipts + /invoices osobne podstrony list i edycji
- InvoiceConfigRepository + Controller (CRUD z walidacja delegacji)
- Seed Domyslny VAT (NOT EXISTS idempotent)
- invoice-config-form.js (toggle is_delegated -> integration_id)
- confirm-delete.js (globalny modul OrderProAlerts.confirm)
- Legacy aliasy starych endpointow /settings/accounting/save|toggle|delete

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-10 22:32:29 +02:00
2382018739 feat(113): fakturownia integration foundation
Phase 113 complete (v3.7 Invoices):
- DB: invoices, invoice_configs, invoice_number_counters, fakturownia_integration_settings + orders.invoice_requested
- FakturowniaIntegrationRepository (multi-account via integrations.type='fakturownia')
- FakturowniaApiClient (testConnection; createInvoice/downloadPdf STUBs)
- IntegrationsRepository::updateTestResult() (reusable test-result writer)
- /settings/integrations/fakturownia (list + edit + test + delete)
- Karta Fakturownia w hubie /settings/integrations

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-10 22:11:55 +02:00
322b23b7be update 2026-05-07 23:35:18 +02:00
782a291210 feat(112): re-import data protection — delta-only re-import + project_generated preservation
Phase 112 / Plan 112-01 complete (v3.6):
- OrderImportRepository::upsertOrderAggregate split into create vs re-import paths
- replaceAddresses/Items/Notes/Shipments/StatusHistory invoked only on first import
- new updateOrderDelta() narrows UPDATE to status_code (cond.), payment_status,
  total_paid, is_canceled_by_buyer, source_updated_at, payload_json, fetched_at
- source-side cancellation override (is_canceled_by_buyer=1 OR pull status_code='anulowane')
- identical-payload no-op guard via normalizePayloadJson()
- fixes case #882: order_items.id stable, project_generated (Phase 97) preserved
- Phase 111 payment.status_changed emit retained without regression

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-07 23:22:37 +02:00
5cf531d718 feat(111): payment transition event for Allegro+shopPRO re-import
Re-import zamowienia wykrywa tranzycje payment_status 0/1->2 i emituje
payment.status_changed, dzieki czemu chain reguly automatyzacji #7 zmienia
status na w_realizacji.

- OrderImportRepository: rozdzielenie paymentTransition (event 0/1->2) i
  statusOverwriteAllowed (preservacja status_code z Phase 62)
- AllegroOrderImportService + ShopproOrdersSyncService: emit
  payment.status_changed na re-imporcie (gate !wasCreated && wasPaymentTransition)
- bin/backfill_payment_transition_111.php: jednorazowy CLI dla zamowien
  payment_status=2 && status_code='nieoplacone' (Allegro + shopPRO)
- Naprawa luki znalezionej w analizie zamowienia #864

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-05 23:35:14 +02:00
0b4ffb7146 feat(110): statistics summary
Phase 110 complete:
- add Statistics -> Podsumowanie page
- add monthly order count and value charts per integration plus total
- use Chart.js with table fallback and 04-2026 default history start
- update PAUL and DOCS technical documentation
2026-04-28 22:48:31 +02:00
6d3dba89ed feat(109): checkbox multiselect filters
Phase 109 complete:
- Add checkbox dropdown enhancement for statistics multi-select filters
- Preserve GET contract for channels[] and status_groups[]
- Update PAUL plan context to read .paul/codebase docs

Co-Authored-By: Codex <noreply@openai.com>
2026-04-28 22:15:04 +02:00
3f5784d8eb update 2026-04-27 22:10:57 +02:00
0063402897 feat(108): delivery status management
Phase 108 complete (v3.2 milestone):

Plan 108-01 — Delivery Status DB & CRUD:
- Tabela delivery_statuses z seedem 11 statusow systemowych
- DeliveryStatusRepository (CRUD + per-request static cache)
- DeliveryStatus::setRepository() — DB fallback dla static final class
- Panel /settings/delivery-statuses (zakladki Statusy + Mapowanie)
- Sidebar przebudowany: Statusy zamowien + Statusy przesylek

Plan 108-02 — Automation Dropdowns z DB + UI Refactor:
- Dropdowny automatyzacji ladowane z DB (warunek shipment_status + akcja update_shipment_status)
- Walidacja przez DeliveryStatus::getAllStatuses()
- Osobna podstrona formularza CRUD (delivery-status-form.php)
- Lista uproszczona: rename Terminal -> Koncowy, usunieta kolumna Typ
- BREAKING: drop backward compat dla starych grupowych kluczy automatyzacji
- Bug fix: path params w DeliveryStatusesController via \$request->input('id')

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-27 22:10:24 +02:00
d8daf61de6 feat(107-automation-email-send-once): idempotent send-once per order for email automation
Phase 107 complete:
- New table automation_email_once_deliveries with UNIQUE KEY (rule_id, action_id, order_id)
- AutomationEmailOnceRepository: wasSent() / markSent() with ON DUPLICATE KEY guard
- AutomationService: send_once_per_order flag — mark only on successful send
- Checkbox "Wyslij tylko raz dla tego zamowienia" in rule form (edit + new action JS)
- 2 unit tests added; 3/3 passing (49 assertions)

Milestone v3.1 Operational Enhancements: COMPLETE (2/2 phases)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-04-27 21:19:29 +02:00
4b998ea5be update 2026-04-25 21:31:50 +02:00
c73b2fe9f6 update 2026-04-22 22:54:26 +02:00
fd1e23eb26 update 2026-04-19 22:43:02 +02:00
567e888664 feat(104-apaczka-weekend-delivery): Apaczka Paczka w Weekend dla paczkomatow InPost
Phase 104 complete:
- Backend: ApaczkaShipmentService::buildOptionsPayload() mapuje weekend_delivery -> option[19] = 1 w payloadzie API Apaczka v2
- Stala OPTION_KEYS jako rozszerzalne mapowanie pole formularza -> id opcji Apaczki
- Frontend: checkbox "Dostawa w weekend (sobota)" w prepare.php widoczny tylko dla supplier=INPOST + paczkomat (door_to_point=1 lub point_to_point=1)
- JS toggle oparty na atrybutach data-supplier/data-paczkomat z resetem stanu
- 3 nowe testy jednostkowe pokrywajace mapowanie buildOptionsPayload (phpunit OK 11/11)
- Hotfix integracyjny po UAT: ShipmentController::create() nie przekazywal pola weekend_delivery z requestu do formData providera (root cause: reczna lista pol w controllerze)
- Dokumentacja zaktualizowana (DOCS/ARCHITECTURE.md, DOCS/TECH_CHANGELOG.md)

DEFER-104-01: rozwazyc test integracyjny pelnego flow controller -> service lub refactor na request->all().

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-17 09:03:44 +02:00
3d61d3b2df update 2026-04-16 23:19:11 +02:00
0e8f246d6f update 2026-04-14 20:36:20 +02:00
e15b4ccf45 update 2026-04-13 22:31:06 +02:00
7eefd1af61 feat(98-order-imported-first-only): gate order.imported na pierwszy import + backfill statusow
- AllegroOrderImportService / ShopproOrdersSyncService: trigger order.imported tylko gdy $wasCreated
- bin/backfill_shipped_status_98.php: jednorazowy CLI, w_realizacji + shipment -> wyslane (przez OrdersRepository::updateOrderStatus)
- backfill: 4 zamowienia naprawione (#275, #340, #396, #422), idempotentny

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 10:56:03 +02:00
d04e02020c update 2026-04-12 01:35:19 +02:00
12c400fdc6 feat(92-buyer-name-copy): ikona kopiowania nazwy kupujacego w szczegolach zamowienia
Phase 92 complete:
- SVG clipboard icon przy nazwie w sekcji Dane zamawiajacego
- navigator.clipboard.writeText() z wizualnym feedbackiem (checkmark 1.5s)
- Style .copy-btn-inline i .copy-name-row

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 12:14:36 +02:00
854adc32c1 update 2026-04-09 00:51:24 +02:00
633da52880 update 2026-04-08 23:22:48 +02:00
c5b2885b44 feat: Add User-Agent header to Allegro API requests
- Implemented buildUserAgent() method in AllegroApiClient, AllegroOAuthClient, and AllegroTrackingService to include User-Agent header in all HTTP requests to Allegro API.
- Updated .env.example to include APP_VERSION and ALLEGRO_USER_AGENT_URL for configuration.
- Created public /info page to provide application details required by Allegro, including app name, version, description, and contact information.
- Added minimalist layout for public pages to ensure a professional appearance.
- Ensured all changes comply with Allegro's API requirements for User-Agent header.
2026-04-08 20:59:55 +02:00
0f7742f10d update 2026-04-08 19:08:40 +02:00
40644eb362 update 2026-04-07 22:39:16 +02:00
8fa9ca6439 update 2026-04-07 20:32:43 +02:00
1933c74395 update 2026-04-07 10:44:03 +02:00
aadf98bc80 feat(search-by-product): extend order search to include product names
Added EXISTS subquery on order_items.original_name to the search filter
in OrdersRepository::buildPaginateFilters(). Users can now find orders
by typing a product name in the search field. Updated search placeholder
to reflect the new capability.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 09:14:40 +02:00
24df01cfde feat(per-page-persistence): remember selected rows per page in localStorage
table-list component now saves per_page selection to localStorage and
restores it when navigating back to any list without explicit per_page
in URL. URL parameter takes priority over stored value to ensure
bookmarked links work predictably.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 08:26:53 +02:00
6d0905d97a feat(attributes-import): import product attributes from shopPRO API into personalization
extractPersonalization() now reads both 'attributes' and 'custom_fields' fields
from the shopPRO API response, joining non-empty values with newline separator.
Previously only custom_fields was imported, causing product attributes like
"Woreczek jutowy", "Kolor koperty", "Zakrętka" to be lost during sync.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 08:21:38 +02:00
278f44b360 update 2026-04-06 12:00:08 +02:00
7feda58a97 update 2026-04-04 18:20:13 +02:00
e95c4967d2 update 2026-04-03 22:35:49 +02:00
0e7ee957cb update 2026-04-03 11:30:14 +02:00
39c318382a update 2026-04-02 00:17:46 +02:00
50507d70a5 update 2026-03-31 10:56:31 +02:00
af48e84449 update 2026-03-31 00:30:50 +02:00
5435209b08 update 2026-03-30 20:23:38 +02:00
1f449f84ad fix(55-desktop-collapsed-sidebar-fix): ukrycie etykiet i centrowanie ikon w zwiniętym sidebarze
Zwiniety sidebar (is-collapsed) pokazywal obciete etykiety zamiast
czystych ikon. Naprawiono: display:none na labelach/strzalkach/sublinkach,
justify-content:center na linkach, ukrycie brand text.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 23:51:24 +02:00
4b38f3e7a6 feat(54-order-detail-image-hover): hover zoom na miniaturkach w widoku zamowienia
Reuse istniejacego patternu orders-image-hover-wrap/popup z listy
zamowien — wrapper + popup img + JS pozycjonujacy w show.php.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 23:40:25 +02:00
775ede52d3 feat(53-mobile-status-panel-toggle): zwijany panel statusow na mobile
Native details/summary toggle — panel zwiniety domyslnie na mobile,
rozwijany kliknieciem. Desktop: zawsze otwarty, bez zmian.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 23:32:07 +02:00
1c87489824 feat(52-mobile-main-menu): hamburger + slide-in overlay sidebar na mobile
Zastapienie niedzialajacej nawigacji horyzontalnej pelnoekranowym
overlay sidebar z hamburgerem, backdrop i animacja CSS transform.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 23:15:52 +02:00
cbc2058b83 update 2026-03-28 21:16:21 +01:00
572643ad82 chore(paul): remove duplicated state core value line 2026-03-28 15:33:18 +01:00
5cee35a89a chore(paul): sync state git commit reference after phase 50 2026-03-28 15:32:54 +01:00
176d740578 feat(50-allegro-shipment-waybill-push): push waybill to allegro checkout form
Phase 50 complete:

- add conditional waybill push for allegro orders only

- add retry on ALLEGRO_HTTP_401 and non-critical failure handling

- add unit tests and update architecture/changelog docs
2026-03-28 15:32:34 +01:00
2ab0d0e90e update 2026-03-28 15:04:35 +01:00
c1d0d7762f chore(47-shipment-created-automation): finalize unify state metadata 2026-03-28 13:25:04 +01:00