Manage clients, testimonials and talks through the API

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-30 19:38:58 +02:00
parent 96747abdc3
commit b02464a7ed
15 changed files with 1255 additions and 7 deletions

View File

@@ -5,11 +5,14 @@ declare(strict_types=1);
namespace Tests\Feature\Api;
use App\Models\Category;
use App\Models\Client;
use App\Models\Member;
use App\Models\Page;
use App\Models\Project;
use App\Models\Service;
use App\Models\Talk;
use App\Models\Technology;
use App\Models\Testimonial;
use App\Models\User;
use Database\Seeders\RolePermissionSeeder;
use Illuminate\Foundation\Testing\RefreshDatabase;
@@ -33,7 +36,7 @@ use Tests\VerifiesOpenApiContract;
* test exercises behaviour, not shape.
*
* Unlike the public listings, an admin index and its matching show endpoint
* send the same full record — none of the four resources here has a
* send the same full record — none of the resources here has a
* "lightweight for a listing" projection — so both are held to the stricter
* rule throughout: everything documented and not `nullable` must be present.
*/
@@ -72,6 +75,9 @@ class AdminApiContractTest extends TestCase
'projects' => ['path' => '/v1/projects'],
'members' => ['path' => '/v1/members'],
'services' => ['path' => '/v1/services'],
'clients' => ['path' => '/v1/clients'],
'testimonials' => ['path' => '/v1/testimonials'],
'talks' => ['path' => '/v1/talks'],
];
}
@@ -84,6 +90,9 @@ class AdminApiContractTest extends TestCase
$project = Project::factory()->create();
$member = Member::factory()->create();
$service = Service::factory()->create();
$client = Client::factory()->create();
$testimonial = Testimonial::factory()->create();
$talk = Talk::factory()->create();
// One request, one documented path — the URL a real caller hits and
// the path key that describes it, side by side rather than derived
@@ -102,6 +111,12 @@ class AdminApiContractTest extends TestCase
'member' => ["/v1/members/{$member->id}", '/v1/members/{member}'],
'services' => ['/v1/services', '/v1/services'],
'service' => ["/v1/services/{$service->id}", '/v1/services/{service}'],
'clients' => ['/v1/clients', '/v1/clients'],
'client' => ["/v1/clients/{$client->id}", '/v1/clients/{client}'],
'testimonials' => ['/v1/testimonials', '/v1/testimonials'],
'testimonial' => ["/v1/testimonials/{$testimonial->id}", '/v1/testimonials/{testimonial}'],
'talks' => ['/v1/talks', '/v1/talks'],
'talk' => ["/v1/talks/{$talk->id}", '/v1/talks/{talk}'],
'users' => ['/v1/users', '/v1/users'],
'user' => ["/v1/users/{$this->caller->id}", '/v1/users/{user}'],
'me' => ['/v1/me', '/v1/me'],