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>
This commit is contained in:
@@ -12,9 +12,9 @@ Sprzedawca może obsługiwać zamówienia ze wszystkich kanałów
|
||||
|
||||
| Attribute | Value |
|
||||
|-----------|-------|
|
||||
| Version | 3.1.0-dev |
|
||||
| Status | v3.1 in progress (Phase 106 shipped) |
|
||||
| Last Updated | 2026-04-22 |
|
||||
| Version | 3.1.0 |
|
||||
| Status | v3.1 shipped — all phases complete |
|
||||
| Last Updated | 2026-04-27 |
|
||||
|
||||
## Requirements
|
||||
|
||||
@@ -110,6 +110,7 @@ Sprzedawca może obsługiwać zamówienia ze wszystkich kanałów
|
||||
- [x] Statystyki zamowien: widok `/statistics/orders` z filtrami (daty, kanaly multiselect, grupy statusow multiselect) i raportem dziennym per kanal (Allegro, shopPRO per integracja); hotfix collation MySQL + fallback netto 23% VAT — Phase 105
|
||||
- [x] Wersja mobilna — modul po module (v3.0) — shipped across phases 52–105
|
||||
- [x] Alert o kliencie z historia zwrotow: badge w liscie zamowien (kolumna buyer) + czerwony banner u gory szczegolow zamowienia; matching OR po email/phone/name; `<details>` z lista zwroconych zamowien — Phase 106
|
||||
- [x] Idempotentna jednorazowa wysylka e-mail per zamowienie: tabela deduplikacji `automation_email_once_deliveries` (UNIQUE KEY rule_id+action_id+order_id), checkbox "Wyslij tylko raz" w konfiguracji akcji, markSent() tylko po sukcesie — Phase 107
|
||||
|
||||
### Deferred
|
||||
|
||||
@@ -190,6 +191,8 @@ PHP (XAMPP/Laravel), integracje z API marketplace'Ăłw (Allegro, Erli) oraz API
|
||||
| Preset przesylek nadpisuje wylacznie wymiary+wage + auto-submit po autofill | Single responsibility preseta + szybszy flow operatora | 2026-04-17 | Active |
|
||||
| Statistics channelSql: explicit `COLLATE utf8mb4_unicode_ci` na CASE z `CAST(integration_id AS CHAR)` | Unikniecie `1271 Illegal mix of collations` w `IN (...)` z parametrami bindowanymi; pattern dla przyszlych agregacji per-integration | 2026-04-19 | Active |
|
||||
| Statistics netto fallback `ROUND(gross / 1.23, 2)` gdy `total_without_tax` puste | shopPRO nie wysyla netto ani w zamowieniu ani w `order_items`; tymczasowy fallback — docelowy fix w `.paul/TODO.md` (STAT-NET) | 2026-04-19 | Active |
|
||||
| ON DUPLICATE KEY UPDATE created_at = created_at dla idempotentnego markSent() | Unikniece silent failure i race condition przy rownolegych cronach; thread-safe bez wyjatkow | 2026-04-25 | Active |
|
||||
| send_once_per_order opt-in przez checkbox (domyslnie off) | Wsteczna zgodnosc — istniejace reguly nie zmieniaja zachowania; markSent() tylko po sukcesie wysylki | 2026-04-25 | Active |
|
||||
|
||||
## Success Metrics
|
||||
|
||||
@@ -220,7 +223,7 @@ Quick Reference:
|
||||
- /simplify → Refaktoryzacja po implementacji (optional)
|
||||
|
||||
---
|
||||
*PROJECT.md — Updated when requirements or context change*
|
||||
*Last updated: 2026-04-19 after v3.0 Mobile Responsive milestone completion (Phase 105 Orders Statistics)*
|
||||
*PROJECT.md — Updated when requirements or context change*
|
||||
*Last updated: 2026-04-27 after v3.1 Operational Enhancements milestone completion (Phase 107 Automation Email Send Once)*
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user