src/Entity/Contract.php line 91

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Entity;
  4. use ApiPlatform\Core\Annotation\ApiFilter;
  5. use ApiPlatform\Core\Annotation\ApiProperty;
  6. use ApiPlatform\Core\Annotation\ApiResource;
  7. use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\OrderFilter;
  8. use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter;
  9. use App\Trait\TimestampableEntity;
  10. use Doctrine\Common\Collections\ArrayCollection;
  11. use Doctrine\Common\Collections\Collection;
  12. use Doctrine\ORM\Mapping as ORM;
  13. use Symfony\Component\Validator\Constraints as Assert;
  14. use Symfony\Component\Serializer\Annotation\Groups;
  15. use Symfony\Component\Serializer\Annotation\MaxDepth;
  16. use Ramsey\Uuid\Uuid;
  17. use Ramsey\Uuid\UuidInterface;
  18. /**
  19.  * @see https://schema.org/Thing
  20.  *
  21.  * @author Jordi Fernandes Alves <jfadev@gmail.com>
  22.  */
  23. #[ORM\Entity]
  24. #[ApiResource(
  25.     iri'Contract',
  26.     itemOperations: [
  27.         'get' => ['normalization_context' => ['groups' => 'contract:item:get''enable_max_depth' => true]],
  28.         'put' => [
  29.             'normalization_context' => ['groups' => 'contract:item:put''enable_max_depth' => true],
  30.             'denormalization_context' => ['groups' => 'contract:item:put''enable_max_depth' => true],
  31.         ],
  32.         'delete' => [],
  33.     ],
  34.     collectionOperations: [
  35.         'get' => [
  36.             'normalization_context' => [
  37.                 'groups' => ['contract:collection:get''createdAt'],
  38.                 'enable_max_depth' => true,
  39.             ],
  40.         ],
  41.         'post' => [
  42.             'normalization_context' => ['groups' => 'contract:collection:post''enable_max_depth' => true],
  43.             'denormalization_context' => ['groups' => 'contract:collection:post''enable_max_depth' => true],
  44.         ],
  45.     ],
  46. )]
  47. #[ApiFilter(
  48.     SearchFilter::class,
  49.     properties: [
  50.         'contractNumber' => 'start',
  51.         'contractType' => 'exact',
  52.         'vessel.vesselName' => 'partial',
  53.         'charterer.companyName' => 'partial',
  54.         'owner.companyName' => 'partial',
  55.         'broker.name' => 'partial',
  56.         'operator.name' => 'partial',
  57.         'laycanStart' => 'start',
  58.         'laycanEnd' => 'start',
  59.         'status' => 'exact',
  60.         'createdAt' => 'start',
  61.         'demurrageStatus' => 'exact',
  62.         'addressCommission' => 'partial',
  63.         'finalDemurrageCost' => 'partial',
  64.         'demurragePaymentDate' => 'start'
  65.     ],
  66. )]
  67. #[ApiFilter(
  68.     OrderFilter::class,
  69.     properties: [
  70.         'contractNumber',
  71.         'contractType',
  72.         'vessel.vesselName',
  73.         'charterer.companyName',
  74.         'owner.companyName',
  75.         'broker.name',
  76.         'operator.name',
  77.         'laycanStart',
  78.         'laycanEnd',
  79.         'status',
  80.         'createdAt',
  81.         'demurrageStatus',
  82.         'addressCommission',
  83.         'finalDemurrageCost',
  84.         'demurragePaymentDate'
  85.     ],
  86. )]
  87. class Contract
  88. {
  89.     use TimestampableEntity;
  90.     public const COST_TYPES = [
  91.         'PMT',
  92.         'LUMPSUM'
  93.     ];
  94.     
  95.     #[ORM\Id]
  96.     #[ORM\GeneratedValue(strategy'NONE')]
  97.     #[ORM\Column(type'uuid'uniquetrue)]
  98.     private ?UuidInterface $id null;
  99.     #[ORM\Column(type'string'nullablefalseuniquetrue)]
  100.     #[ApiProperty(iri'https://schema.org/contractNumber')]
  101.     #[Assert\NotBlank]
  102.     #[Assert\Type('string')]
  103.     #[Groups(['contract:item:get''contract:item:put''contract:collection:get''contract:collection:post'])]
  104.     private ?string $contractNumber null;
  105.     #[ORM\Column(type'date'nullabletrue)]
  106.     #[ApiProperty(iri'https://schema.org/contractDate')]
  107.     // #[Assert\NotBlank]
  108.     #[Assert\Type(\DateTimeInterface::class)]
  109.     #[Groups(['contract:item:get''contract:item:put''contract:collection:get''contract:collection:post'])]
  110.     private ?\DateTimeInterface $contractDate null;
  111.     #[ORM\Column(type'string'nullabletrue)]
  112.     #[ApiProperty(iri'https://schema.org/contractType')]
  113.     #[Assert\NotBlank]
  114.     #[Assert\Type('string')]
  115.     #[Groups(['contract:item:get''contract:item:put''contract:collection:get''contract:collection:post'])]
  116.     private ?string $contractType null;
  117.     #[ORM\Column(type'datetime'nullabletrue)]
  118.     #[ApiProperty(iri'https://schema.org/laycanStart')]
  119.     // #[Assert\NotBlank]
  120.     #[Assert\Type(\DateTimeInterface::class)]
  121.     #[Groups(['contract:item:get''contract:item:put''contract:collection:get''contract:collection:post'])]
  122.     private ?\DateTimeInterface $laycanStart null;
  123.     #[ApiProperty(iri'https://schema.org/laycanStartDate')]
  124.     #[Groups(['contract:item:get'])]
  125.     private ?string $laycanStartDate null;
  126.     #[ApiProperty(iri'https://schema.org/laycanStartTime')]
  127.     #[Groups(['contract:item:get'])]
  128.     private ?string $laycanStartTime null;
  129.     #[ORM\Column(type'datetime'nullabletrue)]
  130.     #[ApiProperty(iri'https://schema.org/laycanEnd')]
  131.     // #[Assert\NotBlank]
  132.     #[Assert\Type(\DateTimeInterface::class)]
  133.     #[Groups(['contract:item:get''contract:item:put''contract:collection:get''contract:collection:post'])]
  134.     private ?\DateTimeInterface $laycanEnd null;
  135.     #[ApiProperty(iri'https://schema.org/laycanEndDate')]
  136.     #[Groups(['contract:item:get'])]
  137.     private ?string $laycanEndDate null;
  138.     #[ApiProperty(iri'https://schema.org/laycanEndTime')]
  139.     #[Groups(['contract:item:get'])]
  140.     private ?string $laycanEndTime null;
  141.     #[ORM\ManyToOne(targetEntity'App\Entity\Vessel'inversedBy'contracts')]
  142.     #[ORM\JoinColumn(nullabletrue)]
  143.     #[ApiProperty(iri'https://schema.org/vessel')]
  144.     #[Groups(['contract:item:get''contract:item:put''contract:collection:get''contract:collection:post'])]
  145.     private ?Vessel $vessel null;
  146.     #[ORM\ManyToOne(targetEntity'App\Entity\Owner'inversedBy'contracts')]
  147.     #[ORM\JoinColumn(nullabletrue)]
  148.     #[ApiProperty(iri'https://schema.org/Owner')]
  149.     #[Groups(['contract:collection:get''contract:collection:post''contract:item:get''contract:item:put'])]
  150.     #[MaxDepth(1)]
  151.     private ?Owner $owner null;
  152.     #[ORM\ManyToOne(targetEntity'App\Entity\Charterer'inversedBy'contracts')]
  153.     #[ORM\JoinColumn(nullabletrue)]
  154.     #[ApiProperty(iri'https://schema.org/Charterer')]
  155.     #[Groups(['contract:collection:get''contract:collection:post''contract:item:get''contract:item:put'])]
  156.     #[MaxDepth(1)]
  157.     private ?Charterer $charterer null;
  158.     #[ORM\ManyToOne(targetEntity'App\Entity\User'inversedBy'contracts')]
  159.     #[ORM\JoinColumn(nullabletrue)]
  160.     #[ApiProperty(iri'https://schema.org/broker')]
  161.     #[Groups(['contract:item:get''contract:item:put''contract:collection:get''contract:collection:post'])]
  162.     #[MaxDepth(1)]
  163.     private ?User $broker null;
  164.     #[ORM\ManyToOne(targetEntity'App\Entity\User'inversedBy'operations')]
  165.     #[ORM\JoinColumn(nullabletrue)]
  166.     #[ApiProperty(iri'https://schema.org/operator')]
  167.     #[Groups(['contract:item:get''contract:item:put''contract:collection:get''contract:collection:post'])]
  168.     #[MaxDepth(1)]
  169.     private ?User $operator null;
  170.     #[ORM\Column(type'string'nullablefalse)]
  171.     #[ApiProperty(iri'https://schema.org/status')]
  172.     #[Assert\NotBlank]
  173.     #[Assert\Type('string')]
  174.     #[Groups(['contract:item:get''contract:item:put''contract:collection:get''contract:collection:post'])]
  175.     private ?string $status null;
  176.     #[ORM\Column(type'string'nullabletrue)]
  177.     #[Assert\Type('string')]
  178.     #[ApiProperty(iri'https://schema.org/freightCost')]
  179.     #[Groups(['contract:item:get''contract:item:put''contract:collection:get''contract:collection:post'])]
  180.     private ?string $freightCost null;
  181.     #[ORM\Column(type'string'nullabletrue)]
  182.     #[Assert\Type('string')]
  183.     #[ApiProperty(iri'https://schema.org/currency')]
  184.     #[Groups(['contract:item:get''contract:item:put''contract:collection:get''contract:collection:post'])]
  185.     private ?string $freightCostCurrency null;
  186.     #[ORM\Column(type'string'nullabletrue)]
  187.     #[Assert\Type('string')]
  188.     #[Assert\Choice(choicesself::COST_TYPESmessage'The type is not valid.')]
  189.     #[ApiProperty(iri'https://schema.org/freightType')]
  190.     #[Groups(['contract:item:get''contract:item:put''contract:collection:get''contract:collection:post'])]
  191.     private ?string $freightType null;
  192.     #[ORM\Column(type'string'nullabletrue)]
  193.     #[Assert\Type('string')]
  194.     #[ApiProperty(iri'https://schema.org/demurragePerDay')]
  195.     #[Groups(['contract:item:get''contract:item:put''contract:collection:get''contract:collection:post'])]
  196.     private ?string $demurragePerDay null;
  197.     #[ORM\Column(type'string'nullabletrue)]
  198.     #[Assert\Type('string')]
  199.     #[ApiProperty(iri'https://schema.org/currency')]
  200.     #[Groups(['contract:item:get''contract:item:put''contract:collection:get''contract:collection:post'])]
  201.     private ?string $demurragePerDayCurrency null;
  202.     #[ORM\OneToMany(targetEntity'App\Entity\AdditionalCost'mappedBy'contract'cascade: ['persist''remove'], orphanRemovaltrue)]
  203.     ##[ORM\OrderBy(['taskIndex' => 'ASC'])]
  204.     #[Groups(['contract:collection:get''contract:collection:post''contract:item:get''contract:item:put'])]
  205.     #[MaxDepth(1)]
  206.     private ?Collection $additionalCosts null;
  207.     #[ORM\Column(type'string'nullabletrue)]
  208.     #[Assert\Type('string')]
  209.     #[ApiProperty(iri'https://schema.org/addressCommission')]
  210.     #[Groups(['contract:item:get''contract:item:put''contract:collection:get''contract:collection:post'])]
  211.     private ?string $addressCommission null;
  212.     #[ORM\Column(type'string'nullabletrue)]
  213.     #[Assert\Type('string')]
  214.     #[ApiProperty(iri'https://schema.org/brokerageCommission')]
  215.     #[Groups(['contract:item:get''contract:item:put''contract:collection:get''contract:collection:post'])]
  216.     private ?string $brokerageCommission null;
  217.     #[ORM\Column(type'integer'nullabletrue)]
  218.     #[ApiProperty(iri'https://schema.org/liftingsMin')]
  219.     #[Assert\Type('integer')]
  220.     #[Groups(['contract:collection:get''contract:collection:post''contract:item:get''contract:item:put'])]
  221.     private ?int $liftingsMin null;
  222.     #[ORM\Column(type'integer'nullabletrue)]
  223.     #[ApiProperty(iri'https://schema.org/liftingsMax')]
  224.     #[Assert\Type('integer')]
  225.     #[Groups(['contract:collection:get''contract:collection:post''contract:item:get''contract:item:put'])]
  226.     private ?int $liftingsMax null;
  227.     #[ORM\OneToMany(mappedBy'contract'targetEntityMedia::class, cascade: ["remove"], orphanRemovaltrue)]
  228.     #[ApiProperty(iri'https://schema.org/documents')]
  229.     #[Groups(['contract:item:get''contract:item:put''contract:collection:get''contract:collection:post'])]
  230.     #[MaxDepth(1)]
  231.     private ?Collection $documents null;
  232.     #[ORM\OneToMany(targetEntity'App\Entity\PortCall'mappedBy'contract'cascade: ['persist''remove'], orphanRemovaltrue)]
  233.     ##[ORM\OrderBy(['taskIndex' => 'ASC'])]
  234.     #[Groups(['contract:collection:get''contract:collection:post''contract:item:get''contract:item:put'])]
  235.     #[MaxDepth(1)]
  236.     private ?Collection $portCalls null;
  237.     #[ORM\OneToMany(targetEntity'App\Entity\ReportedPort'mappedBy'contract'cascade: ['persist''remove'], orphanRemovaltrue)]
  238.     // #[ORM\OrderBy(['taskIndex' => 'ASC'])]
  239.     #[Groups(['contract:collection:get''contract:collection:post''contract:item:get''contract:item:put'])]
  240.     #[MaxDepth(1)]
  241.     private ?Collection $reportedPorts null;
  242.     #[ORM\OneToMany(targetEntity'App\Entity\ReportedIncident'mappedBy'contract'cascade: ['persist''remove'], orphanRemovaltrue)]
  243.     // #[ORM\OrderBy(['taskIndex' => 'ASC'])]
  244.     #[Groups(['contract:collection:get''contract:collection:post''contract:item:get''contract:item:put'])]
  245.     #[MaxDepth(1)]
  246.     private ?Collection $reportedIncidents null;
  247.     #[ORM\OneToMany(targetEntity'App\Entity\ContractCargo'mappedBy'contract'cascade: ['persist''remove'], orphanRemovaltrue)]
  248.     ##[ORM\OrderBy(['taskIndex' => 'ASC'])]
  249.     #[Groups(['contract:collection:get''contract:collection:post''contract:item:get''contract:item:put'])]
  250.     #[MaxDepth(1)]
  251.     private ?Collection $cargoItems null;
  252.     #[ORM\OneToMany(targetEntity'App\Entity\Payment'mappedBy'contract'cascade: ['persist''remove'], orphanRemovaltrue)]
  253.     ##[ORM\OrderBy(['taskIndex' => 'ASC'])]
  254.     #[Groups(['contract:collection:get''contract:collection:post''contract:item:get''contract:item:put'])]
  255.     #[MaxDepth(1)]
  256.     private ?Collection $payments null;
  257.     #[ORM\OneToMany(targetEntity'App\Entity\Hire'mappedBy'contract'cascade: ['persist''remove'], orphanRemovaltrue)]
  258.     ##[ORM\OrderBy(['taskIndex' => 'ASC'])]
  259.     #[Groups(['contract:collection:get''contract:collection:post''contract:item:get''contract:item:put'])]
  260.     #[MaxDepth(1)]
  261.     private ?Collection $hires null;
  262.     // #[ORM\OneToMany(targetEntity: 'App\Entity\Lifting', mappedBy: 'contract', cascade: ['persist', 'remove'], orphanRemoval: true)]
  263.     // ##[ORM\OrderBy(['taskIndex' => 'ASC'])]
  264.     // #[Groups(['contract:collection:get', 'contract:collection:post', 'contract:item:get', 'contract:item:put'])]
  265.     // #[MaxDepth(1)]
  266.     // private ?Collection $liftings = null;
  267.     #[ORM\OneToMany(targetEntity'App\Entity\Contract'mappedBy'contractCoa'cascade: ['persist''remove'], orphanRemovaltrue)]
  268.     ##[ORM\OrderBy(['taskIndex' => 'ASC'])]
  269.     #[Groups(['contract:collection:get''contract:collection:post''contract:item:get''contract:item:put'])]
  270.     #[MaxDepth(2)]
  271.     private ?Collection $liftings null;
  272.     #[ORM\ManyToOne(targetEntity'App\Entity\Checklist'inversedBy'contracts')]
  273.     #[ORM\JoinColumn(nullabletrue)]
  274.     #[ApiProperty(iri'https://schema.org/Checklist')]
  275.     #[Groups(['contract:collection:get''contract:collection:post''contract:item:get''contract:item:put'])]
  276.     #[MaxDepth(1)]
  277.     private ?Checklist $checklist null;
  278.     #[ORM\ManyToMany(targetEntity'App\Entity\Task')]
  279.     #[ORM\InverseJoinColumn(uniquetrue)]
  280.     #[ApiProperty(iri'https://schema.org/checkedTasks')]
  281.     #[Groups(['contract:item:get''contract:item:put''contract:collection:get''contract:collection:post'])]
  282.     #[MaxDepth(1)]
  283.     private ?Collection $checkedTasks null;
  284.     #[ORM\Column(type'text'nullabletrue)]
  285.     #[ApiProperty(iri'https://schema.org/observation')]
  286.     #[Assert\Type('string')]
  287.     #[Groups(['contract:collection:get''contract:collection:post''contract:item:get''contract:item:put'])]
  288.     private ?string $checklistNotes null;
  289.     #[ORM\Column(type'string'nullabletrue)]
  290.     #[ApiProperty(iri'https://schema.org/demurrageStatus')]
  291.     // #[Assert\NotBlank]
  292.     #[Assert\Type('string')]
  293.     #[Groups(['contract:item:get''contract:item:put''contract:collection:get''contract:collection:post'])]
  294.     private ?string $demurrageStatus null;
  295.     #[ORM\Column(type'integer'nullabletrue)]
  296.     #[ApiProperty(iri'https://schema.org/demurrageTimeBar')]
  297.     #[Assert\Type('integer')]
  298.     #[Groups(['contract:collection:get''contract:collection:post''contract:item:get''contract:item:put'])]
  299.     private ?int $demurrageTimeBar null;
  300.     #[ORM\Column(type'date'nullabletrue)]
  301.     #[ApiProperty(iri'https://schema.org/demurragePaymentDate')]
  302.     // #[Assert\NotBlank]
  303.     #[Assert\Type(\DateTimeInterface::class)]
  304.     #[Groups(['contract:item:get''contract:item:put''contract:collection:get''contract:collection:post'])]
  305.     private ?\DateTimeInterface $demurragePaymentDate null;
  306.     #[ORM\Column(type'string'nullabletrue)]
  307.     #[Assert\Type('string')]
  308.     #[ApiProperty(iri'https://schema.org/finalDemurrageCost')]
  309.     #[Groups(['contract:item:get''contract:item:put''contract:collection:get''contract:collection:post'])]
  310.     private ?string $finalDemurrageCost null;
  311.     #[ORM\Column(type'string'nullabletrue)]
  312.     #[Assert\Type('string')]
  313.     #[ApiProperty(iri'https://schema.org/currency')]
  314.     #[Groups(['contract:item:get''contract:item:put''contract:collection:get''contract:collection:post'])]
  315.     private ?string $finalDemurrageCostCurrency null;
  316.     #[ORM\Column(type'string'nullabletrue)]
  317.     #[Assert\Type('string')]
  318.     #[ApiProperty(iri'https://schema.org/demurragePaidByCharterer')]
  319.     #[Groups(['contract:item:get''contract:item:put''contract:collection:get''contract:collection:post'])]
  320.     private ?string $demurragePaidByCharterer null;
  321.     #[ORM\Column(type'string'nullabletrue)]
  322.     #[Assert\Type('string')]
  323.     #[ApiProperty(iri'https://schema.org/currency')]
  324.     #[Groups(['contract:item:get''contract:item:put''contract:collection:get''contract:collection:post'])]
  325.     private ?string $demurragePaidByChartererCurrency null;
  326.     #[ORM\Column(type'datetime'nullabletrue)]
  327.     #[ApiProperty(iri'https://schema.org/etaArrival')]
  328.     // #[Assert\NotBlank]
  329.     #[Assert\Type(\DateTimeInterface::class)]
  330.     #[Groups(['contract:item:get''contract:item:put''contract:collection:get''contract:collection:post'])]
  331.     private ?\DateTimeInterface $etaArrival null;
  332.     #[ApiProperty(iri'https://schema.org/etaArrivalDate')]
  333.     #[Groups(['contract:item:get'])]
  334.     private ?string $etaArrivalDate null;
  335.     #[ApiProperty(iri'https://schema.org/etaArrivalTime')]
  336.     #[Groups(['contract:item:get'])]
  337.     private ?string $etaArrivalTime null;
  338.     #[ORM\Column(type'datetime'nullabletrue)]
  339.     #[ApiProperty(iri'https://schema.org/deliveredArrival')]
  340.     // #[Assert\NotBlank]
  341.     #[Assert\Type(\DateTimeInterface::class)]
  342.     #[Groups(['contract:item:get''contract:item:put''contract:collection:get''contract:collection:post'])]
  343.     private ?\DateTimeInterface $deliveredArrival null;
  344.     #[ApiProperty(iri'https://schema.org/deliveredArrivalDate')]
  345.     #[Groups(['contract:item:get'])]
  346.     private ?string $deliveredArrivalDate null;
  347.     #[ApiProperty(iri'https://schema.org/deliveredArrivalTime')]
  348.     #[Groups(['contract:item:get'])]
  349.     private ?string $deliveredArrivalTime null;
  350.     #[ORM\Column(type'integer'nullabletrue)]
  351.     #[ApiProperty(iri'https://schema.org/deliveryAproxNotice1')]
  352.     #[Assert\Type('integer')]
  353.     #[Groups(['contract:collection:get''contract:collection:post''contract:item:get''contract:item:put'])]
  354.     private ?int $deliveryAproxNotice1 null;
  355.     #[ORM\Column(type'integer'nullabletrue)]
  356.     #[ApiProperty(iri'https://schema.org/deliveryAproxNotice2')]
  357.     #[Assert\Type('integer')]
  358.     #[Groups(['contract:collection:get''contract:collection:post''contract:item:get''contract:item:put'])]
  359.     private ?int $deliveryAproxNotice2 null;
  360.     #[ORM\Column(type'integer'nullabletrue)]
  361.     #[ApiProperty(iri'https://schema.org/deliveryAproxNotice3')]
  362.     #[Assert\Type('integer')]
  363.     #[Groups(['contract:collection:get''contract:collection:post''contract:item:get''contract:item:put'])]
  364.     private ?int $deliveryAproxNotice3 null;
  365.     #[ORM\Column(type'integer'nullabletrue)]
  366.     #[ApiProperty(iri'https://schema.org/deliveryAproxNotice4')]
  367.     #[Assert\Type('integer')]
  368.     #[Groups(['contract:collection:get''contract:collection:post''contract:item:get''contract:item:put'])]
  369.     private ?int $deliveryAproxNotice4 null;
  370.     #[ORM\Column(type'integer'nullabletrue)]
  371.     #[ApiProperty(iri'https://schema.org/deliveryAproxNotice5')]
  372.     #[Assert\Type('integer')]
  373.     #[Groups(['contract:collection:get''contract:collection:post''contract:item:get''contract:item:put'])]
  374.     private ?int $deliveryAproxNotice5 null;
  375.     #[ORM\Column(type'integer'nullabletrue)]
  376.     #[ApiProperty(iri'https://schema.org/deliveryAproxNotice6')]
  377.     #[Assert\Type('integer')]
  378.     #[Groups(['contract:collection:get''contract:collection:post''contract:item:get''contract:item:put'])]
  379.     private ?int $deliveryAproxNotice6 null;
  380.     #[ORM\Column(type'integer'nullabletrue)]
  381.     #[ApiProperty(iri'https://schema.org/deliveryAproxNotice7')]
  382.     #[Assert\Type('integer')]
  383.     #[Groups(['contract:collection:get''contract:collection:post''contract:item:get''contract:item:put'])]
  384.     private ?int $deliveryAproxNotice7 null;
  385.     #[ORM\Column(type'integer'nullabletrue)]
  386.     #[ApiProperty(iri'https://schema.org/deliveryFirmNotice1')]
  387.     #[Assert\Type('integer')]
  388.     #[Groups(['contract:collection:get''contract:collection:post''contract:item:get''contract:item:put'])]
  389.     private ?int $deliveryFirmNotice1 null;
  390.     #[ORM\Column(type'integer'nullabletrue)]
  391.     #[ApiProperty(iri'https://schema.org/deliveryFirmNotice2')]
  392.     #[Assert\Type('integer')]
  393.     #[Groups(['contract:collection:get''contract:collection:post''contract:item:get''contract:item:put'])]
  394.     private ?int $deliveryFirmNotice2 null;
  395.     #[ORM\Column(type'integer'nullabletrue)]
  396.     #[ApiProperty(iri'https://schema.org/deliveryFirmNotice3')]
  397.     #[Assert\Type('integer')]
  398.     #[Groups(['contract:collection:get''contract:collection:post''contract:item:get''contract:item:put'])]
  399.     private ?int $deliveryFirmNotice3 null;
  400.     #[ORM\Column(type'integer'nullabletrue)]
  401.     #[ApiProperty(iri'https://schema.org/deliveryFirmNotice4')]
  402.     #[Assert\Type('integer')]
  403.     #[Groups(['contract:collection:get''contract:collection:post''contract:item:get''contract:item:put'])]
  404.     private ?int $deliveryFirmNotice4 null;
  405.     #[ORM\Column(type'integer'nullabletrue)]
  406.     #[ApiProperty(iri'https://schema.org/deliveryFirmNotice5')]
  407.     #[Assert\Type('integer')]
  408.     #[Groups(['contract:collection:get''contract:collection:post''contract:item:get''contract:item:put'])]
  409.     private ?int $deliveryFirmNotice5 null;
  410.     #[ORM\Column(type'integer'nullabletrue)]
  411.     #[ApiProperty(iri'https://schema.org/deliveryFirmNotice6')]
  412.     #[Assert\Type('integer')]
  413.     #[Groups(['contract:collection:get''contract:collection:post''contract:item:get''contract:item:put'])]
  414.     private ?int $deliveryFirmNotice6 null;
  415.     #[ORM\Column(type'integer'nullabletrue)]
  416.     #[ApiProperty(iri'https://schema.org/deliveryFirmNotice7')]
  417.     #[Assert\Type('integer')]
  418.     #[Groups(['contract:collection:get''contract:collection:post''contract:item:get''contract:item:put'])]
  419.     private ?int $deliveryFirmNotice7 null;
  420.     #[ORM\Column(type'boolean'nullabletrue)]
  421.     #[ApiProperty(iri'https://schema.org/deliveryNoticesNotAplicable')]
  422.     #[Groups(['contract:collection:get''contract:collection:post''contract:item:get''contract:item:put'])]
  423.     private ?bool $deliveryNoticesNotAplicable null;
  424.     #[ORM\Column(type'boolean'nullabletrue)]
  425.     #[ApiProperty(iri'https://schema.org/shipDelivered')]
  426.     #[Groups(['contract:collection:get''contract:collection:post''contract:item:get''contract:item:put'])]
  427.     private ?bool $shipDelivered null;
  428.     #[ORM\ManyToOne(targetEntity'App\Entity\Port'inversedBy'deliveryPorts1')]
  429.     #[ORM\JoinColumn(nullabletrue)]
  430.     #[ApiProperty(iri'https://schema.org/port')]
  431.     #[Groups(['contract:collection:get''contract:collection:post''contract:item:get''contract:item:put'])]
  432.     #[MaxDepth(1)]
  433.     private ?Port $deliveryPort1 null;
  434.     #[ORM\ManyToOne(targetEntity'App\Entity\Port'inversedBy'deliveryPorts2')]
  435.     #[ORM\JoinColumn(nullabletrue)]
  436.     #[ApiProperty(iri'https://schema.org/port')]
  437.     #[Groups(['contract:collection:get''contract:collection:post''contract:item:get''contract:item:put'])]
  438.     #[MaxDepth(1)]
  439.     private ?Port $deliveryPort2 null;
  440.     #[ORM\Column(type'string'nullabletrue)]
  441.     #[Assert\Type('string')]
  442.     #[ApiProperty(iri'https://schema.org/hirePerDay')]
  443.     #[Groups(['contract:item:get''contract:item:put''contract:collection:get''contract:collection:post'])]
  444.     private ?string $hirePerDay null;
  445.     #[ORM\Column(type'string'nullabletrue)]
  446.     #[Assert\Type('string')]
  447.     #[ApiProperty(iri'https://schema.org/currency')]
  448.     #[Groups(['contract:item:get''contract:item:put''contract:collection:get''contract:collection:post'])]
  449.     private ?string $hirePerDayCurrency null;
  450.     #[ORM\Column(type'integer'nullabletrue)]
  451.     #[ApiProperty(iri'https://schema.org/period')]
  452.     #[Assert\Type('integer')]
  453.     #[Groups(['contract:collection:get''contract:collection:post''contract:item:get''contract:item:put'])]
  454.     private ?int $period null;
  455.     #[ORM\OneToMany(targetEntity'App\Entity\DeliveryNotice'mappedBy'contract'cascade: ['persist''remove'], orphanRemovaltrue)]
  456.     ##[ORM\OrderBy(['taskIndex' => 'ASC'])]
  457.     #[Groups(['contract:collection:get''contract:collection:post''contract:item:get''contract:item:put'])]
  458.     #[MaxDepth(1)]
  459.     private ?Collection $deliveryNotices null;
  460.     #[ORM\Column(type'text'nullabletrue)]
  461.     #[ApiProperty(iri'https://schema.org/observation')]
  462.     #[Assert\Type('string')]
  463.     #[Groups(['contract:collection:get''contract:collection:post''contract:item:get''contract:item:put'])]
  464.     private ?string $reportDescription null;
  465.     #[ORM\Column(type'boolean'nullabletrue)]
  466.     #[ApiProperty(iri'https://schema.org/vesselArrivedWithinTheLaycan')]
  467.     #[Groups(['contract:collection:get''contract:collection:post''contract:item:get''contract:item:put'])]
  468.     private ?bool $vesselArrivedWithinTheLaycan false;
  469.     #[ORM\Column(type'boolean'nullabletrue)]
  470.     #[ApiProperty(iri'https://schema.org/vesselWasSubstituted')]
  471.     #[Groups(['contract:collection:get''contract:collection:post''contract:item:get''contract:item:put'])]
  472.     private ?bool $vesselWasSubstituted false;
  473.     #[ORM\Column(type'boolean'nullabletrue)]
  474.     #[ApiProperty(iri'https://schema.org/addendumIssued')]
  475.     #[Groups(['contract:collection:get''contract:collection:post''contract:item:get''contract:item:put'])]
  476.     private ?bool $addendumIssued false;
  477.     #[ORM\Column(type'text'nullabletrue)]
  478.     #[ApiProperty(iri'https://schema.org/observation')]
  479.     #[Assert\Type('string')]
  480.     #[Groups(['contract:collection:get''contract:collection:post''contract:item:get''contract:item:put'])]
  481.     private ?string $addendumDescription null;
  482.     #[ORM\ManyToOne(targetEntity'App\Entity\Contract'inversedBy'liftings')]
  483.     #[ORM\JoinColumn(nullabletrue)]
  484.     #[ApiProperty(iri'https://schema.org/Contract')]
  485.     #[Groups(['contract:collection:get''contract:collection:post''contract:item:get''contract:item:put'])]
  486.     #[MaxDepth(1)]
  487.     private ?Contract $contractCoa null;
  488.     #[ApiProperty(iri'https://schema.org/cargoVolumeM3')]
  489.     #[Groups(['contract:collection:get''contract:item:get'])]
  490.     private ?string $cargoVolumeM3 null;
  491.     #[ApiProperty(iri'https://schema.org/cargoVolumeMT')]
  492.     #[Groups(['contract:collection:get''contract:item:get'])]
  493.     private ?string $cargoVolumeMT null;
  494.     #[ApiProperty(iri'https://schema.org/totalAmount')]
  495.     #[Groups(['contract:collection:get''contract:item:get'])]
  496.     private ?string $totalAmount null;
  497.     #[ApiProperty(iri'https://schema.org/totalAmountCurrency')]
  498.     #[Groups(['contract:collection:get''contract:item:get'])]
  499.     private ?string $totalAmountCurrency null;
  500.     public function __construct()
  501.     {
  502.         $this->id Uuid::uuid4();
  503.         $this->documents = new ArrayCollection();
  504.         $this->portCalls = new ArrayCollection();
  505.         $this->reportedPorts = new ArrayCollection();
  506.         $this->reportedIncidents = new ArrayCollection();
  507.         $this->cargoItems = new ArrayCollection();
  508.         $this->checkedTasks = new ArrayCollection();
  509.         $this->payments = new ArrayCollection();
  510.         $this->hires = new ArrayCollection();
  511.         $this->liftings = new ArrayCollection();
  512.         $this->deliveryNotices = new ArrayCollection();
  513.     }
  514.     public function getId(): ?UuidInterface
  515.     {
  516.         return $this->id;
  517.     }
  518.     public function setContractNumber(?string $contractNumber): void
  519.     {
  520.         $this->contractNumber $contractNumber;
  521.     }
  522.     public function getContractNumber(): ?string
  523.     {
  524.         return $this->contractNumber;
  525.     }
  526.     public function setContractDate(?\DateTimeInterface $contractDate): void
  527.     {
  528.         $this->contractDate $contractDate;
  529.     }
  530.     public function getContractDate(): ?string
  531.     {
  532.         return $this->contractDate?->format('Y-m-d');
  533.     }
  534.     public function setContractType(?string $contractType): void
  535.     {
  536.         $this->contractType $contractType;
  537.     }
  538.     public function getContractType(): ?string
  539.     {
  540.         return $this->contractType;
  541.     }
  542.     public function setLaycanStart(?\DateTimeInterface $laycanStart): void
  543.     {
  544.         $this->laycanStart $laycanStart;
  545.     }
  546.     public function getLaycanStart(): ?\DateTimeInterface
  547.     {
  548.         return $this->laycanStart;
  549.     }
  550.     public function getLaycanStartDate(): ?string
  551.     {
  552.         return $this->laycanStart $this->laycanStart->format('Y-m-d') : null;
  553.     }
  554.     public function getLaycanStartTime(): ?string
  555.     {
  556.         return $this->laycanStart $this->laycanStart->format('H:i') : null;
  557.     }
  558.     public function setLaycanEnd(?\DateTimeInterface $laycanEnd): void
  559.     {
  560.         $this->laycanEnd $laycanEnd;
  561.     }
  562.     public function getLaycanEnd(): ?\DateTimeInterface
  563.     {
  564.         return $this->laycanEnd;
  565.     }
  566.     public function getLaycanEndDate(): ?string
  567.     {
  568.         return $this->laycanEnd $this->laycanEnd->format('Y-m-d') : null;
  569.     }
  570.     public function getLaycanEndTime(): ?string
  571.     {
  572.         return $this->laycanEnd $this->laycanEnd->format('H:i') : null;
  573.     }
  574.     public function setVessel(?Vessel $vessel): void
  575.     {
  576.         $this->vessel $vessel;
  577.     }
  578.     public function getVessel(): ?Vessel
  579.     {
  580.         return $this->vessel;
  581.     }
  582.     public function setOwner(?Owner $owner): void
  583.     {
  584.         $this->owner $owner;
  585.     }
  586.     public function getOwner(): ?Owner
  587.     {
  588.         return $this->owner;
  589.     }
  590.     public function setCharterer(?Charterer $charterer): void
  591.     {
  592.         $this->charterer $charterer;
  593.     }
  594.     public function getCharterer(): ?Charterer
  595.     {
  596.         return $this->charterer;
  597.     }
  598.     public function addDocument(Media $document): void
  599.     {
  600.         $document->setContract($this);
  601.         $this->documents[] = $document;
  602.     }
  603.     public function removeDocument(Media $document): void
  604.     {
  605.         $this->documents->removeElement($document);
  606.     }
  607.     public function getDocuments(): Collection
  608.     {
  609.         return $this->documents;
  610.     }
  611.     public function setBroker(?User $broker): void
  612.     {
  613.         $this->broker $broker;
  614.     }
  615.     public function getBroker(): ?User
  616.     {
  617.         return $this->broker;
  618.     }
  619.     public function setOperator(?User $operator): void
  620.     {
  621.         $this->operator $operator;
  622.     }
  623.     public function getOperator(): ?User
  624.     {
  625.         return $this->operator;
  626.     }
  627.     public function setDemurragePerDay(?string $demurragePerDay): void
  628.     {
  629.         $this->demurragePerDay $demurragePerDay;
  630.     }
  631.     public function getDemurragePerDay(): ?string
  632.     {
  633.         return $this->demurragePerDay;
  634.     }
  635.     public function getDemurragePerDayCurrency(): ?string
  636.     {
  637.         return $this->demurragePerDayCurrency;
  638.     }
  639.     public function setDemurragePerDayCurrency(?string $demurragePerDayCurrency): void
  640.     {
  641.         $this->demurragePerDayCurrency $demurragePerDayCurrency;
  642.     }
  643.     public function setAddressCommission(?string $addressCommission): void
  644.     {
  645.         $this->addressCommission $addressCommission;
  646.     }
  647.     public function getAddressCommission(): ?string
  648.     {
  649.         return $this->addressCommission;
  650.     }
  651.     public function setbrokerageCommission(?string $brokerageCommission): void
  652.     {
  653.         $this->brokerageCommission $brokerageCommission;
  654.     }
  655.     public function getbrokerageCommission(): ?string
  656.     {
  657.         return $this->brokerageCommission;
  658.     }
  659.     public function setLiftingsMin(?int $liftingsMin): void
  660.     {
  661.         $this->liftingsMin $liftingsMin;
  662.     }
  663.     public function getLiftingsMin(): ?int
  664.     {
  665.         return $this->liftingsMin;
  666.     }
  667.     public function setLiftingsMax(?int $liftingsMax): void
  668.     {
  669.         $this->liftingsMax $liftingsMax;
  670.     }
  671.     public function getLiftingsMax(): ?int
  672.     {
  673.         return $this->liftingsMax;
  674.     }
  675.     public function addPortCall(PortCall $portCall): void
  676.     {
  677.         $portCall->setContract($this);
  678.         $this->portCalls[] = $portCall;
  679.     }
  680.     public function removePortCall(PortCall $portCall): void
  681.     {
  682.         $this->portCalls->removeElement($portCall);
  683.     }
  684.     public function getPortCalls(): Collection
  685.     {
  686.         return $this->portCalls;
  687.     }
  688.     public function addReportedPort(ReportedPort $reportedPort): void
  689.     {
  690.         $reportedPort->setContract($this);
  691.         $this->reportedPorts[] = $reportedPort;
  692.     }
  693.     public function removeReportedPort(ReportedPort $reportedPort): void
  694.     {
  695.         $this->reportedPorts->removeElement($reportedPort);
  696.     }
  697.     public function getReportedPorts(): Collection
  698.     {
  699.         return $this->reportedPorts;
  700.     }
  701.     public function addReportedIncident(ReportedIncident $reportedIncident): void
  702.     {
  703.         $reportedIncident->setContract($this);
  704.         $this->reportedIncidents[] = $reportedIncident;
  705.     }
  706.     public function removeReportedIncident(ReportedIncident $reportedIncident): void
  707.     {
  708.         $this->reportedIncidents->removeElement($reportedIncident);
  709.     }
  710.     public function getReportedIncidents(): Collection
  711.     {
  712.         return $this->reportedIncidents;
  713.     }
  714.     public function addCargoItem(ContractCargo $cargoItem): void
  715.     {
  716.         $cargoItem->setContract($this);
  717.         $this->cargoItems[] = $cargoItem;
  718.     }
  719.     public function removeCargoItem(ContractCargo $cargoItem): void
  720.     {
  721.         $this->cargoItems->removeElement($cargoItem);
  722.     }
  723.     public function getCargoItems(): Collection
  724.     {
  725.         return $this->cargoItems;
  726.     }
  727.     public function getPayments(): Collection
  728.     {
  729.         return $this->payments;
  730.     }
  731.     public function addPayment(Payment $payment): void
  732.     {
  733.         $payment->setContract($this);
  734.         $this->payments[] = $payment;
  735.     }
  736.     public function removePayment(Payment $payment): void
  737.     {
  738.         $this->payments->removeElement($payment);
  739.     }
  740.     public function getHires(): Collection
  741.     {
  742.         return $this->hires;
  743.     }
  744.     public function addHire(Hire $hire): void
  745.     {
  746.         $hire->setContract($this);
  747.         $this->hires[] = $hire;
  748.     }
  749.     public function removeHire(Hire $hire): void
  750.     {
  751.         $this->hires->removeElement($hire);
  752.     }
  753.     // public function addLifting(Lifting $lifting): void
  754.     // {
  755.     //     $lifting->setContract($this);
  756.     //     $this->liftings[] = $lifting;
  757.     // }
  758.     // public function removeLifting(Lifting $lifting): void
  759.     // {
  760.     //     $this->liftings->removeElement($lifting);
  761.     // }
  762.     // public function getLiftings(): Collection
  763.     // {
  764.     //     return $this->liftings;
  765.     // }
  766.     public function addLifting(Contract $lifting): void
  767.     {
  768.         $lifting->setContractCoa($this);
  769.         $this->liftings[] = $lifting;
  770.     }
  771.     public function removeLifting(Contract $lifting): void
  772.     {
  773.         $this->liftings->removeElement($lifting);
  774.     }
  775.     public function getLiftings(): Collection
  776.     {
  777.         return $this->liftings;
  778.     }
  779.     public function getFreightCost(): ?string
  780.     {
  781.         return $this->freightCost;
  782.     }
  783.     public function setFreightCost(?string $freightCost): void
  784.     {
  785.         $this->freightCost $freightCost;
  786.     }
  787.     public function getFreightCostCurrency(): ?string
  788.     {
  789.         return $this->freightCostCurrency;
  790.     }
  791.     public function setFreightCostCurrency(?string $freightCostCurrency): void
  792.     {
  793.         $this->freightCostCurrency $freightCostCurrency;
  794.     }
  795.     public function getFreightType(): ?string
  796.     {
  797.         return $this->freightType;
  798.     }
  799.     public function setFreightType(?string $freightType): void
  800.     {
  801.         $this->freightType $freightType;
  802.     }
  803.     public function addAdditionalCost(AdditionalCost $additionalCost): void
  804.     {
  805.         $additionalCost->setContract($this);
  806.         $this->additionalCosts[] = $additionalCost;
  807.     }
  808.     public function removeAdditionalCost(AdditionalCost $additionalCost): void
  809.     {
  810.         $this->additionalCosts->removeElement($additionalCost);
  811.     }
  812.     public function getAdditionalCosts(): ?Collection
  813.     {
  814.         return $this->additionalCosts;
  815.     }
  816.     public function setStatus(?string $status): void
  817.     {
  818.         $this->status $status;
  819.     }
  820.     public function getStatus(): ?string
  821.     {
  822.         return $this->status;
  823.     }
  824.     public function setChecklist(?Checklist $checklist): void
  825.     {
  826.         $this->checklist $checklist;
  827.     }
  828.     public function getChecklist(): ?Checklist
  829.     {
  830.         return $this->checklist;
  831.     }
  832.     public function addCheckedTask(Task $checkedTask): void
  833.     {
  834.         $this->checkedTasks[] = $checkedTask;
  835.     }
  836.     public function removeCheckedTask(Task $checkedTask): void
  837.     {
  838.         $this->checkedTasks->removeElement($checkedTask);
  839.     }
  840.     public function getCheckedTasks(): Collection
  841.     {
  842.         return $this->checkedTasks;
  843.     }
  844.     public function setChecklistNotes(?string $checklistNotes): void
  845.     {
  846.         $this->checklistNotes $checklistNotes;
  847.     }
  848.     public function getChecklistNotes(): ?string
  849.     {
  850.         return $this->checklistNotes;
  851.     }
  852.     public function setDemurrageStatus(?string $demurrageStatus): void
  853.     {
  854.         $this->demurrageStatus $demurrageStatus;
  855.     }
  856.     public function getDemurrageStatus(): ?string
  857.     {
  858.         return $this->demurrageStatus;
  859.     }
  860.     public function setDemurrageTimeBar(?int $demurrageTimeBar): void
  861.     {
  862.         $this->demurrageTimeBar $demurrageTimeBar;
  863.     }
  864.     public function getDemurrageTimeBar(): ?int
  865.     {
  866.         return $this->demurrageTimeBar;
  867.     }
  868.     public function setDemurragePaymentDate(?\DateTimeInterface $demurragePaymentDate): void
  869.     {
  870.         $this->demurragePaymentDate $demurragePaymentDate;
  871.     }
  872.     public function getDemurragePaymentDate(): ?string
  873.     {
  874.         return $this->demurragePaymentDate?->format('Y-m-d');
  875.     }
  876.     public function getDemurragePaidByCharterer(): ?string
  877.     {
  878.         return $this->demurragePaidByCharterer;
  879.     }
  880.     public function setDemurragePaidByCharterer(?string $demurragePaidByCharterer): void
  881.     {
  882.         $this->demurragePaidByCharterer $demurragePaidByCharterer;
  883.     }
  884.     public function getDemurragePaidByChartererCurrency(): ?string
  885.     {
  886.         return $this->demurragePaidByChartererCurrency;
  887.     }
  888.     public function setDemurragePaidByChartererCurrency(?string $demurragePaidByChartererCurrency): void
  889.     {
  890.         $this->demurragePaidByChartererCurrency $demurragePaidByChartererCurrency;
  891.     }
  892.     public function getFinalDemurrageCost(): ?string
  893.     {
  894.         return $this->finalDemurrageCost;
  895.     }
  896.     public function setFinalDemurrageCost(?string $finalDemurrageCost): void
  897.     {
  898.         $this->finalDemurrageCost $finalDemurrageCost;
  899.     }
  900.     public function getFinalDemurrageCostCurrency(): ?string
  901.     {
  902.         return $this->finalDemurrageCostCurrency;
  903.     }
  904.     public function setFinalDemurrageCostCurrency(?string $finalDemurrageCostCurrency): void
  905.     {
  906.         $this->finalDemurrageCostCurrency $finalDemurrageCostCurrency;
  907.     }
  908.     public function getEtaArrival(): ?\DateTimeInterface
  909.     {
  910.         return $this->etaArrival;
  911.     }
  912.     public function getEtaArrivalDate(): ?string
  913.     {
  914.         return $this->etaArrival $this->etaArrival->format('Y-m-d') : null;
  915.     }
  916.     public function getEtaArrivalTime(): ?string
  917.     {
  918.         return $this->etaArrival $this->etaArrival->format('H:i') : null;
  919.     }
  920.     public function setEtaArrival(?\DateTimeInterface $etaArrival): void
  921.     {
  922.         $this->etaArrival $etaArrival;
  923.     }
  924.     public function getDeliveredArrival(): ?\DateTimeInterface
  925.     {
  926.         return $this->deliveredArrival;
  927.     }
  928.     public function getDeliveredArrivalDate(): ?string
  929.     {
  930.         return $this->deliveredArrival $this->deliveredArrival->format('Y-m-d') : null;
  931.     }
  932.     public function getDeliveredArrivalTime(): ?string
  933.     {
  934.         return $this->deliveredArrival $this->deliveredArrival->format('H:i') : null;
  935.     }
  936.     public function setDeliveredArrival(?\DateTimeInterface $deliveredArrival): void
  937.     {
  938.         $this->deliveredArrival $deliveredArrival;
  939.     }
  940.     public function getDeliveryAproxNotice1(): ?int
  941.     {
  942.         return $this->deliveryAproxNotice1;
  943.     }
  944.     public function setDeliveryAproxNotice1(?int $deliveryAproxNotice1): void
  945.     {
  946.         $this->deliveryAproxNotice1 $deliveryAproxNotice1;
  947.     }
  948.     public function getDeliveryAproxNotice2(): ?int
  949.     {
  950.         return $this->deliveryAproxNotice2;
  951.     }
  952.     public function setDeliveryAproxNotice2(?int $deliveryAproxNotice2): void
  953.     {
  954.         $this->deliveryAproxNotice2 $deliveryAproxNotice2;
  955.     }
  956.     public function getDeliveryAproxNotice3(): ?int
  957.     {
  958.         return $this->deliveryAproxNotice3;
  959.     }
  960.     public function setDeliveryAproxNotice3(?int $deliveryAproxNotice3): void
  961.     {
  962.         $this->deliveryAproxNotice3 $deliveryAproxNotice3;
  963.     }
  964.     public function getDeliveryAproxNotice4(): ?int
  965.     {
  966.         return $this->deliveryAproxNotice4;
  967.     }
  968.     public function setDeliveryAproxNotice4(?int $deliveryAproxNotice4): void
  969.     {
  970.         $this->deliveryAproxNotice4 $deliveryAproxNotice4;
  971.     }
  972.     public function getDeliveryAproxNotice5(): ?int
  973.     {
  974.         return $this->deliveryAproxNotice5;
  975.     }
  976.     public function setDeliveryAproxNotice5(?int $deliveryAproxNotice5): void
  977.     {
  978.         $this->deliveryAproxNotice5 $deliveryAproxNotice5;
  979.     }
  980.     public function getDeliveryAproxNotice6(): ?int
  981.     {
  982.         return $this->deliveryAproxNotice6;
  983.     }
  984.     public function setDeliveryAproxNotice6(?int $deliveryAproxNotice6): void
  985.     {
  986.         $this->deliveryAproxNotice6 $deliveryAproxNotice6;
  987.     }
  988.     public function getDeliveryAproxNotice7(): ?int
  989.     {
  990.         return $this->deliveryAproxNotice7;
  991.     }
  992.     public function setDeliveryAproxNotice7(?int $deliveryAproxNotice7): void
  993.     {
  994.         $this->deliveryAproxNotice7 $deliveryAproxNotice7;
  995.     }
  996.     public function getDeliveryFirmNotice1(): ?int
  997.     {
  998.         return $this->deliveryFirmNotice1;
  999.     }
  1000.     public function setDeliveryFirmNotice1(?int $deliveryFirmNotice1): void
  1001.     {
  1002.         $this->deliveryFirmNotice1 $deliveryFirmNotice1;
  1003.     }
  1004.     public function getDeliveryFirmNotice2(): ?int
  1005.     {
  1006.         return $this->deliveryFirmNotice2;
  1007.     }
  1008.     public function setDeliveryFirmNotice2(?int $deliveryFirmNotice2): void
  1009.     {
  1010.         $this->deliveryFirmNotice2 $deliveryFirmNotice2;
  1011.     }
  1012.     public function getDeliveryFirmNotice3(): ?int
  1013.     {
  1014.         return $this->deliveryFirmNotice3;
  1015.     }
  1016.     public function setDeliveryFirmNotice3(?int $deliveryFirmNotice3): void
  1017.     {
  1018.         $this->deliveryFirmNotice3 $deliveryFirmNotice3;
  1019.     }
  1020.     public function getDeliveryFirmNotice4(): ?int
  1021.     {
  1022.         return $this->deliveryFirmNotice4;
  1023.     }
  1024.     public function setDeliveryFirmNotice4(?int $deliveryFirmNotice4): void
  1025.     {
  1026.         $this->deliveryFirmNotice4 $deliveryFirmNotice4;
  1027.     }
  1028.     public function getDeliveryFirmNotice5(): ?int
  1029.     {
  1030.         return $this->deliveryFirmNotice5;
  1031.     }
  1032.     public function setDeliveryFirmNotice5(?int $deliveryFirmNotice5): void
  1033.     {
  1034.         $this->deliveryFirmNotice5 $deliveryFirmNotice5;
  1035.     }
  1036.     public function getDeliveryFirmNotice6(): ?int
  1037.     {
  1038.         return $this->deliveryFirmNotice6;
  1039.     }
  1040.     public function setDeliveryFirmNotice6(?int $deliveryFirmNotice6): void
  1041.     {
  1042.         $this->deliveryFirmNotice6 $deliveryFirmNotice6;
  1043.     }
  1044.     public function getDeliveryFirmNotice7(): ?int
  1045.     {
  1046.         return $this->deliveryFirmNotice7;
  1047.     }
  1048.     public function setDeliveryFirmNotice7(?int $deliveryFirmNotice7): void
  1049.     {
  1050.         $this->deliveryFirmNotice7 $deliveryFirmNotice7;
  1051.     }
  1052.     public function getDeliveryNoticesNotAplicable(): ?bool
  1053.     {
  1054.         return $this->deliveryNoticesNotAplicable;
  1055.     }
  1056.     public function setDeliveryNoticesNotAplicable(?bool $deliveryNoticesNotAplicable): void
  1057.     {
  1058.         $this->deliveryNoticesNotAplicable $deliveryNoticesNotAplicable;
  1059.     }
  1060.     public function getShipDelivered(): ?bool
  1061.     {
  1062.         return $this->shipDelivered;
  1063.     }
  1064.     public function setShipDelivered(?bool $shipDelivered): void
  1065.     {
  1066.         $this->shipDelivered $shipDelivered;
  1067.     }
  1068.     public function getDeliveryPort1(): ?Port
  1069.     {
  1070.         return $this->deliveryPort1;
  1071.     }
  1072.     public function setDeliveryPort1(?Port $deliveryPort1): void
  1073.     {
  1074.         $this->deliveryPort1 $deliveryPort1;
  1075.     }
  1076.     public function getDeliveryPort2(): ?Port
  1077.     {
  1078.         return $this->deliveryPort2;
  1079.     }
  1080.     public function setDeliveryPort2(?Port $deliveryPort2): void
  1081.     {
  1082.         $this->deliveryPort2 $deliveryPort2;
  1083.     }
  1084.     public function getHirePerDay(): ?string
  1085.     {
  1086.         return $this->hirePerDay;
  1087.     }
  1088.     public function setHirePerDay(?string $hirePerDay): void
  1089.     {
  1090.         $this->hirePerDay $hirePerDay;
  1091.     }
  1092.     public function getHirePerDayCurrency(): ?string
  1093.     {
  1094.         return $this->hirePerDayCurrency;
  1095.     }
  1096.     public function setHirePerDayCurrency(?string $hirePerDayCurrency): void
  1097.     {
  1098.         $this->hirePerDayCurrency $hirePerDayCurrency;
  1099.     }
  1100.     public function getPeriod(): ?int
  1101.     {
  1102.         return $this->period;
  1103.     }
  1104.     public function setPeriod(?int $period): void
  1105.     {
  1106.         $this->period $period;
  1107.     }
  1108.     public function addDeliveryNotice(DeliveryNotice $deliveryNotice): void
  1109.     {
  1110.         $deliveryNotice->setContract($this);
  1111.         $this->deliveryNotices[] = $deliveryNotice;
  1112.     }
  1113.     public function removeDeliveryNotice(DeliveryNotice $deliveryNotice): void
  1114.     {
  1115.         $this->deliveryNotices->removeElement($deliveryNotice);
  1116.     }
  1117.     public function getDeliveryNotices(): ?Collection
  1118.     {
  1119.         return $this->deliveryNotices;
  1120.     }
  1121.     public function setReportDescription(?string $reportDescription): void
  1122.     {
  1123.         $this->reportDescription $reportDescription;
  1124.     }
  1125.     public function getReportDescription(): ?string
  1126.     {
  1127.         return $this->reportDescription;
  1128.     }
  1129.     public function getVesselArrivedWithinTheLaycan(): ?bool
  1130.     {
  1131.         return $this->vesselArrivedWithinTheLaycan;
  1132.     }
  1133.     public function setVesselArrivedWithinTheLaycan(?bool $vesselArrivedWithinTheLaycan): void
  1134.     {
  1135.         $this->vesselArrivedWithinTheLaycan $vesselArrivedWithinTheLaycan;
  1136.     }
  1137.     public function getVesselWasSubstituted(): ?bool
  1138.     {
  1139.         return $this->vesselWasSubstituted;
  1140.     }
  1141.     public function setVesselWasSubstituted(?bool $vesselWasSubstituted): void
  1142.     {
  1143.         $this->vesselWasSubstituted $vesselWasSubstituted;
  1144.     }
  1145.     public function getAddendumIssued(): ?bool
  1146.     {
  1147.         return $this->addendumIssued;
  1148.     }
  1149.     public function setAddendumIssued(?bool $addendumIssued): void
  1150.     {
  1151.         $this->addendumIssued $addendumIssued;
  1152.     }
  1153.     public function setAddendumDescription(?string $addendumDescription): void
  1154.     {
  1155.         $this->addendumDescription $addendumDescription;
  1156.     }
  1157.     public function getAddendumDescription(): ?string
  1158.     {
  1159.         return $this->addendumDescription;
  1160.     }
  1161.     public function setContractCoa(?Contract $contract): void
  1162.     {
  1163.         $this->contractCoa $contract;
  1164.     }
  1165.     public function getContractCoa(): ?Contract
  1166.     {
  1167.         return $this->contractCoa;
  1168.     }
  1169.     public function getCargoVolumeM3(): ?string
  1170.     {
  1171.         $totalVolume 0.0;
  1172.         foreach ($this->getCargoItems() as $cargoItem) {
  1173.             $totalVolume += (float) $cargoItem->getQuantityM3();
  1174.         }
  1175.         return number_format($totalVolume3'.''');
  1176.     }
  1177.     public function getCargoVolumeMT(): ?string
  1178.     {
  1179.         $totalVolume 0.0;
  1180.         foreach ($this->getCargoItems() as $cargoItem) {
  1181.             $totalVolume += (float) $cargoItem->getQuantityMT();
  1182.         }
  1183.         return number_format($totalVolume3'.''');
  1184.     }
  1185.     public function getTotalAmount(): ?string
  1186.     {
  1187.         $totalAmount 0.0;
  1188.         if ($this->getContractType() === 'SPOT') {
  1189.             foreach ($this->getPayments() as $invoice) {
  1190.                 $amount = (float) str_replace('.'''$invoice->getAmount() ?? '');
  1191.                 $totalAmount += $amount;
  1192.             }
  1193.             return number_format($totalAmount2',''.');  
  1194.         } elseif ($this->getContractType() === 'TIME_CHARTER') {
  1195.             foreach ($this->getHires() as $hire) {
  1196.                 $amount = (float) str_replace('.'''$hire->getTotalInvoice() ?? '');
  1197.                 $totalAmount += $amount;
  1198.             }
  1199.             return number_format($totalAmount2',''.');
  1200.         } else {
  1201.             return null;
  1202.         }
  1203.     }
  1204.     public function getTotalAmountCurrency(): ?string
  1205.     {
  1206.         if ($this->getContractType() === 'SPOT' && $this->getPayments()->count() > 0) {
  1207.             return $this->getPayments()->first()->getAmountCurrency() ?? '';
  1208.         } elseif ($this->getContractType() === 'TIME_CHARTER' && $this->getHires()->count() > 0) {
  1209.             return $this->getHires()->first()->getTotalInvoiceCurrency() ?? '';
  1210.         } else {
  1211.             return null;
  1212.         }
  1213.     }
  1214. }