feat(catalog): model availability as global decisions

This commit is contained in:
2026-08-25 09:03:04 -03:00
parent d9635d47ba
commit 98bfc0d5e9
13 changed files with 220 additions and 149 deletions

View File

@@ -2,37 +2,32 @@
return [
'stock_reservation_expiration_minutes' => (int) env('STOCK_RESERVATION_EXPIRATION_MINUTES', 30),
'availability_policies' => [
'user_quota_reached' => [
'product' => [
'display' => true,
'select_variant' => false,
'change_quantity' => false,
'add_to_cart' => false,
'buy_now' => false,
],
'variant' => [
'display' => true,
'select_variant' => false,
'change_quantity' => false,
'add_to_cart' => false,
'buy_now' => false,
],
'availability' => [
'default_actions' => [
'select_variant',
'change_quantity',
'add_to_cart',
'buy_now',
],
'out_of_stock' => [
'product' => [
'display' => false,
'select_variant' => false,
'change_quantity' => false,
'add_to_cart' => false,
'buy_now' => false,
'rules' => [
'user_quota_reached' => [
'effect' => 'restrict',
'denied_actions' => [
'select_variant',
'change_quantity',
'add_to_cart',
'buy_now',
],
],
'variant' => [
'display' => false,
'select_variant' => false,
'change_quantity' => false,
'add_to_cart' => false,
'buy_now' => false,
'out_of_stock' => [
'effect' => 'hide',
],
'requested_quantity_exceeds_user_quota' => [
'effect' => 'restrict',
'denied_actions' => [
'add_to_cart',
'buy_now',
],
],
],
],