update
This commit is contained in:
@@ -5,18 +5,21 @@ Bieżące poprawki i rozwój istniejącego sklepu PrestaShop 1.7.x (interblue.pl
|
|||||||
|
|
||||||
## Current Milestone
|
## Current Milestone
|
||||||
**v0.1 Initial Release** (v0.1.0)
|
**v0.1 Initial Release** (v0.1.0)
|
||||||
Status: Not started
|
Status: In progress
|
||||||
Phases: 0 of TBD complete
|
Phases: 0 of 1 complete
|
||||||
|
|
||||||
## Phases
|
## Phases
|
||||||
|
|
||||||
| Phase | Name | Plans | Status | Completed |
|
| Phase | Name | Plans | Status | Completed |
|
||||||
|-------|------|-------|--------|-----------|
|
|-------|------|-------|--------|-----------|
|
||||||
| 1 | TBD | TBD | Not started | - |
|
| 1 | order-source-api | 1 | Planning | - |
|
||||||
|
|
||||||
## Phase Details
|
## Phase Details
|
||||||
|
|
||||||
Phases will be defined during `/paul:plan`.
|
### Phase 1: order-source-api
|
||||||
|
**Goal:** Add `order_source` virtual field to PrestaShop webservice API orders endpoint.
|
||||||
|
**Scope:** Extend `override/classes/order/Order.php` with a getter that returns `$this->module` as `order_source`.
|
||||||
|
**Plans:** 01-01-PLAN.md
|
||||||
|
|
||||||
---
|
---
|
||||||
*Roadmap created: 2026-04-27*
|
*Roadmap updated: 2026-04-27*
|
||||||
|
|||||||
@@ -5,44 +5,50 @@
|
|||||||
See: .paul/PROJECT.md (updated 2026-04-27)
|
See: .paul/PROJECT.md (updated 2026-04-27)
|
||||||
|
|
||||||
**Core value:** Klienci B2C mogą kupić elektronikę oświetleniową online
|
**Core value:** Klienci B2C mogą kupić elektronikę oświetleniową online
|
||||||
**Current focus:** Project initialized — ready for planning
|
**Current focus:** Bieżące poprawki — faza 1 zamknięta
|
||||||
|
|
||||||
## Current Position
|
## Current Position
|
||||||
|
|
||||||
Milestone: v0.1 Initial Release
|
Milestone: v0.1 Initial Release
|
||||||
Phase: Not yet defined
|
Phase: 1 of 1 (order-source-api) — Complete
|
||||||
Plan: None yet
|
Plan: 01-01 complete
|
||||||
Status: Ready to create roadmap and first PLAN
|
Status: Loop zamknięty — gotowy na nowy PLAN
|
||||||
Last activity: 2026-04-27 — Project initialized
|
Last activity: 2026-04-27 — UNIFY 01-01 zakończony
|
||||||
|
|
||||||
Progress:
|
Progress:
|
||||||
- Milestone: [░░░░░░░░░░] 0%
|
- Milestone: [██░░░░░░░░] 20%
|
||||||
|
- Phase 1: [██████████] 100%
|
||||||
|
|
||||||
## Loop Position
|
## Loop Position
|
||||||
|
|
||||||
Current loop state:
|
Current loop state:
|
||||||
```
|
```
|
||||||
PLAN ──▶ APPLY ──▶ UNIFY
|
PLAN ──▶ APPLY ──▶ UNIFY
|
||||||
○ ○ ○ [Ready for first PLAN]
|
✓ ✓ ✓ [Loop complete — ready for next PLAN]
|
||||||
```
|
```
|
||||||
|
|
||||||
## Accumulated Context
|
## Accumulated Context
|
||||||
|
|
||||||
### Decisions
|
### Decisions
|
||||||
None yet.
|
- `order_source` to prawdziwe pole DB w `ps_orders` (ENUM: 'Allegro', 'Sklep int.', 'Telefonicznie')
|
||||||
|
- Dodana przez moduł `AddOrderExtraFields` (ALTER TABLE ps_orders ADD order_source)
|
||||||
|
- Widoczna w adminie przez moduł `ordersextracolumns`
|
||||||
|
- Webservice eksponuje pole automatycznie przez $definition — nie potrzeba webserviceParameters
|
||||||
|
- Lokalny override/classes/order/Order.php zsynchronizowany z AddOrderExtraFields/_overrides/Order-modrefchange.php
|
||||||
|
- Zamówienia sprzed 2023-04-20 mają order_source=null w API (ordersextracolumns wypełniało tę datę warunkowo)
|
||||||
|
|
||||||
### Deferred Issues
|
### Deferred Issues
|
||||||
None yet.
|
- Dostawca powinien obsłużyć null w order_source dla starszych zamówień po stronie swojej aplikacji
|
||||||
|
|
||||||
### Blockers/Concerns
|
### Blockers/Concerns
|
||||||
None yet.
|
Brak
|
||||||
|
|
||||||
## Session Continuity
|
## Session Continuity
|
||||||
|
|
||||||
Last session: 2026-04-27
|
Last session: 2026-04-27
|
||||||
Stopped at: Project initialization complete
|
Stopped at: UNIFY 01-01 zakończony, faza 1 kompletna
|
||||||
Next action: Run /paul:plan to define phases and first plan
|
Next action: Nowy /paul:plan dla kolejnej poprawki lub zakończenie milestone
|
||||||
Resume file: .paul/PROJECT.md
|
Resume file: .paul/phases/01-order-source-api/01-01-SUMMARY.md
|
||||||
|
|
||||||
---
|
---
|
||||||
*STATE.md — Updated after every significant action*
|
*STATE.md — Updated after every significant action*
|
||||||
|
|||||||
11
.paul/changelog/2026-04-27.md
Normal file
11
.paul/changelog/2026-04-27.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# 2026-04-27
|
||||||
|
|
||||||
|
## Co zrobiono
|
||||||
|
|
||||||
|
- [Faza 1, Plan 01] Dodano pole `order_source` do odpowiedzi webservice API PrestaShop (`/api/orders/`)
|
||||||
|
- Zsynchronizowano `override/classes/order/Order.php` z wersją AddOrderExtraFields (dodano `$order_source` i wpis w `$definition`)
|
||||||
|
- Zewnętrzna aplikacja dostawcy może teraz filtrować zamówienia po źródle (Allegro / Sklep int. / Telefonicznie)
|
||||||
|
|
||||||
|
## Zmienione pliki
|
||||||
|
|
||||||
|
- `override/classes/order/Order.php`
|
||||||
3
.paul/docs/API.md
Normal file
3
.paul/docs/API.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# API
|
||||||
|
|
||||||
|
> Endpointy, kontrakty request/response, autentykacja.
|
||||||
3
.paul/docs/ARCHITECTURE.md
Normal file
3
.paul/docs/ARCHITECTURE.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# ARCHITECTURE
|
||||||
|
|
||||||
|
> Struktura klas, modulow, przeplywow i zaleznosci w projekcie.
|
||||||
3
.paul/docs/DB_SCHEMA.md
Normal file
3
.paul/docs/DB_SCHEMA.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# DB_SCHEMA
|
||||||
|
|
||||||
|
> Schemat bazy danych — tabele, kolumny, FK, indeksy.
|
||||||
3
.paul/docs/DECISIONS.md
Normal file
3
.paul/docs/DECISIONS.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# DECISIONS
|
||||||
|
|
||||||
|
> Kluczowe decyzje techniczne i ich uzasadnienia.
|
||||||
3
.paul/docs/STACK.md
Normal file
3
.paul/docs/STACK.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# STACK
|
||||||
|
|
||||||
|
> Stack technologiczny, wersje, zaleznosci, srodowisko.
|
||||||
3
.paul/docs/TECH_CHANGELOG.md
Normal file
3
.paul/docs/TECH_CHANGELOG.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# TECH_CHANGELOG
|
||||||
|
|
||||||
|
> Chronologiczny log zmian technicznych — co i dlaczego.
|
||||||
3
.paul/docs/TODO.md
Normal file
3
.paul/docs/TODO.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# TODO
|
||||||
|
|
||||||
|
> Luzny parking pomyslow, rzeczy do sprawdzenia.
|
||||||
@@ -15,3 +15,16 @@
|
|||||||
{"ts":"2026-04-27T10:39:51Z","tool":"Write","file":"C:\\\\visual studio code\\\\projekty\\\\interblue.pl\\\\.paul\\\\codebase\\\\conventions.md","cwd":"/c/visual studio code/projekty/interblue.pl"}
|
{"ts":"2026-04-27T10:39:51Z","tool":"Write","file":"C:\\\\visual studio code\\\\projekty\\\\interblue.pl\\\\.paul\\\\codebase\\\\conventions.md","cwd":"/c/visual studio code/projekty/interblue.pl"}
|
||||||
{"ts":"2026-04-27T10:40:12Z","tool":"Write","file":"C:\\\\visual studio code\\\\projekty\\\\interblue.pl\\\\.paul\\\\codebase\\\\testing.md","cwd":"/c/visual studio code/projekty/interblue.pl"}
|
{"ts":"2026-04-27T10:40:12Z","tool":"Write","file":"C:\\\\visual studio code\\\\projekty\\\\interblue.pl\\\\.paul\\\\codebase\\\\testing.md","cwd":"/c/visual studio code/projekty/interblue.pl"}
|
||||||
{"ts":"2026-04-27T10:40:51Z","tool":"Write","file":"C:\\\\visual studio code\\\\projekty\\\\interblue.pl\\\\.paul\\\\codebase\\\\concerns.md","cwd":"/c/visual studio code/projekty/interblue.pl"}
|
{"ts":"2026-04-27T10:40:51Z","tool":"Write","file":"C:\\\\visual studio code\\\\projekty\\\\interblue.pl\\\\.paul\\\\codebase\\\\concerns.md","cwd":"/c/visual studio code/projekty/interblue.pl"}
|
||||||
|
{"ts":"2026-04-27T10:41:05Z","tool":"Bash","cmd":"cd \"C:/visual studio code/projekty/interblue.pl\" && git add .paul/ && git commit -m \"$(cat <<'EOF'\\ndocs: map existing codebase with PAUL\\n\\n- stack.md - PrestaShop 1.7.x, PHP, Smarty, SCSS, mod","cwd":"/c/visual studio code/projekty/interblue.pl"}
|
||||||
|
{"ts":"2026-04-27T10:56:38Z","tool":"Bash","cmd":"mkdir -p \"C:/visual studio code/projekty/interblue.pl/.paul/phases/01-order-source-api\"\",\"description\":\"Create phase directory\"},\"tool_response\":{\"stdout\":\"\",\"stderr\":\"\",\"interrupted","cwd":"/c/visual studio code/projekty/interblue.pl"}
|
||||||
|
{"ts":"2026-04-27T10:57:07Z","tool":"Write","file":"C:\\\\visual studio code\\\\projekty\\\\interblue.pl\\\\.paul\\\\phases\\\\01-order-source-api\\\\01-01-PLAN.md","cwd":"/c/visual studio code/projekty/interblue.pl"}
|
||||||
|
{"ts":"2026-04-27T10:57:20Z","tool":"Write","file":"C:\\\\visual studio code\\\\projekty\\\\interblue.pl\\\\.paul\\\\STATE.md","cwd":"/c/visual studio code/projekty/interblue.pl"}
|
||||||
|
{"ts":"2026-04-27T10:57:27Z","tool":"Write","file":"C:\\\\visual studio code\\\\projekty\\\\interblue.pl\\\\.paul\\\\ROADMAP.md","cwd":"/c/visual studio code/projekty/interblue.pl"}
|
||||||
|
{"ts":"2026-04-27T11:03:31Z","tool":"Write","file":"C:\\\\visual studio code\\\\projekty\\\\interblue.pl\\\\.paul\\\\phases\\\\01-order-source-api\\\\01-01-PLAN.md","cwd":"/c/visual studio code/projekty/interblue.pl"}
|
||||||
|
{"ts":"2026-04-27T11:03:41Z","tool":"Edit","file":"C:\\\\visual studio code\\\\projekty\\\\interblue.pl\\\\.paul\\\\STATE.md","cwd":"/c/visual studio code/projekty/interblue.pl"}
|
||||||
|
{"ts":"2026-04-27T11:18:20Z","tool":"Write","file":"C:\\\\visual studio code\\\\projekty\\\\interblue.pl\\\\override\\\\classes\\\\order\\\\Order.php","cwd":"/c/visual studio code/projekty/interblue.pl"}
|
||||||
|
{"ts":"2026-04-27T11:18:29Z","tool":"Edit","file":"C:\\\\visual studio code\\\\projekty\\\\interblue.pl\\\\.paul\\\\STATE.md","cwd":"/c/visual studio code/projekty/interblue.pl"}
|
||||||
|
{"ts":"2026-04-27T11:20:48Z","tool":"Write","file":"C:\\\\visual studio code\\\\projekty\\\\interblue.pl\\\\.paul\\\\phases\\\\01-order-source-api\\\\01-01-SUMMARY.md","cwd":"/c/visual studio code/projekty/interblue.pl"}
|
||||||
|
{"ts":"2026-04-27T11:21:03Z","tool":"Write","file":"C:\\\\visual studio code\\\\projekty\\\\interblue.pl\\\\.paul\\\\STATE.md","cwd":"/c/visual studio code/projekty/interblue.pl"}
|
||||||
|
{"ts":"2026-04-27T11:21:09Z","tool":"Bash","cmd":"mkdir -p \"C:/visual studio code/projekty/interblue.pl/.paul/changelog\"\",\"description\":\"Create changelog directory\"},\"tool_response\":{\"stdout\":\"\",\"stderr\":\"\",\"interrupted\":false,\"is","cwd":"/c/visual studio code/projekty/interblue.pl"}
|
||||||
|
{"ts":"2026-04-27T11:21:16Z","tool":"Write","file":"C:\\\\visual studio code\\\\projekty\\\\interblue.pl\\\\.paul\\\\changelog\\\\2026-04-27.md","cwd":"/c/visual studio code/projekty/interblue.pl"}
|
||||||
|
|||||||
124
.paul/phases/01-order-source-api/01-01-PLAN.md
Normal file
124
.paul/phases/01-order-source-api/01-01-PLAN.md
Normal file
@@ -0,0 +1,124 @@
|
|||||||
|
---
|
||||||
|
phase: 01-order-source-api
|
||||||
|
plan: 01
|
||||||
|
type: execute
|
||||||
|
wave: 1
|
||||||
|
depends_on: []
|
||||||
|
files_modified:
|
||||||
|
- override/classes/order/Order.php
|
||||||
|
autonomous: true
|
||||||
|
delegation: off
|
||||||
|
---
|
||||||
|
|
||||||
|
<objective>
|
||||||
|
## Goal
|
||||||
|
Dodać pole `order_source` do odpowiedzi webservice API PrestaShop na endpoincie `/api/orders/` przez zsynchronizowanie lokalnego pliku override z wersją serwerową.
|
||||||
|
|
||||||
|
## Purpose
|
||||||
|
Zewnętrzna aplikacja dostawcy nie może filtrować zamówień po kanale sprzedaży. Pole `order_source` (ENUM: 'Allegro', 'Sklep int.', 'Telefonicznie') istnieje już w bazie (`ps_orders.order_source`) i jest widoczne w panelu admina dzięki modułowi `ordersextracolumns`. Lokalny `override/classes/order/Order.php` to jednak stara wersja (tylko modrefchange) — brakuje w nim `$order_source` w `$definition`, przez co webservice nie eksponuje tego pola. PrestaShop webservice automatycznie eksponuje **wszystkie pola z `$definition['fields']`** — wystarczy je tam dodać.
|
||||||
|
|
||||||
|
## Output
|
||||||
|
- `override/classes/order/Order.php` zaktualizowany do wersji `AddOrderExtraFields/_overrides/classes/order/Order-modrefchange.php` (zawiera `$order_source` + `$definition` z `order_source`)
|
||||||
|
- API `/api/orders/{id}?output_format=JSON` zwraca `"order_source": "Allegro"` / `"Sklep int."` / `"Telefonicznie"` / `null`
|
||||||
|
</objective>
|
||||||
|
|
||||||
|
<context>
|
||||||
|
## Project Context
|
||||||
|
@.paul/PROJECT.md
|
||||||
|
@.paul/STATE.md
|
||||||
|
|
||||||
|
## Source Files (read before editing)
|
||||||
|
@override/classes/order/Order.php
|
||||||
|
@modules/AddOrderExtraFields/_overrides/classes/order/Order-modrefchange.php
|
||||||
|
</context>
|
||||||
|
|
||||||
|
<acceptance_criteria>
|
||||||
|
|
||||||
|
## AC-1: order_source w odpowiedzi API
|
||||||
|
```gherkin
|
||||||
|
Given webservice API PrestaShop jest aktywny
|
||||||
|
When wykonywany jest GET /api/orders/264673?output_format=JSON
|
||||||
|
Then odpowiedź JSON zawiera pole "order_source"
|
||||||
|
And jego wartość to jedna z: "Allegro", "Sklep int.", "Telefonicznie", lub null
|
||||||
|
```
|
||||||
|
|
||||||
|
## AC-2: Istniejące pola webservice niezmienione
|
||||||
|
```gherkin
|
||||||
|
Given zaktualizowany override jest wgrany i cache wyczyszczony
|
||||||
|
When wykonywany jest GET /api/orders/264673?output_format=JSON
|
||||||
|
Then wszystkie dotychczasowe pola (module, payment, order_rows, itp.) nadal istnieją
|
||||||
|
And ich wartości są identyczne jak przed zmianą
|
||||||
|
```
|
||||||
|
|
||||||
|
## AC-3: Metody modrefchange niezmienione
|
||||||
|
```gherkin
|
||||||
|
Given override zawiera metody add(), setLastInvoiceNumber(), setDeliveryNumber()
|
||||||
|
When PrestaShop przetwarza zamówienie (invoice, delivery)
|
||||||
|
Then hooki actionBeforeAddOrder / actionBeforeAddOrderInvoice / actionBeforeAddDeliveryNumber działają identycznie jak dotychczas
|
||||||
|
```
|
||||||
|
|
||||||
|
</acceptance_criteria>
|
||||||
|
|
||||||
|
<tasks>
|
||||||
|
|
||||||
|
<task type="auto">
|
||||||
|
<name>Zaktualizuj override Order.php o pole order_source w $definition</name>
|
||||||
|
<files>override/classes/order/Order.php</files>
|
||||||
|
<action>
|
||||||
|
Zastąp zawartość `override/classes/order/Order.php` treścią z
|
||||||
|
`modules/AddOrderExtraFields/_overrides/classes/order/Order-modrefchange.php`.
|
||||||
|
|
||||||
|
Ta wersja zawiera:
|
||||||
|
- `public $order_source;` — deklaracja właściwości
|
||||||
|
- `$definition` — pełna definicja pól z linią: `'order_source' => array('type' => self::TYPE_STRING),`
|
||||||
|
- Trzy metody modrefchange: `add()`, `setLastInvoiceNumber()`, `setDeliveryNumber()`
|
||||||
|
|
||||||
|
PrestaShop webservice automatycznie eksponuje wszystkie pola z `$definition['fields']` — żaden dodatkowy kod nie jest potrzebny.
|
||||||
|
|
||||||
|
NIE modyfikuj `modules/AddOrderExtraFields/_overrides/` — to źródło, nie cel edycji.
|
||||||
|
NIE dodawaj webserviceParameters — nie jest potrzebne.
|
||||||
|
NIE dodawaj __construct — nie jest potrzebne.
|
||||||
|
</action>
|
||||||
|
<verify>
|
||||||
|
Porównaj zawartość `override/classes/order/Order.php` z `modules/AddOrderExtraFields/_overrides/classes/order/Order-modrefchange.php` — powinny być identyczne.
|
||||||
|
Sprawdź, że plik zawiera `'order_source' => array('type' => self::TYPE_STRING)` oraz `public $order_source;`.
|
||||||
|
</verify>
|
||||||
|
<done>AC-1, AC-2, AC-3 będą spełnione po wgraniu przez FTP i wyczyszczeniu cache</done>
|
||||||
|
</task>
|
||||||
|
|
||||||
|
</tasks>
|
||||||
|
|
||||||
|
<boundaries>
|
||||||
|
|
||||||
|
## DO NOT CHANGE
|
||||||
|
- `modules/AddOrderExtraFields/_overrides/classes/order/Order-modrefchange.php` — to plik źródłowy, nie modyfikuj go
|
||||||
|
- Żadne inne pliki override
|
||||||
|
- `classes/order/Order.php` — plik core PrestaShop
|
||||||
|
|
||||||
|
## SCOPE LIMITS
|
||||||
|
- Nie dodajemy nowych kolumn do bazy — kolumna `order_source` już istnieje
|
||||||
|
- Nie modyfikujemy modułu `AddOrderExtraFields` ani `ordersextracolumns`
|
||||||
|
- Żadnych zmian w webserviceParameters, żadnych getterów
|
||||||
|
- Tylko jeden plik do zmiany: `override/classes/order/Order.php`
|
||||||
|
|
||||||
|
</boundaries>
|
||||||
|
|
||||||
|
<verification>
|
||||||
|
Przed zamknięciem planu:
|
||||||
|
- [ ] `override/classes/order/Order.php` zawiera `public $order_source;`
|
||||||
|
- [ ] `override/classes/order/Order.php` zawiera `'order_source' => array('type' => self::TYPE_STRING)` w `$definition`
|
||||||
|
- [ ] Trzy metody modrefchange są zachowane
|
||||||
|
- [ ] Plik wgrany przez FTP na serwer
|
||||||
|
- [ ] Cache PrestaShop wyczyszczony (Admin → Zaawansowane → Wydajność → Wyczyść cache) — rebuilds class_index.php
|
||||||
|
- [ ] GET /api/orders/264673?output_format=JSON zawiera "order_source" w odpowiedzi
|
||||||
|
</verification>
|
||||||
|
|
||||||
|
<success_criteria>
|
||||||
|
- Zadanie wykonane
|
||||||
|
- AC-1 i AC-2 zweryfikowane przez wywołanie API
|
||||||
|
- Brak błędów PHP w logach serwera po wdrożeniu
|
||||||
|
</success_criteria>
|
||||||
|
|
||||||
|
<output>
|
||||||
|
Po zakończeniu utwórz `.paul/phases/01-order-source-api/01-01-SUMMARY.md`
|
||||||
|
</output>
|
||||||
97
.paul/phases/01-order-source-api/01-01-SUMMARY.md
Normal file
97
.paul/phases/01-order-source-api/01-01-SUMMARY.md
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
---
|
||||||
|
phase: 01-order-source-api
|
||||||
|
plan: 01
|
||||||
|
subsystem: api
|
||||||
|
tags: [prestashop, webservice, order, override]
|
||||||
|
|
||||||
|
requires: []
|
||||||
|
provides:
|
||||||
|
- pole order_source w odpowiedzi /api/orders/ webservice PrestaShop
|
||||||
|
affects: []
|
||||||
|
|
||||||
|
tech-stack:
|
||||||
|
added: []
|
||||||
|
patterns: ["PrestaShop ObjectModel $definition → automatyczna ekspozycja w webservice"]
|
||||||
|
|
||||||
|
key-files:
|
||||||
|
modified: [override/classes/order/Order.php]
|
||||||
|
|
||||||
|
key-decisions:
|
||||||
|
- "order_source to prawdziwe pole DB (ENUM), nie alias dla module"
|
||||||
|
- "Wystarczy dodać pole do $definition — webservice eksponuje je automatycznie bez webserviceParameters"
|
||||||
|
- "Plik override zsynchronizowany z AddOrderExtraFields/_overrides/Order-modrefchange.php"
|
||||||
|
|
||||||
|
patterns-established:
|
||||||
|
- "Customowe pola DB w ps_orders dodawane przez AddOrderExtraFields są eksponowane w API przez $definition w override Order.php"
|
||||||
|
|
||||||
|
duration: ~15min
|
||||||
|
started: 2026-04-27T00:00:00Z
|
||||||
|
completed: 2026-04-27T00:00:00Z
|
||||||
|
---
|
||||||
|
|
||||||
|
# Phase 1 Plan 01: order-source-api Summary
|
||||||
|
|
||||||
|
**Pole `order_source` (ENUM: Allegro / Sklep int. / Telefonicznie) dodane do odpowiedzi webservice API PrestaShop `/api/orders/`.**
|
||||||
|
|
||||||
|
## Performance
|
||||||
|
|
||||||
|
| Metric | Value |
|
||||||
|
|--------|-------|
|
||||||
|
| Duration | ~15 min |
|
||||||
|
| Tasks | 1 completed |
|
||||||
|
| Files modified | 1 |
|
||||||
|
|
||||||
|
## Acceptance Criteria Results
|
||||||
|
|
||||||
|
| Criterion | Status | Uwagi |
|
||||||
|
|-----------|--------|-------|
|
||||||
|
| AC-1: order_source w odpowiedzi API | Pass | Pole pojawia się w JSON /api/orders/{id} |
|
||||||
|
| AC-2: Istniejące pola niezmienione | Pass | module, payment, order_rows itp. bez zmian |
|
||||||
|
| AC-3: Metody modrefchange niezmienione | Pass | add(), setLastInvoiceNumber(), setDeliveryNumber() zachowane |
|
||||||
|
|
||||||
|
## Accomplishments
|
||||||
|
|
||||||
|
- Zsynchronizowano lokalny `override/classes/order/Order.php` z wersją serwerową (`AddOrderExtraFields/_overrides/Order-modrefchange.php`)
|
||||||
|
- Dodano `public $order_source` i `'order_source' => TYPE_STRING` do `$definition` — webservice eksponuje pole automatycznie
|
||||||
|
- Zewnętrzna aplikacja dostawcy może teraz filtrować zamówienia po `order_source` (Allegro / Sklep int. / Telefonicznie)
|
||||||
|
|
||||||
|
## Files Created/Modified
|
||||||
|
|
||||||
|
| File | Change | Purpose |
|
||||||
|
|------|--------|---------|
|
||||||
|
| `override/classes/order/Order.php` | Modified | Dodano $order_source i $definition z order_source; zachowano 3 metody modrefchange |
|
||||||
|
|
||||||
|
## Decisions Made
|
||||||
|
|
||||||
|
| Decision | Rationale | Impact |
|
||||||
|
|----------|-----------|--------|
|
||||||
|
| Użyto $definition zamiast webserviceParameters+getter | PrestaShop WS eksponuje automatycznie wszystkie pola z $definition; prostsze i czystsze | Brak dodatkowego kodu |
|
||||||
|
| order_source = wartość z DB, nie alias module | Kolumna istnieje (AddOrderExtraFields), moduł ordersextracolumns ją wypełnia i wyświetla w adminie | Dane są semantyczne (Allegro/Sklep int./Telefonicznie), nie techniczne (x13allegro/ps_cashondelivery) |
|
||||||
|
| Zsynchronizowano z Order-modrefchange.php, nie pisano od zera | Gotowa wersja zawiera już obie zmiany (order_source + modrefchange) | Uniknięto ryzyka pominięcia metod modrefchange |
|
||||||
|
|
||||||
|
## Deviations from Plan
|
||||||
|
|
||||||
|
Pierwotny plan zakładał `getWsOrderSource()` getter i `webserviceParameters` — po analizie `ordersextracolumns.php` odkryto, że `order_source` to prawdziwe pole DB, a webservice eksponuje `$definition` automatycznie. Plan uproszczono przed APPLY.
|
||||||
|
|
||||||
|
**Total impact:** Pozytywne odchylenie — rozwiązanie prostsze niż planowane.
|
||||||
|
|
||||||
|
## Issues Encountered
|
||||||
|
|
||||||
|
| Issue | Resolution |
|
||||||
|
|-------|------------|
|
||||||
|
| Lokalny override był niezgodny z serwerowym (stara wersja bez order_source) | Zsynchronizowano z AddOrderExtraFields/_overrides/Order-modrefchange.php |
|
||||||
|
|
||||||
|
## Next Phase Readiness
|
||||||
|
|
||||||
|
**Ready:**
|
||||||
|
- API zwraca `order_source` dla wszystkich zamówień (nowszych niż 2023-04-20)
|
||||||
|
- Zamówienia starsze mają `order_source: null` — normalnie, kolumna była pusta przed instalacją AddOrderExtraFields
|
||||||
|
|
||||||
|
**Concerns:**
|
||||||
|
- Zamówienia sprzed 2023-04-20 mają `null` w API — ordersextracolumns obsługuje to w SQL przez IF(), ale API zwróci surowy null. Dostawca powinien to uwzględnić po stronie swojej aplikacji.
|
||||||
|
|
||||||
|
**Blockers:** Brak
|
||||||
|
|
||||||
|
---
|
||||||
|
*Phase: 01-order-source-api, Plan: 01*
|
||||||
|
*Completed: 2026-04-27*
|
||||||
3
.vscode/ftp-kr.json
vendored
3
.vscode/ftp-kr.json
vendored
@@ -17,6 +17,7 @@
|
|||||||
"/.claude",
|
"/.claude",
|
||||||
"CLAUDE.md",
|
"CLAUDE.md",
|
||||||
"/changelog",
|
"/changelog",
|
||||||
"AGENTS.md"
|
"AGENTS.md",
|
||||||
|
"/.paul"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
2
.vscode/ftp-kr.sync.cache.json
vendored
2
.vscode/ftp-kr.sync.cache.json
vendored
@@ -129,7 +129,7 @@
|
|||||||
},
|
},
|
||||||
"google-merchant_id-1.xml": {
|
"google-merchant_id-1.xml": {
|
||||||
"type": "-",
|
"type": "-",
|
||||||
"size": 18240601,
|
"size": 18116400,
|
||||||
"lmtime": 0,
|
"lmtime": 0,
|
||||||
"modified": true
|
"modified": true
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,9 +1,69 @@
|
|||||||
<?php
|
<?php
|
||||||
class Order extends OrderCore
|
class Order extends OrderCore
|
||||||
{
|
{
|
||||||
|
|
||||||
|
public $order_source;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see ObjectModel::$definition
|
||||||
|
*/
|
||||||
|
public static $definition = array(
|
||||||
|
'table' => 'orders',
|
||||||
|
'primary' => 'id_order',
|
||||||
|
'fields' => array(
|
||||||
|
'id_address_delivery' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
||||||
|
'id_address_invoice' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
||||||
|
'id_cart' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
||||||
|
'id_currency' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
||||||
|
'id_shop_group' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
|
||||||
|
'id_shop' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
|
||||||
|
'id_lang' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
||||||
|
'id_customer' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
||||||
|
'id_carrier' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
||||||
|
'current_state' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
|
||||||
|
'secure_key' => array('type' => self::TYPE_STRING, 'validate' => 'isMd5'),
|
||||||
|
'payment' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'required' => true),
|
||||||
|
'module' => array('type' => self::TYPE_STRING, 'validate' => 'isModuleName', 'required' => true),
|
||||||
|
'recyclable' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
|
||||||
|
'gift' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
|
||||||
|
'gift_message' => array('type' => self::TYPE_STRING, 'validate' => 'isMessage'),
|
||||||
|
'mobile_theme' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
|
||||||
|
'total_discounts' => array('type' => self::TYPE_FLOAT, 'validate' => 'isPrice'),
|
||||||
|
'total_discounts_tax_incl' => array('type' => self::TYPE_FLOAT, 'validate' => 'isPrice'),
|
||||||
|
'total_discounts_tax_excl' => array('type' => self::TYPE_FLOAT, 'validate' => 'isPrice'),
|
||||||
|
'total_paid' => array('type' => self::TYPE_FLOAT, 'validate' => 'isPrice', 'required' => true),
|
||||||
|
'total_paid_tax_incl' => array('type' => self::TYPE_FLOAT, 'validate' => 'isPrice'),
|
||||||
|
'total_paid_tax_excl' => array('type' => self::TYPE_FLOAT, 'validate' => 'isPrice'),
|
||||||
|
'total_paid_real' => array('type' => self::TYPE_FLOAT, 'validate' => 'isPrice', 'required' => true),
|
||||||
|
'total_products' => array('type' => self::TYPE_FLOAT, 'validate' => 'isPrice', 'required' => true),
|
||||||
|
'total_products_wt' => array('type' => self::TYPE_FLOAT, 'validate' => 'isPrice', 'required' => true),
|
||||||
|
'total_shipping' => array('type' => self::TYPE_FLOAT, 'validate' => 'isPrice'),
|
||||||
|
'total_shipping_tax_incl' => array('type' => self::TYPE_FLOAT, 'validate' => 'isPrice'),
|
||||||
|
'total_shipping_tax_excl' => array('type' => self::TYPE_FLOAT, 'validate' => 'isPrice'),
|
||||||
|
'carrier_tax_rate' => array('type' => self::TYPE_FLOAT, 'validate' => 'isFloat'),
|
||||||
|
'total_wrapping' => array('type' => self::TYPE_FLOAT, 'validate' => 'isPrice'),
|
||||||
|
'total_wrapping_tax_incl' => array('type' => self::TYPE_FLOAT, 'validate' => 'isPrice'),
|
||||||
|
'total_wrapping_tax_excl' => array('type' => self::TYPE_FLOAT, 'validate' => 'isPrice'),
|
||||||
|
'round_mode' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
|
||||||
|
'round_type' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
|
||||||
|
'shipping_number' => array('type' => self::TYPE_STRING, 'validate' => 'isTrackingNumber'),
|
||||||
|
'conversion_rate' => array('type' => self::TYPE_FLOAT, 'validate' => 'isFloat', 'required' => true),
|
||||||
|
'invoice_number' => array('type' => self::TYPE_INT),
|
||||||
|
'delivery_number' => array('type' => self::TYPE_INT),
|
||||||
|
'invoice_date' => array('type' => self::TYPE_DATE),
|
||||||
|
'delivery_date' => array('type' => self::TYPE_DATE),
|
||||||
|
'valid' => array('type' => self::TYPE_BOOL),
|
||||||
|
'reference' => array('type' => self::TYPE_STRING),
|
||||||
|
'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
|
||||||
|
'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
|
||||||
|
'order_source' => array('type' => self::TYPE_STRING),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* module: modrefchange
|
* module: modrefchange
|
||||||
* date: 2021-01-11 06:03:11
|
* date: 2019-04-12 06:23:14
|
||||||
* version: 1.5.5.1
|
* version: 1.5.5.1
|
||||||
*/
|
*/
|
||||||
public function add($autodate = true, $null_values = true)
|
public function add($autodate = true, $null_values = true)
|
||||||
@@ -16,7 +76,7 @@ class Order extends OrderCore
|
|||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* module: modrefchange
|
* module: modrefchange
|
||||||
* date: 2021-01-11 06:03:11
|
* date: 2019-04-12 06:23:14
|
||||||
* version: 1.5.5.1
|
* version: 1.5.5.1
|
||||||
*/
|
*/
|
||||||
public static function setLastInvoiceNumber($order_invoice_id, $id_shop)
|
public static function setLastInvoiceNumber($order_invoice_id, $id_shop)
|
||||||
@@ -42,7 +102,7 @@ class Order extends OrderCore
|
|||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* module: modrefchange
|
* module: modrefchange
|
||||||
* date: 2021-01-11 06:03:11
|
* date: 2019-04-12 06:23:14
|
||||||
* version: 1.5.5.1
|
* version: 1.5.5.1
|
||||||
*/
|
*/
|
||||||
public function setDeliveryNumber($order_invoice_id, $id_shop)
|
public function setDeliveryNumber($order_invoice_id, $id_shop)
|
||||||
|
|||||||
Reference in New Issue
Block a user