ver. 0.296: REST API for ordersPRO — orders management, dictionaries, API key auth

- New API layer: ApiRouter, OrdersApiController, DictionariesApiController
- Orders API: list (with filters/pagination/updated_since), details, change status, set paid/unpaid
- Dictionaries API: order statuses, transport methods, payment methods
- X-Api-Key authentication via pp_settings.api_key
- OrderRepository: listForApi(), findForApi(), touchUpdatedAt()
- updated_at column on pp_shop_orders for polling support
- api.php: skip session for API requests, route to ApiRouter
- SettingsController: api_key field in system tab
- 30 new tests (666 total, 1930 assertions)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-19 20:25:07 +01:00
parent ccff6155ce
commit 8a633e375f
22 changed files with 1457 additions and 54 deletions

BIN
updates/0.20/ver_0.296.zip Normal file

Binary file not shown.

View File

@@ -0,0 +1,4 @@
ALTER TABLE `pp_shop_orders` ADD COLUMN `updated_at` DATETIME NULL DEFAULT NULL AFTER `date_order`;
UPDATE `pp_shop_orders` SET `updated_at` = `date_order` WHERE `updated_at` IS NULL;
CREATE INDEX `idx_pp_shop_orders_updated_at` ON `pp_shop_orders` (`updated_at`);
INSERT INTO `pp_settings` (`param`, `value`) VALUES ('api_key', '');

View File

@@ -1,3 +1,9 @@
<b>ver. 0.296 - 19.02.2026</b><br />
- NEW - REST API zamówień dla ordersPRO (lista, szczegóły, zmiana statusu, płatności)
- NEW - Endpointy słownikowe (statusy, transporty, metody płatności)
- NEW - Autentykacja API przez X-Api-Key header
- NEW - Kolumna updated_at w pp_shop_orders (polling zmian)
<hr>
<b>ver. 0.295 - 19.02.2026</b><br />
- NEW - Edycja produktów w zamówieniu z panelu admina (dodawanie, usuwanie, zmiana ilości/cen)
- NEW - Wyszukiwarka produktów AJAX w formularzu edycji zamówienia

View File

@@ -1,5 +1,5 @@
<?
$current_ver = 295;
$current_ver = 296;
for ($i = 1; $i <= $current_ver; $i++)
{