feat(04-schema-docs): annotate ensure_* compensating migrations and update DB_SCHEMA.md
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -8,6 +8,7 @@ use App\Core\Http\Response;
|
||||
use App\Core\I18n\Translator;
|
||||
use App\Core\Security\Csrf;
|
||||
use App\Core\View\Template;
|
||||
use App\Core\Support\Flash;
|
||||
use App\Core\Support\StringHelper;
|
||||
use App\Modules\Auth\AuthService;
|
||||
use App\Modules\Shipments\ShipmentPackageRepository;
|
||||
@@ -160,9 +161,8 @@ final class OrdersController
|
||||
? $this->shipmentPackages->findByOrderId($orderId)
|
||||
: [];
|
||||
|
||||
$flashSuccess = (string) ($_SESSION['order_flash_success'] ?? '');
|
||||
$flashError = (string) ($_SESSION['order_flash_error'] ?? '');
|
||||
unset($_SESSION['order_flash_success'], $_SESSION['order_flash_error']);
|
||||
$flashSuccess = (string) Flash::get('order.success', '');
|
||||
$flashError = (string) Flash::get('order.error', '');
|
||||
|
||||
$html = $this->template->render('orders/show', [
|
||||
'title' => $this->translator->get('orders.details.title') . ' #' . $orderId,
|
||||
@@ -201,13 +201,13 @@ final class OrdersController
|
||||
|
||||
$csrfToken = (string) $request->input('_token', '');
|
||||
if (!Csrf::validate($csrfToken)) {
|
||||
$_SESSION['order_flash_error'] = $this->translator->get('auth.errors.csrf_expired');
|
||||
Flash::set('order.error', $this->translator->get('auth.errors.csrf_expired'));
|
||||
return Response::redirect('/orders/' . $orderId);
|
||||
}
|
||||
|
||||
$newStatus = trim((string) $request->input('new_status', ''));
|
||||
if ($newStatus === '') {
|
||||
$_SESSION['order_flash_error'] = $this->translator->get('orders.details.status_change.status_required');
|
||||
Flash::set('order.error', $this->translator->get('orders.details.status_change.status_required'));
|
||||
return Response::redirect('/orders/' . $orderId);
|
||||
}
|
||||
|
||||
@@ -216,9 +216,9 @@ final class OrdersController
|
||||
|
||||
$success = $this->orders->updateOrderStatus($orderId, $newStatus, 'user', $actorName !== '' ? $actorName : null);
|
||||
if ($success) {
|
||||
$_SESSION['order_flash_success'] = $this->translator->get('orders.details.status_change.success');
|
||||
Flash::set('order.success', $this->translator->get('orders.details.status_change.success'));
|
||||
} else {
|
||||
$_SESSION['order_flash_error'] = $this->translator->get('orders.details.status_change.failed');
|
||||
Flash::set('order.error', $this->translator->get('orders.details.status_change.failed'));
|
||||
}
|
||||
|
||||
return Response::redirect('/orders/' . $orderId);
|
||||
|
||||
Reference in New Issue
Block a user