fix: naprawiono wysyłkę zamówień do Apilo — brakujące $apiloRepository w closurach cron.php

Regresja z ver. 0.339 (split IntegrationsRepository → ApiloRepository):
$apiloRepository nie było w use() 5 handlerów cron.php.
Dodano retry zamówień z apilo_order_id=-1 co 1h.
Dodano powiadomienia mailowe o błędach sync Apilo.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jacek
2026-03-16 09:52:26 +01:00
parent 30aaa3b9b8
commit a4e1ef9ecd
6 changed files with 370 additions and 21 deletions

View File

@@ -5,25 +5,25 @@
See: .paul/PROJECT.md (updated 2026-03-12)
**Core value:** Właściciel sklepu ma pełną kontrolę nad sprzedażą online w jednym systemie pisanym od podstaw, bez narzutów zewnętrznych platform.
**Current focus:** Hotfix coupon crash — COMPLETE
**Current focus:** Hotfix Apilo — COMPLETE
## Current Position
Milestone: Hotfix — coupon order crash
Phase: 7Fix coupon stdClass method call crash — Complete
Plan: 07-01 complete (phase done)
Status: UNIFY complete, phase 7 finished
Last activity: 2026-03-15 — 07-01 UNIFY complete
Milestone: Hotfix — Apilo orders not sending
Phase: 8Diagnoza i naprawa wysyłki zamówień do Apilo — Complete
Plan: 08-01 complete (phase done)
Status: UNIFY complete, phase 8 finished
Last activity: 2026-03-16 — 08-01 UNIFY complete
Progress:
- Phase 7: [██████████] 100% (COMPLETE)
- Phase 8: [██████████] 100% (COMPLETE)
## Loop Position
Current loop state (phase 7, plan 01):
Current loop state (phase 8, plan 01):
```
PLAN ──▶ APPLY ──▶ UNIFY
✓ ✓ ✓ [Phase 7 complete]
✓ ✓ ✓ [Phase 8 complete]
```
Previous phases:
@@ -32,12 +32,16 @@ Phase 4: PLAN ──▶ APPLY ──▶ UNIFY ✓ ✓ ✓ [COMPLETE — 2026-0
Phase 5: PLAN ──▶ APPLY ──▶ UNIFY ✓ ✓ ✓ [COMPLETE — 2026-03-12]
Phase 6: PLAN ──▶ APPLY ──▶ UNIFY ✓ ✓ ✓ [COMPLETE — 2026-03-12]
Phase 7: PLAN ──▶ APPLY ──▶ UNIFY ✓ ✓ ✓ [COMPLETE — 2026-03-15]
Phase 8: PLAN ──▶ APPLY ──▶ UNIFY ✓ ✓ ✓ [COMPLETE — 2026-03-16]
```
## Accumulated Context
### Decisions
- Use existing `CouponRepository::markAsUsed()` instead of adding methods to stdClass
- 2026-03-16: Przyczyna braku wysyłki = brakujące $apiloRepository w use() closures cron.php (regresja z fazy 6)
- 2026-03-16: Retry -1 orders co 1h zamiast permanent failure
- 2026-03-16: Email notification o trwale failed Apilo jobach
### Deferred Issues
None.
@@ -47,10 +51,10 @@ None.
## Session Continuity
Last session: 2026-03-15
Stopped at: Phase 07 UNIFY complete — hotfix loop closed
Next action: Deploy fix to production, then /paul:progress for next work
Resume file: .paul/phases/07-coupon-bugfix/07-01-SUMMARY.md
Last session: 2026-03-16
Stopped at: Phase 08 UNIFY complete — Apilo fix loop closed
Next action: Deploy fix to instance, then /paul:progress for next work
Resume file: .paul/phases/08-apilo-orders-fix/08-01-SUMMARY.md
---
*STATE.md — Updated after every significant action*