feat(services): partial/unpaid payment on admin create, payment history per invoice, zip attachments
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
02daefe4c2
commit
fe68171aa7
@@ -73,6 +73,19 @@ class ServiceAttachmentTest extends TestCase
|
||||
Storage::disk('public')->assertExists($copy->path);
|
||||
}
|
||||
|
||||
public function test_upload_accepts_zip_and_rejects_executables(): void
|
||||
{
|
||||
$base = "/api/v1/administrator/services/{$this->service->id}/attachments";
|
||||
$admin = $this->actingAs($this->admin, 'admin');
|
||||
|
||||
$admin->post($base, ['file' => UploadedFile::fake()->create('source.zip', 10, 'application/zip')], ['Accept' => 'application/json'])
|
||||
->assertCreated();
|
||||
$admin->post($base, ['file' => UploadedFile::fake()->create('run.exe', 10, 'application/x-msdownload')], ['Accept' => 'application/json'])
|
||||
->assertUnprocessable();
|
||||
|
||||
$this->assertDatabaseCount('service_attachments', 1);
|
||||
}
|
||||
|
||||
public function test_list_and_detail_expose_linked_order_and_invoices(): void
|
||||
{
|
||||
$admin = $this->actingAs($this->admin, 'admin');
|
||||
@@ -85,7 +98,8 @@ class ServiceAttachmentTest extends TestCase
|
||||
|
||||
$admin->getJson("/api/v1/administrator/services/{$this->service->id}")
|
||||
->assertOk()
|
||||
->assertJsonPath('data.linked_invoices.0.id', $this->invoice->id);
|
||||
->assertJsonPath('data.linked_invoices.0.id', $this->invoice->id)
|
||||
->assertJsonPath('data.linked_invoices.0.amount_paid', 0);
|
||||
}
|
||||
|
||||
public function test_rejects_unsupported_file_type(): void
|
||||
|
||||
Reference in New Issue
Block a user