Commit Graph

90 Commits

Author SHA1 Message Date
f592203b60 update 2026-03-24 00:33:52 +01:00
325a941c42 feat(29-delivery-status-mapping-ui): konfiguracja mapowania statusów dostawy per provider
Phase 29 complete (v1.3):
- Tabela delivery_status_mappings z DB overrides
- DeliveryStatus: normalizeWithOverrides(), descriptionWithOverrides(), getDefaultMappings()
- UI ustawień: tabela mapowań per provider (InPost/Apaczka/Allegro), bulk save, reset, resetAll
- 5 endpointów w routes/web.php, link w menu bocznym

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 23:55:42 +01:00
98a0077204 feat(28-shipment-tracking-ui): badge'e statusow dostawy, linki sledzenia, ustawienia interwalu trackingu
- Kolorowe badge'e statusow dostawy w tabelach paczek (show.php + prepare.php)
- Link sledzenia z carrier detection (InPost, Apaczka, Orlen, Allegro, Google fallback)
- Sekcja Status dostawy w boksie Platnosc i wysylka
- Ustawienie interwalu trackingu crona (5-120 min) w zakladce Ustawienia
- Tekstowe mapowania statusow Apaczka API (NEW, CONFIRMED, etc.)
- Fix: use-statements ApaczkaShipmentService (pre-existing bug)
- Fix: pickup date normalization (next day po 16:00)
- Fix: przycisk Pobierz etykiete (POST zamiast link do prepare)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 23:04:05 +01:00
228c0e96cf feat(27-shipment-tracking-backend): infrastruktura sledzenia przesylek — statusy, tracking services, cron handler
Dwupoziomowy system statusow dostawy (normalized + raw z API), implementacje
trackingu dla InPost ShipX, Apaczka i Allegro WZA, cron handler odpytujacy
aktywne przesylki co 15 minut.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 20:33:44 +01:00
c59d431083 feat(26-manual-tracking-number): reczne dodawanie numeru przesylki do zamowienia
Nowy endpoint POST /orders/{id}/shipment/manual z formularzem inline
w zakladce Przesylki. Reuse tabeli shipment_packages (provider='manual',
status='created'). Activity log, walidacja CSRF, HTML required.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 18:17:21 +01:00
686429d9cf update 2026-03-22 23:54:59 +01:00
91963d5173 feat(25-shipment-presets-management): edycja, usuwanie i zarządzanie presetami przesyłek
Phase 25 complete — milestone v1.0 done:
- Ikonka edycji (✎) na hover z dropdown menu
- Edycja nazwy i koloru presetu w popup
- "Zapisz bieżące wartości" — aktualizacja parametrów z formularza
- Usuwanie z potwierdzeniem OrderProAlerts.confirm()
- SCSS: dropdown, edit-icon, btn-wrap style

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 23:53:44 +01:00
e379557533 feat(24-shipment-presets-ui): kolorowe przyciski presetów, popup tworzenia, autofill formularza
Phase 24 complete:
- SCSS moduł _shipment-presets.scss (przyciski, popup, color picker)
- Sekcja presetów nad formularzem przesyłki z przyciskiem "Dodaj"
- Popup tworzenia presetu z nazwą i wyborem koloru (8 opcji)
- JS autofill: carrier, usługa dostawy, wymiary, waga, label format
- Obsługa 3 paneli: Allegro searchable, InPost select, Apaczka select

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 23:42:56 +01:00
03a237e7d2 feat(23-shipment-presets-backend): tabela DB, repository CRUD i JSON API dla presetów przesyłek
Phase 23 complete:
- Migracja shipment_presets (16 kolumn: name, color, carrier, wymiary, waga, itp.)
- ShipmentPresetRepository z findAll/findById/create/update/delete
- ShipmentPresetController z 4 endpointami JSON API
- Routing w routes/web.php z auth middleware

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 23:27:14 +01:00
d6375cc61d fix(22-regon-save-fix): naprawa zapisu REGON, BDO, KRS i logo w ustawieniach firmy
CompanySettingsController::save() nie przekazywał 4 pól (regon, bdo_number,
court_register, logo_path) do repozytorium — dane z formularza ginęły.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 23:10:07 +01:00
5d98377729 chore: add .gitignore for C# project, remove bin/obj/publish from tracking
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 22:49:49 +01:00
5fef42ba12 feat(20-windows-client): aplikacja C# WinForms do zdalnego druku etykiet
- System tray app z NotifyIcon + ContextMenuStrip
- Polling API orderPRO (GET /api/print/jobs/pending)
- Pobieranie etykiet PDF i druk przez PdfiumViewer
- Formularz ustawień: URL API, klucz, drukarka, interwał
- Okno logów z historią (ciemny motyw, Consolas)
- Self-contained .NET 8 publish (win-x64)
- Milestone v0.7 Zdalne drukowanie etykiet — COMPLETE

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 22:49:28 +01:00
02d06298ea feat(19-ui-integration): przycisk Drukuj, bulk print, kolejka wydruku
- Przycisk "Drukuj" w prepare.php i show.php z AJAX + duplikat protection
- Bulk print z listy zamówień (checkboxy + header action)
- Kolejka wydruku w Ustawienia > Drukowanie (filtr statusu, retry)
- POST /api/print/jobs/bulk endpoint (package_ids + order_ids)
- ensureLabel() auto-download przez ShipmentProviderRegistry
- Apaczka carrier_id = nazwa usługi, kolumna Przewoznik
- Tab persistence (localStorage), label file_exists check
- Fix use statement ApaczkaApiClient, redirect po utworzeniu przesyłki
- Phase 17 (receipt duplicate guard) + Phase 18 (print queue backend) docs

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 21:16:54 +01:00
d1a1b79247 update 2026-03-18 00:40:11 +01:00
b9f639e037 feat(16-automated-tasks): moduł zadań automatycznych — CRUD + watcher/executor
Reguły automatyzacji oparte na zdarzeniach (receipt.created) z warunkami
(integracja/kanał sprzedaży, AND logic) i akcjami (wyślij e-mail z 3 trybami
odbiorcy: klient / firma / klient+firma). Trigger w ReceiptController po
utworzeniu paragonu — błąd automatyzacji nie blokuje sukcesu paragonu.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 00:39:47 +01:00
a6512cbfa4 update 2026-03-18 00:02:18 +01:00
74230cb7c3 update 2026-03-17 00:06:07 +01:00
2f73a940de feat(14-email-templates): CRUD szablonów e-mail z Quill.js + załączniki
Phase 14 complete (2 plans):
- 14-01: CRUD szablonów, Quill.js editor, system zmiennych {{grupa.pole}}, podgląd, toggle
- 14-02: Select "Załącznik nr 1" z mapą ATTACHMENT_TYPES, kolumna w liście, migracja attachment_1

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 23:59:25 +01:00
4d091b2441 wip(14-email-templates): CRUD szablonów e-mail z Quill.js + system zmiennych
APPLY in progress — checkpoint human-verify awaiting re-test po namespace fixes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 00:21:01 +01:00
3223aac4d9 feat(13-email-mailboxes): phase 13 complete — email DB foundation + SMTP mailbox CRUD
3 migrations (email_mailboxes, email_templates, email_logs), full CRUD
for SMTP mailboxes with encrypted passwords (IntegrationSecretCipher),
native SMTP connection test via stream_socket_client, sidebar navigation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 23:57:33 +01:00
8b3fb3fd0b update: session state, docs, screenshots
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 21:31:57 +01:00
22ce87efe2 chore: complete milestone v0.3 — Moduł Paragonów
Archive milestone, evolve PROJECT.md, reorganize ROADMAP.md.
5 phases, 5 plans: DB foundation, config, issuing, preview/print/PDF, list+XLSX.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 21:21:59 +01:00
22fc330055 feat(11-12-accounting): phases 11-12 complete — milestone v0.3 done
Phase 11: Receipt preview, print & PDF via dompdf.
Phase 12: Accounting section with receipt list, filters, pagination,
selectable checkboxes and XLSX export via PhpSpreadsheet.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 21:00:29 +01:00
fb60b6d5d7 feat(11-receipt-print): phase 11 complete — receipt preview, print & PDF
Add receipt show/print/pdf endpoints with dompdf integration.
Active preview and PDF links in order Documents tab.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 20:31:04 +01:00
ed057fc304 feat(08-10-receipt-module): phases 08-10 complete — receipt issuing from orders
Phase 08 — DB Foundation:
- 3 new tables: receipt_configs, receipts, receipt_number_counters
- company_settings extended with BDO, REGON, KRS, logo fields

