Compare commits
62 Commits
2ded545a94
...
cc934b1b3c
Author | SHA1 | Date |
---|---|---|
philipp lang | cc934b1b3c | |
philipp lang | 1c92e1a2e2 | |
philipp lang | 6827358307 | |
philipp lang | b01bc5d1f1 | |
philipp lang | 04bfb85293 | |
philipp lang | de6cb31a79 | |
philipp lang | 39edad55ca | |
philipp lang | 4a3a80c101 | |
philipp lang | 0b54bbaf30 | |
philipp lang | 7ed31f111f | |
philipp lang | 1be3e0393a | |
philipp lang | 13cc02afd0 | |
philipp lang | 7b6daa47eb | |
philipp lang | 4ecbff4cf1 | |
philipp lang | 0da1e1ca42 | |
philipp lang | dc15bda5c7 | |
philipp lang | 836a38390f | |
philipp lang | 5ef5e95be8 | |
philipp lang | 16db435018 | |
philipp lang | dd9ad974ce | |
philipp lang | 3159323f5a | |
philipp lang | 6ea9db8eef | |
philipp lang | c5bb2e3428 | |
philipp lang | 19a13df20d | |
philipp lang | 36976cda90 | |
philipp lang | cac0209a71 | |
philipp lang | 6f8240af80 | |
philipp lang | 8fbd4cd2d1 | |
philipp lang | 96f8f7e152 | |
philipp lang | 816950797f | |
philipp lang | da17f4c6d2 | |
philipp lang | 7be0ab1c82 | |
philipp lang | b8eabaa501 | |
philipp lang | 634c2f69c7 | |
philipp lang | b528d59800 | |
philipp lang | 67c62c9fa7 | |
philipp lang | 2ff3942b8d | |
philipp lang | 2c501e23d0 | |
philipp lang | 114d611169 | |
philipp lang | ffa2bf1ab9 | |
philipp lang | 03ba1777fc | |
philipp lang | f0f1d236ef | |
philipp lang | d42d70d5fa | |
philipp lang | 33d8c6aae8 | |
philipp lang | 5f0bbf7dc1 | |
philipp lang | 9ce81a9f0f | |
philipp lang | 4372b2196e | |
philipp lang | d58fde42c2 | |
philipp lang | 74d755ad47 | |
philipp lang | 05fe99a2bb | |
philipp lang | e323daeacb | |
philipp lang | 4ea848af7d | |
philipp lang | 3ae0b85b05 | |
philipp lang | c4b300403f | |
philipp lang | bff309ccfa | |
philipp lang | ea140b428e | |
philipp lang | a1a50aaddb | |
philipp lang | dcb25c8814 | |
philipp lang | 8feac575ad | |
philipp lang | f8ea3824ae | |
philipp lang | 040af778ef | |
philipp lang | ea53dcea4f |
|
@ -1,6 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
docker buildx build -f .docker/base.Dockerfile .
|
||||
docker image tag sha256:... zoomyboy/adrema-base
|
||||
docker push zoomyboy/adrema-base
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
FROM composer:2.7.9 as composer
|
||||
FROM composer:2.2.7 as composer
|
||||
WORKDIR /app
|
||||
COPY . /app
|
||||
RUN composer install --ignore-platform-reqs --no-dev
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
# Letzte Änderungen
|
||||
|
||||
### 1.11.1
|
||||
|
||||
- Es kann nun auch das Feld "Datenweiterverwendung" über Adrema gepflegt werden.
|
||||
|
||||
### 1.10.20
|
||||
|
||||
- Fixed: Bei Textfeldern wird nun die Einleitung dargestellt
|
||||
|
|
|
@ -50,7 +50,6 @@ class InsertMemberAction
|
|||
'nationality_id' => Nationality::where('nami_id', $member->nationalityId)->firstOrFail()->id,
|
||||
'mitgliedsnr' => $member->memberId,
|
||||
'version' => $member->version,
|
||||
'keepdata' => $member->keepdata,
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ class NamiPutMemberAction
|
|||
'groupId' => $member->group->nami_id,
|
||||
'id' => $member->nami_id,
|
||||
'version' => $member->version,
|
||||
'keepdata' => $member->keepdata,
|
||||
'keepdata' => false,
|
||||
]);
|
||||
$response = $api->putMember($namiMember, $activity ? $activity->nami_id : null, $subactivity ? $subactivity->nami_id : null);
|
||||
Member::withoutEvents(function () use ($response, $member) {
|
||||
|
|
|
@ -58,7 +58,7 @@ class Member extends Model implements Geolocatable
|
|||
/**
|
||||
* @var array<int, string>
|
||||
*/
|
||||
public static array $namiFields = ['firstname', 'lastname', 'joined_at', 'birthday', 'send_newspaper', 'address', 'zip', 'location', 'nickname', 'other_country', 'further_address', 'main_phone', 'mobile_phone', 'work_phone', 'fax', 'email', 'email_parents', 'gender_id', 'confession_id', 'region_id', 'country_id', 'fee_id', 'nationality_id', 'slug', 'subscription_id', 'keepdata'];
|
||||
public static array $namiFields = ['firstname', 'lastname', 'joined_at', 'birthday', 'send_newspaper', 'address', 'zip', 'location', 'nickname', 'other_country', 'further_address', 'main_phone', 'mobile_phone', 'work_phone', 'fax', 'email', 'email_parents', 'gender_id', 'confession_id', 'region_id', 'country_id', 'fee_id', 'nationality_id', 'slug', 'subscription_id'];
|
||||
|
||||
/**
|
||||
* @var array<string, string>
|
||||
|
@ -77,7 +77,6 @@ class Member extends Model implements Geolocatable
|
|||
'multiply_pv' => 'boolean',
|
||||
'multiply_more_pv' => 'boolean',
|
||||
'is_leader' => 'boolean',
|
||||
'keepdata' => 'boolean',
|
||||
'bill_kind' => BillKind::class,
|
||||
'mitgliedsnr' => 'integer',
|
||||
|
||||
|
|
|
@ -83,7 +83,6 @@ class MemberRequest extends FormRequest
|
|||
'other_country' => '',
|
||||
'salutation' => '',
|
||||
'comment' => '',
|
||||
'keepdata' => 'boolean',
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
@ -106,7 +106,6 @@ class MemberResource extends JsonResource
|
|||
'lat' => $this->lat,
|
||||
'lon' => $this->lon,
|
||||
'group_name' => $this->group->name,
|
||||
'keepdata' => $this->keepdata,
|
||||
'links' => [
|
||||
'membership_index' => route('member.membership.index', ['member' => $this->getModel()]),
|
||||
'invoiceposition_index' => route('member.invoice-position.index', ['member' => $this->getModel()]),
|
||||
|
@ -203,7 +202,6 @@ class MemberResource extends JsonResource
|
|||
'has_svk' => false,
|
||||
'multiply_pv' => false,
|
||||
'multiply_more_pv' => false,
|
||||
'keepdata' => false,
|
||||
]
|
||||
];
|
||||
}
|
||||
|
|
|
@ -36,7 +36,6 @@ class MemberFactory extends Factory
|
|||
'location' => $this->faker->city,
|
||||
'email' => $this->faker->safeEmail(),
|
||||
'recertified_at' => null,
|
||||
'keepdata' => false,
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
@ -1,28 +0,0 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('members', function (Blueprint $table) {
|
||||
$table->boolean('keepdata')->after('email_parents')->default(false);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('members', function (Blueprint $table) {
|
||||
$table->dropColumn('keepdata');
|
||||
});
|
||||
}
|
||||
};
|
|
@ -58,8 +58,7 @@
|
|||
<f-select id="subscription_id" v-model="inner.subscription_id" :options="meta.subscriptions" label="Beitrag" name="subscription_id" size="sm"></f-select>
|
||||
<f-switch id="has_nami" v-model="inner.has_nami" name="has_nami" size="sm" label="In Nami eintragen"></f-switch>
|
||||
<f-switch id="send_newspaper" v-model="inner.send_newspaper" name="send_newspaper" label="Mittendrin versenden" size="sm"></f-switch>
|
||||
<f-switch id="keepdata" v-model="inner.keepdata" name="keepdata" label="Datenweiterverwendung" size="sm"></f-switch>
|
||||
<f-text id="joined_at" v-model="inner.joined_at" type="date" label="Eintrittsdatum" size="sm" required></f-text>
|
||||
<f-text id="joined_at" v-model="inner.joined_at" class="sm:col-span-2" type="date" label="Eintrittsdatum" size="sm" required></f-text>
|
||||
<f-textarea id="comment" v-model="inner.comment" :rows="3" class="col-span-2" label="Kommentar" size="sm"></f-textarea>
|
||||
<div v-if="mode === 'create' || (original.has_nami === false && inner.has_nami === true)" class="contents">
|
||||
<f-select
|
||||
|
|
|
@ -32,7 +32,6 @@ class EditTest extends TestCase
|
|||
$this->assertInertiaHas('Biber', $response, "meta.formSubactivities.{$activity->id}.{$subactivity->id}");
|
||||
$this->assertInertiaHas('€ Mitglied', $response, "meta.formActivities.{$activity->id}");
|
||||
$this->assertInertiaHas('Max', $response, 'data.firstname');
|
||||
$this->assertInertiaHas(false, $response, 'data.keepdata');
|
||||
$this->assertInertiaHas('Doktor', $response, 'data.salutation');
|
||||
$this->assertInertiaHas('Lorem bla', $response, 'data.comment');
|
||||
$this->assertInertiaHas('edit', $response, 'mode');
|
||||
|
|
|
@ -17,55 +17,50 @@ use App\Region;
|
|||
use App\Subactivity;
|
||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||
use Phake;
|
||||
use Tests\TestCase;
|
||||
use Zoomyboy\LaravelNami\Fakes\MemberFake;
|
||||
|
||||
uses(DatabaseTransactions::class);
|
||||
class NamiPutMemberActionTest extends TestCase
|
||||
{
|
||||
use DatabaseTransactions;
|
||||
|
||||
it('testItPutsAMember', function (array $memberAttributes, array $storedAttributes) {
|
||||
Fee::factory()->create();
|
||||
$this->stubIo(PullMemberAction::class, fn ($mock) => $mock);
|
||||
$this->stubIo(PullMembershipsAction::class, fn ($mock) => $mock);
|
||||
$this->withoutExceptionHandling()->login()->loginNami();
|
||||
$country = Country::factory()->create();
|
||||
$region = Region::factory()->create();
|
||||
$nationality = Nationality::factory()->inNami(565)->create();
|
||||
$subscription = Subscription::factory()->forFee()->create();
|
||||
$group = Group::factory()->inNami(55)->create();
|
||||
$confession = Confession::factory()->inNami(567)->create(['is_null' => true]);
|
||||
app(MemberFake::class)->stores(55, 993);
|
||||
$activity = Activity::factory()->hasAttached(Subactivity::factory()->name('Biber')->inNami(55))->name('Leiter')->inNami(6)->create();
|
||||
$subactivity = $activity->subactivities->first();
|
||||
public function testItPutsAMember(): void
|
||||
{
|
||||
Fee::factory()->create();
|
||||
$this->stubIo(PullMemberAction::class, fn ($mock) => $mock);
|
||||
$this->stubIo(PullMembershipsAction::class, fn ($mock) => $mock);
|
||||
$this->withoutExceptionHandling()->login()->loginNami();
|
||||
$country = Country::factory()->create();
|
||||
$region = Region::factory()->create();
|
||||
$nationality = Nationality::factory()->inNami(565)->create();
|
||||
$subscription = Subscription::factory()->forFee()->create();
|
||||
$group = Group::factory()->inNami(55)->create();
|
||||
$confession = Confession::factory()->inNami(567)->create(['is_null' => true]);
|
||||
app(MemberFake::class)->stores(55, 993);
|
||||
$activity = Activity::factory()->hasAttached(Subactivity::factory()->name('Biber')->inNami(55))->name('Leiter')->inNami(6)->create();
|
||||
$subactivity = $activity->subactivities->first();
|
||||
|
||||
$member = Member::factory()
|
||||
->for($country)
|
||||
->for($subscription)
|
||||
->for($region)
|
||||
->for($nationality)
|
||||
->for($group)
|
||||
->emailBillKind()
|
||||
->create($memberAttributes);
|
||||
$member = Member::factory()
|
||||
->for($country)
|
||||
->for($subscription)
|
||||
->for($region)
|
||||
->for($nationality)
|
||||
->for($group)
|
||||
->emailBillKind()
|
||||
->create(['email_parents' => 'a@b.de']);
|
||||
|
||||
NamiPutMemberAction::run($member, $activity, $subactivity);
|
||||
NamiPutMemberAction::run($member, $activity, $subactivity);
|
||||
|
||||
app(MemberFake::class)->assertStored(55, [
|
||||
'ersteTaetigkeitId' => 6,
|
||||
'ersteUntergliederungId' => 55,
|
||||
'konfessionId' => 567,
|
||||
...$storedAttributes,
|
||||
]);
|
||||
$this->assertDatabaseHas('members', [
|
||||
'nami_id' => 993,
|
||||
]);
|
||||
Phake::verify(app(PullMemberAction::class))->handle(55, 993);
|
||||
Phake::verify(app(PullMembershipsAction::class))->handle($member);
|
||||
})->with([
|
||||
[
|
||||
['email_parents' => 'a@b.de'], ['emailVertretungsberechtigter' => 'a@b.de'],
|
||||
],
|
||||
[
|
||||
['keepdata' => true], ['wiederverwendenFlag' => true],
|
||||
],
|
||||
[
|
||||
['keepdata' => false], ['wiederverwendenFlag' => false],
|
||||
],
|
||||
]);
|
||||
app(MemberFake::class)->assertStored(55, [
|
||||
'ersteTaetigkeitId' => 6,
|
||||
'ersteUntergliederungId' => 55,
|
||||
'konfessionId' => 567,
|
||||
'emailVertretungsberechtigter' => 'a@b.de',
|
||||
]);
|
||||
$this->assertDatabaseHas('members', [
|
||||
'nami_id' => 993,
|
||||
]);
|
||||
Phake::verify(app(PullMemberAction::class))->handle(55, 993);
|
||||
Phake::verify(app(PullMembershipsAction::class))->handle($member);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,134 +11,142 @@ use App\Nationality;
|
|||
use App\Payment\Subscription;
|
||||
use App\Region;
|
||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||
use Tests\TestCase;
|
||||
use Zoomyboy\LaravelNami\Fakes\MemberFake;
|
||||
|
||||
uses(DatabaseTransactions::class);
|
||||
class PullMemberActionTest extends TestCase
|
||||
{
|
||||
use DatabaseTransactions;
|
||||
|
||||
beforeEach(function () {
|
||||
Subscription::factory()->name('test')->forFee(300)->create();
|
||||
Gender::factory()->inNami(303)->create();
|
||||
Country::factory()->inNami(302)->create();
|
||||
Nationality::factory()->inNami(1054)->create();
|
||||
});
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
it('testFetchNormalMember', function () {
|
||||
$this->loginNami();
|
||||
app(MemberFake::class)->shows(1000, 1001, [
|
||||
'vorname' => '::firstname::',
|
||||
'nachname' => '::lastname::',
|
||||
'beitragsartId' => 300,
|
||||
'geburtsDatum' => '2014-07-11 00:00:00',
|
||||
'gruppierungId' => 1000,
|
||||
'geschlechtId' => 303,
|
||||
'id' => 1001,
|
||||
'eintrittsdatum' => '2020-11-17 00:00:00',
|
||||
'landId' => 302,
|
||||
'staatsangehoerigkeitId' => 1054,
|
||||
'zeitschriftenversand' => true,
|
||||
'strasse' => '::street::',
|
||||
'plz' => '12346',
|
||||
'ort' => '::location::',
|
||||
'version' => 40,
|
||||
'gruppierung' => 'SG Wald',
|
||||
'mitgliedsNummer' => 53,
|
||||
]);
|
||||
Subscription::factory()->name('test')->forFee(300)->create();
|
||||
Gender::factory()->inNami(303)->create();
|
||||
Country::factory()->inNami(302)->create();
|
||||
Nationality::factory()->inNami(1054)->create();
|
||||
$this->loginNami();
|
||||
}
|
||||
|
||||
$member = app(PullMemberAction::class)->handle(1000, 1001);
|
||||
public function testFetchNormalMember(): void
|
||||
{
|
||||
app(MemberFake::class)->shows(1000, 1001, [
|
||||
'vorname' => '::firstname::',
|
||||
'nachname' => '::lastname::',
|
||||
'beitragsartId' => 300,
|
||||
'geburtsDatum' => '2014-07-11 00:00:00',
|
||||
'gruppierungId' => 1000,
|
||||
'geschlechtId' => 303,
|
||||
'id' => 1001,
|
||||
'eintrittsdatum' => '2020-11-17 00:00:00',
|
||||
'landId' => 302,
|
||||
'staatsangehoerigkeitId' => 1054,
|
||||
'zeitschriftenversand' => true,
|
||||
'strasse' => '::street::',
|
||||
'plz' => '12346',
|
||||
'ort' => '::location::',
|
||||
'version' => 40,
|
||||
'gruppierung' => 'SG Wald',
|
||||
'mitgliedsNummer' => 53,
|
||||
]);
|
||||
|
||||
$this->assertDatabaseHas('members', [
|
||||
'firstname' => '::firstname::',
|
||||
'lastname' => '::lastname::',
|
||||
'subscription_id' => Subscription::firstWhere('name', 'test')->id,
|
||||
'birthday' => '2014-07-11',
|
||||
'group_id' => Group::nami(1000)->id,
|
||||
'gender_id' => Gender::nami(303)->id,
|
||||
'nami_id' => 1001,
|
||||
'joined_at' => '2020-11-17',
|
||||
'country_id' => Country::nami(302)->id,
|
||||
'nationality_id' => Nationality::nami(1054)->id,
|
||||
'send_newspaper' => 1,
|
||||
'address' => '::street::',
|
||||
'zip' => '12346',
|
||||
'location' => '::location::',
|
||||
'version' => '40',
|
||||
'mitgliedsnr' => 53,
|
||||
]);
|
||||
$member = app(PullMemberAction::class)->handle(1000, 1001);
|
||||
|
||||
$this->assertDatabaseHas('groups', [
|
||||
'name' => 'SG Wald',
|
||||
'nami_id' => 1000,
|
||||
'inner_name' => 'SG Wald',
|
||||
]);
|
||||
$this->assertEquals(1001, $member->nami_id);
|
||||
});
|
||||
$this->assertDatabaseHas('members', [
|
||||
'firstname' => '::firstname::',
|
||||
'lastname' => '::lastname::',
|
||||
'subscription_id' => Subscription::firstWhere('name', 'test')->id,
|
||||
'birthday' => '2014-07-11',
|
||||
'group_id' => Group::nami(1000)->id,
|
||||
'gender_id' => Gender::nami(303)->id,
|
||||
'nami_id' => 1001,
|
||||
'joined_at' => '2020-11-17',
|
||||
'country_id' => Country::nami(302)->id,
|
||||
'nationality_id' => Nationality::nami(1054)->id,
|
||||
'send_newspaper' => 1,
|
||||
'address' => '::street::',
|
||||
'zip' => '12346',
|
||||
'location' => '::location::',
|
||||
'version' => '40',
|
||||
'mitgliedsnr' => 53,
|
||||
]);
|
||||
|
||||
it('testFetchWiederverwendenFlag', function (array $memberAttributes, array $storedAttributes) {
|
||||
$this->loginNami();
|
||||
Region::factory()->inNami(999)->name('nicht-de')->create(['is_null' => true]);
|
||||
app(MemberFake::class)->shows(1000, 1001, $memberAttributes);
|
||||
$this->assertDatabaseHas('groups', [
|
||||
'name' => 'SG Wald',
|
||||
'nami_id' => 1000,
|
||||
'inner_name' => 'SG Wald',
|
||||
]);
|
||||
$this->assertEquals(1001, $member->nami_id);
|
||||
}
|
||||
|
||||
app(PullMemberAction::class)->handle(1000, 1001);
|
||||
public function testRegionIdIsSetToNull(): void
|
||||
{
|
||||
Region::factory()->inNami(999)->name('nicht-de')->create(['is_null' => true]);
|
||||
app(MemberFake::class)->shows(1000, 1001, [
|
||||
'regionId' => 999,
|
||||
]);
|
||||
|
||||
$this->assertDatabaseHas('members', $storedAttributes);
|
||||
})->with([
|
||||
[['wiederverwendenFlag' => false], ['keepdata' => false]],
|
||||
[['wiederverwendenFlag' => true], ['keepdata' => true]],
|
||||
[['regionId' => 999], ['region_id' => null]]
|
||||
]);
|
||||
app(PullMemberAction::class)->handle(1000, 1001);
|
||||
|
||||
it('testItSetsFirstSubscriptionFromFee', function () {
|
||||
$this->loginNami();
|
||||
Region::factory()->inNami(999)->name('nicht-de')->create(['is_null' => true]);
|
||||
$should = Subscription::factory()->forFee(55)->create();
|
||||
app(MemberFake::class)->shows(1000, 1001, [
|
||||
'beitragsartId' => 55,
|
||||
]);
|
||||
$this->assertDatabaseHas('members', [
|
||||
'region_id' => null,
|
||||
]);
|
||||
}
|
||||
|
||||
app(PullMemberAction::class)->handle(1000, 1001);
|
||||
public function testItSetsFirstSubscriptionFromFee(): void
|
||||
{
|
||||
Region::factory()->inNami(999)->name('nicht-de')->create(['is_null' => true]);
|
||||
$should = Subscription::factory()->forFee(55)->create();
|
||||
app(MemberFake::class)->shows(1000, 1001, [
|
||||
'beitragsartId' => 55,
|
||||
]);
|
||||
|
||||
$this->assertDatabaseHas('members', [
|
||||
'subscription_id' => $should->id,
|
||||
]);
|
||||
});
|
||||
app(PullMemberAction::class)->handle(1000, 1001);
|
||||
|
||||
it('testItCreatesSubscriptionOnTheFly', function () {
|
||||
$this->loginNami();
|
||||
Region::factory()->inNami(999)->name('nicht-de')->create(['is_null' => true]);
|
||||
app(MemberFake::class)->shows(1000, 1001, [
|
||||
'beitragsartId' => 55,
|
||||
'beitragsart' => 'Lala',
|
||||
]);
|
||||
$this->assertDatabaseHas('members', [
|
||||
'subscription_id' => $should->id,
|
||||
]);
|
||||
}
|
||||
|
||||
app(PullMemberAction::class)->handle(1000, 1001);
|
||||
public function testItCreatesSubscriptionOnTheFly(): void
|
||||
{
|
||||
Region::factory()->inNami(999)->name('nicht-de')->create(['is_null' => true]);
|
||||
app(MemberFake::class)->shows(1000, 1001, [
|
||||
'beitragsartId' => 55,
|
||||
'beitragsart' => 'Lala',
|
||||
]);
|
||||
|
||||
$fee = Fee::where('nami_id', 55)->firstOrFail();
|
||||
$subscription = Subscription::where('fee_id', $fee->id)->firstOrFail();
|
||||
$this->assertDatabaseHas('subscriptions', [
|
||||
'fee_id' => $fee->id,
|
||||
'name' => 'Lala',
|
||||
]);
|
||||
$this->assertDatabaseHas('subscription_children', [
|
||||
'name' => 'Lala',
|
||||
'amount' => 1000,
|
||||
'parent_id' => $subscription->id,
|
||||
]);
|
||||
$this->assertDatabaseHas('members', [
|
||||
'subscription_id' => $subscription->id,
|
||||
]);
|
||||
});
|
||||
app(PullMemberAction::class)->handle(1000, 1001);
|
||||
|
||||
it('testItPullsMemberWithNoSubscription', function () {
|
||||
$this->loginNami();
|
||||
Region::factory()->inNami(999)->name('nicht-de')->create(['is_null' => true]);
|
||||
app(MemberFake::class)->shows(1000, 1001, [
|
||||
'beitragsartId' => null,
|
||||
'beitragsart' => null,
|
||||
]);
|
||||
$fee = Fee::where('nami_id', 55)->firstOrFail();
|
||||
$subscription = Subscription::where('fee_id', $fee->id)->firstOrFail();
|
||||
$this->assertDatabaseHas('subscriptions', [
|
||||
'fee_id' => $fee->id,
|
||||
'name' => 'Lala',
|
||||
]);
|
||||
$this->assertDatabaseHas('subscription_children', [
|
||||
'name' => 'Lala',
|
||||
'amount' => 1000,
|
||||
'parent_id' => $subscription->id,
|
||||
]);
|
||||
$this->assertDatabaseHas('members', [
|
||||
'subscription_id' => $subscription->id,
|
||||
]);
|
||||
}
|
||||
|
||||
app(PullMemberAction::class)->handle(1000, 1001);
|
||||
public function testItPullsMemberWithNoSubscription(): void
|
||||
{
|
||||
Region::factory()->inNami(999)->name('nicht-de')->create(['is_null' => true]);
|
||||
app(MemberFake::class)->shows(1000, 1001, [
|
||||
'beitragsartId' => null,
|
||||
'beitragsart' => null,
|
||||
]);
|
||||
|
||||
$this->assertDatabaseHas('members', [
|
||||
'subscription_id' => null,
|
||||
]);
|
||||
});
|
||||
app(PullMemberAction::class)->handle(1000, 1001);
|
||||
|
||||
$this->assertDatabaseHas('members', [
|
||||
'subscription_id' => null,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -89,35 +89,6 @@ class StoreTest extends TestCase
|
|||
]);
|
||||
}
|
||||
|
||||
public function testItStoresWiederverwendenFlag(): void
|
||||
{
|
||||
app(MemberFake::class)->stores(55, 103);
|
||||
Fee::factory()->create();
|
||||
$this->withoutExceptionHandling()->login()->loginNami();
|
||||
$activity = Activity::factory()->inNami(89)->create();
|
||||
$subactivity = Subactivity::factory()->inNami(90)->create();
|
||||
$subscription = Subscription::factory()->forFee()->create();
|
||||
$confesstion = Confession::factory()->create(['is_null' => true]);
|
||||
PullMemberAction::shouldRun();
|
||||
PullMembershipsAction::shouldRun();
|
||||
|
||||
$this
|
||||
->from('/member/create')
|
||||
->post('/member', $this->attributes([
|
||||
'first_activity_id' => $activity->id,
|
||||
'first_subactivity_id' => $subactivity->id,
|
||||
'subscription_id' => $subscription->id,
|
||||
'keepdata' => true,
|
||||
]))->assertSessionHasNoErrors();
|
||||
|
||||
$this->assertDatabaseHas('members', [
|
||||
'keepdata' => true,
|
||||
]);
|
||||
app(MemberFake::class)->assertStored(55, [
|
||||
'wiederverwendenFlag' => true,
|
||||
]);
|
||||
}
|
||||
|
||||
public function testItCanStoreAMemberWithoutNami(): void
|
||||
{
|
||||
$this->withoutExceptionHandling()->login()->loginNami();
|
||||
|
|
|
@ -77,23 +77,6 @@ class UpdateTest extends TestCase
|
|||
]);
|
||||
}
|
||||
|
||||
public function testItUpdatesWiederverwendenFlag(): void
|
||||
{
|
||||
$this->withoutExceptionHandling()->login()->loginNami();
|
||||
$member = $this->member();
|
||||
$this->fakeRequest();
|
||||
NamiPutMemberAction::allowToRun();
|
||||
|
||||
$this->patch("/member/{$member->id}", array_merge($member->getAttributes(), [
|
||||
'keepdata' => true,
|
||||
'has_nami' => true,
|
||||
]));
|
||||
|
||||
$this->assertDatabaseHas('members', [
|
||||
'keepdata' => true,
|
||||
]);
|
||||
}
|
||||
|
||||
public function testItSetsLocationToNull(): void
|
||||
{
|
||||
$this->withoutExceptionHandling()->login()->loginNami();
|
||||
|
|
Loading…
Reference in New Issue