feat(tenant): add checkout editing policy

This commit is contained in:
2026-08-20 10:56:13 -03:00
parent 2de02dfd31
commit d36a929f8c
12 changed files with 89 additions and 3 deletions

View File

@@ -74,6 +74,7 @@ class BootstrapTenantControllerTest extends TestCase
'display_seach_bar' => false,
'display_cart' => false,
'cart_editing_policy' => 'disabled',
'checkout_editing_policy' => 'quantity_and_remove',
'display_cart_item_images' => false,
]);
@@ -96,6 +97,11 @@ class BootstrapTenantControllerTest extends TestCase
->assertJsonPath('data.cart_editing_policy.allow_delete', false)
->assertJsonPath('data.cart_editing_policy.allow_update_quantity', false)
->assertJsonPath('data.cart_editing_policy.allow_update_variant', false)
->assertJsonPath('data.checkout_editing_policy.code', 'quantity_and_remove')
->assertJsonPath('data.checkout_editing_policy.allow_modify', true)
->assertJsonPath('data.checkout_editing_policy.allow_delete', true)
->assertJsonPath('data.checkout_editing_policy.allow_update_quantity', true)
->assertJsonPath('data.checkout_editing_policy.allow_update_variant', false)
->assertJsonPath('data.display_cart_item_images', false)
->assertJsonPath('data.header_bg_color', '#ffffff')->assertJsonPath('data.footer_bg_color', '#ffffff');
@@ -763,6 +769,7 @@ class BootstrapTenantControllerTest extends TestCase
$response = $this->putJson("/api/tenants/{$tenant->codigo}", [
'primary_color' => '#000000',
'cart_editing_policy' => 'quantity_and_remove',
'checkout_editing_policy' => 'disabled',
'display_cart_item_images' => false,
]);
@@ -776,6 +783,8 @@ class BootstrapTenantControllerTest extends TestCase
->assertJsonPath('data.cart_editing_policy.allow_delete', true)
->assertJsonPath('data.cart_editing_policy.allow_update_quantity', true)
->assertJsonPath('data.cart_editing_policy.allow_update_variant', false)
->assertJsonPath('data.checkout_editing_policy.code', 'disabled')
->assertJsonPath('data.checkout_editing_policy.allow_modify', false)
->assertJsonPath('data.display_cart_item_images', false);
$this->assertDatabaseHas('tenants', [
@@ -784,6 +793,7 @@ class BootstrapTenantControllerTest extends TestCase
'nombre' => 'Acme',
'primary_color' => '#000000',
'cart_editing_policy' => 'quantity_and_remove',
'checkout_editing_policy' => 'disabled',
'display_cart_item_images' => false,
]);
}