Add update fields

This commit is contained in:
philipp lang 2021-06-21 23:50:28 +02:00
parent 009a9b1678
commit 38fe258f5c
3 changed files with 17 additions and 4 deletions

View File

@ -92,9 +92,11 @@ class Api {
$member = Member::fromAttributes($attributes);
$response = $this->http()->put(self::$url.'/ica/rest/nami/mitglied/filtered-for-navigation/gruppierung/gruppierung/'.$member->group_id.'/'.$member->id, $member->toNami());
if (!data_get($response->json(), 'id')) {
$this->exception('Update failed', $response->json(), $member->toNami());
if (data_get($response->json(), 'success') !== true) {
$this->exception('Update failed', $member->toNami(), $response->json());
}
return $response->json()['data'];
}
public function membershipsOf($memberId): Collection {

View File

@ -80,13 +80,24 @@ class Member extends Model {
'eintrittsdatum' => $this->joined_at.'T00:00:00',
'version' => $this->version,
'beitragsartId' => $this->fee_id,
'regionId' => $this->region_id,
'regionId' => $this->region_id ?: Region::getNullValue(),
'landId' => $this->country_id,
'staatsangehoerigkeitId' => $this->nationality_id,
'geburtsDatum' => $this->birthday,
'geschlechtId' => $this->gender_id ?: Gender::getNullValue(),
'gruppierungId' => $this->group_id,
'id' => $this->id,
'zeitschriftenversand' => $this->send_newspaper,
'telefon1' => $this->main_phone ?: '',
'telefon2' => $this->mobile_phone ?: '',
'telefon3' => $this->work_phone ?: '',
'telefax' => $this->fax ?: '',
'email' => $this->email ?: '',
'emailVertretungsberechtigter' => $this->email_parents ?: '',
'geburtsDatum' => $this->birthday.' 00:00:00',
'nameZusatz' => $this->further_address ?: '',
'konfessionId' => $this->confession_id,
'staatsangehoerigkeitText' => $this->other_country ?: '',
];
}

View File

@ -30,7 +30,7 @@ class NamiUser implements Authenticatable {
}
public function getNamiGroupId() {
return $this->groupid;
return $this->api()->findNr($this->mglnr)->group_id;
}
public function getAuthIdentifierName() {