Compare commits
67 Commits
cc934b1b3c
...
2ded545a94
Author | SHA1 | Date |
---|---|---|
philipp lang | 2ded545a94 | |
philipp lang | 4f2f2b43ce | |
philipp lang | 744782ec61 | |
philipp lang | 93c132210a | |
philipp lang | c838884cce | |
philipp lang | 6ad2c24833 | |
philipp lang | 3a1c327cfe | |
philipp lang | 45de2da93e | |
philipp lang | 340d6dab45 | |
philipp lang | 66cc226a67 | |
philipp lang | d5ef4e6651 | |
philipp lang | 336b9c9c1b | |
philipp lang | 4dae977bd9 | |
philipp lang | 806bf73abd | |
philipp lang | b8be5e4623 | |
philipp lang | 4d2272e067 | |
philipp lang | 9330398c9b | |
philipp lang | a9fed5503f | |
philipp lang | 4672344bd9 | |
philipp lang | bd90f6f77b | |
philipp lang | 7e09d78265 | |
philipp lang | 523e77c76a | |
philipp lang | 3cffbc9230 | |
philipp lang | 0915de8f8b | |
philipp lang | e67af9e33a | |
philipp lang | 06a9a584e9 | |
philipp lang | cc481b6536 | |
philipp lang | d60e24ff64 | |
philipp lang | 09fbaabcb8 | |
philipp lang | 0b9446e010 | |
philipp lang | 6dbf091a74 | |
philipp lang | e67325e643 | |
philipp lang | b190a4aecf | |
philipp lang | 1c9c9b343b | |
philipp lang | b51419c87a | |
philipp lang | 1081cf2b70 | |
philipp lang | c192367bd1 | |
philipp lang | c129d4927a | |
philipp lang | 557a529813 | |
philipp lang | 4c77654195 | |
philipp lang | 08821b3731 | |
philipp lang | a8dbfcbb9d | |
philipp lang | c5d76ffd95 | |
philipp lang | abb298cdfa | |
philipp lang | e46e0fcb73 | |
philipp lang | c6dedff312 | |
philipp lang | 7f96a0122d | |
philipp lang | 79c6402073 | |
philipp lang | 217e82bd44 | |
philipp lang | 0934297698 | |
philipp lang | 7bf0f76ca8 | |
philipp lang | 87496d4dc3 | |
philipp lang | 5649310b13 | |
philipp lang | ba91cf0f92 | |
philipp lang | 845385f687 | |
philipp lang | d051929a49 | |
philipp lang | 12cb71bb95 | |
philipp lang | 9f29e976c0 | |
philipp lang | 35be12dd01 | |
philipp lang | 990aec57be | |
philipp lang | e134ee8c12 | |
philipp lang | 75642f336b | |
philipp lang | ed1a8f30bc | |
philipp lang | e5066af192 | |
philipp lang | 31afa2e418 | |
philipp lang | a897690e7a | |
philipp lang | 24ed5d4ab9 |
|
@ -0,0 +1,6 @@
|
||||||
|
#!/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.2.7 as composer
|
FROM composer:2.7.9 as composer
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY . /app
|
COPY . /app
|
||||||
RUN composer install --ignore-platform-reqs --no-dev
|
RUN composer install --ignore-platform-reqs --no-dev
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
# Letzte Änderungen
|
# Letzte Änderungen
|
||||||
|
|
||||||
|
### 1.11.1
|
||||||
|
|
||||||
|
- Es kann nun auch das Feld "Datenweiterverwendung" über Adrema gepflegt werden.
|
||||||
|
|
||||||
### 1.10.20
|
### 1.10.20
|
||||||
|
|
||||||
- Fixed: Bei Textfeldern wird nun die Einleitung dargestellt
|
- Fixed: Bei Textfeldern wird nun die Einleitung dargestellt
|
||||||
|
|
|
@ -50,6 +50,7 @@ class InsertMemberAction
|
||||||
'nationality_id' => Nationality::where('nami_id', $member->nationalityId)->firstOrFail()->id,
|
'nationality_id' => Nationality::where('nami_id', $member->nationalityId)->firstOrFail()->id,
|
||||||
'mitgliedsnr' => $member->memberId,
|
'mitgliedsnr' => $member->memberId,
|
||||||
'version' => $member->version,
|
'version' => $member->version,
|
||||||
|
'keepdata' => $member->keepdata,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ class NamiPutMemberAction
|
||||||
'groupId' => $member->group->nami_id,
|
'groupId' => $member->group->nami_id,
|
||||||
'id' => $member->nami_id,
|
'id' => $member->nami_id,
|
||||||
'version' => $member->version,
|
'version' => $member->version,
|
||||||
'keepdata' => false,
|
'keepdata' => $member->keepdata,
|
||||||
]);
|
]);
|
||||||
$response = $api->putMember($namiMember, $activity ? $activity->nami_id : null, $subactivity ? $subactivity->nami_id : null);
|
$response = $api->putMember($namiMember, $activity ? $activity->nami_id : null, $subactivity ? $subactivity->nami_id : null);
|
||||||
Member::withoutEvents(function () use ($response, $member) {
|
Member::withoutEvents(function () use ($response, $member) {
|
||||||
|
|
|
@ -58,7 +58,7 @@ class Member extends Model implements Geolocatable
|
||||||
/**
|
/**
|
||||||
* @var array<int, string>
|
* @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'];
|
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'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array<string, string>
|
* @var array<string, string>
|
||||||
|
@ -77,6 +77,7 @@ class Member extends Model implements Geolocatable
|
||||||
'multiply_pv' => 'boolean',
|
'multiply_pv' => 'boolean',
|
||||||
'multiply_more_pv' => 'boolean',
|
'multiply_more_pv' => 'boolean',
|
||||||
'is_leader' => 'boolean',
|
'is_leader' => 'boolean',
|
||||||
|
'keepdata' => 'boolean',
|
||||||
'bill_kind' => BillKind::class,
|
'bill_kind' => BillKind::class,
|
||||||
'mitgliedsnr' => 'integer',
|
'mitgliedsnr' => 'integer',
|
||||||
|
|
||||||
|
|
|
@ -83,6 +83,7 @@ class MemberRequest extends FormRequest
|
||||||
'other_country' => '',
|
'other_country' => '',
|
||||||
'salutation' => '',
|
'salutation' => '',
|
||||||
'comment' => '',
|
'comment' => '',
|
||||||
|
'keepdata' => 'boolean',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -106,6 +106,7 @@ class MemberResource extends JsonResource
|
||||||
'lat' => $this->lat,
|
'lat' => $this->lat,
|
||||||
'lon' => $this->lon,
|
'lon' => $this->lon,
|
||||||
'group_name' => $this->group->name,
|
'group_name' => $this->group->name,
|
||||||
|
'keepdata' => $this->keepdata,
|
||||||
'links' => [
|
'links' => [
|
||||||
'membership_index' => route('member.membership.index', ['member' => $this->getModel()]),
|
'membership_index' => route('member.membership.index', ['member' => $this->getModel()]),
|
||||||
'invoiceposition_index' => route('member.invoice-position.index', ['member' => $this->getModel()]),
|
'invoiceposition_index' => route('member.invoice-position.index', ['member' => $this->getModel()]),
|
||||||
|
@ -202,6 +203,7 @@ class MemberResource extends JsonResource
|
||||||
'has_svk' => false,
|
'has_svk' => false,
|
||||||
'multiply_pv' => false,
|
'multiply_pv' => false,
|
||||||
'multiply_more_pv' => false,
|
'multiply_more_pv' => false,
|
||||||
|
'keepdata' => false,
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,6 +36,7 @@ class MemberFactory extends Factory
|
||||||
'location' => $this->faker->city,
|
'location' => $this->faker->city,
|
||||||
'email' => $this->faker->safeEmail(),
|
'email' => $this->faker->safeEmail(),
|
||||||
'recertified_at' => null,
|
'recertified_at' => null,
|
||||||
|
'keepdata' => false,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
<?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,7 +58,8 @@
|
||||||
<f-select id="subscription_id" v-model="inner.subscription_id" :options="meta.subscriptions" label="Beitrag" name="subscription_id" size="sm"></f-select>
|
<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="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="send_newspaper" v-model="inner.send_newspaper" name="send_newspaper" label="Mittendrin versenden" size="sm"></f-switch>
|
||||||
<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-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-textarea id="comment" v-model="inner.comment" :rows="3" class="col-span-2" label="Kommentar" size="sm"></f-textarea>
|
<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">
|
<div v-if="mode === 'create' || (original.has_nami === false && inner.has_nami === true)" class="contents">
|
||||||
<f-select
|
<f-select
|
||||||
|
|
|
@ -32,6 +32,7 @@ class EditTest extends TestCase
|
||||||
$this->assertInertiaHas('Biber', $response, "meta.formSubactivities.{$activity->id}.{$subactivity->id}");
|
$this->assertInertiaHas('Biber', $response, "meta.formSubactivities.{$activity->id}.{$subactivity->id}");
|
||||||
$this->assertInertiaHas('€ Mitglied', $response, "meta.formActivities.{$activity->id}");
|
$this->assertInertiaHas('€ Mitglied', $response, "meta.formActivities.{$activity->id}");
|
||||||
$this->assertInertiaHas('Max', $response, 'data.firstname');
|
$this->assertInertiaHas('Max', $response, 'data.firstname');
|
||||||
|
$this->assertInertiaHas(false, $response, 'data.keepdata');
|
||||||
$this->assertInertiaHas('Doktor', $response, 'data.salutation');
|
$this->assertInertiaHas('Doktor', $response, 'data.salutation');
|
||||||
$this->assertInertiaHas('Lorem bla', $response, 'data.comment');
|
$this->assertInertiaHas('Lorem bla', $response, 'data.comment');
|
||||||
$this->assertInertiaHas('edit', $response, 'mode');
|
$this->assertInertiaHas('edit', $response, 'mode');
|
||||||
|
|
|
@ -17,50 +17,55 @@ use App\Region;
|
||||||
use App\Subactivity;
|
use App\Subactivity;
|
||||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||||
use Phake;
|
use Phake;
|
||||||
use Tests\TestCase;
|
|
||||||
use Zoomyboy\LaravelNami\Fakes\MemberFake;
|
use Zoomyboy\LaravelNami\Fakes\MemberFake;
|
||||||
|
|
||||||
class NamiPutMemberActionTest extends TestCase
|
uses(DatabaseTransactions::class);
|
||||||
{
|
|
||||||
use DatabaseTransactions;
|
|
||||||
|
|
||||||
public function testItPutsAMember(): void
|
it('testItPutsAMember', function (array $memberAttributes, array $storedAttributes) {
|
||||||
{
|
Fee::factory()->create();
|
||||||
Fee::factory()->create();
|
$this->stubIo(PullMemberAction::class, fn ($mock) => $mock);
|
||||||
$this->stubIo(PullMemberAction::class, fn ($mock) => $mock);
|
$this->stubIo(PullMembershipsAction::class, fn ($mock) => $mock);
|
||||||
$this->stubIo(PullMembershipsAction::class, fn ($mock) => $mock);
|
$this->withoutExceptionHandling()->login()->loginNami();
|
||||||
$this->withoutExceptionHandling()->login()->loginNami();
|
$country = Country::factory()->create();
|
||||||
$country = Country::factory()->create();
|
$region = Region::factory()->create();
|
||||||
$region = Region::factory()->create();
|
$nationality = Nationality::factory()->inNami(565)->create();
|
||||||
$nationality = Nationality::factory()->inNami(565)->create();
|
$subscription = Subscription::factory()->forFee()->create();
|
||||||
$subscription = Subscription::factory()->forFee()->create();
|
$group = Group::factory()->inNami(55)->create();
|
||||||
$group = Group::factory()->inNami(55)->create();
|
$confession = Confession::factory()->inNami(567)->create(['is_null' => true]);
|
||||||
$confession = Confession::factory()->inNami(567)->create(['is_null' => true]);
|
app(MemberFake::class)->stores(55, 993);
|
||||||
app(MemberFake::class)->stores(55, 993);
|
$activity = Activity::factory()->hasAttached(Subactivity::factory()->name('Biber')->inNami(55))->name('Leiter')->inNami(6)->create();
|
||||||
$activity = Activity::factory()->hasAttached(Subactivity::factory()->name('Biber')->inNami(55))->name('Leiter')->inNami(6)->create();
|
$subactivity = $activity->subactivities->first();
|
||||||
$subactivity = $activity->subactivities->first();
|
|
||||||
|
|
||||||
$member = Member::factory()
|
$member = Member::factory()
|
||||||
->for($country)
|
->for($country)
|
||||||
->for($subscription)
|
->for($subscription)
|
||||||
->for($region)
|
->for($region)
|
||||||
->for($nationality)
|
->for($nationality)
|
||||||
->for($group)
|
->for($group)
|
||||||
->emailBillKind()
|
->emailBillKind()
|
||||||
->create(['email_parents' => 'a@b.de']);
|
->create($memberAttributes);
|
||||||
|
|
||||||
NamiPutMemberAction::run($member, $activity, $subactivity);
|
NamiPutMemberAction::run($member, $activity, $subactivity);
|
||||||
|
|
||||||
app(MemberFake::class)->assertStored(55, [
|
app(MemberFake::class)->assertStored(55, [
|
||||||
'ersteTaetigkeitId' => 6,
|
'ersteTaetigkeitId' => 6,
|
||||||
'ersteUntergliederungId' => 55,
|
'ersteUntergliederungId' => 55,
|
||||||
'konfessionId' => 567,
|
'konfessionId' => 567,
|
||||||
'emailVertretungsberechtigter' => 'a@b.de',
|
...$storedAttributes,
|
||||||
]);
|
]);
|
||||||
$this->assertDatabaseHas('members', [
|
$this->assertDatabaseHas('members', [
|
||||||
'nami_id' => 993,
|
'nami_id' => 993,
|
||||||
]);
|
]);
|
||||||
Phake::verify(app(PullMemberAction::class))->handle(55, 993);
|
Phake::verify(app(PullMemberAction::class))->handle(55, 993);
|
||||||
Phake::verify(app(PullMembershipsAction::class))->handle($member);
|
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],
|
||||||
|
],
|
||||||
|
]);
|
||||||
|
|
|
@ -11,142 +11,134 @@ use App\Nationality;
|
||||||
use App\Payment\Subscription;
|
use App\Payment\Subscription;
|
||||||
use App\Region;
|
use App\Region;
|
||||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||||
use Tests\TestCase;
|
|
||||||
use Zoomyboy\LaravelNami\Fakes\MemberFake;
|
use Zoomyboy\LaravelNami\Fakes\MemberFake;
|
||||||
|
|
||||||
class PullMemberActionTest extends TestCase
|
uses(DatabaseTransactions::class);
|
||||||
{
|
|
||||||
use DatabaseTransactions;
|
|
||||||
|
|
||||||
public function setUp(): void
|
beforeEach(function () {
|
||||||
{
|
Subscription::factory()->name('test')->forFee(300)->create();
|
||||||
parent::setUp();
|
Gender::factory()->inNami(303)->create();
|
||||||
|
Country::factory()->inNami(302)->create();
|
||||||
|
Nationality::factory()->inNami(1054)->create();
|
||||||
|
});
|
||||||
|
|
||||||
Subscription::factory()->name('test')->forFee(300)->create();
|
it('testFetchNormalMember', function () {
|
||||||
Gender::factory()->inNami(303)->create();
|
$this->loginNami();
|
||||||
Country::factory()->inNami(302)->create();
|
app(MemberFake::class)->shows(1000, 1001, [
|
||||||
Nationality::factory()->inNami(1054)->create();
|
'vorname' => '::firstname::',
|
||||||
$this->loginNami();
|
'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,
|
||||||
|
]);
|
||||||
|
|
||||||
public function testFetchNormalMember(): void
|
$member = app(PullMemberAction::class)->handle(1000, 1001);
|
||||||
{
|
|
||||||
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,
|
|
||||||
]);
|
|
||||||
|
|
||||||
$member = app(PullMemberAction::class)->handle(1000, 1001);
|
$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,
|
||||||
|
]);
|
||||||
|
|
||||||
$this->assertDatabaseHas('members', [
|
$this->assertDatabaseHas('groups', [
|
||||||
'firstname' => '::firstname::',
|
'name' => 'SG Wald',
|
||||||
'lastname' => '::lastname::',
|
'nami_id' => 1000,
|
||||||
'subscription_id' => Subscription::firstWhere('name', 'test')->id,
|
'inner_name' => 'SG Wald',
|
||||||
'birthday' => '2014-07-11',
|
]);
|
||||||
'group_id' => Group::nami(1000)->id,
|
$this->assertEquals(1001, $member->nami_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,
|
|
||||||
]);
|
|
||||||
|
|
||||||
$this->assertDatabaseHas('groups', [
|
it('testFetchWiederverwendenFlag', function (array $memberAttributes, array $storedAttributes) {
|
||||||
'name' => 'SG Wald',
|
$this->loginNami();
|
||||||
'nami_id' => 1000,
|
Region::factory()->inNami(999)->name('nicht-de')->create(['is_null' => true]);
|
||||||
'inner_name' => 'SG Wald',
|
app(MemberFake::class)->shows(1000, 1001, $memberAttributes);
|
||||||
]);
|
|
||||||
$this->assertEquals(1001, $member->nami_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testRegionIdIsSetToNull(): void
|
app(PullMemberAction::class)->handle(1000, 1001);
|
||||||
{
|
|
||||||
Region::factory()->inNami(999)->name('nicht-de')->create(['is_null' => true]);
|
|
||||||
app(MemberFake::class)->shows(1000, 1001, [
|
|
||||||
'regionId' => 999,
|
|
||||||
]);
|
|
||||||
|
|
||||||
app(PullMemberAction::class)->handle(1000, 1001);
|
$this->assertDatabaseHas('members', $storedAttributes);
|
||||||
|
})->with([
|
||||||
|
[['wiederverwendenFlag' => false], ['keepdata' => false]],
|
||||||
|
[['wiederverwendenFlag' => true], ['keepdata' => true]],
|
||||||
|
[['regionId' => 999], ['region_id' => null]]
|
||||||
|
]);
|
||||||
|
|
||||||
$this->assertDatabaseHas('members', [
|
it('testItSetsFirstSubscriptionFromFee', function () {
|
||||||
'region_id' => null,
|
$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,
|
||||||
|
]);
|
||||||
|
|
||||||
public function testItSetsFirstSubscriptionFromFee(): void
|
app(PullMemberAction::class)->handle(1000, 1001);
|
||||||
{
|
|
||||||
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,
|
|
||||||
]);
|
|
||||||
|
|
||||||
app(PullMemberAction::class)->handle(1000, 1001);
|
$this->assertDatabaseHas('members', [
|
||||||
|
'subscription_id' => $should->id,
|
||||||
|
]);
|
||||||
|
});
|
||||||
|
|
||||||
$this->assertDatabaseHas('members', [
|
it('testItCreatesSubscriptionOnTheFly', function () {
|
||||||
'subscription_id' => $should->id,
|
$this->loginNami();
|
||||||
]);
|
Region::factory()->inNami(999)->name('nicht-de')->create(['is_null' => true]);
|
||||||
}
|
app(MemberFake::class)->shows(1000, 1001, [
|
||||||
|
'beitragsartId' => 55,
|
||||||
|
'beitragsart' => 'Lala',
|
||||||
|
]);
|
||||||
|
|
||||||
public function testItCreatesSubscriptionOnTheFly(): void
|
app(PullMemberAction::class)->handle(1000, 1001);
|
||||||
{
|
|
||||||
Region::factory()->inNami(999)->name('nicht-de')->create(['is_null' => true]);
|
|
||||||
app(MemberFake::class)->shows(1000, 1001, [
|
|
||||||
'beitragsartId' => 55,
|
|
||||||
'beitragsart' => 'Lala',
|
|
||||||
]);
|
|
||||||
|
|
||||||
app(PullMemberAction::class)->handle(1000, 1001);
|
$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,
|
||||||
|
]);
|
||||||
|
});
|
||||||
|
|
||||||
$fee = Fee::where('nami_id', 55)->firstOrFail();
|
it('testItPullsMemberWithNoSubscription', function () {
|
||||||
$subscription = Subscription::where('fee_id', $fee->id)->firstOrFail();
|
$this->loginNami();
|
||||||
$this->assertDatabaseHas('subscriptions', [
|
Region::factory()->inNami(999)->name('nicht-de')->create(['is_null' => true]);
|
||||||
'fee_id' => $fee->id,
|
app(MemberFake::class)->shows(1000, 1001, [
|
||||||
'name' => 'Lala',
|
'beitragsartId' => null,
|
||||||
]);
|
'beitragsart' => null,
|
||||||
$this->assertDatabaseHas('subscription_children', [
|
]);
|
||||||
'name' => 'Lala',
|
|
||||||
'amount' => 1000,
|
|
||||||
'parent_id' => $subscription->id,
|
|
||||||
]);
|
|
||||||
$this->assertDatabaseHas('members', [
|
|
||||||
'subscription_id' => $subscription->id,
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testItPullsMemberWithNoSubscription(): void
|
app(PullMemberAction::class)->handle(1000, 1001);
|
||||||
{
|
|
||||||
Region::factory()->inNami(999)->name('nicht-de')->create(['is_null' => true]);
|
|
||||||
app(MemberFake::class)->shows(1000, 1001, [
|
|
||||||
'beitragsartId' => null,
|
|
||||||
'beitragsart' => null,
|
|
||||||
]);
|
|
||||||
|
|
||||||
app(PullMemberAction::class)->handle(1000, 1001);
|
$this->assertDatabaseHas('members', [
|
||||||
|
'subscription_id' => null,
|
||||||
$this->assertDatabaseHas('members', [
|
]);
|
||||||
'subscription_id' => null,
|
});
|
||||||
]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -89,6 +89,35 @@ 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
|
public function testItCanStoreAMemberWithoutNami(): void
|
||||||
{
|
{
|
||||||
$this->withoutExceptionHandling()->login()->loginNami();
|
$this->withoutExceptionHandling()->login()->loginNami();
|
||||||
|
|
|
@ -77,6 +77,23 @@ 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
|
public function testItSetsLocationToNull(): void
|
||||||
{
|
{
|
||||||
$this->withoutExceptionHandling()->login()->loginNami();
|
$this->withoutExceptionHandling()->login()->loginNami();
|
||||||
|
|
Loading…
Reference in New Issue