Compare commits
3 Commits
37c9021e76
...
48881ef4ed
Author | SHA1 | Date |
---|---|---|
|
48881ef4ed | |
|
2e010aece1 | |
|
793f916581 |
|
@ -84,6 +84,9 @@ class MemberRequest extends FormRequest
|
||||||
'salutation' => '',
|
'salutation' => '',
|
||||||
'comment' => '',
|
'comment' => '',
|
||||||
'keepdata' => 'boolean',
|
'keepdata' => 'boolean',
|
||||||
|
'bank_account' => 'array|exclude',
|
||||||
|
'bank_account.iban' => 'nullable|string|max:255',
|
||||||
|
'bank_account.bic' => 'nullable|string|max:255',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -94,6 +97,7 @@ class MemberRequest extends FormRequest
|
||||||
'group_id' => Group::where('nami_id', $settings->default_group_id)->firstOrFail()->id,
|
'group_id' => Group::where('nami_id', $settings->default_group_id)->firstOrFail()->id,
|
||||||
]);
|
]);
|
||||||
$member->updatePhoneNumbers()->save();
|
$member->updatePhoneNumbers()->save();
|
||||||
|
$member->bankAccount->update($this->input('bank_account'));
|
||||||
|
|
||||||
if ($this->input('has_nami')) {
|
if ($this->input('has_nami')) {
|
||||||
$this->storeFreshMemberInNami($member);
|
$this->storeFreshMemberInNami($member);
|
||||||
|
@ -117,6 +121,7 @@ class MemberRequest extends FormRequest
|
||||||
$namiSync = $member->isDirty(Member::$namiFields);
|
$namiSync = $member->isDirty(Member::$namiFields);
|
||||||
|
|
||||||
$member->save();
|
$member->save();
|
||||||
|
$member->bankAccount->update($this->input('bank_account'));
|
||||||
|
|
||||||
if ($this->input('has_nami') && null === $member->nami_id) {
|
if ($this->input('has_nami') && null === $member->nami_id) {
|
||||||
$this->storeFreshMemberInNami($member);
|
$this->storeFreshMemberInNami($member);
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use App\Member\Member;
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
use Illuminate\Support\Facades\Schema;
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
@ -22,6 +23,10 @@ return new class extends Migration
|
||||||
$table->string('account_number')->nullable();
|
$table->string('account_number')->nullable();
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
foreach (Member::get() as $member) {
|
||||||
|
$member->bankAccount()->create([]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -92,6 +92,8 @@ services:
|
||||||
|
|
||||||
socketi:
|
socketi:
|
||||||
image: quay.io/soketi/soketi:89604f268623cf799573178a7ba56b7491416bde-16-debian
|
image: quay.io/soketi/soketi:89604f268623cf799573178a7ba56b7491416bde-16-debian
|
||||||
|
ports:
|
||||||
|
- '6001:6001'
|
||||||
environment:
|
environment:
|
||||||
SOKETI_DEFAULT_APP_ID: adremaid
|
SOKETI_DEFAULT_APP_ID: adremaid
|
||||||
SOKETI_DEFAULT_APP_KEY: adremakey
|
SOKETI_DEFAULT_APP_KEY: adremakey
|
||||||
|
@ -104,6 +106,8 @@ services:
|
||||||
|
|
||||||
meilisearch:
|
meilisearch:
|
||||||
image: getmeili/meilisearch:v1.6
|
image: getmeili/meilisearch:v1.6
|
||||||
|
ports:
|
||||||
|
- '7700:7700'
|
||||||
volumes:
|
volumes:
|
||||||
- ./data/meilisearch:/meili_data
|
- ./data/meilisearch:/meili_data
|
||||||
env_file:
|
env_file:
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit f905c316ee7913cbf85c386021fbaa28b4b2a158
|
Subproject commit 7189511a550ecce5c9b8f6a0b31e3b4e011752a2
|
|
@ -17,16 +17,19 @@ use App\Region;
|
||||||
use App\Subactivity;
|
use App\Subactivity;
|
||||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||||
use Tests\Lib\MergesAttributes;
|
use Tests\Lib\MergesAttributes;
|
||||||
|
use Tests\RequestFactories\MemberStoreRequestFactory;
|
||||||
use Tests\TestCase;
|
use Tests\TestCase;
|
||||||
use Zoomyboy\LaravelNami\Fakes\MemberFake;
|
use Zoomyboy\LaravelNami\Fakes\MemberFake;
|
||||||
|
|
||||||
class StoreTest extends TestCase
|
uses(DatabaseTransactions::class);
|
||||||
{
|
|
||||||
use DatabaseTransactions;
|
|
||||||
use MergesAttributes;
|
|
||||||
|
|
||||||
public function testItCanStoreAMember(): void
|
beforeEach(function () {
|
||||||
{
|
Confession::factory()->create(['is_null' => true]);
|
||||||
|
PullMemberAction::shouldRun();
|
||||||
|
PullMembershipsAction::shouldRun();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('can store a member', function () {
|
||||||
app(MemberFake::class)->stores(55, 103);
|
app(MemberFake::class)->stores(55, 103);
|
||||||
Fee::factory()->create();
|
Fee::factory()->create();
|
||||||
$this->withoutExceptionHandling()->login()->loginNami();
|
$this->withoutExceptionHandling()->login()->loginNami();
|
||||||
|
@ -37,13 +40,10 @@ class StoreTest extends TestCase
|
||||||
$activity = Activity::factory()->inNami(89)->create();
|
$activity = Activity::factory()->inNami(89)->create();
|
||||||
$subactivity = Subactivity::factory()->inNami(90)->create();
|
$subactivity = Subactivity::factory()->inNami(90)->create();
|
||||||
$subscription = Subscription::factory()->forFee()->create();
|
$subscription = Subscription::factory()->forFee()->create();
|
||||||
$confesstion = Confession::factory()->create(['is_null' => true]);
|
|
||||||
PullMemberAction::shouldRun();
|
|
||||||
PullMembershipsAction::shouldRun();
|
|
||||||
|
|
||||||
$response = $this
|
$response = $this
|
||||||
->from('/member/create')
|
->from('/member/create')
|
||||||
->post('/member', $this->attributes([
|
->post('/member', MemberStoreRequestFactory::new()->create([
|
||||||
'country_id' => $country->id,
|
'country_id' => $country->id,
|
||||||
'gender_id' => $gender->id,
|
'gender_id' => $gender->id,
|
||||||
'region_id' => $region->id,
|
'region_id' => $region->id,
|
||||||
|
@ -57,7 +57,6 @@ class StoreTest extends TestCase
|
||||||
]))->assertSessionHasNoErrors();
|
]))->assertSessionHasNoErrors();
|
||||||
|
|
||||||
$response->assertRedirect('/member')->assertSessionHasNoErrors();
|
$response->assertRedirect('/member')->assertSessionHasNoErrors();
|
||||||
$member = Member::firstWhere('firstname', 'Joe');
|
|
||||||
$this->assertDatabaseHas('members', [
|
$this->assertDatabaseHas('members', [
|
||||||
'address' => 'Bavert 50',
|
'address' => 'Bavert 50',
|
||||||
'bill_kind' => 'Post',
|
'bill_kind' => 'Post',
|
||||||
|
@ -87,23 +86,41 @@ class StoreTest extends TestCase
|
||||||
'ersteTaetigkeitId' => 89,
|
'ersteTaetigkeitId' => 89,
|
||||||
'ersteUntergliederungId' => 90,
|
'ersteUntergliederungId' => 90,
|
||||||
]);
|
]);
|
||||||
}
|
});
|
||||||
|
|
||||||
public function testItStoresWiederverwendenFlag(): void
|
it('can store iban and bic', function () {
|
||||||
{
|
app(MemberFake::class)->stores(55, 103);
|
||||||
|
Fee::factory()->create();
|
||||||
|
$this->withoutExceptionHandling()->login()->loginNami();
|
||||||
|
|
||||||
|
$this->post('/member', MemberStoreRequestFactory::new()->create([
|
||||||
|
'bank_account.iban' => '666',
|
||||||
|
'bank_account.bic' => 'SOLSDE',
|
||||||
|
]))->assertSessionHasNoErrors();
|
||||||
|
|
||||||
|
$this->assertDatabaseHas('bank_accounts', [
|
||||||
|
'iban' => '666',
|
||||||
|
'bic' => 'SOLSDE',
|
||||||
|
'member_id' => Member::first()->id,
|
||||||
|
]);
|
||||||
|
|
||||||
|
app(MemberFake::class)->assertStored(55, function ($payload) {
|
||||||
|
$bank = json_decode($payload['kontoverbindung'], true);
|
||||||
|
return $bank['iban'] === '666' && $bank['bic'] === 'SOLSDE';
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('testItStoresWiederverwendenFlag', function () {
|
||||||
app(MemberFake::class)->stores(55, 103);
|
app(MemberFake::class)->stores(55, 103);
|
||||||
Fee::factory()->create();
|
Fee::factory()->create();
|
||||||
$this->withoutExceptionHandling()->login()->loginNami();
|
$this->withoutExceptionHandling()->login()->loginNami();
|
||||||
$activity = Activity::factory()->inNami(89)->create();
|
$activity = Activity::factory()->inNami(89)->create();
|
||||||
$subactivity = Subactivity::factory()->inNami(90)->create();
|
$subactivity = Subactivity::factory()->inNami(90)->create();
|
||||||
$subscription = Subscription::factory()->forFee()->create();
|
$subscription = Subscription::factory()->forFee()->create();
|
||||||
$confesstion = Confession::factory()->create(['is_null' => true]);
|
|
||||||
PullMemberAction::shouldRun();
|
|
||||||
PullMembershipsAction::shouldRun();
|
|
||||||
|
|
||||||
$this
|
$this
|
||||||
->from('/member/create')
|
->from('/member/create')
|
||||||
->post('/member', $this->attributes([
|
->post('/member', MemberStoreRequestFactory::new()->create([
|
||||||
'first_activity_id' => $activity->id,
|
'first_activity_id' => $activity->id,
|
||||||
'first_subactivity_id' => $subactivity->id,
|
'first_subactivity_id' => $subactivity->id,
|
||||||
'subscription_id' => $subscription->id,
|
'subscription_id' => $subscription->id,
|
||||||
|
@ -116,17 +133,16 @@ class StoreTest extends TestCase
|
||||||
app(MemberFake::class)->assertStored(55, [
|
app(MemberFake::class)->assertStored(55, [
|
||||||
'wiederverwendenFlag' => true,
|
'wiederverwendenFlag' => true,
|
||||||
]);
|
]);
|
||||||
}
|
});
|
||||||
|
|
||||||
public function testItCanStoreAMemberWithoutNami(): void
|
it('testItCanStoreAMemberWithoutNami', function () {
|
||||||
{
|
|
||||||
$this->withoutExceptionHandling()->login()->loginNami();
|
$this->withoutExceptionHandling()->login()->loginNami();
|
||||||
$activity = Activity::factory()->create();
|
$activity = Activity::factory()->create();
|
||||||
$subactivity = Subactivity::factory()->create();
|
$subactivity = Subactivity::factory()->create();
|
||||||
|
|
||||||
$response = $this
|
$response = $this
|
||||||
->from('/member/create')
|
->from('/member/create')
|
||||||
->post('/member', $this->attributes([
|
->post('/member', MemberStoreRequestFactory::new()->create([
|
||||||
'first_activity_id' => $activity->id,
|
'first_activity_id' => $activity->id,
|
||||||
'first_subactivity_id' => $subactivity->id,
|
'first_subactivity_id' => $subactivity->id,
|
||||||
'has_nami' => false,
|
'has_nami' => false,
|
||||||
|
@ -137,13 +153,12 @@ class StoreTest extends TestCase
|
||||||
'nami_id' => null,
|
'nami_id' => null,
|
||||||
]);
|
]);
|
||||||
NamiPutMemberAction::spy()->shouldNotHaveReceived('handle');
|
NamiPutMemberAction::spy()->shouldNotHaveReceived('handle');
|
||||||
}
|
});
|
||||||
|
|
||||||
public function testItUpdatesPhoneNumber(): void
|
it('testItUpdatesPhoneNumber', function () {
|
||||||
{
|
|
||||||
$this->withoutExceptionHandling()->login()->loginNami();
|
$this->withoutExceptionHandling()->login()->loginNami();
|
||||||
|
|
||||||
$this->post('/member', $this->attributes([
|
$this->post('/member', MemberStoreRequestFactory::new()->create([
|
||||||
'has_nami' => false,
|
'has_nami' => false,
|
||||||
'main_phone' => '02103 4455129',
|
'main_phone' => '02103 4455129',
|
||||||
'fax' => '02103 4455130',
|
'fax' => '02103 4455130',
|
||||||
|
@ -155,13 +170,12 @@ class StoreTest extends TestCase
|
||||||
'fax' => '+49 2103 4455130',
|
'fax' => '+49 2103 4455130',
|
||||||
'children_phone' => '+49 2103 4455130',
|
'children_phone' => '+49 2103 4455130',
|
||||||
]);
|
]);
|
||||||
}
|
});
|
||||||
|
|
||||||
public function testItHasErrorWhenPhoneNumberIsInvalid(): void
|
it('testItHasErrorWhenPhoneNumberIsInvalid', function () {
|
||||||
{
|
|
||||||
$this->login()->loginNami();
|
$this->login()->loginNami();
|
||||||
|
|
||||||
$response = $this->post('/member', $this->attributes([
|
$response = $this->post('/member', MemberStoreRequestFactory::new()->create([
|
||||||
'has_nami' => false,
|
'has_nami' => false,
|
||||||
'main_phone' => '1111111111111111',
|
'main_phone' => '1111111111111111',
|
||||||
'mobile_phone' => '1111111111111111',
|
'mobile_phone' => '1111111111111111',
|
||||||
|
@ -175,14 +189,13 @@ class StoreTest extends TestCase
|
||||||
'children_phone' => 'Telefon (Kind) ist keine valide Nummer.',
|
'children_phone' => 'Telefon (Kind) ist keine valide Nummer.',
|
||||||
'fax' => 'Fax ist keine valide Nummer.',
|
'fax' => 'Fax ist keine valide Nummer.',
|
||||||
]);
|
]);
|
||||||
}
|
});
|
||||||
|
|
||||||
public function testItDoesntRequireBirthdayWhenNotInNami(): void
|
it('testItDoesntRequireBirthdayWhenNotInNami', function () {
|
||||||
{
|
|
||||||
$this->login()->loginNami();
|
$this->login()->loginNami();
|
||||||
|
|
||||||
$this
|
$this
|
||||||
->post('/member', $this->attributes([
|
->post('/member', MemberStoreRequestFactory::new()->create([
|
||||||
'nationality_id' => null,
|
'nationality_id' => null,
|
||||||
'birthday' => null,
|
'birthday' => null,
|
||||||
'has_nami' => false,
|
'has_nami' => false,
|
||||||
|
@ -199,28 +212,26 @@ class StoreTest extends TestCase
|
||||||
'location' => null,
|
'location' => null,
|
||||||
'joined_at' => null,
|
'joined_at' => null,
|
||||||
]);
|
]);
|
||||||
}
|
});
|
||||||
|
|
||||||
public function testItDoesntNeedSubscription(): void
|
it('testItDoesntNeedSubscription', function () {
|
||||||
{
|
|
||||||
$this->login()->loginNami();
|
$this->login()->loginNami();
|
||||||
|
|
||||||
$this
|
$this
|
||||||
->post('/member', $this->attributes([
|
->post('/member', MemberStoreRequestFactory::new()->create([
|
||||||
'has_nami' => false,
|
'has_nami' => false,
|
||||||
'subscription_id' => null,
|
'subscription_id' => null,
|
||||||
]))->assertSessionDoesntHaveErrors();
|
]))->assertSessionDoesntHaveErrors();
|
||||||
$this->assertDatabaseHas('members', [
|
$this->assertDatabaseHas('members', [
|
||||||
'subscription_id' => null,
|
'subscription_id' => null,
|
||||||
]);
|
]);
|
||||||
}
|
});
|
||||||
|
|
||||||
public function testItRequiresFields(): void
|
it('testItRequiresFields', function () {
|
||||||
{
|
|
||||||
$this->login()->loginNami();
|
$this->login()->loginNami();
|
||||||
|
|
||||||
$this
|
$this
|
||||||
->post('/member', $this->attributes([
|
->post('/member', MemberStoreRequestFactory::new()->create([
|
||||||
'nationality_id' => null,
|
'nationality_id' => null,
|
||||||
'birthday' => '',
|
'birthday' => '',
|
||||||
'address' => '',
|
'address' => '',
|
||||||
|
@ -229,65 +240,19 @@ class StoreTest extends TestCase
|
||||||
'joined_at' => '',
|
'joined_at' => '',
|
||||||
]))
|
]))
|
||||||
->assertSessionHasErrors(['nationality_id', 'birthday', 'address', 'zip', 'location', 'joined_at']);
|
->assertSessionHasErrors(['nationality_id', 'birthday', 'address', 'zip', 'location', 'joined_at']);
|
||||||
}
|
});
|
||||||
|
|
||||||
public function testSubscriptionIsRequiredIfFirstActivityIsPaid(): void
|
it('testSubscriptionIsRequiredIfFirstActivityIsPaid', function () {
|
||||||
{
|
|
||||||
$this->login()->loginNami();
|
$this->login()->loginNami();
|
||||||
$activity = Activity::factory()->name('€ Mitglied')->create();
|
$activity = Activity::factory()->name('€ Mitglied')->create();
|
||||||
$subactivity = Subactivity::factory()->create();
|
$subactivity = Subactivity::factory()->create();
|
||||||
|
|
||||||
$this
|
$this
|
||||||
->from('/member/create')
|
->from('/member/create')
|
||||||
->post('/member', $this->attributes([
|
->post('/member', MemberStoreRequestFactory::new()->create([
|
||||||
'first_activity_id' => $activity->id,
|
'first_activity_id' => $activity->id,
|
||||||
'first_subactivity_id' => $subactivity->id,
|
'first_subactivity_id' => $subactivity->id,
|
||||||
'subscription_id' => null,
|
'subscription_id' => null,
|
||||||
]))
|
]))
|
||||||
->assertSessionHasErrors(['subscription_id' => 'Beitragsart ist erforderlich.']);
|
->assertSessionHasErrors(['subscription_id' => 'Beitragsart ist erforderlich.']);
|
||||||
}
|
});
|
||||||
|
|
||||||
/**
|
|
||||||
* @return array<string, mixed>
|
|
||||||
*/
|
|
||||||
public function defaults(): array
|
|
||||||
{
|
|
||||||
$country = Country::factory()->create();
|
|
||||||
$nationality = Nationality::factory()->create();
|
|
||||||
$subscription = Subscription::factory()->forFee()->create();
|
|
||||||
|
|
||||||
return [
|
|
||||||
'address' => 'Bavert 50',
|
|
||||||
'birthday' => '2013-02-19',
|
|
||||||
'children_phone' => '+49 176 70512778',
|
|
||||||
'efz' => '',
|
|
||||||
'email' => '',
|
|
||||||
'email_parents' => 'osloot@aol.com',
|
|
||||||
'fax' => '+49 212 4732223',
|
|
||||||
'firstname' => 'Joe',
|
|
||||||
'further_address' => '',
|
|
||||||
'has_nami' => true,
|
|
||||||
'has_svk' => false,
|
|
||||||
'has_vk' => false,
|
|
||||||
'joined_at' => '2022-08-12',
|
|
||||||
'lastname' => 'Muster',
|
|
||||||
'letter_address' => '',
|
|
||||||
'location' => 'Solingen',
|
|
||||||
'main_phone' => '+49 212 337056',
|
|
||||||
'mobile_phone' => '+49 176 70512774',
|
|
||||||
'more_ps_at' => '',
|
|
||||||
'multiply_more_pv' => false,
|
|
||||||
'multiply_pv' => false,
|
|
||||||
'other_country' => '',
|
|
||||||
'ps_at' => '',
|
|
||||||
'send_newspaper' => true,
|
|
||||||
'without_education_at' => '',
|
|
||||||
'without_efz_at' => '',
|
|
||||||
'work_phone' => '',
|
|
||||||
'zip' => '42719',
|
|
||||||
'country_id' => $country->id,
|
|
||||||
'nationality_id' => $nationality->id,
|
|
||||||
'subscription_id' => $subscription->id,
|
|
||||||
];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ class UpdateTest extends TestCase
|
||||||
|
|
||||||
$response = $this
|
$response = $this
|
||||||
->from("/member/{$member->id}")
|
->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');
|
$response->assertRedirect('/member');
|
||||||
NamiPutMemberAction::spy()->shouldHaveReceived('handle')->withArgs(
|
NamiPutMemberAction::spy()->shouldHaveReceived('handle')->withArgs(
|
||||||
|
@ -51,7 +51,7 @@ class UpdateTest extends TestCase
|
||||||
|
|
||||||
$response = $this
|
$response = $this
|
||||||
->from("/member/{$member->id}")
|
->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");
|
$response->assertRedirect("/member/{$member->id}/edit?conflict=1");
|
||||||
}
|
}
|
||||||
|
@ -64,6 +64,7 @@ class UpdateTest extends TestCase
|
||||||
NamiPutMemberAction::allowToRun();
|
NamiPutMemberAction::allowToRun();
|
||||||
|
|
||||||
$this->patch("/member/{$member->id}", array_merge($member->getAttributes(), [
|
$this->patch("/member/{$member->id}", array_merge($member->getAttributes(), [
|
||||||
|
'bank_account' => [],
|
||||||
'main_phone' => '02103 4455129',
|
'main_phone' => '02103 4455129',
|
||||||
'fax' => '02103 4455130',
|
'fax' => '02103 4455130',
|
||||||
'children_phone' => '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
|
public function testItUpdatesWiederverwendenFlag(): void
|
||||||
{
|
{
|
||||||
$this->withoutExceptionHandling()->login()->loginNami();
|
$this->withoutExceptionHandling()->login()->loginNami();
|
||||||
|
@ -85,6 +105,7 @@ class UpdateTest extends TestCase
|
||||||
NamiPutMemberAction::allowToRun();
|
NamiPutMemberAction::allowToRun();
|
||||||
|
|
||||||
$this->patch("/member/{$member->id}", array_merge($member->getAttributes(), [
|
$this->patch("/member/{$member->id}", array_merge($member->getAttributes(), [
|
||||||
|
'bank_account' => [],
|
||||||
'keepdata' => true,
|
'keepdata' => true,
|
||||||
'has_nami' => true,
|
'has_nami' => true,
|
||||||
]));
|
]));
|
||||||
|
@ -102,6 +123,7 @@ class UpdateTest extends TestCase
|
||||||
NamiPutMemberAction::allowToRun();
|
NamiPutMemberAction::allowToRun();
|
||||||
|
|
||||||
$this->patch("/member/{$member->id}", array_merge($member->getAttributes(), [
|
$this->patch("/member/{$member->id}", array_merge($member->getAttributes(), [
|
||||||
|
'bank_account' => [],
|
||||||
'location' => null,
|
'location' => null,
|
||||||
]));
|
]));
|
||||||
|
|
||||||
|
@ -119,6 +141,7 @@ class UpdateTest extends TestCase
|
||||||
$response = $this
|
$response = $this
|
||||||
->from("/member/{$member->id}")
|
->from("/member/{$member->id}")
|
||||||
->patch("/member/{$member->id}", array_merge($member->getAttributes(), [
|
->patch("/member/{$member->id}", array_merge($member->getAttributes(), [
|
||||||
|
'bank_account' => [],
|
||||||
'other_country' => 'englisch',
|
'other_country' => 'englisch',
|
||||||
]));
|
]));
|
||||||
|
|
||||||
|
@ -138,6 +161,7 @@ class UpdateTest extends TestCase
|
||||||
|
|
||||||
$this->patch("/member/{$member->id}", [
|
$this->patch("/member/{$member->id}", [
|
||||||
...$member->getAttributes(),
|
...$member->getAttributes(),
|
||||||
|
'bank_account' => [],
|
||||||
'has_nami' => true,
|
'has_nami' => true,
|
||||||
'first_activity_id' => $activity->id,
|
'first_activity_id' => $activity->id,
|
||||||
'first_subactivity_id' => $subactivity->id,
|
'first_subactivity_id' => $subactivity->id,
|
||||||
|
@ -178,6 +202,7 @@ class UpdateTest extends TestCase
|
||||||
$response = $this
|
$response = $this
|
||||||
->from("/member/{$member->id}")
|
->from("/member/{$member->id}")
|
||||||
->patch("/member/{$member->id}", array_merge($member->getAttributes(), [
|
->patch("/member/{$member->id}", array_merge($member->getAttributes(), [
|
||||||
|
'bank_account' => [],
|
||||||
'ps_at' => '2021-02-01',
|
'ps_at' => '2021-02-01',
|
||||||
'more_ps_at' => '2021-02-02',
|
'more_ps_at' => '2021-02-02',
|
||||||
'has_svk' => true,
|
'has_svk' => true,
|
||||||
|
|
|
@ -0,0 +1,62 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\RequestFactories;
|
||||||
|
|
||||||
|
use App\Activity;
|
||||||
|
use App\Country;
|
||||||
|
use App\Nationality;
|
||||||
|
use App\Payment\Subscription;
|
||||||
|
use App\Subactivity;
|
||||||
|
use Worksome\RequestFactories\RequestFactory;
|
||||||
|
|
||||||
|
class MemberStoreRequestFactory extends RequestFactory
|
||||||
|
{
|
||||||
|
public function definition(): array
|
||||||
|
{
|
||||||
|
$country = Country::factory()->create();
|
||||||
|
$nationality = Nationality::factory()->create();
|
||||||
|
$subscription = Subscription::factory()->forFee()->create();
|
||||||
|
$activity = Activity::factory()->inNami(89)->create();
|
||||||
|
$subactivity = Subactivity::factory()->inNami(90)->create();
|
||||||
|
|
||||||
|
return [
|
||||||
|
'bank_account' => [
|
||||||
|
'iban' => '',
|
||||||
|
'bic' => '',
|
||||||
|
],
|
||||||
|
'address' => 'Bavert 50',
|
||||||
|
'birthday' => '2013-02-19',
|
||||||
|
'children_phone' => '+49 176 70512778',
|
||||||
|
'efz' => '',
|
||||||
|
'email' => '',
|
||||||
|
'email_parents' => 'osloot@aol.com',
|
||||||
|
'fax' => '+49 212 4732223',
|
||||||
|
'firstname' => 'Joe',
|
||||||
|
'further_address' => '',
|
||||||
|
'has_nami' => true,
|
||||||
|
'has_svk' => false,
|
||||||
|
'has_vk' => false,
|
||||||
|
'joined_at' => '2022-08-12',
|
||||||
|
'lastname' => 'Muster',
|
||||||
|
'letter_address' => '',
|
||||||
|
'location' => 'Solingen',
|
||||||
|
'main_phone' => '+49 212 337056',
|
||||||
|
'mobile_phone' => '+49 176 70512774',
|
||||||
|
'more_ps_at' => '',
|
||||||
|
'multiply_more_pv' => false,
|
||||||
|
'multiply_pv' => false,
|
||||||
|
'other_country' => '',
|
||||||
|
'ps_at' => '',
|
||||||
|
'send_newspaper' => true,
|
||||||
|
'without_education_at' => '',
|
||||||
|
'without_efz_at' => '',
|
||||||
|
'work_phone' => '',
|
||||||
|
'zip' => '42719',
|
||||||
|
'country_id' => $country->id,
|
||||||
|
'nationality_id' => $nationality->id,
|
||||||
|
'subscription_id' => $subscription->id,
|
||||||
|
'first_activity_id' => $activity->id,
|
||||||
|
'first_subactivity_id' => $subactivity->id,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue