<?php

declare(strict_types=1);

namespace OCA\Mitgliederverwaltung\Db;

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

/**
 * Injury entity mapping oc_mv_injuries.
 *
 * Part of Issue #57.
 *
 * @method string getDatum()
 * @method void setDatum(string $datum)
 * @method int getMemberId()
 * @method void setMemberId(int $memberId)
 * @method int|null getLagerId()
 * @method void setLagerId(?int $lagerId)
 * @method string|null getActivityName()
 * @method void setActivityName(?string $activityName)
 * @method string getBeschreibung()
 * @method void setBeschreibung(string $beschreibung)
 * @method string|null getUhrzeit()
 * @method void setUhrzeit(?string $uhrzeit)
 * @method string getCreatedBy()
 * @method void setCreatedBy(string $createdBy)
 * @method string getCreatedAt()
 * @method void setCreatedAt(string $createdAt)
 */
class Injury extends Entity implements JsonSerializable {

    protected string $datum = '';
    protected ?string $uhrzeit = null;
    protected int $memberId = 0;
    protected ?int $lagerId = null;
    protected ?string $activityName = null;
    protected string $beschreibung = '';
    protected string $createdBy = '';
    protected string $createdAt = '';

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

    public function jsonSerialize(): array {
        return [
            'id' => $this->id,
            'datum' => $this->datum,
            'uhrzeit' => $this->uhrzeit,
            'memberId' => $this->memberId,
            'lagerId' => $this->lagerId,
            'activityName' => $this->activityName,
            'beschreibung' => $this->beschreibung,
            'createdBy' => $this->createdBy,
            'createdAt' => $this->createdAt,
        ];
    }
}
