<?php

declare(strict_types=1);

namespace OCA\Mitgliederverwaltung\Db;

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

/**
 * @method int getMemberId()
 * @method void setMemberId(int $memberId)
 * @method int getStufeId()
 * @method void setStufeId(int $stufeId)
 * @method string getChangedAt()
 * @method void setChangedAt(string $changedAt)
 * @method string getChangedBy()
 * @method void setChangedBy(string $changedBy)
 */
class StufeHistory extends Entity implements JsonSerializable {

    protected int $memberId = 0;
    protected int $stufeId = 0;
    protected string $changedAt = '';
    protected string $changedBy = '';

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

    public function jsonSerialize(): array {
        return [
            'id' => $this->id,
            'memberId' => $this->memberId,
            'stufeId' => $this->stufeId,
            'changedAt' => $this->changedAt,
            'changedBy' => $this->changedBy,
        ];
    }
}