Phase 09 — Receipt Config:
- CRUD for receipt configurations (Settings > Accounting)
- ReceiptConfigController + ReceiptConfigRepository

Phase 10 — Receipt Issuing:
- ReceiptRepository with atomic numbering (INSERT ON DUPLICATE KEY UPDATE)
- ReceiptController with snapshot pattern (seller/buyer/items as JSON)
- "Wystaw paragon" button in order view
- Documents tab showing both receipts and marketplace documents
- Activity log entry on receipt creation

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 19:49:06 +01:00
3bccc7a533 update 2026-03-15 01:17:19 +01:00
5ab87a5a20 feat(07-pre-expansion-fixes): complete phase 07 — milestone v0.2 done
Phase 7 complete (5 plans):
- 07-01: Performance (N+1→LEFT JOIN, static cache, DB indexes)
- 07-02: Stability (SSL verification, cron throttle DB, migration 000014b)
- 07-03: UX (orderpro_to_allegro disable, lista zamówień fixes, SSL hotfix)
- 07-04: Tests (12 unit tests for AllegroTokenManager + AllegroOrderImportService)
- 07-05: InPost ShipX API (natywny provider, workaround remap usunięty)

Additional fixes:
- 5 broken use-statements fixed across 4 files
- vendor/ excluded from ftp-kr auto-upload
- PHPUnit + dg/bypass-finals infrastructure

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 00:37:21 +01:00
62a68e9ec2 update 2026-03-14 01:10:29 +01:00
ac0e07916e update 2026-03-14 01:10:22 +01:00
ae747de77a update 2026-03-13 17:47:11 +01:00
209f7db3fe wip(07-pre-expansion-fixes): pause session — 5 plans ready, awaiting APPLY
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 17:46:23 +01:00
03c18f6782 plan(07-pre-expansion-fixes): create 5 plans for pre-expansion fixes
07-01: Performance — N+1 subqueries, information_schema static, DB indexes
07-02: Stability — SSL verification (4 clients), cron throttle→DB, migration 000014b
07-03: UX — orderpro_to_allegro disable, orders list items 14-17
07-04: Tests — AllegroTokenManager + AllegroOrderImportService unit tests
07-05: InPost ShipmentProviderInterface (replaces allegro_wza workaround)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 17:44:42 +01:00
e01b68f559 chore(milestone): complete v0.1 Initial Release — archive, MILESTONES.md, ROADMAP reorganized
v0.1 Initial Release: 6 phases, 15 plans complete.
- Created .paul/MILESTONES.md with milestone entry
- Archived to .paul/milestones/v0.1-ROADMAP.md
- ROADMAP.md reorganized (milestone collapsed to Completed section)
- STATE.md cleared for next milestone

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 17:29:57 +01:00
aaa5d2fc25 feat(06-sonarqube-quality): phase 06 complete — SonarQube Quality 6/6 plans, milestone v0.1 done
Phase 06 summary:
- 06-01: typed exception hierarchy (S112: 95x eliminated)
- 06-02: return statement reduction (S1142: 57x reduced)
- 06-03: string literal constants (S1192: 40x eliminated)
- 06-04: cognitive complexity reduction (S3776: 31x reduced)
- 06-06: long method extraction (S138: 4x eliminated)
- 06-05: god class split — ShopproOrdersSyncService 39→9 methods, AllegroIntegrationController 35→25 methods (S1448: 6x→2x)

