<?php
declare(strict_types=1);
namespace App\Entity;
use ApiPlatform\Core\Annotation\ApiResource;
use ApiPlatform\Core\Annotation\ApiProperty;
use App\Trait\TimestampableEntity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Serializer\Annotation\MaxDepth;
use Ramsey\Uuid\Uuid;
use Ramsey\Uuid\UuidInterface;
/**
* The most generic type of item.
*
* @see https://schema.org/Thing
*
* @author Jordi Fernandes Alves <jfadev@gmail.com>
*/
#[ORM\Entity]
#[ApiResource(
iri: 'Hire',
itemOperations: [
'get' => ['normalization_context' => ['groups' => 'hire:item:get']],
'put' => [
'normalization_context' => ['groups' => 'hire:item:put'],
'denormalization_context' => ['groups' => 'hire:item:put'],
],
'delete' => [],
],
collectionOperations: [
'get' => [
'normalization_context' => ['groups' => 'hire:collection:get'],
],
'post' => [
'normalization_context' => ['groups' => 'hire:collection:post'],
'denormalization_context' => ['groups' => 'hire:collection:post'],
],
]
)]
class Hire
{
use TimestampableEntity;
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'NONE')]
#[ORM\Column(type: 'uuid', unique: true)]
private ?UuidInterface $id = null;
#[ORM\Column(type: 'datetime', nullable: true)]
#[ApiProperty(iri: 'https://schema.org/hireBegin')]
#[Assert\Type(\DateTimeInterface::class)]
#[Groups(['hire:collection:get', 'hire:collection:post', 'hire:item:get', 'hire:item:put', 'contract:collection:post', 'contract:item:get', 'contract:item:put'])]
private ?\DateTimeInterface $hireBegin = null;
#[ApiProperty(iri: 'https://schema.org/hireBeginDate')]
#[Groups(['contract:item:get'])]
private ?string $hireBeginDate = null;
#[ApiProperty(iri: 'https://schema.org/hireBeginTime')]
#[Groups(['contract:item:get'])]
private ?string $hireBeginTime = null;
#[ORM\Column(type: 'datetime', nullable: true)]
#[ApiProperty(iri: 'https://schema.org/hireEnd')]
#[Assert\Type(\DateTimeInterface::class)]
#[Groups(['hire:collection:get', 'hire:collection:post', 'hire:item:get', 'hire:item:put', 'contract:collection:post', 'contract:item:get', 'contract:item:put'])]
private ?\DateTimeInterface $hireEnd = null;
#[ApiProperty(iri: 'https://schema.org/hireEndDate')]
#[Groups(['contract:item:get'])]
private ?string $hireEndDate = null;
#[ApiProperty(iri: 'https://schema.org/hireEndTime')]
#[Groups(['contract:item:get'])]
private ?string $hireEndTime = null;
#[ORM\Column(type: 'string', nullable: true)]
#[ApiProperty(iri: 'https://schema.org/fuelType')]
#[Assert\Type('string')]
#[Groups(['hire:collection:get', 'hire:collection:post', 'hire:item:get', 'hire:item:put', 'contract:collection:post', 'contract:item:get', 'contract:item:put'])]
private ?string $fuelType = null;
#[ORM\Column(type: 'string', nullable: true)]
#[ApiProperty(iri: 'https://schema.org/fuelType2')]
#[Assert\Type('string')]
#[Groups(['hire:collection:get', 'hire:collection:post', 'hire:item:get', 'hire:item:put', 'contract:collection:post', 'contract:item:get', 'contract:item:put'])]
private ?string $fuelType2 = null;
#[ORM\Column(type: 'string', nullable: true)]
#[ApiProperty(iri: 'https://schema.org/fuelType3')]
#[Assert\Type('string')]
#[Groups(['hire:collection:get', 'hire:collection:post', 'hire:item:get', 'hire:item:put', 'contract:collection:post', 'contract:item:get', 'contract:item:put'])]
private ?string $fuelType3 = null;
#[ORM\Column(type: 'string', nullable: true)]
#[ApiProperty(iri: 'https://schema.org/price')]
#[Assert\Type('string')]
#[Groups(['hire:collection:get', 'hire:collection:post', 'hire:item:get', 'hire:item:put', 'contract:collection:post', 'contract:item:get', 'contract:item:put'])]
private ?string $price = null;
#[ORM\Column(type: 'string', nullable: true)]
#[ApiProperty(iri: 'https://schema.org/price2')]
#[Assert\Type('string')]
#[Groups(['hire:collection:get', 'hire:collection:post', 'hire:item:get', 'hire:item:put', 'contract:collection:post', 'contract:item:get', 'contract:item:put'])]
private ?string $price2 = null;
#[ORM\Column(type: 'string', nullable: true)]
#[ApiProperty(iri: 'https://schema.org/price3')]
#[Assert\Type('string')]
#[Groups(['hire:collection:get', 'hire:collection:post', 'hire:item:get', 'hire:item:put', 'contract:collection:post', 'contract:item:get', 'contract:item:put'])]
private ?string $price3 = null;
#[ORM\Column(type: 'string', nullable: true)]
#[ApiProperty(iri: 'https://schema.org/priceCurrency')]
#[Assert\Type('string')]
#[Groups(['hire:collection:get', 'hire:collection:post', 'hire:item:get', 'hire:item:put', 'contract:collection:post', 'contract:item:get', 'contract:item:put'])]
private ?string $priceCurrency = null;
#[ORM\Column(type: 'string', nullable: true)]
#[ApiProperty(iri: 'https://schema.org/priceCurrency2')]
#[Assert\Type('string')]
#[Groups(['hire:collection:get', 'hire:collection:post', 'hire:item:get', 'hire:item:put', 'contract:collection:post', 'contract:item:get', 'contract:item:put'])]
private ?string $priceCurrency2 = null;
#[ORM\Column(type: 'string', nullable: true)]
#[ApiProperty(iri: 'https://schema.org/priceCurrency3')]
#[Assert\Type('string')]
#[Groups(['hire:collection:get', 'hire:collection:post', 'hire:item:get', 'hire:item:put', 'contract:collection:post', 'contract:item:get', 'contract:item:put'])]
private ?string $priceCurrency3 = null;
#[ORM\Column(type: 'boolean', nullable: true)]
#[ApiProperty(iri: 'https://schema.org/multiFuel')]
#[Groups(['hire:collection:get', 'hire:collection:post', 'hire:item:get', 'hire:item:put', 'contract:collection:post', 'contract:item:get', 'contract:item:put'])]
private ?bool $multiFuel = false;
#[ORM\Column(type: 'datetime', nullable: true)]
#[ApiProperty(iri: 'https://schema.org/offHireBegin')]
#[Assert\Type(\DateTimeInterface::class)]
#[Groups(['hire:collection:get', 'hire:collection:post', 'hire:item:get', 'hire:item:put', 'contract:collection:post', 'contract:item:get', 'contract:item:put'])]
private ?\DateTimeInterface $offHireBegin = null;
#[ApiProperty(iri: 'https://schema.org/offHireBeginDate')]
#[Groups(['contract:item:get'])]
private ?string $offHireBeginDate = null;
#[ApiProperty(iri: 'https://schema.org/offHireBeginTime')]
#[Groups(['contract:item:get'])]
private ?string $offHireBeginTime = null;
#[ORM\Column(type: 'datetime', nullable: true)]
#[ApiProperty(iri: 'https://schema.org/offHireEnd')]
#[Assert\Type(\DateTimeInterface::class)]
#[Groups(['hire:collection:get', 'hire:collection:post', 'hire:item:get', 'hire:item:put', 'contract:collection:post', 'contract:item:get', 'contract:item:put'])]
private ?\DateTimeInterface $offHireEnd = null;
#[ApiProperty(iri: 'https://schema.org/offHireEndDate')]
#[Groups(['contract:item:get'])]
private ?string $offHireEndDate = null;
#[ApiProperty(iri: 'https://schema.org/offHireEndTime')]
#[Groups(['contract:item:get'])]
private ?string $offHireEndTime = null;
#[ORM\Column(type: 'string', nullable: true)]
#[ApiProperty(iri: 'https://schema.org/offHireCost')]
#[Assert\Type('string')]
#[Groups(['hire:collection:get', 'hire:collection:post', 'hire:item:get', 'hire:item:put', 'contract:collection:post', 'contract:item:get', 'contract:item:put'])]
private ?string $offHireCost = null;
#[ORM\Column(type: 'string', nullable: true)]
#[ApiProperty(iri: 'https://schema.org/offHireCostCurrency')]
#[Assert\Type('string')]
#[Groups(['hire:collection:get', 'hire:collection:post', 'hire:item:get', 'hire:item:put', 'contract:collection:post', 'contract:item:get', 'contract:item:put'])]
private ?string $offHireCostCurrency = null;
#[ORM\Column(type: 'string', nullable: true)]
#[ApiProperty(iri: 'https://schema.org/addressCommission')]
#[Assert\Type('string')]
#[Groups(['hire:collection:get', 'hire:collection:post', 'hire:item:get', 'hire:item:put', 'contract:collection:post', 'contract:item:get', 'contract:item:put'])]
private ?string $addressCommission = null;
#[ORM\Column(type: 'string', nullable: true)]
#[ApiProperty(iri: 'https://schema.org/extraCosts')]
#[Assert\Type('string')]
#[Groups(['hire:collection:get', 'hire:collection:post', 'hire:item:get', 'hire:item:put', 'contract:collection:post', 'contract:item:get', 'contract:item:put'])]
private ?string $extraCosts = null;
#[ORM\Column(type: 'string', nullable: true)]
#[ApiProperty(iri: 'https://schema.org/extraCostsCurrency')]
#[Assert\Type('string')]
#[Groups(['hire:collection:get', 'hire:collection:post', 'hire:item:get', 'hire:item:put', 'contract:collection:post', 'contract:item:get', 'contract:item:put'])]
private ?string $extraCostsCurrency = null;
#[ORM\Column(type: 'string', nullable: true)]
#[ApiProperty(iri: 'https://schema.org/extraCostsDescription')]
#[Assert\Type('string')]
#[Groups(['hire:collection:get', 'hire:collection:post', 'hire:item:get', 'hire:item:put', 'contract:collection:post', 'contract:item:get', 'contract:item:put'])]
private ?string $extraCostsDescription = null;
#[ORM\Column(type: 'string', nullable: true)]
#[ApiProperty(iri: 'https://schema.org/totalInvoice')]
#[Assert\Type('string')]
#[Groups(['hire:collection:get', 'hire:collection:post', 'hire:item:get', 'hire:item:put', 'contract:collection:post', 'contract:item:get', 'contract:item:put'])]
private ?string $totalInvoice = null;
#[ORM\Column(type: 'string', nullable: true)]
#[ApiProperty(iri: 'https://schema.org/totalInvoiceCurrency')]
#[Assert\Type('string')]
#[Groups(['hire:collection:get', 'hire:collection:post', 'hire:item:get', 'hire:item:put', 'contract:collection:post', 'contract:item:get', 'contract:item:put'])]
private ?string $totalInvoiceCurrency = null;
#[ORM\Column(type: 'string', nullable: true)]
#[ApiProperty(iri: 'https://schema.org/invoiceStatus')]
#[Assert\Type('string')]
#[Groups(['hire:collection:get', 'hire:collection:post', 'hire:item:get', 'hire:item:put', 'contract:collection:post', 'contract:item:get', 'contract:item:put'])]
private ?string $invoiceStatus = null;
#[ORM\Column(type: 'boolean', nullable: true)]
#[ApiProperty(iri: 'https://schema.org/bunker')]
#[Groups(['hire:collection:get', 'hire:collection:post', 'hire:item:get', 'hire:item:put', 'contract:collection:post', 'contract:item:get', 'contract:item:put'])]
private ?bool $bunker = false;
#[ORM\Column(type: 'boolean', nullable: true)]
#[ApiProperty(iri: 'https://schema.org/finalHire')]
#[Groups(['hire:collection:get', 'hire:collection:post', 'hire:item:get', 'hire:item:put', 'contract:collection:post', 'contract:item:get', 'contract:item:put'])]
private ?bool $finalHire = false;
#[ORM\ManyToOne(targetEntity: 'App\Entity\Contract', inversedBy: 'hires')]
#[ORM\JoinColumn(nullable: true)]
#[ApiProperty(iri: 'https://schema.org/Contract')]
#[Groups(['hire:collection:get', 'hire:collection:post', 'hire:item:get', 'hire:item:put', 'contract:collection:post', 'contract:item:get', 'contract:item:put'])]
#[MaxDepth(1)]
private ?Contract $contract = null;
public function __construct()
{
$this->id = Uuid::uuid4();
}
public function getId(): ?UuidInterface
{
return $this->id;
}
public function getHireBegin(): ?\DateTimeInterface
{
return $this->hireBegin;
}
public function setHireBegin(?\DateTimeInterface $hireBegin): void
{
$this->hireBegin = $hireBegin;
}
public function getHireBeginDate(): ?string
{
return $this->hireBegin ? $this->hireBegin->format('Y-m-d') : null;
}
public function getHireBeginTime(): ?string
{
return $this->hireBegin ? $this->hireBegin->format('H:i') : null;
}
public function getHireEnd(): ?\DateTimeInterface
{
return $this->hireEnd;
}
public function setHireEnd(?\DateTimeInterface $hireEnd): void
{
$this->hireEnd = $hireEnd;
}
public function getHireEndDate(): ?string
{
return $this->hireEnd ? $this->hireEnd->format('Y-m-d') : null;
}
public function getHireEndTime(): ?string
{
return $this->hireEnd ? $this->hireEnd->format('H:i') : null;
}
public function getFuelType(): ?string
{
return $this->fuelType;
}
public function setFuelType(?string $fuelType): void
{
$this->fuelType = $fuelType;
}
public function getFuelType2(): ?string
{
return $this->fuelType2;
}
public function setFuelType2(?string $fuelType2): void
{
$this->fuelType2 = $fuelType2;
}
public function getFuelType3(): ?string
{
return $this->fuelType3;
}
public function setFuelType3(?string $fuelType3): void
{
$this->fuelType3 = $fuelType3;
}
public function getPrice(): ?string
{
return $this->price;
}
public function setPrice(?string $price): void
{
$this->price = $price;
}
public function getPrice2(): ?string
{
return $this->price2;
}
public function setPrice2(?string $price2): void
{
$this->price2 = $price2;
}
public function getPrice3(): ?string
{
return $this->price3;
}
public function setPrice3(?string $price3): void
{
$this->price3 = $price3;
}
public function getPriceCurrency(): ?string
{
return $this->priceCurrency;
}
public function setPriceCurrency(?string $priceCurrency): void
{
$this->priceCurrency = $priceCurrency;
}
public function getPriceCurrency2(): ?string
{
return $this->priceCurrency2;
}
public function setPriceCurrency2(?string $priceCurrency2): void
{
$this->priceCurrency2 = $priceCurrency2;
}
public function getPriceCurrency3(): ?string
{
return $this->priceCurrency3;
}
public function setPriceCurrency3(?string $priceCurrency3): void
{
$this->priceCurrency3 = $priceCurrency3;
}
public function getMultiFuel(): ?bool
{
return $this->multiFuel;
}
public function setMultiFuel(?bool $multiFuel): void
{
$this->multiFuel = $multiFuel;
}
public function setOffHireBegin(?\DateTimeInterface $offHireBegin): void
{
$this->offHireBegin = $offHireBegin;
}
public function getOffHireBegin(): ?\DateTimeInterface
{
return $this->offHireBegin;
}
public function getOffHireBeginDate(): ?string
{
return $this->offHireBegin ? $this->offHireBegin->format('Y-m-d') : null;
}
public function getOffHireBeginTime(): ?string
{
return $this->offHireBegin ? $this->offHireBegin->format('H:i') : null;
}
public function setOffHireEnd(?\DateTimeInterface $offHireEnd): void
{
$this->offHireEnd = $offHireEnd;
}
public function getOffHireEnd(): ?\DateTimeInterface
{
return $this->offHireEnd;
}
public function getOffHireEndDate(): ?string
{
return $this->offHireEnd ? $this->offHireEnd->format('Y-m-d') : null;
}
public function getOffHireEndTime(): ?string
{
return $this->offHireEnd ? $this->offHireEnd->format('H:i') : null;
}
public function getOffHireCost(): ?string
{
return $this->offHireCost;
}
public function setOffHireCost(?string $offHireCost): void
{
$this->offHireCost = $offHireCost;
}
public function getOffHireCostCurrency(): ?string
{
return $this->offHireCostCurrency;
}
public function setOffHireCostCurrency(?string $offHireCostCurrency): void
{
$this->offHireCostCurrency = $offHireCostCurrency;
}
public function getAddressCommission(): ?string
{
return $this->addressCommission;
}
public function setAddressCommission(?string $addressCommission): void
{
$this->addressCommission = $addressCommission;
}
public function getExtraCosts(): ?string
{
return $this->extraCosts;
}
public function setExtraCosts(?string $extraCosts): void
{
$this->extraCosts = $extraCosts;
}
public function getExtraCostsCurrency(): ?string
{
return $this->extraCostsCurrency;
}
public function setExtraCostsCurrency(?string $extraCostsCurrency): void
{
$this->extraCostsCurrency = $extraCostsCurrency;
}
public function getExtraCostsDescription(): ?string
{
return $this->extraCostsDescription;
}
public function setExtraCostsDescription(?string $extraCostsDescription): void
{
$this->extraCostsDescription = $extraCostsDescription;
}
public function getTotalInvoice(): ?string
{
return $this->totalInvoice;
}
public function setTotalInvoice(?string $totalInvoice): void
{
$this->totalInvoice = $totalInvoice;
}
public function getTotalInvoiceCurrency(): ?string
{
return $this->totalInvoiceCurrency;
}
public function setTotalInvoiceCurrency(?string $totalInvoiceCurrency): void
{
$this->totalInvoiceCurrency = $totalInvoiceCurrency;
}
public function getInvoiceStatus(): ?string
{
return $this->invoiceStatus;
}
public function setInvoiceStatus(?string $invoiceStatus): void
{
$this->invoiceStatus = $invoiceStatus;
}
public function getBunker(): ?bool
{
return $this->bunker;
}
public function setBunker(?bool $bunker): void
{
$this->bunker = $bunker;
}
public function getFinalHire(): ?bool
{
return $this->finalHire;
}
public function setFinalHire(?bool $finalHire): void
{
$this->finalHire = $finalHire;
}
public function setContract(?Contract $contract): void
{
$this->contract = $contract;
}
public function getContract(): ?Contract
{
return $this->contract;
}
}