<?php
namespace App\Entity\Gauge;
use App\Entity\PriceDecision\Distributor;
use App\Repository\Gauge\GaugePropertiesRepository;
use App\Utils\Dataset;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=GaugePropertiesRepository::class)
* @ORM\Table(name="gauge_properties")
*/
class GaugeProperties
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private int $id;
/**
* IČO value of customer
* @var string|null
* @ORM\Column(type="string", nullable=true)
*/
private ?string $customerICO = null;
/**
* Name value of customer
* @var string|null
* @ORM\Column(type="string", nullable=true)
*/
private ?string $customerName = null;
/**
* @ORM\Column(type="string", length=50, nullable=true)
*/
private ?string $customerEmail = null;
/**
* @ORM\Column(type="string", length=50, nullable=true)
*/
private ?string $customerBankAccount = null;
/**
* "EAN code" in case of electricity meter
* "EIC code" in case of gasometer
* "identification number" in case of heat meter
* "VIN code" in case of other fuels
* "evidence number" in case of fuel or thermometer or environment quality meter
*
* @var string|null
* @ORM\Column(type="string", options={"comment":"EAN code in case electricity meter; EIC code in case gasometer; ident number in case heat meter; VIN code in case other fuels; evidence number in case of fuel or thermometer or environment quality meter "}, nullable=true)
*/
private ?string $identifier = null;
/**
* @var string|null
* @ORM\Column(type="string", name="ean_production", nullable=true)
*/
private ?string $eanProduction = null;
/**
* "supply point number" in case of other electricity/gas/water/heat/fuel meter
* @var string|null
* @ORM\Column(type="string", nullable=true)
*/
private ?string $supplyPointNumber = null;
/**
* @var string|null
* @ORM\Column(type="string", nullable=true)
*/
private ?string $meterNumber = null;
/**
* GID - Global Identification for Prague region
* @var string|null
* @ORM\Column(type="string", nullable=true)
*/
private ?string $gid = null;
/**
* @var Gauge
* @ORM\OneToOne(targetEntity="App\Entity\Gauge\Gauge", inversedBy="properties")
* @ORM\JoinColumn(name="gauge_id", referencedColumnName="id", nullable=false)
*/
private Gauge $gauge;
/**
* @var string|null
* @ORM\Column(type="string", nullable=true)
*/
private ?string $model = null;
/**
* @var string|null
* @ORM\Column(type="string", nullable=true)
*/
private ?string $location = null;
/**
* value from Dataset::CONSUMPTION_TYPE_...
* @var int|null
* @ORM\Column(type="smallint", nullable=true)
*/
private ?int $consumptionType = null;
/**
* @var string|null
* @ORM\Column(type="string", nullable=true)
*/
private ?string $measurementType = null;
/**
* @var string|null
* @ORM\Column(type="string", nullable=true)
*/
private ?string $reservedPower = null;
/**
* @var string|null
* @ORM\Column(type="string", nullable=true)
*/
private ?string $reservedCapacity = null;
/**
* @var string|null
* @ORM\Column(type="string", nullable=true)
*/
private ?string $dailyReservedCapacity = null;
/**
* @var int|null
* @ORM\Column(type="smallint", nullable=true)
*/
private ?int $dailyReservedCapacityUnit;
/**
* @var string|null
* @ORM\Column(type="text", nullable=true)
*/
private ?string $note;
/**
* @var string|null
* @ORM\Column(type="string", nullable=true)
*/
private ?string $distributorLink = null;
/**
* values are defined in App\Utils\Period
* @var int|null
* @ORM\Column(type="smallint", nullable=true)
*/
private ?int $invoicePeriod = null;
/**
* values are defined in App\Utils\Period
* @var int|null
* @ORM\Column(type="smallint", nullable=true)
*/
private ?int $invoiceDepositPeriod = null;
/**
* @var bool
* @ORM\Column(type="boolean")
*/
private bool $involvedInPurchase = false;
/**
* @var bool
* @ORM\Column(type="boolean")
*/
private bool $centralDelivery = false;
/**
* @var Supplier|null
* @ORM\ManyToOne(targetEntity="App\Entity\Gauge\Supplier", cascade={"persist"})
* @ORM\JoinColumn(name="supplier_id", referencedColumnName="id", nullable=true)
*/
private ?Supplier $supplier = null;
/**
* @var \DateTime|null
*
* @ORM\Column(type="datetime", nullable=true)
*/
private ?\DateTime $supplierContractValidTo = null;
/**
* values are defined in App\Utils\Dataset::PAYMENT_RANGE_...
* @var int|null
* @ORM\Column(type="smallint", nullable=true)
*/
private ?int $paymentsRange = null;
/**
* values are defined in App\Utils\Dataset::COSTS_IN_RESULTS_...
* @var int|null
* @ORM\Column(type="smallint", nullable=true)
*/
private ?int $costsInResults = Dataset::COSTS_IN_RESULTS_ON;
/**
* @var bool|null
* @ORM\Column(type="boolean", nullable=true)
*/
private ?bool $forceLowTariff = false;
/**
* @var bool|null
* @ORM\Column(type="boolean", nullable=true)
*/
private ?bool $forceSpecialTariff = false;
/**
* @var int|null
* @ORM\Column(type="smallint", nullable=true)
*/
private ?int $invoiceIncomePeriod;
/**
* @var string|null
* @ORM\Column(type="string", nullable=true)
*/
private ?string $productionBuyer = null;
/**
* @var string|null
* @ORM\Column(type="string", name="supply_point_usage", nullable=true)
*/
private ?string $supplyPointUsage = null;
/**
* @var string|null
* @ORM\Column(type="string", name="annual_consumption", nullable=true)
*/
private ?string $annualConsumption = null;
/**
* @var string|null
* @ORM\Column(type="string", name="gasometer_rate", nullable=true)
*/
private ?string $gasometerRate = null;
/**
* @var string|null
* @ORM\Column(type="string", nullable=true)
*/
private ?string $tdd = null;
/**
* @var int|null
* @ORM\Column(type="smallint", name="tdd_el", nullable=true)
*/
private ?int $tddEl = null;
/**
* @var bool
* @ORM\Column(type="boolean", options={"default" : 0})
*/
private bool $overflowFVE = false;
/**
* values are defined in App\Utils\GaugeType::PRODUCTION_TYPE_...
* @var int|null
* @ORM\Column(type="smallint", nullable=true)
*/
private ?int $productionType = null;
/**
* @var bool
* @ORM\Column(type="boolean", options={"default" : 0})
*/
private bool $electricitySharingConsumption = false;
/**
* @var bool
* @ORM\Column(type="boolean", options={"default" : 0})
*/
private bool $electricitySharingProduction = false;
/**
* GaugeProperties constructor.
* @param Gauge $gauge
*/
public function __construct(Gauge $gauge)
{
$this->gauge = $gauge;
}
/**
* @return int
*/
public function getId(): int
{
return $this->id;
}
/**
* @return string|null
*/
public function getCustomerICO(): ?string
{
return $this->customerICO;
}
/**
* @param string|null $customerICO
* @return self
*/
public function setCustomerICO(?string $customerICO): self
{
$this->customerICO = $customerICO;
return $this;
}
/**
* @return string|null
*/
public function getCustomerName(): ?string
{
return $this->customerName;
}
/**
* @param string|null $customerName
* @return self
*/
public function setCustomerName(?string $customerName): self
{
$this->customerName = $customerName;
return $this;
}
public function getCustomerEmail(): ?string
{
return $this->customerEmail;
}
public function setCustomerEmail(?string $customerEmail): self
{
$this->customerEmail = $customerEmail;
return $this;
}
public function getCustomerBankAccount(): ?string
{
return $this->customerBankAccount;
}
public function setCustomerBankAccount(?string $customerBankAccount): self
{
$this->customerBankAccount = $customerBankAccount;
return $this;
}
/**
* @return string|null
*/
public function getIdentifier(): ?string
{
return $this->identifier;
}
/**
* @param string|null $identifier
* @return self
*/
public function setIdentifier(?string $identifier): self
{
$this->identifier = $identifier;
return $this;
}
/**
* @return string|null
*/
public function getEanProduction(): ?string
{
if ($this->eanProduction === null && $this->gauge->getParent() !== null) {
return $this->gauge->getParent()->getProperties()->getEanProduction();
}
return $this->eanProduction;
}
/**
* @param string|null $eanProduction
* @return self
*/
public function setEanProduction(?string $eanProduction): self
{
$this->eanProduction = $eanProduction;
return $this;
}
/**
* @return string|null
*/
public function getSupplyPointNumber(): ?string
{
return $this->supplyPointNumber;
}
/**
* @param string|null $supplyPointNumber
* @return self
*/
public function setSupplyPointNumber(?string $supplyPointNumber): self
{
$this->supplyPointNumber = $supplyPointNumber;
return $this;
}
/**
* @return string|null
*/
public function getMeterNumber(): ?string
{
return $this->meterNumber;
}
/**
* @param string|null $meterNumber
* @return self
*/
public function setMeterNumber(?string $meterNumber): self
{
$this->meterNumber = $meterNumber;
return $this;
}
public function getGid(): ?string
{
return $this->gid;
}
public function setGid(?string $gid): self
{
$this->gid = $gid;
return $this;
}
/**
* Returns gauge GID if set, otherwise building GID, otherwise null.
*/
public function getEffectiveGid(): ?string
{
if ($this->gid !== null) {
return $this->gid;
}
return $this->gauge->getBuilding()->getGid();
}
/**
* @return Gauge
*/
public function getGauge(): Gauge
{
return $this->gauge;
}
/**
* @param Gauge $gauge
* @return self
*/
public function setGauge(Gauge $gauge): self
{
$this->gauge = $gauge;
return $this;
}
/**
* @return string|null
*/
public function getModel(): ?string
{
return $this->model;
}
/**
* @param string|null $model
* @return self
*/
public function setModel(?string $model): self
{
$this->model = $model;
return $this;
}
/**
* @return string|null
*/
public function getLocation(): ?string
{
return $this->location;
}
/**
* @param string|null $location
* @return self
*/
public function setLocation(?string $location): self
{
$this->location = $location;
return $this;
}
/**
* @return int|null
*/
public function getConsumptionType(): ?int
{
return $this->consumptionType;
}
/**
* @param int|null $consumptionType
* @return self
*/
public function setConsumptionType(?int $consumptionType): self
{
$this->consumptionType = $consumptionType;
return $this;
}
/**
* @return string|null
*/
public function getMeasurementType(): ?string
{
return $this->measurementType;
}
/**
* @param string|null $measurementType
* @return self
*/
public function setMeasurementType(?string $measurementType): self
{
$this->measurementType = $measurementType;
return $this;
}
/**
* @return string|null
*/
public function getReservedPower(): ?string
{
return $this->reservedPower;
}
/**
* @param string|null $reservedPower
* @return self
*/
public function setReservedPower(?string $reservedPower): self
{
$this->reservedPower = $reservedPower;
return $this;
}
/**
* @return string|null
*/
public function getReservedCapacity(): ?string
{
return $this->reservedCapacity;
}
/**
* @param string|null $reservedCapacity
* @return self
*/
public function setReservedCapacity(?string $reservedCapacity): self
{
$this->reservedCapacity = $reservedCapacity;
return $this;
}
/**
* @return string|null
*/
public function getDailyReservedCapacity(): ?string
{
return $this->dailyReservedCapacity;
}
/**
* @param string|null $dailyReservedCapacity
* @return self
*/
public function setDailyReservedCapacity(?string $dailyReservedCapacity): self
{
$this->dailyReservedCapacity = $dailyReservedCapacity;
return $this;
}
/**
* @return int|null
*/
public function getDailyReservedCapacityUnit(): ?int
{
return $this->dailyReservedCapacityUnit;
}
/**
* @param int|null $dailyReservedCapacityUnit
* @return self
*/
public function setDailyReservedCapacityUnit(?int $dailyReservedCapacityUnit): self
{
$this->dailyReservedCapacityUnit = $dailyReservedCapacityUnit;
return $this;
}
/**
* @return string|null
*/
public function getNote(): ?string
{
return $this->note;
}
/**
* @param string|null $note
* @return self
*/
public function setNote(?string $note): self
{
$this->note = $note;
return $this;
}
/**
* @return string|null
*/
public function getDistributorLink(): ?string
{
return $this->distributorLink;
}
/**
* @param string|null $distributorLink
* @return self
*/
public function setDistributorLink(?string $distributorLink): self
{
$this->distributorLink = $distributorLink;
return $this;
}
/**
* @return int|null
*/
public function getInvoicePeriod(): ?int
{
return $this->invoicePeriod;
}
/**
* @param int|null $invoicePeriod
* @return self
*/
public function setInvoicePeriod(?int $invoicePeriod): self
{
$this->invoicePeriod = $invoicePeriod;
return $this;
}
/**
* @return int|null
*/
public function getInvoiceDepositPeriod(): ?int
{
return $this->invoiceDepositPeriod;
}
/**
* @param int|null $invoiceDepositPeriod
* @return self
*/
public function setInvoiceDepositPeriod(?int $invoiceDepositPeriod): self
{
$this->invoiceDepositPeriod = $invoiceDepositPeriod;
return $this;
}
/**
* @return bool
*/
public function isInvolvedInPurchase(): bool
{
return $this->involvedInPurchase;
}
/**
* @param bool $involvedInPurchase
* @return self
*/
public function setInvolvedInPurchase(bool $involvedInPurchase): self
{
$this->involvedInPurchase = $involvedInPurchase;
return $this;
}
/**
* @return bool
*/
public function isCentralDelivery(): bool
{
return $this->centralDelivery;
}
/**
* @param bool $centralDelivery
* @return self
*/
public function setCentralDelivery(bool $centralDelivery): self
{
$this->centralDelivery = $centralDelivery;
return $this;
}
/**
* @return Supplier|null
*/
public function getSupplier(): ?Supplier
{
return $this->supplier;
}
/**
* @param Supplier|null $supplier
* @return $this
*/
public function setSupplier(?Supplier $supplier): GaugeProperties
{
$this->supplier = $supplier;
return $this;
}
/**
* @return \DateTime|null
*/
public function getSupplierContractValidTo(): ?\DateTime
{
return $this->supplierContractValidTo;
}
/**
* @param \DateTime|null $supplierContractValidTo
* @return self
*/
public function setSupplierContractValidTo(?\DateTime $supplierContractValidTo): self
{
$this->supplierContractValidTo = $supplierContractValidTo;
return $this;
}
/**
* @return int|null
*/
public function getPaymentsRange(): ?int
{
return $this->paymentsRange;
}
/**
* @param int|null $paymentsRange
* @return self
*/
public function setPaymentsRange(?int $paymentsRange): self
{
$this->paymentsRange = $paymentsRange;
return $this;
}
/**
* @return int|null
*/
public function getCostsInResults(): ?int
{
return $this->costsInResults;
}
/**
* @param int|null $costsInResults
* @return self
*/
public function setCostsInResults(?int $costsInResults): self
{
$this->costsInResults = $costsInResults;
return $this;
}
/**
* @return bool|null
*/
public function getForceLowTariff(): ?bool
{
return $this->forceLowTariff;
}
/**
* @param bool|null $forceLowTariff
* @return GaugeProperties
*/
public function setForceLowTariff(?bool $forceLowTariff): GaugeProperties
{
$this->forceLowTariff = $forceLowTariff;
return $this;
}
/**
* @return bool|null
*/
public function getForceSpecialTariff(): ?bool
{
return $this->forceSpecialTariff;
}
/**
* @param bool|null $forceSpecialTariff
* @return GaugeProperties
*/
public function setForceSpecialTariff(?bool $forceSpecialTariff): GaugeProperties
{
$this->forceSpecialTariff = $forceSpecialTariff;
return $this;
}
public function setElectricityDistributor(?Distributor $elDistributor): GaugeProperties
{
$this->gauge->setElectricityDistributor($elDistributor);
return $this;
}
public function getElectricityDistributor(): ?Distributor
{
return $this->gauge->getElectricityDistributor();
}
/**
* @return int|null
*/
public function getInvoiceIncomePeriod(): ?int
{
return $this->invoiceIncomePeriod;
}
public function setInvoiceIncomePeriod(?int $invoiceIncomePeriod): GaugeProperties
{
$this->invoiceIncomePeriod = $invoiceIncomePeriod;
return $this;
}
public function setProductionBuyer(?string $productionBuyer): GaugeProperties
{
$this->productionBuyer = $productionBuyer;
return $this;
}
/**
* @return string|null
*/
public function getProductionBuyer(): ?string
{
return $this->productionBuyer;
}
/**
* @return string|null
*/
public function getSupplyPointUsage(): ?string
{
return $this->supplyPointUsage;
}
/**
* @param string|null $supplyPointUsage
* @return GaugeProperties
*/
public function setSupplyPointUsage(?string $supplyPointUsage): GaugeProperties
{
$this->supplyPointUsage = $supplyPointUsage;
return $this;
}
/**
* @return string|null
*/
public function getAnnualConsumption(): ?string
{
return $this->annualConsumption;
}
/**
* @param string|null $annualConsumption
* @return GaugeProperties
*/
public function setAnnualConsumption(?string $annualConsumption): GaugeProperties
{
$this->annualConsumption = $annualConsumption;
return $this;
}
/**
* @return string|null
*/
public function getGasometerRate(): ?string
{
return $this->gasometerRate;
}
/**
* @param string|null $gasometerRate
* @return GaugeProperties
*/
public function setGasometerRate(?string $gasometerRate): GaugeProperties
{
$this->gasometerRate = $gasometerRate;
return $this;
}
/**
* @return string|null
*/
public function getTdd(): ?string
{
if (!$this->gauge->isMain() && $this->gauge->getParent() !== null) {
return $this->gauge->getParent()->getProperties()->getTdd();
}
return $this->tdd;
}
/**
* @param string|null $tdd
* @return GaugeProperties
*/
public function setTdd(?string $tdd): GaugeProperties
{
$this->tdd = $tdd;
return $this;
}
/**
* @return int|null
*/
public function getTddEl(): ?int
{
if (!$this->gauge->isMain() && $this->gauge->getParent() !== null) {
return $this->gauge->getParent()->getProperties()->getTddEl();
}
return $this->tddEl;
}
/**
* @param int|null $tddEl
* @return GaugeProperties
*/
public function setTddEl(?int $tddEl): GaugeProperties
{
$this->tddEl = $tddEl;
return $this;
}
public function isOverflowFVE(): bool
{
return $this->overflowFVE;
}
public function setOverflowFVE(bool $overflowFVE): GaugeProperties
{
$this->overflowFVE = $overflowFVE;
return $this;
}
public function getProductionType(): ?int
{
return $this->productionType;
}
public function setProductionType(?int $productionType): GaugeProperties
{
$this->productionType = $productionType;
return $this;
}
public function isElectricitySharingConsumption(): bool
{
return $this->electricitySharingConsumption;
}
public function setElectricitySharingConsumption(bool $electricitySharingConsumption): void
{
$this->electricitySharingConsumption = $electricitySharingConsumption;
}
public function isElectricitySharingProduction(): bool
{
return $this->electricitySharingProduction;
}
public function setElectricitySharingProduction(bool $electricitySharingProduction): void
{
$this->electricitySharingProduction = $electricitySharingProduction;
}
}