Milestone v0.1 Initial Release: 6/6 phases complete.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 17:27:41 +01:00
fbb3020180 docs(06-sonarqube-quality): close loop 06-05 — UNIFY complete
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 17:26:03 +01:00
eb5c9bf345 feat(06-sonarqube-quality): split god classes — ShopproOrdersSyncService + AllegroIntegrationController (06-05)
ShopproOrdersSyncService: 39→9 methods via ShopproOrderMapper + ShopproProductImageResolver.
AllegroIntegrationController: 35→25 methods via AllegroStatusMappingController + AllegroDeliveryMappingController.
S1448 violations: 6x→2x. CronHandlerFactory and routes/web.php updated.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 17:25:59 +01:00
ddf767926e docs(06-sonarqube-quality): close loop 06-04 — UNIFY complete
SUMMARY.md with AC results, deviations, skill audit.
STATE.md updated: 5/6 plans complete, next → 06-05.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 14:27:47 +01:00
8f56dab513 feat(06-sonarqube-quality): reduce cognitive complexity in loadDeliveryServices (S3776 fix, 06-04)
Extract private helpers to flatten 5-level nesting in AllegroIntegrationController
and ShopproIntegrationsController: loadAllegroDeliveryServices(),
fetchAllegroDeliveryResponse(), loadApaczkaServices().
sync() and saveStatusMappings() were already compliant from plan 06-06.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 14:22:52 +01:00
91bc9914c6 wip(06-sonarqube-quality): paused after 06-06 UNIFY — 4/6 plans complete
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 12:39:52 +01:00
42e647f007 feat(06-sonarqube-quality): extract long methods to fix S138 violations (06-06)
ShopproOrdersSyncService: sync() 195→44 lines via syncOneIntegration,
fetchOrdersPage, processPageCandidates, importOneOrder; mapAddresses()
166→34 lines via buildCustomerAddress, buildDeliveryAddress.

OrdersRepository: paginate() 183→69 lines via buildPaginateFilters,
buildListSql, transformOrderRow; findDetails() 101→40 lines via
loadOrderAddresses/Items/Payments/Shipments/Documents/Notes/StatusHistory.

