<?php

namespace Cobblestone\CcLogin\Entity;

use JMS\Serializer\Annotation as Serializer;

/**
 * Represents a Lease from the User Rights Management database
 *
 * Class Lease
 * @package Cobblestone\CcLogin\Entity
 */
class Lease
{
    /**
     * @Serializer\Groups({"lease"})
     *
     * @var int
     */
    private $id;

    /**
     * Which asset the lease is attached to
     *
     * @var int
     */
    private $assetId;

    /**
     * @Serializer\Groups({"lease"})
     *
     * @var string
     */
    private $address;

    /**
     * Zip is nullable in the User Rights Management database, so the field here is also nullable
     *
     * @var string|null
     */
    private $zip;

    /**
     * Lease constructor.
     * @param int $id
     * @param int $assetId
     * @param string $address
     * @param null|string $zip
     */
    public function __construct
    (
        int $id,
        int $assetId,
        string $address,
        ?string $zip = null
    )
    {
        $this->id = $id;
        $this->assetId = $assetId;
        $this->address = $address;
        $this->zip = $zip;
    }

    /**
     * @return int
     */
    public function getId(): int
    {
        return $this->id;
    }

    /**
     * @param int $id
     */
    public function setId(int $id): void
    {
        $this->id = $id;
    }

    /**
     * @return int
     */
    public function getAssetId(): int
    {
        return $this->assetId;
    }

    /**
     * @param int $assetId
     */
    public function setAssetId(int $assetId): void
    {
        $this->assetId = $assetId;
    }

    /**
     * @return string
     */
    public function getAddress(): string
    {
        return $this->address;
    }

    /**
     * @param string $address
     */
    public function setAddress(string $address): void
    {
        $this->address = $address;
    }

    /**
     * @return null|string
     */
    public function getZip(): ?string
    {
        return $this->zip;
    }

    /**
     * @param null|string $zip
     */
    public function setZip(?string $zip): void
    {
        $this->zip = $zip;
    }
}