refactor(tenants): remove general write endpoints

This commit is contained in:
2026-09-21 15:18:48 -03:00
parent fcb8386735
commit f4de2ff5b2
15 changed files with 40 additions and 1608 deletions

View File

@@ -2,9 +2,9 @@
namespace Tests\Feature\Tenant;
use App\Domains\Core\Tenant\Models\Tenant;
use App\Shared\Attachable\Enums\AttachmentType;
use App\Shared\Attachable\Models\Attachment;
use App\Domains\Core\Tenant\Models\Tenant;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Str;
@@ -31,41 +31,6 @@ class TenantRefundConfigurationTest extends TestCase
->assertJsonPath('data.ticket_partial_refund_percentage', '0.00');
}
public function test_refund_configuration_can_be_updated_and_validates_its_precision(): void
{
$tenant = $this->createTenant('refund-update');
$this->putJson("/api/tenants/{$tenant->codigo}", [
'allow_ticket_refund' => true,
'allow_ticket_total_refund' => true,
'allow_ticket_partial_refund' => true,
'ticket_partial_refund_percentage' => 25.50,
])
->assertOk()
->assertJsonPath('data.allow_ticket_refund', true)
->assertJsonPath('data.allow_ticket_total_refund', true)
->assertJsonPath('data.allow_ticket_partial_refund', true)
->assertJsonPath('data.ticket_partial_refund_percentage', '25.50');
$this->assertDatabaseHas('tenants', [
'id' => $tenant->id,
'allow_ticket_refund' => true,
'allow_ticket_total_refund' => true,
'allow_ticket_partial_refund' => true,
'ticket_partial_refund_percentage' => 25.50,
]);
$this->putJson("/api/tenants/{$tenant->codigo}", [
'ticket_partial_refund_percentage' => 100,
])->assertUnprocessable()
->assertJsonValidationErrors('ticket_partial_refund_percentage');
$this->putJson("/api/tenants/{$tenant->codigo}", [
'ticket_partial_refund_percentage' => 12.345,
])->assertUnprocessable()
->assertJsonValidationErrors('ticket_partial_refund_percentage');
}
public function test_tenant_allow_refund_logic(): void
{
$tenant = new Tenant([