<?php

namespace Lc\CaracoleBundle\Model\Order;

use Doctrine\ORM\Mapping as ORM;
use Lc\CaracoleBundle\Doctrine\Extension\OrderPayoffInterface;
use Lc\CaracoleBundle\Doctrine\Extension\OrderPayoffTrait;
use Lc\CaracoleBundle\Model\File\DocumentInterface;
use Lc\SovBundle\Doctrine\Pattern\AbstractLightEntity;

/**
 * @ORM\MappedSuperclass()
 */
abstract class OrderRefundModel extends AbstractLightEntity implements OrderPayoffInterface, OrderRefundInterface
{
    use OrderPayoffTrait;

    /**
     * @ORM\Column(type="float", nullable=true)
     */
    protected $deliveryRefundAmount;

    /**
     * @ORM\OneToOne(targetEntity="Lc\CaracoleBundle\Model\File\DocumentInterface", inversedBy="orderRefund", cascade={"persist", "remove"})
     * @ORM\JoinColumn(nullable=false)
     */
    protected $document;

    public function getDeliveryRefundAmount(): ?float
    {
        return $this->deliveryRefundAmount;
    }

    public function setDeliveryRefundAmount(?float $deliveryRefundAmount): self
    {
        $this->deliveryRefundAmount = $deliveryRefundAmount;

        return $this;
    }

    public function getDocument(): ?DocumentInterface
    {
        return $this->document;
    }

    public function setDocument(DocumentInterface $document): self
    {
        $this->document = $document;

        return $this;
    }
}