Add mitgliedsnr
continuous-integration/drone/push Build is passing Details

This commit is contained in:
philipp lang 2023-03-02 23:14:25 +01:00
parent 5a9f04a48f
commit fe8ea63fa5
7 changed files with 42 additions and 2 deletions

View File

@ -47,6 +47,7 @@ class InsertMemberAction
'country_id' => optional(Country::where('nami_id', $member->countryId)->first())->id,
'subscription_id' => $this->getSubscriptionId($member),
'nationality_id' => Nationality::where('nami_id', $member->nationalityId)->firstOrFail()->id,
'mitgliedsnr' => $member->memberId,
'version' => $member->version,
]);
}

View File

@ -74,6 +74,7 @@ class Member extends Model
'multiply_more_pv' => 'boolean',
'is_leader' => 'boolean',
'bill_kind' => BillKind::class,
'mitgliedsnr' => 'integer',
];
/**

View File

@ -90,6 +90,7 @@ class MemberResource extends JsonResource
'is_leader' => $this->leaderMemberships->count() > 0,
'group_id' => $this->group_id,
'salutation' => $this->salutation,
'mitgliedsnr' => $this->mitgliedsnr,
'comment' => $this->comment,
'links' => [
'show' => route('member.show', ['member' => $this->getModel()]),

View File

@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('members', function (Blueprint $table) {
$table->string('mitgliedsnr')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('members', function (Blueprint $table) {
$table->dropColumn('mitgliedsnr');
});
}
};

View File

@ -1,6 +1,7 @@
<template>
<div class="grid gap-3">
<key-value v-show="inner.nami_id" label="Nami Mitgliedsnummer" :value="inner.nami_id"></key-value>
<key-value v-show="inner.nami_id" label="NaMi ID" :value="inner.nami_id"></key-value>
<key-value v-show="inner.nami_id" label="NaMi Mitgliedsnummer" :value="inner.mitgliedsnr"></key-value>
<key-value label="Beitrag" :value="inner.subscription ? inner.subscription.name : 'kein'"></key-value>
<key-value v-if="inner.joined_at_human" label="Eintrittsdatum" :value="inner.joined_at_human"></key-value>
<key-value v-if="inner.bill_kind_name" label="Rechnung" :value="inner.bill_kind_name"></key-value>

View File

@ -48,11 +48,12 @@ class PullMemberActionTest extends TestCase
'ort' => '::location::',
'version' => 40,
'gruppierung' => 'SG Wald',
'mitgliedsNummer' => 53,
]);
$member = app(PullMemberAction::class)->handle(1000, 1001);
$group = Group::firstWhere('nami_id', 1000);
Group::firstWhere('nami_id', 1000);
$this->assertDatabaseHas('members', [
'firstname' => '::firstname::',
'lastname' => '::lastname::',
@ -69,6 +70,7 @@ class PullMemberActionTest extends TestCase
'zip' => '12346',
'location' => '::location::',
'version' => '40',
'mitgliedsnr' => 53,
]);
$this->assertDatabaseHas('groups', [

View File

@ -71,6 +71,7 @@ class ShowTest extends TestCase
'multiply_more_pv' => true,
'send_newspaper' => true,
'joined_at' => '2022-06-11',
'mitgliedsnr' => 998,
]);
$response = $this->get("/member/{$member->id}");
@ -103,6 +104,7 @@ class ShowTest extends TestCase
'send_newspaper' => true,
'joined_at_human' => '11.06.2022',
'bill_kind_name' => 'Post',
'mitgliedsnr' => 998,
'subscription' => [
'name' => 'Sub',
],