--wip-- [skip ci]

This commit is contained in:
philipp lang 2025-04-04 01:40:09 +02:00
parent 2e010aece1
commit 48881ef4ed
5 changed files with 38 additions and 3 deletions

View File

@ -121,6 +121,7 @@ class MemberRequest extends FormRequest
$namiSync = $member->isDirty(Member::$namiFields);
$member->save();
$member->bankAccount->update($this->input('bank_account'));
if ($this->input('has_nami') && null === $member->nami_id) {
$this->storeFreshMemberInNami($member);

View File

@ -1,5 +1,6 @@
<?php
use App\Member\Member;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
@ -22,6 +23,10 @@ return new class extends Migration
$table->string('account_number')->nullable();
$table->timestamps();
});
foreach (Member::get() as $member) {
$member->bankAccount()->create([]);
}
}
/**

View File

@ -92,6 +92,8 @@ services:
socketi:
image: quay.io/soketi/soketi:89604f268623cf799573178a7ba56b7491416bde-16-debian
ports:
- '6001:6001'
environment:
SOKETI_DEFAULT_APP_ID: adremaid
SOKETI_DEFAULT_APP_KEY: adremakey
@ -104,6 +106,8 @@ services:
meilisearch:
image: getmeili/meilisearch:v1.6
ports:
- '7700:7700'
volumes:
- ./data/meilisearch:/meili_data
env_file:

@ -1 +1 @@
Subproject commit f905c316ee7913cbf85c386021fbaa28b4b2a158
Subproject commit 7189511a550ecce5c9b8f6a0b31e3b4e011752a2

View File

@ -32,7 +32,7 @@ class UpdateTest extends TestCase
$response = $this
->from("/member/{$member->id}")
->patch("/member/{$member->id}", array_merge($member->getAttributes(), ['has_nami' => true]));
->patch("/member/{$member->id}", array_merge($member->getAttributes(), ['has_nami' => true, 'bank_account' => []]));
$response->assertRedirect('/member');
NamiPutMemberAction::spy()->shouldHaveReceived('handle')->withArgs(
@ -51,7 +51,7 @@ class UpdateTest extends TestCase
$response = $this
->from("/member/{$member->id}")
->patch("/member/{$member->id}", array_merge($member->getAttributes(), ['has_nami' => true, 'firstname' => '::firstname::']));
->patch("/member/{$member->id}", array_merge($member->getAttributes(), ['has_nami' => true, 'firstname' => '::firstname::', 'bank_account' => []]));
$response->assertRedirect("/member/{$member->id}/edit?conflict=1");
}
@ -64,6 +64,7 @@ class UpdateTest extends TestCase
NamiPutMemberAction::allowToRun();
$this->patch("/member/{$member->id}", array_merge($member->getAttributes(), [
'bank_account' => [],
'main_phone' => '02103 4455129',
'fax' => '02103 4455130',
'children_phone' => '02103 4455130',
@ -77,6 +78,25 @@ class UpdateTest extends TestCase
]);
}
public function testItUpdatesKontoverbindung(): void
{
$this->withoutExceptionHandling()->login()->loginNami();
$member = $this->member();
$this->fakeRequest();
NamiPutMemberAction::allowToRun();
$this->patch("/member/{$member->id}", array_merge($member->getAttributes(), [
'bank_account' => ['iban' => 'SSS', 'bic' => 'AAA'],
'has_nami' => true,
]));
$this->assertDatabaseHas('bank_accounts', [
'member_id' => $member->id,
'iban' => 'SSS',
'bic' => 'AAA',
]);
}
public function testItUpdatesWiederverwendenFlag(): void
{
$this->withoutExceptionHandling()->login()->loginNami();
@ -85,6 +105,7 @@ class UpdateTest extends TestCase
NamiPutMemberAction::allowToRun();
$this->patch("/member/{$member->id}", array_merge($member->getAttributes(), [
'bank_account' => [],
'keepdata' => true,
'has_nami' => true,
]));
@ -102,6 +123,7 @@ class UpdateTest extends TestCase
NamiPutMemberAction::allowToRun();
$this->patch("/member/{$member->id}", array_merge($member->getAttributes(), [
'bank_account' => [],
'location' => null,
]));
@ -119,6 +141,7 @@ class UpdateTest extends TestCase
$response = $this
->from("/member/{$member->id}")
->patch("/member/{$member->id}", array_merge($member->getAttributes(), [
'bank_account' => [],
'other_country' => 'englisch',
]));
@ -138,6 +161,7 @@ class UpdateTest extends TestCase
$this->patch("/member/{$member->id}", [
...$member->getAttributes(),
'bank_account' => [],
'has_nami' => true,
'first_activity_id' => $activity->id,
'first_subactivity_id' => $subactivity->id,
@ -178,6 +202,7 @@ class UpdateTest extends TestCase
$response = $this
->from("/member/{$member->id}")
->patch("/member/{$member->id}", array_merge($member->getAttributes(), [
'bank_account' => [],
'ps_at' => '2021-02-01',
'more_ps_at' => '2021-02-02',
'has_svk' => true,