SonarQube S138 violations: 4 → 0.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 12:33:12 +01:00
ae976b7964 wip(06-sonarqube-quality): paused after 06-02 UNIFY — 3/6 plans complete
06-01 (S112 exceptions), 06-02 (S1142 returns), 06-03 (S1192 constants) done.
Next: 06-06 → 06-04 → 06-05

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 12:06:30 +01:00
028c46c685 feat(06-sonarqube-quality): reduce return statements to ≤3 (S1142 fix)
Extract validation helpers in AllegroIntegrationController:
- validateSaveInput(): ?string (save: 6→3 returns)
- validateImportSettingsInput(): ?string (saveImportSettings: 5→3 returns)
- validateOAuthCallbackParams(): ?string (oauthCallback: 4→3 returns)

Extract validation helpers in ShopproIntegrationsController:
- validateSaveAccess(): ?Response (save: 9→3 returns)
- validateSaveInput(): ?string (save field validation)
- validateCsrfAndIntegrationAccess(): ?Response (saveStatusMappings/syncStatuses: 4→3 returns)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 11:57:18 +01:00
d7d3f996cc feat(06-sonarqube-quality): extract string literals to constants (S1192 fix)
- Add IntegrationSources {ALLEGRO, SHOPPRO, APACZKA, INPOST} and RedirectPaths constants in src/Core/Constants/
- Replace integration source literals in AllegroOrderImportService, AllegroStatusSyncService, ShopproOrdersSyncService, ShopproPaymentStatusSyncService
- Replace redirect path literals in AllegroIntegrationController (24+ occurrences) and ShopproIntegrationsController (3 occurrences)
- Auto-fix: broken use statements from plan 06-01 in AllegroOrderImportService and AllegroIntegrationController (missing backslashes)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 11:28:23 +01:00
3c27c4e54a feat(06-sonarqube-quality): introduce typed exception hierarchy (S112 fix)
Replace 86+ generic RuntimeException throws with domain-specific exception
classes: AllegroApiException, AllegroOAuthException, ApaczkaApiException,
ShipmentException, IntegrationConfigException — all extending OrderProException
extends RuntimeException. Existing catch(RuntimeException) blocks unaffected.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 11:04:52 +01:00
3a9cfcd4a2 wip(06-sonarqube-quality): 6 planów SonarQube Quality utworzonych
Plany dla php:S112, S1142, S1192, S3776, S1448, S138 — gotowe do APPLY.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 10:54:57 +01:00
2d4b52adfc feat(04-schema-docs): annotate ensure_* compensating migrations and update DB_SCHEMA.md
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 10:15:58 +01:00
9a0dbe050b update 2026-03-13 01:00:28 +01:00
7b29fd9e02 feat(03-tech-debt): standardize CSRF field name to _token
Phase 3 complete:
- Zmieniono _csrf_token -> _token w OrdersController (1x), ShipmentController (2x)
- Zmieniono name="_csrf_token" -> name="_token" w orders/show.php (1x), shipments/prepare.php (2x)
- Usunięto concern z .paul/codebase/CONCERNS.md

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-13 00:58:59 +01:00
880ab5933f feat(02-bug-fixes): extract CronHandlerFactory, complete Phase 2
Phase 2 complete (4/4 plans):
- Plan 02-01: Fix dead ZPL page size condition in AllegroShipmentService
- Plan 02-02: Add time-based cursor to AllegroStatusSyncService
- Plan 02-03: Fix ShopproOrdersSyncService using wrong state repository
- Plan 02-04: Extract CronHandlerFactory as single cron composition point

Plan 02-04 specifics:
- New CronHandlerFactory builds complete cron object graph
- Application::maybeRunCronOnWeb() reduced from 80+ to ~20 lines
- bin/cron.php reduced from 123 to 26 lines
- Fixed 2 bugs: AllegroOAuthClient→AllegroTokenManager,
  AllegroOrderSyncStateRepository→ShopproOrderSyncStateRepository

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-13 00:43:04 +01:00
87203c4321 fix(02-bug-fixes): fix 3 known bugs from CONCERNS.md
Phase 02 plans 02-01, 02-02, 02-03:

- fix(02-01): dead condition in AllegroShipmentService ZPL page size
  Both ternary branches returned 'A6'; ZPL now correctly returns 'ZPL'

- fix(02-02): add last_status_checked_at cursor to AllegroStatusSyncService
  New migration adds orders.last_status_checked_at DATETIME NULL with
  composite index (source, source_updated_at). findOrdersNeedingStatusSync()
  filters by cursor; markOrderStatusChecked() records timestamp on success.

- fix(02-03): replace AllegroOrderSyncStateRepository in ShopproOrdersSyncService
  New ShopproOrderSyncStateRepository (same table, correct class name).
  Application.php wires correct repository to correct service.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 00:26:07 +01:00