From fe8ea63fa5513d525599693b06700fc8fa5ca35e Mon Sep 17 00:00:00 2001 From: philipp lang Date: Thu, 2 Mar 2023 23:14:25 +0100 Subject: [PATCH] Add mitgliedsnr --- app/Actions/InsertMemberAction.php | 1 + app/Member/Member.php | 1 + app/Member/MemberResource.php | 1 + ...0832_create_members_mitgliedsnr_column.php | 32 +++++++++++++++++++ resources/js/views/member/boxes/System.vue | 3 +- tests/Feature/Member/PullMemberActionTest.php | 4 ++- tests/Feature/Member/ShowTest.php | 2 ++ 7 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 database/migrations/2023_03_02_220832_create_members_mitgliedsnr_column.php diff --git a/app/Actions/InsertMemberAction.php b/app/Actions/InsertMemberAction.php index cc1738c7..7c975e90 100644 --- a/app/Actions/InsertMemberAction.php +++ b/app/Actions/InsertMemberAction.php @@ -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, ]); } diff --git a/app/Member/Member.php b/app/Member/Member.php index d71c18d8..0e135dcc 100644 --- a/app/Member/Member.php +++ b/app/Member/Member.php @@ -74,6 +74,7 @@ class Member extends Model 'multiply_more_pv' => 'boolean', 'is_leader' => 'boolean', 'bill_kind' => BillKind::class, + 'mitgliedsnr' => 'integer', ]; /** diff --git a/app/Member/MemberResource.php b/app/Member/MemberResource.php index 59188ff5..f5552ad9 100644 --- a/app/Member/MemberResource.php +++ b/app/Member/MemberResource.php @@ -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()]), diff --git a/database/migrations/2023_03_02_220832_create_members_mitgliedsnr_column.php b/database/migrations/2023_03_02_220832_create_members_mitgliedsnr_column.php new file mode 100644 index 00000000..12770a13 --- /dev/null +++ b/database/migrations/2023_03_02_220832_create_members_mitgliedsnr_column.php @@ -0,0 +1,32 @@ +string('mitgliedsnr')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('members', function (Blueprint $table) { + $table->dropColumn('mitgliedsnr'); + }); + } +}; diff --git a/resources/js/views/member/boxes/System.vue b/resources/js/views/member/boxes/System.vue index 0d94ff66..f247d93b 100644 --- a/resources/js/views/member/boxes/System.vue +++ b/resources/js/views/member/boxes/System.vue @@ -1,6 +1,7 @@