| 1 |
<?php |
| 2 |
/** |
| 3 |
* WCPOS sync read surface. |
| 4 |
* |
| 5 |
* @package WCPOS\WooCommercePOS\Sync |
| 6 |
*/ |
| 7 |
|
| 8 |
namespace WCPOS\WooCommercePOS\Sync; |
| 9 |
|
| 10 |
use RuntimeException; |
| 11 |
|
| 12 |
// phpcs:disable Squiz.Commenting, Generic.Commenting -- Ported lab documentation is preserved verbatim. |
| 13 |
|
| 14 |
/** |
| 15 |
* The uuid fail-closed contract violated: serialize_order/skeleton_for_order |
| 16 |
* always stamp _woocommerce_pos_uuid, so an empty uuid on a non-empty payload |
| 17 |
* means the write surface is broken — never emit the document. This is THE |
| 18 |
* one reaction (#424): direct builders let it fail their page/chunk (retried); |
| 19 |
* the pull planner catches it to stop the page WITHOUT advancing the checkpoint |
| 20 |
* (hasMore forces a retry from the last emitted position). |
| 21 |
*/ |
| 22 |
final class Order_Uuid_Exception extends RuntimeException { |
| 23 |
public static function for_order( int $order_id ): self { |
| 24 |
return new self( 'Order document could not resolve _woocommerce_pos_uuid for order ' . $order_id ); |
| 25 |
} |
| 26 |
} |
| 27 |
|