ver. 0.295: Admin order product editing — add/remove/modify products, AJAX search, stock adjustment

- Order product CRUD in admin panel (add, delete, edit quantity/prices)
- AJAX product search endpoint for order edit form
- Automatic stock adjustment when editing order products
- Transport cost recalculation based on free delivery threshold
- Fix: promo price = 0 when equal to base price (no real promotion)
- Clean up stale temp/ build artifacts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-19 19:30:38 +01:00
parent 662c9f63de
commit ccff6155ce
73 changed files with 1037 additions and 9560 deletions

View File

@@ -41,6 +41,7 @@ class ShopOrderControllerTest extends TestCase
$this->assertTrue(method_exists($this->controller, 'toggle_trustmate_send'));
$this->assertTrue(method_exists($this->controller, 'delete'));
$this->assertTrue(method_exists($this->controller, 'order_delete'));
$this->assertTrue(method_exists($this->controller, 'search_products_ajax'));
}
public function testViewActionsReturnString(): void
@@ -70,6 +71,7 @@ class ShopOrderControllerTest extends TestCase
$this->assertEquals('void', (string)$reflection->getMethod('toggle_trustmate_send')->getReturnType());
$this->assertEquals('void', (string)$reflection->getMethod('delete')->getReturnType());
$this->assertEquals('void', (string)$reflection->getMethod('order_delete')->getReturnType());
$this->assertEquals('void', (string)$reflection->getMethod('search_products_ajax')->getReturnType());
}
public function testConstructorRequiresOrderAdminService(): void
@@ -78,7 +80,9 @@ class ShopOrderControllerTest extends TestCase
$constructor = $reflection->getConstructor();
$params = $constructor->getParameters();
$this->assertCount(1, $params);
$this->assertCount(2, $params);
$this->assertEquals('Domain\\Order\\OrderAdminService', $params[0]->getType()->getName());
$this->assertEquals('Domain\\Product\\ProductRepository', $params[1]->getType()->getName());
$this->assertTrue($params[1]->isOptional());
}
}