diff --git a/src/Api.php b/src/Api.php index 6a9ea77..11a6216 100644 --- a/src/Api.php +++ b/src/Api.php @@ -165,6 +165,12 @@ class Api { }); } + public function feesOf($groupid) { + return collect($this->http()->get(self::$url."/ica/rest/namiBeitrag/beitragsartmgl/gruppierung/{$groupid}")['data'])->map(function($fee) { + return Fee::fromNami($fee); + }); + } + public function confessions(): Collection { return collect($this->http()->get(self::$url."/ica/rest/baseadmin/konfession")['data'])->map(function($gender) { return Confession::fromNami($gender); @@ -209,14 +215,6 @@ class Api { // ------------------------------------- - public function fees() { - $response = $this->client->get("/ica/rest/namiBeitrag/beitragsartmgl/gruppierung/{$this->user->getNamiGroupId()}", [ - 'cookies' => $this->cookie - ]); - - return json_decode((string)$response->getBody()); - } - public function regions() { $response = $this->client->get("/ica/rest/baseadmin/region", [ 'cookies' => $this->cookie diff --git a/src/Fee.php b/src/Fee.php new file mode 100644 index 0000000..f99c7ce --- /dev/null +++ b/src/Fee.php @@ -0,0 +1,21 @@ + $name, + 'id' => $item['id'] + ]); + } + +} diff --git a/src/Group.php b/src/Group.php index 89616f5..d646bc6 100644 --- a/src/Group.php +++ b/src/Group.php @@ -28,6 +28,10 @@ class Group implements Arrayable { return Nami::subgroupsOf($this->id); } + public function fees() { + return Nami::feesOf($this->id); + } + public function members(): MemberCollection { $members = Nami::membersOf($this->id);