<?php

declare(strict_types=1);

namespace OCA\Mitgliederverwaltung\Db;

use JsonSerializable;
use OCP\AppFramework\Db\Entity;

/**
 * Member entity mapping all columns from oc_mv_members.
 *
 * @method string getVorname()
 * @method void setVorname(string $vorname)
 * @method string getNachname()
 * @method void setNachname(string $nachname)
 * @method string|null getGeburtsdatum()
 * @method void setGeburtsdatum(?string $geburtsdatum)
 * @method string|null getGeschlecht()
 * @method void setGeschlecht(?string $geschlecht)
 * @method string getRolle()
 * @method void setRolle(string $rolle)
 * @method int|null getStufeId()
 * @method void setStufeId(?int $stufeId)
 * @method string getEintritt()
 * @method void setEintritt(string $eintritt)
 * @method string|null getAustritt()
 * @method void setAustritt(?string $austritt)
 * @method string getStatus()
 * @method void setStatus(string $status)
 * @method string|null getAllergienEncrypted()
 * @method void setAllergienEncrypted(?string $allergienEncrypted)
 * @method string|null getNotizen()
 * @method void setNotizen(?string $notizen)
 * @method string|null getZusatzNotizen()
 * @method void setZusatzNotizen(?string $zusatzNotizen)
 * @method string|null getKvTyp()
 * @method void setKvTyp(?string $kvTyp)
 * @method string|null getKvName()
 * @method void setKvName(?string $kvName)
 * @method int|null getFamilyId()
 * @method void setFamilyId(?int $familyId)
 * @method string|null getFrozenFeeRate()
 * @method void setFrozenFeeRate(?string $frozenFeeRate)
 * @method string|null getCalendarEventUri()
 * @method void setCalendarEventUri(?string $calendarEventUri)
 * @method string|null getContactVcardUri()
 * @method void setContactVcardUri(?string $contactVcardUri)
 * @method string getCreatedAt()
 * @method void setCreatedAt(string $createdAt)
 * @method string getUpdatedAt()
 * @method void setUpdatedAt(string $updatedAt)
 * @method string|null getDeletedAt()
 * @method void setDeletedAt(?string $deletedAt)
 * @method string|null getEinwilligungDatum()
 * @method void setEinwilligungDatum(?string $einwilligungDatum)
 * @method string|null getJuleicaNummer()
 * @method void setJuleicaNummer(?string $juleicaNummer)
 * @method string|null getJuleicaAblaufdatum()
 * @method void setJuleicaAblaufdatum(?string $juleicaAblaufdatum)
 */
class Member extends Entity implements JsonSerializable {

    protected string $vorname = '';
    protected string $nachname = '';
    protected ?string $geburtsdatum = null;
    protected ?string $geschlecht = null;
    protected string $rolle = 'mitglied';
    protected ?int $stufeId = null;
    protected string $eintritt = '';
    protected ?string $austritt = null;
    protected string $status = 'aktiv';
    protected ?string $allergienEncrypted = null;
    protected ?string $notizen = null;
    protected ?string $zusatzNotizen = null;
    protected ?string $kvTyp = null;
    protected ?string $kvName = null;
    protected ?int $familyId = null;
    protected ?string $frozenFeeRate = null;
    protected ?string $calendarEventUri = null;
    protected ?string $contactVcardUri = null;
    protected string $createdAt = '';
    protected string $updatedAt = '';
    protected ?string $deletedAt = null;
    protected ?string $einwilligungDatum = null;
    protected ?string $juleicaNummer = null;
    protected ?string $juleicaAblaufdatum = null;

    public function __construct() {
        $this->addType('id', 'integer');
        $this->addType('stufeId', 'integer');
        $this->addType('familyId', 'integer');
    }

    public function jsonSerialize(): array {
        return [
            'id' => $this->id,
            'vorname' => $this->vorname,
            'nachname' => $this->nachname,
            'geburtsdatum' => $this->geburtsdatum,
            'geschlecht' => $this->geschlecht,
            'rolle' => $this->rolle,
            'stufeId' => $this->stufeId,
            'eintritt' => $this->eintritt,
            'austritt' => $this->austritt,
            'status' => $this->status,
            'allergienEncrypted' => $this->allergienEncrypted,
            'notizen' => $this->notizen,
            'zusatzNotizen' => $this->zusatzNotizen,
            'kvTyp' => $this->kvTyp,
            'kvName' => $this->kvName,
            'familyId' => $this->familyId,
            'frozenFeeRate' => $this->frozenFeeRate,
            'calendarEventUri' => $this->calendarEventUri,
            'contactVcardUri' => $this->contactVcardUri,
            'createdAt' => $this->createdAt,
            'updatedAt' => $this->updatedAt,
            'deletedAt' => $this->deletedAt,
            'einwilligungDatum' => $this->einwilligungDatum,
            'juleicaNummer' => $this->juleicaNummer,
            'juleicaAblaufdatum' => $this->juleicaAblaufdatum,
        ];
    }
}
