- Added 'cart_editing_enabled' attribute to Tenant model with default value true. - Updated StoreTenantRequest and UpdateTenantRequest to include validation for 'cart_editing_enabled'. - Modified TenantResource to expose 'cart_editing_enabled' in API responses. - Created migration to add 'cart_editing_enabled' column to tenants table, defaulting to true, and set to false for specific tenant. - Updated DesfilePuraTendenciaSeeder to set 'cart_editing_enabled' to false for the desfile tenant. - Enhanced Postman collection generation script to include 'cart_editing_enabled' in tenant creation and update requests. - Added tests to verify the correct behavior of 'cart_editing_enabled' during migrations and tenant provisioning.
39 lines
1.0 KiB
PHP
39 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace Tests\Feature\Migrations;
|
|
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
use Illuminate\Support\Facades\DB;
|
|
use Tests\TestCase;
|
|
|
|
class AddCartEditingEnabledToTenantsTest extends TestCase
|
|
{
|
|
use RefreshDatabase;
|
|
|
|
public function test_it_disables_cart_editing_only_for_desfile(): void
|
|
{
|
|
$migration = require database_path(
|
|
'migrations/2026_08_18_060000_add_cart_editing_enabled_to_tenants_table.php'
|
|
);
|
|
|
|
$migration->down();
|
|
$migration->up();
|
|
|
|
$this->assertDatabaseHas('tenants', [
|
|
'codigo' => 'desfile_pura_tendencia',
|
|
'cart_editing_enabled' => false,
|
|
]);
|
|
|
|
DB::table('tenants')->insert([
|
|
'codigo' => 'cart-editing-default',
|
|
'nombre' => 'Cart editing default',
|
|
'dominio' => 'cart-editing-default.test',
|
|
]);
|
|
|
|
$this->assertDatabaseHas('tenants', [
|
|
'codigo' => 'cart-editing-default',
|
|
'cart_editing_enabled' => true,
|
|
]);
|
|
}
|
|
}
|