src/Entity/Contract.php line 167

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 ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\BooleanFilter;
  10. use App\Trait\TimestampableEntity;
  11. use Doctrine\Common\Collections\ArrayCollection;
  12. use Doctrine\Common\Collections\Collection;
  13. use Doctrine\ORM\Mapping as ORM;
  14. use Symfony\Component\Validator\Constraints as Assert;
  15. use Symfony\Component\Serializer\Annotation\Groups;
  16. use Symfony\Component\Serializer\Annotation\MaxDepth;
  17. use Ramsey\Uuid\Uuid;
  18. use Ramsey\Uuid\UuidInterface;
  19. #[ORM\Entity]
  20. #[ApiResource(
  21.     iri'Contract',
  22.     itemOperations: [
  23.         'get' => [
  24.             'security' => "is_granted('ROLE_USER')",
  25.             'normalization_context' => [
  26.                 'groups' => 'contract:item:get'
  27.                 'enable_max_depth' => true
  28.             ]
  29.         ],
  30.         'put' => [
  31.             'security' => "
  32.                 is_granted('ROLE_ADMIN') or 
  33.                 is_granted('ROLE_OPERATOR') or
  34.                 is_granted('ROLE_OPERATIONS_COORDINATOR') or 
  35.                 is_granted('ROLE_INTERN')
  36.             ",
  37.             'normalization_context' => [
  38.                 'groups' => 'contract:item:put'
  39.                 'enable_max_depth' => true
  40.             ],
  41.             'denormalization_context' => [
  42.                 'groups' => 'contract:item:put'
  43.                 'enable_max_depth' => true
  44.             ],
  45.         ],
  46.         'delete' => [
  47.             'security' => "
  48.                 is_granted('ROLE_ADMIN') or 
  49.                 is_granted('ROLE_OPERATOR') or
  50.                 is_granted('ROLE_OPERATIONS_COORDINATOR') or 
  51.                 is_granted('ROLE_INTERN')
  52.             ",
  53.         ],
  54.     ],
  55.     collectionOperations: [
  56.         'get' => [
  57.             'security' => "is_granted('ROLE_USER')",
  58.             'normalization_context' => [
  59.                 'groups' => [
  60.                     'contract:collection:get'
  61.                     'createdAt'
  62.                 ],
  63.                 'enable_max_depth' => true,
  64.             ],
  65.         ],
  66.         'post' => [
  67.             'security' => "
  68.                 is_granted('ROLE_ADMIN') or 
  69.                 is_granted('ROLE_OPERATOR') or
  70.                 is_granted('ROLE_OPERATIONS_COORDINATOR') or 
  71.                 is_granted('ROLE_INTERN')
  72.             ",
  73.             'normalization_context' => [
  74.                 'groups' => 'contract:collection:post'
  75.                 'enable_max_depth' => true
  76.             ],
  77.             'denormalization_context' => [
  78.                 'groups' => 'contract:collection:post'
  79.                 'enable_max_depth' => true
  80.             ],
  81.         ],
  82.     ],
  83. )]
  84. #[ApiFilter(
  85.     SearchFilter::class,
  86.     properties: [
  87.         'contractNumber' => 'start',
  88.         'contractType' => 'exact',
  89.         'vessel.vesselName' => 'partial',
  90.         'charterer.companyName' => 'partial',
  91.         'owner.companyName' => 'partial',
  92.         'broker.name' => 'partial',
  93.         'operator.name' => 'partial',
  94.         'laycanStart' => 'start',
  95.         'laycanEnd' => 'start',
  96.         'demurrageStatus' => 'exact',
  97.         'addressCommission' => 'partial',
  98.         'brokerageCommission' => 'partial',
  99.         'finalDemurrageCost' => 'partial',
  100.         'demurragePaymentDate' => 'start',
  101.         'status' => 'exact',
  102.         'createdAt' => 'start',
  103.         'broker.desk' => 'partial',
  104.         'freightType' => 'exact',
  105.         'freightInvoiceStatus' => 'exact',
  106.         'freightInvoiceNumber' => 'partial',
  107.         'freightInvoiceCabotagePtax' => 'partial',
  108.         'freightInvoicePaymentInvoiceDiff' => 'partial',
  109.         'freightInvoiceBankInvoiced' => 'exact',
  110.         'demurrageInvoiceStatus' => 'exact',
  111.         'demurrageInvoiceNumber' => 'partial',
  112.         'demurrageInvoiceCabotagePtax' => 'partial',
  113.         'demurrageInvoicePaymentInvoiceDiff' => 'partial',
  114.         'demurrageInvoiceBankInvoiced' => 'exact',
  115.     ],
  116. )]
  117. #[ApiFilter(
  118.     OrderFilter::class,
  119.     properties: [
  120.         'contractNumber',
  121.         'contractType',
  122.         'vessel.vesselName',
  123.         'charterer.companyName',
  124.         'owner.companyName',
  125.         'broker.name',
  126.         'operator.name',
  127.         'laycanStart',
  128.         'laycanEnd',
  129.         'demurrageStatus',
  130.         'addressCommission',
  131.         'brokerageCommission',
  132.         'finalDemurrageCost',
  133.         'demurragePaymentDate',
  134.         'status',
  135.         'createdAt',
  136.         'broker.desk',
  137.         'freightType',
  138.         'freightInvoiceStatus',
  139.         'freightInvoiceNumber',
  140.         'freightInvoiceTaxAction',
  141.         'freightInvoiceCabotagePtax',
  142.         'freightInvoicePaymentInvoiceDiff',
  143.         'freightInvoiceBankInvoiced',
  144.         'freightInvoicePaymentDate',
  145.         'freightInvoiceInvoiceDate',
  146.         'demurrageInvoiceStatus',
  147.         'demurrageInvoiceNumber',
  148.         'demurrageInvoiceTaxAction',
  149.         'demurrageInvoiceCabotagePtax',
  150.         'demurrageInvoicePaymentInvoiceDiff',
  151.         'demurrageInvoiceBankInvoiced',
  152.         'demurrageInvoicePaymentDate',
  153.         'demurrageInvoiceInvoiceDate',
  154.     ],
  155. )]
  156. #[ApiFilter(
  157.     BooleanFilter::class,
  158.     properties: [
  159.         'freightInvoiceTaxAction',
  160.         'demurrageInvoiceTaxAction',
  161.     ],
  162. )]
  163. class Contract
  164. {
  165.     use TimestampableEntity;
  166.     public const CONTRACT_TYPE_SPOT 'SPOT';
  167.     public const CONTRACT_TYPE_COA 'COA';
  168.     public const CONTRACT_TYPE_TIME_CHARTER 'TIME_CHARTER';
  169.     public const CONTRACT_TYPES = [
  170.         self::CONTRACT_TYPE_SPOT,
  171.         self::CONTRACT_TYPE_COA,
  172.         self::CONTRACT_TYPE_TIME_CHARTER,
  173.     ];
  174.     public const COST_TYPE_PMT 'PMT';
  175.     public const COST_TYPE_LUMPSUM 'LUMPSUM';
  176.     public const COST_TYPE_WS 'WS';
  177.     public const COST_TYPES = [
  178.         self::COST_TYPE_PMT,
  179.         self::COST_TYPE_LUMPSUM,
  180.         self::COST_TYPE_WS,
  181.     ];
  182.     public const CONTRACT_STATUS_TRANSIT_TO_LOAD_PORT 'TRANSIT_TO_LOAD_PORT';
  183.     public const CONTRACT_STATUS_AT_LOAD_PORT 'AT_LOAD_PORT';
  184.     public const CONTRACT_STATUS_LOADING 'LOADING';
  185.     public const CONTRACT_STATUS_TRANSIT_TO_DISCHARGE_PORT 'TRANSIT_TO_DISCHARGE_PORT';
  186.     public const CONTRACT_STATUS_AT_DISCHARGE_PORT 'AT_DISCHARGE_PORT';
  187.     public const CONTRACT_STATUS_DISCHARGING 'DISCHARGING';
  188.     public const CONTRACT_STATUS_OPERATIONS_COMPLETED 'OPERATIONS_COMPLETED';
  189.     public const CONTRACT_STATUS_DEMURRAGE 'DEMURRAGE';
  190.     public const CONTRACT_STATUS_UNASSIGNED 'UNASSIGNED';
  191.     public const CONTRACT_STATUS_COMPLETED 'COMPLETED';
  192.     public const CONTRACT_STATUS_ACTIVE 'ACTIVE';
  193.     public const CONTRACT_STATUS_CANCELED 'CANCELED';
  194.     public const CONTRACT_STATUSES = [
  195.         self::CONTRACT_STATUS_TRANSIT_TO_LOAD_PORT,
  196.         self::CONTRACT_STATUS_AT_LOAD_PORT,
  197.         self::CONTRACT_STATUS_LOADING,
  198.         self::CONTRACT_STATUS_TRANSIT_TO_DISCHARGE_PORT,
  199.         self::CONTRACT_STATUS_AT_DISCHARGE_PORT,
  200.         self::CONTRACT_STATUS_DISCHARGING,
  201.         self::CONTRACT_STATUS_OPERATIONS_COMPLETED,
  202.         self::CONTRACT_STATUS_DEMURRAGE,
  203.         self::CONTRACT_STATUS_UNASSIGNED,
  204.         self::CONTRACT_STATUS_COMPLETED,
  205.         self::CONTRACT_STATUS_ACTIVE,
  206.         self::CONTRACT_STATUS_CANCELED,
  207.     ];
  208.     public const DEMURRAGE_STATUS_AWAITING_CLAIM 'AWAITING_CLAIM';
  209.     public const DEMURRAGE_STATUS_CLAIM_RECEIVED 'CLAIM_RECEIVED';
  210.     public const DEMURRAGE_STATUS_CLAIM_SENT 'CLAIM_SENT';
  211.     public const DEMURRAGE_STATUS_NO_DEMURRAGE 'NO_DEMURRAGE';
  212.     public const DEMURRAGE_STATUS_IN_ARBITRATION 'IN_ARBITRATION';
  213.     public const DEMURRAGE_STATUS_PAID 'PAID';
  214.     public const DEMURRAGE_STATUSES = [
  215.         self::DEMURRAGE_STATUS_AWAITING_CLAIM,
  216.         self::DEMURRAGE_STATUS_CLAIM_RECEIVED,
  217.         self::DEMURRAGE_STATUS_CLAIM_SENT,
  218.         self::DEMURRAGE_STATUS_NO_DEMURRAGE,
  219.         self::DEMURRAGE_STATUS_IN_ARBITRATION,
  220.         self::DEMURRAGE_STATUS_PAID,
  221.     ];
  222.     public const DEMURRAGE_INVOICE_STATUS_INVOICED 'INVOICED';
  223.     public const DEMURRAGE_INVOICE_STATUS_NOT_INVOICED 'NOT_INVOICED';
  224.     public const DEMURRAGE_INVOICE_STATUS_PAID 'PAID';
  225.     public const DEMURRAGE_INVOICE_STATUS_CANCELED 'CANCELED';
  226.    
  227.     public const DEMURRAGE_INVOICE_STATUSES = [
  228.         self::DEMURRAGE_INVOICE_STATUS_INVOICED,
  229.         self::DEMURRAGE_INVOICE_STATUS_NOT_INVOICED,
  230.         self::DEMURRAGE_INVOICE_STATUS_PAID,
  231.         self::DEMURRAGE_INVOICE_STATUS_CANCELED,
  232.     ];
  233.     public const FREIGHT_INVOICE_STATUS_INVOICED 'INVOICED';
  234.     public const FREIGHT_INVOICE_STATUS_NOT_INVOICED 'NOT_INVOICED';
  235.     public const FREIGHT_INVOICE_STATUS_PAID 'PAID';
  236.     public const FREIGHT_INVOICE_STATUS_CANCELED 'CANCELED';
  237.    
  238.     public const FREIGHT_INVOICE_STATUSES = [
  239.         self::FREIGHT_INVOICE_STATUS_INVOICED,
  240.         self::FREIGHT_INVOICE_STATUS_NOT_INVOICED,
  241.         self::FREIGHT_INVOICE_STATUS_PAID,
  242.         self::FREIGHT_INVOICE_STATUS_CANCELED,
  243.     ];
  244.     public const BANK_ITAU 'ITAU';
  245.     public const BANK_FINECO 'FINECO';
  246.     public const BANKS = [
  247.         self::BANK_ITAU,
  248.         self::BANK_FINECO,
  249.     ];
  250.     #[ORM\Id]
  251.     #[ORM\GeneratedValue(strategy'NONE')]
  252.     #[ORM\Column(type'uuid'uniquetrue)]
  253.     private ?UuidInterface $id null;
  254.     #[ORM\Column(type'string'nullablefalseuniquetrue)]
  255.     #[ApiProperty()]
  256.     #[Assert\NotBlank]
  257.     #[Assert\Type('string')]
  258.     #[Groups([
  259.         'contract:item:get'
  260.         'contract:item:put'
  261.         'contract:collection:get'
  262.         'contract:collection:post'
  263.     ])]
  264.     private ?string $contractNumber null;
  265.     #[ORM\Column(type'string'nullabletrue)]
  266.     #[ApiProperty()]
  267.     #[Assert\NotBlank]
  268.     #[Assert\Type('string')]
  269.     #[Assert\Choice(
  270.         choicesself::CONTRACT_TYPES
  271.         message'The type is not valid.'
  272.     )]
  273.     #[Groups([
  274.         'contract:item:get'
  275.         'contract:item:put'
  276.         'contract:collection:get'
  277.         'contract:collection:post'
  278.     ])]
  279.     private ?string $contractType null;
  280.     #[ORM\Column(type'datetime'nullabletrue)]
  281.     #[ApiProperty()]
  282.     // #[Assert\NotBlank]
  283.     #[Assert\Type(\DateTimeInterface::class)]
  284.     #[Groups([
  285.         'contract:item:get'
  286.         'contract:item:put'
  287.         // 'contract:collection:get', 
  288.         'contract:collection:post'
  289.     ])]
  290.     private ?\DateTimeInterface $laycanStart null;
  291.     #[ApiProperty()]
  292.     #[Groups([
  293.         'contract:item:get'
  294.     ])]
  295.     private ?string $laycanStartDate null;
  296.     #[ApiProperty()]
  297.     #[Groups([
  298.         'contract:item:get'
  299.     ])]
  300.     private ?string $laycanStartTime null;
  301.     #[ORM\Column(type'datetime'nullabletrue)]
  302.     #[ApiProperty()]
  303.     // #[Assert\NotBlank]
  304.     #[Assert\Type(\DateTimeInterface::class)]
  305.     #[Groups([
  306.         'contract:item:get'
  307.         'contract:item:put'
  308.         // 'contract:collection:get', 
  309.         'contract:collection:post'
  310.     ])]
  311.     private ?\DateTimeInterface $laycanEnd null;
  312.     #[ApiProperty()]
  313.     #[Groups([
  314.         'contract:item:get'
  315.     ])]
  316.     private ?string $laycanEndDate null;
  317.     #[ApiProperty()]
  318.     #[Groups([
  319.         'contract:item:get'
  320.     ])]
  321.     private ?string $laycanEndTime null;
  322.     #[ORM\ManyToOne(
  323.         targetEntityVessel::class, 
  324.         inversedBy'contracts'
  325.     )]
  326.     #[ORM\JoinColumn(nullabletrue)]
  327.     #[ApiProperty()]
  328.     #[Groups([
  329.         'contract:item:get'
  330.         'contract:item:put'
  331.         'contract:collection:get'
  332.         'contract:collection:post'
  333.     ])]
  334.     private ?Vessel $vessel null;
  335.     #[ORM\ManyToOne(
  336.         targetEntityOwner::class, 
  337.         inversedBy'contracts'
  338.     )]
  339.     #[ORM\JoinColumn(nullabletrue)]
  340.     #[ApiProperty()]
  341.     #[Groups([
  342.         'contract:item:get'
  343.         'contract:item:put'
  344.         'contract:collection:get'
  345.         'contract:collection:post'
  346.     ])]
  347.     #[MaxDepth(1)]
  348.     private ?Owner $owner null;
  349.     #[ORM\ManyToOne(
  350.         targetEntityCharterer::class, 
  351.         inversedBy'contracts'
  352.     )]
  353.     #[ORM\JoinColumn(nullabletrue)]
  354.     #[ApiProperty()]
  355.     #[Groups([
  356.         'contract:item:get'
  357.         'contract:item:put'
  358.         'contract:collection:get'
  359.         'contract:collection:post'
  360.     ])]
  361.     #[MaxDepth(1)]
  362.     private ?Charterer $charterer null;
  363.     #[ORM\ManyToOne(
  364.         targetEntityUser::class, 
  365.         inversedBy'contracts'
  366.     )]
  367.     #[ORM\JoinColumn(nullabletrue)]
  368.     #[ApiProperty()]
  369.     #[Groups([
  370.         'contract:item:get'
  371.         'contract:item:put'
  372.         'contract:collection:get'
  373.         'contract:collection:post'
  374.     ])]
  375.     #[MaxDepth(1)]
  376.     private ?User $broker null;
  377.     #[ORM\ManyToOne(
  378.         targetEntityUser::class, 
  379.         inversedBy'operations'
  380.     )]
  381.     #[ORM\JoinColumn(nullabletrue)]
  382.     #[ApiProperty()]
  383.     #[Groups([
  384.         'contract:item:get'
  385.         'contract:item:put'
  386.         'contract:collection:get'
  387.         'contract:collection:post'
  388.     ])]
  389.     #[MaxDepth(1)]
  390.     private ?User $operator null;
  391.     #[ORM\Column(type'string'nullablefalse)]
  392.     #[ApiProperty()]
  393.     #[Assert\NotBlank]
  394.     #[Assert\Type('string')]
  395.     #[Assert\Choice(
  396.         choicesself::CONTRACT_STATUSES
  397.         message'The status is not valid.'
  398.     )]
  399.     #[Groups([
  400.         'contract:item:get'
  401.         'contract:item:put'
  402.         'contract:collection:get'
  403.         'contract:collection:post'
  404.     ])]
  405.     private ?string $status null;
  406.     #[ORM\Column(type'string'nullabletrue)]
  407.     #[Assert\Type('string')]
  408.     #[ApiProperty()]
  409.     #[Groups([
  410.         'contract:item:get'
  411.         'contract:item:put'
  412.         'contract:collection:get'
  413.         'contract:collection:post'
  414.     ])]
  415.     private ?string $freightCost null;
  416.     #[ORM\Column(type'string'nullabletrue)]
  417.     #[Assert\Type('string')]
  418.     #[ApiProperty()]
  419.     #[Groups([
  420.         'contract:item:get'
  421.         'contract:item:put'
  422.         'contract:collection:get'
  423.         'contract:collection:post'
  424.     ])]
  425.     private ?string $freightCostCurrency null;
  426.     #[ORM\Column(type'string'nullabletrue)]
  427.     #[Assert\Type('string')]
  428.     #[Assert\Choice(
  429.         choicesself::COST_TYPES
  430.         message'The type is not valid.'
  431.     )]
  432.     #[ApiProperty()]
  433.     #[Groups([
  434.         'contract:item:get'
  435.         'contract:item:put'
  436.         'contract:collection:get'
  437.         'contract:collection:post'
  438.     ])]
  439.     private ?string $freightType null;
  440.     #[ORM\Column(type'string'nullabletrue)]
  441.     #[Assert\Type('string')]
  442.     #[ApiProperty()]
  443.     #[Groups([
  444.         'contract:item:get'
  445.         'contract:item:put'
  446.         // 'contract:collection:get', 
  447.         'contract:collection:post'
  448.     ])]
  449.     private ?string $demurragePerDay null;
  450.     #[ORM\Column(type'string'nullabletrue)]
  451.     #[Assert\Type('string')]
  452.     #[ApiProperty()]
  453.     #[Groups([
  454.         'contract:item:get'
  455.         'contract:item:put'
  456.         // 'contract:collection:get', 
  457.         'contract:collection:post'
  458.     ])]
  459.     private ?string $demurragePerDayCurrency null;
  460.     #[ORM\OneToMany(
  461.         targetEntityAdditionalCost::class, 
  462.         mappedBy'contract'
  463.         cascade: ['persist''remove'], 
  464.         orphanRemovaltrue
  465.     )]
  466.     ##[ORM\OrderBy(['taskIndex' => 'ASC'])]
  467.     #[Groups([
  468.         'contract:item:get'
  469.         'contract:item:put'
  470.         // 'contract:collection:get', 
  471.         'contract:collection:post'
  472.     ])]
  473.     #[MaxDepth(1)]
  474.     private ?Collection $additionalCosts null;
  475.     #[ORM\Column(type'string'nullabletrue)]
  476.     #[Assert\Type('string')]
  477.     #[ApiProperty()]
  478.     #[Groups([
  479.         'contract:item:get'
  480.         'contract:item:put'
  481.         'contract:collection:get'
  482.         'contract:collection:post'
  483.     ])]
  484.     private ?string $addressCommission null;
  485.     #[ORM\Column(type'string'nullabletrue)]
  486.     #[Assert\Type('string')]
  487.     #[ApiProperty()]
  488.     #[Groups([
  489.         'contract:item:get'
  490.         'contract:item:put'
  491.         'contract:collection:get'
  492.         'contract:collection:post'
  493.     ])]
  494.     private ?string $brokerageCommission null;
  495.     #[ORM\Column(type'integer'nullabletrue)]
  496.     #[ApiProperty()]
  497.     #[Assert\Type('integer')]
  498.     #[Groups([
  499.         'contract:item:get'
  500.         'contract:item:put'
  501.         // 'contract:collection:get', 
  502.         'contract:collection:post'
  503.     ])]
  504.     private ?int $liftingsMin null;
  505.     #[ORM\Column(type'integer'nullabletrue)]
  506.     #[ApiProperty()]
  507.     #[Assert\Type('integer')]
  508.     #[Groups([
  509.         'contract:item:get'
  510.         'contract:item:put'
  511.         // 'contract:collection:get', 
  512.         'contract:collection:post'
  513.     ])]
  514.     private ?int $liftingsMax null;
  515.     #[ORM\OneToMany(
  516.         targetEntityMedia::class,
  517.         mappedBy'contract'
  518.         cascade: ['remove'], 
  519.         orphanRemovaltrue
  520.     )]
  521.     #[ApiProperty()]
  522.     #[Groups([
  523.         'contract:item:get'
  524.         'contract:item:put'
  525.         // 'contract:collection:get', 
  526.         'contract:collection:post'
  527.     ])]
  528.     #[MaxDepth(1)]
  529.     private ?Collection $documents null;
  530.     #[ORM\OneToMany(
  531.         targetEntityPortCall::class, 
  532.         mappedBy'contract'
  533.         cascade: ['persist''remove'], 
  534.         orphanRemovaltrue
  535.     )]
  536.     #[ORM\OrderBy(['portIndex' => 'ASC'])]
  537.     #[Groups([
  538.         'contract:item:get'
  539.         'contract:item:put'
  540.         'contract:collection:get'
  541.         'contract:collection:post'
  542.     ])]
  543.     #[MaxDepth(1)]
  544.     private ?Collection $portCalls null;
  545.     #[ORM\OneToMany(
  546.         targetEntityOperationReport::class, 
  547.         mappedBy'contract'
  548.         cascade: ['persist''remove'], 
  549.         orphanRemovaltrue
  550.     )]
  551.     // #[ORM\OrderBy(['taskIndex' => 'ASC'])]
  552.     #[Groups([
  553.         'contract:item:get'
  554.         'contract:item:put'
  555.         // 'contract:collection:get', 
  556.         'contract:collection:post'
  557.     ])]
  558.     #[MaxDepth(1)]
  559.     private ?Collection $operationReports null;
  560.     #[ORM\OneToMany(
  561.         targetEntityContractCargo::class, 
  562.         mappedBy'contract'
  563.         cascade: ['persist''remove'], 
  564.         orphanRemovaltrue
  565.     )]
  566.     ##[ORM\OrderBy(['taskIndex' => 'ASC'])]
  567.     #[Groups([
  568.         'contract:item:get'
  569.         'contract:item:put'
  570.         // 'contract:collection:get', 
  571.         'contract:collection:post'
  572.     ])]
  573.     #[MaxDepth(1)]
  574.     private ?Collection $cargoItems null;
  575.     #[ORM\OneToMany(
  576.         targetEntityPayment::class, 
  577.         mappedBy'contract'
  578.         cascade: ['persist''remove'], 
  579.         orphanRemovaltrue
  580.     )]
  581.     ##[ORM\OrderBy(['taskIndex' => 'ASC'])]
  582.     #[Groups([
  583.         'contract:item:get'
  584.         'contract:item:put'
  585.         // 'contract:collection:get', 
  586.         'contract:collection:post'
  587.     ])]
  588.     #[MaxDepth(1)]
  589.     private ?Collection $payments null;
  590.     #[ORM\OneToMany(
  591.         targetEntityHire::class, 
  592.         mappedBy'contract'
  593.         cascade: ['persist''remove'], 
  594.         orphanRemovaltrue
  595.     )]
  596.     #[ORM\OrderBy(['hireIndex' => 'ASC'])]
  597.     #[Groups([
  598.         'contract:item:get'
  599.         'contract:item:put'
  600.         // 'contract:collection:get', 
  601.         'contract:collection:post'
  602.     ])]
  603.     #[MaxDepth(1)]
  604.     private ?Collection $hires null;
  605.     #[ORM\OneToMany(
  606.         targetEntityContract::class, 
  607.         mappedBy'contractCoa'
  608.         cascade: ['persist''remove'], 
  609.         orphanRemovaltrue
  610.     )]
  611.     ##[ORM\OrderBy(['taskIndex' => 'ASC'])]
  612.     #[Groups([
  613.         'contract:item:get'
  614.         'contract:item:put'
  615.         // 'contract:collection:get', 
  616.         'contract:collection:post'
  617.     ])]
  618.     #[MaxDepth(2)]
  619.     private ?Collection $liftings null;
  620.     #[ORM\ManyToOne(
  621.         targetEntityChecklist::class, 
  622.         inversedBy'contracts'
  623.     )]
  624.     #[ORM\JoinColumn(nullabletrue)]
  625.     #[ApiProperty()]
  626.     #[Groups([
  627.         'contract:item:get'
  628.         'contract:item:put'
  629.         // 'contract:collection:get', 
  630.         'contract:collection:post'
  631.     ])]
  632.     #[MaxDepth(1)]
  633.     private ?Checklist $checklist null;
  634.     #[ORM\ManyToMany(
  635.         targetEntityTask::class, 
  636.         inversedBy'contracts'
  637.         cascade: ['persist']
  638.     )]
  639.     #[ApiProperty()]
  640.     #[Groups([
  641.         'contract:item:get'
  642.         'contract:item:put'
  643.         // 'contract:collection:get', 
  644.         'contract:collection:post'
  645.     ])]
  646.     #[MaxDepth(1)]
  647.     private ?Collection $checkedTasks null;
  648.     #[ORM\Column(type'text'nullabletrue)]
  649.     #[ApiProperty()]
  650.     #[Assert\Type('string')]
  651.     #[Groups([
  652.         'contract:item:get'
  653.         'contract:item:put'
  654.         // 'contract:collection:get', 
  655.         'contract:collection:post'
  656.     ])]
  657.     private ?string $checklistNotes null;
  658.     #[ORM\Column(type'string'nullabletrue)]
  659.     #[ApiProperty()]
  660.     // #[Assert\NotBlank]
  661.     #[Assert\Type('string')]
  662.     #[Assert\Choice(
  663.         choicesself::DEMURRAGE_STATUSES
  664.         message'The status is not valid.'
  665.     )]
  666.     #[Groups([
  667.         'contract:item:get'
  668.         'contract:item:put'
  669.         'contract:collection:get'
  670.         'contract:collection:post'
  671.     ])]
  672.     private ?string $demurrageStatus null;
  673.     #[ORM\Column(type'integer'nullabletrue)]
  674.     #[ApiProperty()]
  675.     #[Assert\Type('integer')]
  676.     #[Groups([
  677.         'contract:item:get'
  678.         'contract:item:put'
  679.         'contract:collection:get'
  680.         'contract:collection:post'
  681.     ])]
  682.     private ?int $demurrageTimeBar null;
  683.     #[ORM\Column(type'date'nullabletrue)]
  684.     #[ApiProperty()]
  685.     // #[Assert\NotBlank]
  686.     #[Assert\Type(\DateTimeInterface::class)]
  687.     #[Groups([
  688.         'contract:item:get'
  689.         'contract:item:put'
  690.         'contract:collection:get'
  691.         'contract:collection:post'
  692.     ])]
  693.     private ?\DateTimeInterface $demurragePaymentDate null;
  694.     #[ORM\Column(type'date'nullabletrue)]
  695.     #[ApiProperty()]
  696.     // #[Assert\NotBlank]
  697.     #[Assert\Type(\DateTimeInterface::class)]
  698.     #[Groups([
  699.         'contract:item:get'
  700.         'contract:item:put'
  701.         'contract:collection:get'
  702.         'contract:collection:post'
  703.     ])]
  704.     private ?\DateTimeInterface $demurrageClaimDate null;
  705.     #[ORM\Column(type'string'nullabletrue)]
  706.     #[Assert\Type('string')]
  707.     #[ApiProperty()]
  708.     #[Groups([
  709.         'contract:item:get'
  710.         'contract:item:put'
  711.         'contract:collection:get'
  712.         'contract:collection:post'
  713.     ])]
  714.     private ?string $finalDemurrageCost null;
  715.     #[ORM\Column(type'string'nullabletrue)]
  716.     #[Assert\Type('string')]
  717.     #[ApiProperty()]
  718.     #[Groups([
  719.         'contract:item:get'
  720.         'contract:item:put'
  721.         'contract:collection:get'
  722.         'contract:collection:post'
  723.     ])]
  724.     private ?string $finalDemurrageCostCurrency null;
  725.     #[ORM\Column(type'string'nullabletrue)]
  726.     #[Assert\Type('string')]
  727.     #[ApiProperty()]
  728.     #[Groups([
  729.         'contract:item:get'
  730.         'contract:item:put'
  731.         // 'contract:collection:get', 
  732.         'contract:collection:post'
  733.     ])]
  734.     private ?string $demurragePaidByCharterer null;
  735.     #[ORM\Column(type'string'nullabletrue)]
  736.     #[Assert\Type('string')]
  737.     #[ApiProperty()]
  738.     #[Groups([
  739.         'contract:item:get'
  740.         'contract:item:put'
  741.         // 'contract:collection:get', 
  742.         'contract:collection:post'
  743.     ])]
  744.     private ?string $demurragePaidByChartererCurrency null;
  745.     #[ORM\Column(type'datetime'nullabletrue)]
  746.     #[ApiProperty()]
  747.     // #[Assert\NotBlank]
  748.     #[Assert\Type(\DateTimeInterface::class)]
  749.     #[Groups([
  750.         'contract:item:get'
  751.         'contract:item:put'
  752.         // 'contract:collection:get', 
  753.         'contract:collection:post'
  754.     ])]
  755.     private ?\DateTimeInterface $etaArrival null;
  756.     #[ApiProperty()]
  757.     #[Groups([
  758.         'contract:item:get'
  759.     ])]
  760.     private ?string $etaArrivalDate null;
  761.     #[ApiProperty()]
  762.     #[Groups([
  763.         'contract:item:get'
  764.     ])]
  765.     private ?string $etaArrivalTime null;
  766.     #[ORM\Column(type'datetime'nullabletrue)]
  767.     #[ApiProperty()]
  768.     // #[Assert\NotBlank]
  769.     #[Assert\Type(\DateTimeInterface::class)]
  770.     #[Groups([
  771.         'contract:item:get'
  772.         'contract:item:put'
  773.         // 'contract:collection:get', 
  774.         'contract:collection:post'
  775.     ])]
  776.     private ?\DateTimeInterface $redeliveryEtaArrival null;
  777.     #[ApiProperty()]
  778.     #[Groups([
  779.         'contract:item:get'
  780.     ])]
  781.     private ?string $redeliveryEtaArrivalDate null;
  782.     #[ApiProperty()]
  783.     #[Groups([
  784.         'contract:item:get'
  785.     ])]
  786.     private ?string $redeliveryEtaArrivalTime null;
  787.     #[ORM\Column(type'integer'nullabletrue)]
  788.     #[ApiProperty()]
  789.     #[Assert\Type('integer')]
  790.     #[Groups([
  791.         'contract:item:get'
  792.         'contract:item:put'
  793.         // 'contract:collection:get', 
  794.         'contract:collection:post'
  795.     ])]
  796.     private ?int $deliveryAproxNotice1 null;
  797.     #[ORM\Column(type'integer'nullabletrue)]
  798.     #[ApiProperty()]
  799.     #[Assert\Type('integer')]
  800.     #[Groups([
  801.         'contract:item:get'
  802.         'contract:item:put'
  803.         // 'contract:collection:get', 
  804.         'contract:collection:post'
  805.     ])]
  806.     private ?int $deliveryAproxNotice2 null;
  807.     #[ORM\Column(type'integer'nullabletrue)]
  808.     #[ApiProperty()]
  809.     #[Assert\Type('integer')]
  810.     #[Groups([
  811.         'contract:item:get'
  812.         'contract:item:put'
  813.         // 'contract:collection:get', 
  814.         'contract:collection:post'
  815.     ])]
  816.     private ?int $deliveryAproxNotice3 null;
  817.     #[ORM\Column(type'integer'nullabletrue)]
  818.     #[ApiProperty()]
  819.     #[Assert\Type('integer')]
  820.     #[Groups([
  821.         'contract:item:get'
  822.         'contract:item:put'
  823.         // 'contract:collection:get', 
  824.         'contract:collection:post'
  825.     ])]
  826.     private ?int $deliveryAproxNotice4 null;
  827.     #[ORM\Column(type'integer'nullabletrue)]
  828.     #[ApiProperty()]
  829.     #[Assert\Type('integer')]
  830.     #[Groups([
  831.         'contract:item:get'
  832.         'contract:item:put'
  833.         // 'contract:collection:get', 
  834.         'contract:collection:post'
  835.     ])]
  836.     private ?int $deliveryAproxNotice5 null;
  837.     #[ORM\Column(type'integer'nullabletrue)]
  838.     #[ApiProperty()]
  839.     #[Assert\Type('integer')]
  840.     #[Groups([
  841.         'contract:item:get'
  842.         'contract:item:put'
  843.         // 'contract:collection:get', 
  844.         'contract:collection:post'
  845.     ])]
  846.     private ?int $deliveryAproxNotice6 null;
  847.     #[ORM\Column(type'integer'nullabletrue)]
  848.     #[ApiProperty()]
  849.     #[Assert\Type('integer')]
  850.     #[Groups([
  851.         'contract:item:get'
  852.         'contract:item:put'
  853.         // 'contract:collection:get', 
  854.         'contract:collection:post'
  855.     ])]
  856.     private ?int $deliveryAproxNotice7 null;
  857.     #[ORM\Column(type'integer'nullabletrue)]
  858.     #[ApiProperty()]
  859.     #[Assert\Type('integer')]
  860.     #[Groups([
  861.         'contract:item:get'
  862.         'contract:item:put'
  863.         // 'contract:collection:get', 
  864.         'contract:collection:post'
  865.     ])]
  866.     private ?int $deliveryFirmNotice1 null;
  867.     #[ORM\Column(type'integer'nullabletrue)]
  868.     #[ApiProperty()]
  869.     #[Assert\Type('integer')]
  870.     #[Groups([
  871.         'contract:item:get'
  872.         'contract:item:put'
  873.         // 'contract:collection:get', 
  874.         'contract:collection:post'
  875.     ])]
  876.     private ?int $deliveryFirmNotice2 null;
  877.     #[ORM\Column(type'integer'nullabletrue)]
  878.     #[ApiProperty()]
  879.     #[Assert\Type('integer')]
  880.     #[Groups([
  881.         'contract:item:get'
  882.         'contract:item:put'
  883.         // 'contract:collection:get', 
  884.         'contract:collection:post'
  885.     ])]
  886.     private ?int $deliveryFirmNotice3 null;
  887.     #[ORM\Column(type'integer'nullabletrue)]
  888.     #[ApiProperty()]
  889.     #[Assert\Type('integer')]
  890.     #[Groups([
  891.         'contract:item:get'
  892.         'contract:item:put'
  893.         // 'contract:collection:get', 
  894.         'contract:collection:post'
  895.     ])]
  896.     private ?int $deliveryFirmNotice4 null;
  897.     #[ORM\Column(type'integer'nullabletrue)]
  898.     #[ApiProperty()]
  899.     #[Assert\Type('integer')]
  900.     #[Groups([
  901.         'contract:item:get'
  902.         'contract:item:put'
  903.         // 'contract:collection:get', 
  904.         'contract:collection:post'
  905.     ])]
  906.     private ?int $deliveryFirmNotice5 null;
  907.     #[ORM\Column(type'integer'nullabletrue)]
  908.     #[ApiProperty()]
  909.     #[Assert\Type('integer')]
  910.     #[Groups([
  911.         'contract:item:get'
  912.         'contract:item:put'
  913.         // 'contract:collection:get', 
  914.         'contract:collection:post'
  915.     ])]
  916.     private ?int $deliveryFirmNotice6 null;
  917.     #[ORM\Column(type'integer'nullabletrue)]
  918.     #[ApiProperty()]
  919.     #[Assert\Type('integer')]
  920.     #[Groups([
  921.         'contract:item:get'
  922.         'contract:item:put'
  923.         // 'contract:collection:get', 
  924.         'contract:collection:post'
  925.     ])]
  926.     private ?int $deliveryFirmNotice7 null;
  927.     #[ORM\Column(type'integer'nullabletrue)]
  928.     #[ApiProperty()]
  929.     #[Assert\Type('integer')]
  930.     #[Groups([
  931.         'contract:item:get'
  932.         'contract:item:put'
  933.         // 'contract:collection:get', 
  934.         'contract:collection:post'
  935.     ])]
  936.     private ?int $redeliveryAproxNotice1 null;
  937.     #[ORM\Column(type'integer'nullabletrue)]
  938.     #[ApiProperty()]
  939.     #[Assert\Type('integer')]
  940.     #[Groups([
  941.         'contract:item:get'
  942.         'contract:item:put'
  943.         // 'contract:collection:get', 
  944.         'contract:collection:post'
  945.     ])]
  946.     private ?int $redeliveryAproxNotice2 null;
  947.     #[ORM\Column(type'integer'nullabletrue)]
  948.     #[ApiProperty()]
  949.     #[Assert\Type('integer')]
  950.     #[Groups([
  951.         'contract:item:get'
  952.         'contract:item:put'
  953.         // 'contract:collection:get', 
  954.         'contract:collection:post'
  955.     ])]
  956.     private ?int $redeliveryAproxNotice3 null;
  957.     #[ORM\Column(type'integer'nullabletrue)]
  958.     #[ApiProperty()]
  959.     #[Assert\Type('integer')]
  960.     #[Groups([
  961.         'contract:item:get'
  962.         'contract:item:put'
  963.         // 'contract:collection:get', 
  964.         'contract:collection:post'
  965.     ])]
  966.     private ?int $redeliveryAproxNotice4 null;
  967.     #[ORM\Column(type'integer'nullabletrue)]
  968.     #[ApiProperty()]
  969.     #[Assert\Type('integer')]
  970.     #[Groups([
  971.         'contract:item:get'
  972.         'contract:item:put'
  973.         // 'contract:collection:get', 
  974.         'contract:collection:post'
  975.     ])]
  976.     private ?int $redeliveryAproxNotice5 null;
  977.     #[ORM\Column(type'integer'nullabletrue)]
  978.     #[ApiProperty()]
  979.     #[Assert\Type('integer')]
  980.     #[Groups([
  981.         'contract:item:get'
  982.         'contract:item:put'
  983.         // 'contract:collection:get', 
  984.         'contract:collection:post'
  985.     ])]
  986.     private ?int $redeliveryAproxNotice6 null;
  987.     #[ORM\Column(type'integer'nullabletrue)]
  988.     #[ApiProperty()]
  989.     #[Assert\Type('integer')]
  990.     #[Groups([
  991.         'contract:item:get'
  992.         'contract:item:put'
  993.         // 'contract:collection:get', 
  994.         'contract:collection:post'
  995.     ])]
  996.     private ?int $redeliveryAproxNotice7 null;
  997.     #[ORM\Column(type'integer'nullabletrue)]
  998.     #[ApiProperty()]
  999.     #[Assert\Type('integer')]
  1000.     #[Groups([
  1001.         'contract:item:get'
  1002.         'contract:item:put'
  1003.         // 'contract:collection:get', 
  1004.         'contract:collection:post'
  1005.     ])]
  1006.     private ?int $redeliveryFirmNotice1 null;
  1007.     #[ORM\Column(type'integer'nullabletrue)]
  1008.     #[ApiProperty()]
  1009.     #[Assert\Type('integer')]
  1010.     #[Groups([
  1011.         'contract:item:get'
  1012.         'contract:item:put'
  1013.         // 'contract:collection:get', 
  1014.         'contract:collection:post'
  1015.     ])]
  1016.     private ?int $redeliveryFirmNotice2 null;
  1017.     #[ORM\Column(type'integer'nullabletrue)]
  1018.     #[ApiProperty()]
  1019.     #[Assert\Type('integer')]
  1020.     #[Groups([
  1021.         'contract:item:get'
  1022.         'contract:item:put'
  1023.         // 'contract:collection:get', 
  1024.         'contract:collection:post'
  1025.     ])]
  1026.     private ?int $redeliveryFirmNotice3 null;
  1027.     #[ORM\Column(type'integer'nullabletrue)]
  1028.     #[ApiProperty()]
  1029.     #[Assert\Type('integer')]
  1030.     #[Groups([
  1031.         'contract:item:get'
  1032.         'contract:item:put'
  1033.         // 'contract:collection:get', 
  1034.         'contract:collection:post'
  1035.     ])]
  1036.     private ?int $redeliveryFirmNotice4 null;
  1037.     #[ORM\Column(type'integer'nullabletrue)]
  1038.     #[ApiProperty()]
  1039.     #[Assert\Type('integer')]
  1040.     #[Groups([
  1041.         'contract:item:get'
  1042.         'contract:item:put'
  1043.         // 'contract:collection:get', 
  1044.         'contract:collection:post'
  1045.     ])]
  1046.     private ?int $redeliveryFirmNotice5 null;
  1047.     #[ORM\Column(type'integer'nullabletrue)]
  1048.     #[ApiProperty()]
  1049.     #[Assert\Type('integer')]
  1050.     #[Groups([
  1051.         'contract:item:get'
  1052.         'contract:item:put'
  1053.         // 'contract:collection:get', 
  1054.         'contract:collection:post'
  1055.     ])]
  1056.     private ?int $redeliveryFirmNotice6 null;
  1057.     #[ORM\Column(type'integer'nullabletrue)]
  1058.     #[ApiProperty()]
  1059.     #[Assert\Type('integer')]
  1060.     #[Groups([
  1061.         'contract:item:get'
  1062.         'contract:item:put'
  1063.         // 'contract:collection:get', 
  1064.         'contract:collection:post'
  1065.     ])]
  1066.     private ?int $redeliveryFirmNotice7 null;
  1067.     #[ORM\Column(type'boolean'nullabletrue)]
  1068.     #[ApiProperty()]
  1069.     #[Groups([
  1070.         'contract:item:get'
  1071.         'contract:item:put'
  1072.         // 'contract:collection:get', 
  1073.         'contract:collection:post'
  1074.     ])]
  1075.     private ?bool $deliveryNoticesNotAplicable false;
  1076.     #[ORM\Column(type'boolean'nullabletrue)]
  1077.     #[ApiProperty()]
  1078.     #[Groups([
  1079.         'contract:item:get'
  1080.         'contract:item:put'
  1081.         // 'contract:collection:get', 
  1082.         'contract:collection:post'
  1083.     ])]
  1084.     private ?bool $redeliveryNoticesNotAplicable false;
  1085.     #[ORM\Column(type'boolean'nullabletrue)]
  1086.     #[ApiProperty()]
  1087.     #[Groups([
  1088.         'contract:item:get'
  1089.         'contract:item:put'
  1090.         // 'contract:collection:get', 
  1091.         'contract:collection:post'
  1092.     ])]
  1093.     private ?bool $shipDelivered false;
  1094.     #[ORM\Column(type'boolean'nullabletrue)]
  1095.     #[ApiProperty()]
  1096.     #[Groups([
  1097.         'contract:item:get'
  1098.         'contract:item:put'
  1099.         // 'contract:collection:get', 
  1100.         'contract:collection:post'
  1101.     ])]
  1102.     private ?bool $shipRedelivered false;
  1103.     #[ORM\ManyToOne(
  1104.         targetEntityPort::class, 
  1105.         inversedBy'deliveryPorts1'
  1106.     )]
  1107.     #[ORM\JoinColumn(nullabletrue)]
  1108.     #[ApiProperty()]
  1109.     #[Groups([
  1110.         'contract:item:get'
  1111.         'contract:item:put'
  1112.         // 'contract:collection:get', 
  1113.         'contract:collection:post'
  1114.     ])]
  1115.     #[MaxDepth(1)]
  1116.     private ?Port $deliveryPort1 null;
  1117.     #[ORM\ManyToOne(
  1118.         targetEntityPort::class, 
  1119.         inversedBy'deliveryPorts2'
  1120.     )]
  1121.     #[ORM\JoinColumn(nullabletrue)]
  1122.     #[ApiProperty()]
  1123.     #[Groups([
  1124.         'contract:item:get'
  1125.         'contract:item:put'
  1126.         // 'contract:collection:get', 
  1127.         'contract:collection:post'
  1128.     ])]
  1129.     #[MaxDepth(1)]
  1130.     private ?Port $deliveryPort2 null;
  1131.     #[ORM\ManyToOne(
  1132.         targetEntityPort::class, 
  1133.         inversedBy'redeliveryPorts1'
  1134.     )]
  1135.     #[ORM\JoinColumn(nullabletrue)]
  1136.     #[ApiProperty()]
  1137.     #[Groups([
  1138.         'contract:item:get'
  1139.         'contract:item:put'
  1140.         // 'contract:collection:get', 
  1141.         'contract:collection:post'
  1142.     ])]
  1143.     #[MaxDepth(1)]
  1144.     private ?Port $redeliveryPort1 null;
  1145.     #[ORM\ManyToOne(
  1146.         targetEntityPort::class, 
  1147.         inversedBy'redeliveryPorts2'
  1148.     )]
  1149.     #[ORM\JoinColumn(nullabletrue)]
  1150.     #[ApiProperty()]
  1151.     #[Groups([
  1152.         'contract:item:get'
  1153.         'contract:item:put'
  1154.         // 'contract:collection:get', 
  1155.         'contract:collection:post'
  1156.     ])]
  1157.     #[MaxDepth(1)]
  1158.     private ?Port $redeliveryPort2 null;
  1159.     #[ORM\Column(type'string'nullabletrue)]
  1160.     #[Assert\Type('string')]
  1161.     #[ApiProperty()]
  1162.     #[Groups([
  1163.         'contract:item:get'
  1164.         'contract:item:put'
  1165.         // 'contract:collection:get', 
  1166.         'contract:collection:post'
  1167.     ])]
  1168.     private ?string $hirePerDay null;
  1169.     #[ORM\Column(type'string'nullabletrue)]
  1170.     #[Assert\Type('string')]
  1171.     #[ApiProperty()]
  1172.     #[Groups([
  1173.         'contract:item:get'
  1174.         'contract:item:put'
  1175.         // 'contract:collection:get', 
  1176.         'contract:collection:post'
  1177.     ])]
  1178.     private ?string $hirePerDayCurrency null;
  1179.     #[ORM\Column(type'float'nullabletrue)]
  1180.     #[ApiProperty()]
  1181.     #[Assert\Type('float')]
  1182.     #[Groups([
  1183.         'contract:item:get'
  1184.         'contract:item:put'
  1185.         'contract:collection:get'
  1186.         'contract:collection:post'
  1187.     ])]
  1188.     private ?float $period null;
  1189.     #[ORM\OneToMany(
  1190.         targetEntityDeliveryNotice::class, 
  1191.         mappedBy'contract'
  1192.         cascade: ['persist''remove'], 
  1193.         orphanRemovaltrue
  1194.     )]
  1195.     ##[ORM\OrderBy(['taskIndex' => 'ASC'])]
  1196.     #[Groups([
  1197.         'contract:item:get'
  1198.         'contract:item:put'
  1199.         // 'contract:collection:get', 
  1200.         'contract:collection:post'
  1201.     ])]
  1202.     #[MaxDepth(1)]
  1203.     private ?Collection $deliveryNotices null;
  1204.     #[ORM\OneToMany(
  1205.         targetEntityRedeliveryNotice::class, 
  1206.         mappedBy'contract'
  1207.         cascade: ['persist''remove'], 
  1208.         orphanRemovaltrue
  1209.     )]
  1210.     ##[ORM\OrderBy(['taskIndex' => 'ASC'])]
  1211.     #[Groups([
  1212.         'contract:item:get'
  1213.         'contract:item:put'
  1214.         // 'contract:collection:get', 
  1215.         'contract:collection:post'
  1216.     ])]
  1217.     #[MaxDepth(1)]
  1218.     private ?Collection $redeliveryNotices null;
  1219.     #[ORM\ManyToOne(
  1220.         targetEntityContract::class, 
  1221.         inversedBy'liftings'
  1222.     )]
  1223.     #[ORM\JoinColumn(nullabletrue)]
  1224.     #[ApiProperty()]
  1225.     #[Groups([
  1226.         'contract:item:get'
  1227.         'contract:item:put'
  1228.         // 'contract:collection:get', 
  1229.         'contract:collection:post'
  1230.     ])]
  1231.     #[MaxDepth(1)]
  1232.     private ?Contract $contractCoa null;
  1233.     #[ApiProperty()]
  1234.     #[Groups([
  1235.         'contract:collection:get'
  1236.         'contract:item:get'
  1237.     ])]
  1238.     private ?string $loadPortsResume null;
  1239.     #[ApiProperty()]
  1240.     #[Groups([
  1241.         'contract:collection:get'
  1242.         'contract:item:get'
  1243.     ])]
  1244.     private ?string $dischargePortsResume null;
  1245.     #[ApiProperty()]
  1246.     #[Groups([
  1247.         'contract:collection:get'
  1248.         'contract:item:get'
  1249.     ])]
  1250.     private ?string $cargoResume null;
  1251.     #[ApiProperty()]
  1252.     #[Groups([
  1253.         'contract:collection:get'
  1254.         'contract:item:get'
  1255.     ])]
  1256.     private ?string $cargoVolumeM3 null;
  1257.     #[ApiProperty()]
  1258.     #[Groups([
  1259.         'contract:collection:get'
  1260.         'contract:item:get'
  1261.     ])]
  1262.     private ?string $cargoVolumeMT null;
  1263.     #[ApiProperty()]
  1264.     #[Groups([
  1265.         'contract:collection:get'
  1266.         'contract:item:get'
  1267.     ])]
  1268.     private ?string $totalAmount null;
  1269.     #[ApiProperty()]
  1270.     #[Groups([
  1271.         'contract:collection:get'
  1272.         'contract:item:get'
  1273.     ])]
  1274.     private ?string $totalAmountCurrency null;
  1275.     #[ApiProperty()]
  1276.     #[Groups([
  1277.         'contract:collection:get'
  1278.         'contract:item:get'
  1279.     ])]
  1280.     private ?\DateTimeInterface $demurrageDeadline null;
  1281.     #[ApiProperty()]
  1282.     #[Groups([
  1283.         'contract:collection:get'
  1284.         'contract:item:get'
  1285.     ])]
  1286.     private ?int $demurrageDaysLeft null;
  1287.     #[ORM\Column(type'string'nullabletrue)]
  1288.     #[ApiProperty()]
  1289.     #[Assert\Type('string')]
  1290.     #[Assert\Choice(
  1291.         choicesself::FREIGHT_INVOICE_STATUSES
  1292.         message'The status is not valid.'
  1293.     )]
  1294.     #[Groups([
  1295.         'contract:item:get'
  1296.         'contract:item:put'
  1297.         'contract:collection:get'
  1298.         'contract:collection:post'
  1299.     ])]
  1300.     private ?string $freightInvoiceStatus null;
  1301.     #[ORM\Column(type'string'nullabletrue)]
  1302.     #[ApiProperty()]
  1303.     #[Assert\Type('string')]
  1304.     #[Groups([
  1305.         'contract:item:get'
  1306.         'contract:item:put'
  1307.         'contract:collection:get'
  1308.         'contract:collection:post'
  1309.     ])]
  1310.     private ?string $freightInvoiceNumber null;
  1311.     #[ORM\Column(type'string'nullabletrue)]
  1312.     #[ApiProperty()]
  1313.     #[Assert\Type('string')]
  1314.     #[Groups([
  1315.         'contract:item:get'
  1316.         'contract:item:put'
  1317.         'contract:collection:get'
  1318.         'contract:collection:post'
  1319.     ])]
  1320.     private ?string $freightInvoiceOwnerNumber null;
  1321.     #[ORM\Column(type'boolean'nullabletrue)]
  1322.     #[ApiProperty()]
  1323.     #[Groups([
  1324.         'contract:item:get'
  1325.         'contract:item:put'
  1326.         'contract:collection:get'
  1327.         'contract:collection:post'
  1328.     ])]
  1329.     private ?bool $freightInvoiceTaxAction false;
  1330.     #[ApiProperty()]
  1331.     #[Groups([
  1332.         'contract:collection:get'
  1333.         'contract:item:get'
  1334.     ])]
  1335.     private ?string $freightInvoiceFreightOrHire null;
  1336.     #[ApiProperty()]
  1337.     #[Groups([
  1338.         'contract:collection:get'
  1339.         'contract:item:get'
  1340.     ])]
  1341.     private ?string $freightInvoiceFreightOrHireCurrency null;
  1342.     #[ORM\Column(type'string'nullabletrue)]
  1343.     #[Assert\Type('string')]
  1344.     #[ApiProperty()]
  1345.     #[Groups([
  1346.         'contract:item:get'
  1347.         'contract:item:put'
  1348.         'contract:collection:get'
  1349.         'contract:collection:post'
  1350.     ])]
  1351.     private ?string $freightInvoiceAdditionalCost null;
  1352.     #[ORM\Column(type'string'nullabletrue)]
  1353.     #[Assert\Type('string')]
  1354.     #[ApiProperty()]
  1355.     #[Groups([
  1356.         'contract:item:get'
  1357.         'contract:item:put'
  1358.         'contract:collection:get'
  1359.         'contract:collection:post'
  1360.     ])]
  1361.     private ?string $freightInvoiceAdditionalCostCurrency null;
  1362.     // #[ORM\Column(type: 'string', nullable: true)]
  1363.     // #[Assert\Type('string')]
  1364.     #[ApiProperty()]
  1365.     #[Groups([
  1366.         'contract:item:get'
  1367.         // 'contract:item:put', 
  1368.         'contract:collection:get'
  1369.         // 'contract:collection:post'
  1370.     ])]
  1371.     private ?string $freightInvoiceTotalFreightOrHire null;
  1372.     // #[ORM\Column(type: 'string', nullable: true)]
  1373.     // #[Assert\Type('string')]
  1374.     #[ApiProperty()]
  1375.     #[Groups([
  1376.         'contract:item:get'
  1377.         // 'contract:item:put', 
  1378.         'contract:collection:get'
  1379.         // 'contract:collection:post'
  1380.     ])]
  1381.     private ?string $freightInvoiceTotalFreightOrHireCurrency null;
  1382.     #[ApiProperty()]
  1383.     #[Groups([
  1384.         'contract:collection:get'
  1385.         'contract:item:get'
  1386.     ])]
  1387.     private ?string $freightInvoiceTotalCommission null;
  1388.     #[ApiProperty()]
  1389.     #[Groups([
  1390.         'contract:collection:get'
  1391.         'contract:item:get'
  1392.     ])]
  1393.     private ?string $freightInvoiceTotalCommissionCurrency null;
  1394.     #[ORM\Column(type'string'nullabletrue)]
  1395.     #[Assert\Type('string')]
  1396.     #[ApiProperty()]
  1397.     #[Groups([
  1398.         'contract:item:get'
  1399.         'contract:item:put'
  1400.         'contract:collection:get'
  1401.         'contract:collection:post'
  1402.     ])]
  1403.     private ?string $freightInvoiceCabotagePtax null;
  1404.     #[ApiProperty()]
  1405.     #[Groups([
  1406.         'contract:collection:get'
  1407.         'contract:item:get'
  1408.     ])]
  1409.     private ?string $freightInvoiceCabotageTotalFreight null;
  1410.     #[ApiProperty()]
  1411.     #[Groups([
  1412.         'contract:collection:get'
  1413.         'contract:item:get'
  1414.     ])]
  1415.     private ?string $freightInvoiceCabotageTotalFreightCurrency 'BRL';
  1416.     // #[ORM\Column(type: 'string', nullable: true)]
  1417.     // #[Assert\Type('string')]
  1418.     #[ApiProperty()]
  1419.     #[Groups([
  1420.         'contract:item:get'
  1421.         // 'contract:item:put', 
  1422.         'contract:collection:get'
  1423.         // 'contract:collection:post'
  1424.     ])]
  1425.     private ?string $freightInvoiceCabotageTotalCommission null;
  1426.     // #[ORM\Column(type: 'string', nullable: true)]
  1427.     // #[Assert\Type('string')]
  1428.     #[ApiProperty()]
  1429.     #[Groups([
  1430.         'contract:item:get'
  1431.         // 'contract:item:put', 
  1432.         'contract:collection:get'
  1433.         // 'contract:collection:post'
  1434.     ])]
  1435.     private ?string $freightInvoiceCabotageTotalCommissionCurrency 'BRL';
  1436.     #[ORM\Column(type'string'nullabletrue)]
  1437.     #[Assert\Type('string')]
  1438.     #[ApiProperty()]
  1439.     #[Groups([
  1440.         'contract:item:get'
  1441.         'contract:item:put'
  1442.         'contract:collection:get'
  1443.         'contract:collection:post'
  1444.     ])]
  1445.     private ?string $freightInvoiceAmountReceived null;
  1446.     #[ORM\Column(type'string'nullabletrue)]
  1447.     #[Assert\Type('string')]
  1448.     #[ApiProperty()]
  1449.     #[Groups([
  1450.         'contract:item:get'
  1451.         'contract:item:put'
  1452.         'contract:collection:get'
  1453.         'contract:collection:post'
  1454.     ])]
  1455.     private ?string $freightInvoiceAmountReceivedCurrency 'USD';
  1456.     #[ApiProperty()]
  1457.     #[Groups([
  1458.         'contract:collection:get'
  1459.         'contract:item:get'
  1460.     ])]
  1461.     private ?string $freightInvoiceDifference null;
  1462.     #[ApiProperty()]
  1463.     #[Groups([
  1464.         'contract:collection:get'
  1465.         'contract:item:get'
  1466.     ])]
  1467.     private ?string $freightInvoiceDifferenceCurrency null;
  1468.     #[ORM\Column(type'date'nullabletrue)]
  1469.     #[Assert\Type(\DateTimeInterface::class)]
  1470.     #[ApiProperty()]
  1471.     #[Groups([
  1472.         'contract:item:get'
  1473.         'contract:item:put'
  1474.         'contract:collection:get'
  1475.         'contract:collection:post' 
  1476.     ])]
  1477.     private ?\DateTimeInterface $freightInvoicePaymentDate null;
  1478.     #[ORM\Column(type'date'nullabletrue)]
  1479.     #[Assert\Type(\DateTimeInterface::class)]
  1480.     #[ApiProperty()]
  1481.     #[Groups([
  1482.         'contract:item:get'
  1483.         'contract:item:put'
  1484.         'contract:collection:get'
  1485.         'contract:collection:post' 
  1486.     ])]
  1487.     private ?\DateTimeInterface $freightInvoiceDate null;
  1488.     #[ORM\Column(type'integer'nullabletrue)]
  1489.     #[ApiProperty()]
  1490.     #[Groups([
  1491.         'contract:item:get'
  1492.         'contract:item:put'
  1493.         'contract:collection:get'
  1494.         'contract:collection:post'
  1495.     ])]
  1496.     private ?int $freightInvoicePaymentInvoiceDiff null;
  1497.     #[ORM\Column(type'string'nullabletrue)]
  1498.     #[Assert\Type('string')]
  1499.     #[Assert\Choice(
  1500.         choicesself::BANKS
  1501.         message'The bank is not valid.'
  1502.     )]
  1503.     #[ApiProperty()]
  1504.     #[Groups([
  1505.         'contract:item:get'
  1506.         'contract:item:put'
  1507.         'contract:collection:get'
  1508.         'contract:collection:post'
  1509.     ])]
  1510.     private ?string $freightInvoiceBankInvoiced null;
  1511.     #[ORM\Column(type'text'nullabletrue)]
  1512.     #[ApiProperty()]
  1513.     #[Assert\Type('string')]
  1514.     #[Groups([
  1515.         'contract:item:get'
  1516.         'contract:item:put'
  1517.         'contract:collection:get'
  1518.         'contract:collection:post'
  1519.     ])]
  1520.     private ?string $freightInvoiceComments null;
  1521.     #[ORM\Column(type'string'nullabletrue)]
  1522.     #[ApiProperty()]
  1523.     #[Assert\Type('string')]
  1524.     #[Assert\Choice(
  1525.         choicesself::DEMURRAGE_INVOICE_STATUSES
  1526.         message'The status is not valid.'
  1527.     )]
  1528.     #[Groups([
  1529.         'contract:item:get'
  1530.         'contract:item:put'
  1531.         'contract:collection:get'
  1532.         'contract:collection:post'
  1533.     ])]
  1534.     private ?string $demurrageInvoiceStatus null;
  1535.     #[ORM\Column(type'string'nullabletrue)]
  1536.     #[ApiProperty()]
  1537.     #[Assert\Type('string')]
  1538.     #[Groups([
  1539.         'contract:item:get'
  1540.         'contract:item:put'
  1541.         'contract:collection:get'
  1542.         'contract:collection:post'
  1543.     ])]
  1544.     private ?string $demurrageInvoiceNumber null;
  1545.     #[ORM\Column(type'string'nullabletrue)]
  1546.     #[ApiProperty()]
  1547.     #[Assert\Type('string')]
  1548.     #[Groups([
  1549.         'contract:item:get'
  1550.         'contract:item:put'
  1551.         'contract:collection:get'
  1552.         'contract:collection:post'
  1553.     ])]
  1554.     private ?string $demurrageInvoiceOwnerNumber null;
  1555.     #[ORM\Column(type'boolean'nullabletrue)]
  1556.     #[ApiProperty()]
  1557.     #[Groups([
  1558.         'contract:item:get'
  1559.         'contract:item:put'
  1560.         'contract:collection:get'
  1561.         'contract:collection:post'
  1562.     ])]
  1563.     private ?bool $demurrageInvoiceTaxAction false;
  1564.     #[ApiProperty()]
  1565.     #[Groups([
  1566.         'contract:collection:get'
  1567.         'contract:item:get'
  1568.     ])]
  1569.     private ?string $demurrageInvoiceTotalCommission null;
  1570.     #[ApiProperty()]
  1571.     #[Groups([
  1572.         'contract:collection:get'
  1573.         'contract:item:get'
  1574.     ])]
  1575.     private ?string $demurrageInvoiceTotalCommissionCurrency null;
  1576.     #[ORM\Column(type'string'nullabletrue)]
  1577.     #[Assert\Type('string')]
  1578.     #[ApiProperty()]
  1579.     #[Groups([
  1580.         'contract:item:get'
  1581.         'contract:item:put'
  1582.         'contract:collection:get'
  1583.         'contract:collection:post'
  1584.     ])]
  1585.     private ?string $demurrageInvoiceCabotagePtax null;
  1586.     // #[ORM\Column(type: 'string', nullable: true)]
  1587.     // #[Assert\Type('string')]
  1588.     #[ApiProperty()]
  1589.     #[Groups([
  1590.         'contract:item:get'
  1591.         // 'contract:item:put', 
  1592.         'contract:collection:get'
  1593.         // 'contract:collection:post'
  1594.     ])]
  1595.     private ?string $demurrageInvoiceCabotageTotalDemurrage null;
  1596.     // #[ORM\Column(type: 'string', nullable: true)]
  1597.     // #[Assert\Type('string')]
  1598.     #[ApiProperty()]
  1599.     #[Groups([
  1600.         'contract:item:get'
  1601.         // 'contract:item:put', 
  1602.         'contract:collection:get'
  1603.         // 'contract:collection:post'
  1604.     ])]
  1605.     private ?string $demurrageInvoiceCabotageTotalDemurrageCurrency 'BRL';
  1606.     // #[ORM\Column(type: 'string', nullable: true)]
  1607.     // #[Assert\Type('string')]
  1608.     #[ApiProperty()]
  1609.     #[Groups([
  1610.         'contract:item:get'
  1611.         // 'contract:item:put', 
  1612.         'contract:collection:get'
  1613.         // 'contract:collection:post'
  1614.     ])]
  1615.     private ?string $demurrageInvoiceCabotageTotalCommission null;
  1616.     // #[ORM\Column(type: 'string', nullable: true)]
  1617.     // #[Assert\Type('string')]
  1618.     #[ApiProperty()]
  1619.     #[Groups([
  1620.         'contract:item:get'
  1621.         // 'contract:item:put', 
  1622.         'contract:collection:get'
  1623.         // 'contract:collection:post'
  1624.     ])]
  1625.     private ?string $demurrageInvoiceCabotageTotalCommissionCurrency 'BRL';
  1626.     #[ORM\Column(type'string'nullabletrue)]
  1627.     #[Assert\Type('string')]
  1628.     #[ApiProperty()]
  1629.     #[Groups([
  1630.         'contract:item:get'
  1631.         'contract:item:put'
  1632.         'contract:collection:get'
  1633.         'contract:collection:post'
  1634.     ])]
  1635.     private ?string $demurrageInvoiceAmountReceived null;
  1636.     #[ORM\Column(type'string'nullabletrue)]
  1637.     #[Assert\Type('string')]
  1638.     #[ApiProperty()]
  1639.     #[Groups([
  1640.         'contract:item:get'
  1641.         'contract:item:put'
  1642.         'contract:collection:get'
  1643.         'contract:collection:post'
  1644.     ])]
  1645.     private ?string $demurrageInvoiceAmountReceivedCurrency 'USD';
  1646.     #[ApiProperty()]
  1647.     #[Groups([
  1648.         'contract:collection:get'
  1649.         'contract:item:get'
  1650.     ])]
  1651.     private ?string $demurrageInvoiceDifference null;
  1652.     #[ApiProperty()]
  1653.     #[Groups([
  1654.         'contract:collection:get'
  1655.         'contract:item:get'
  1656.     ])]
  1657.     private ?string $demurrageInvoiceDifferenceCurrency null;
  1658.     #[ORM\Column(type'date'nullabletrue)]
  1659.     #[Assert\Type(\DateTimeInterface::class)]
  1660.     #[ApiProperty()]
  1661.     #[Groups([
  1662.         'contract:item:get'
  1663.         'contract:item:put'
  1664.         'contract:collection:get'
  1665.         'contract:collection:post' 
  1666.     ])]
  1667.     private ?\DateTimeInterface $demurrageInvoicePaymentDate null;
  1668.     #[ORM\Column(type'date'nullabletrue)]
  1669.     #[Assert\Type(\DateTimeInterface::class)]
  1670.     #[ApiProperty()]
  1671.     #[Groups([
  1672.         'contract:item:get'
  1673.         'contract:item:put'
  1674.         'contract:collection:get'
  1675.         'contract:collection:post' 
  1676.     ])]
  1677.     private ?\DateTimeInterface $demurrageInvoiceDate null;
  1678.     #[ORM\Column(type'integer'nullabletrue)]
  1679.     #[ApiProperty()]
  1680.     #[Groups([
  1681.         'contract:item:get'
  1682.         'contract:item:put'
  1683.         'contract:collection:get'
  1684.         'contract:collection:post'
  1685.     ])]
  1686.     private ?int $demurrageInvoicePaymentInvoiceDiff null;
  1687.     #[ORM\Column(type'string'nullabletrue)]
  1688.     #[Assert\Type('string')]
  1689.     #[Assert\Choice(
  1690.         choicesself::BANKS
  1691.         message'The bank is not valid.'
  1692.     )]
  1693.     #[ApiProperty()]
  1694.     #[Groups([
  1695.         'contract:item:get'
  1696.         'contract:item:put'
  1697.         'contract:collection:get'
  1698.         'contract:collection:post'
  1699.     ])]
  1700.     private ?string $demurrageInvoiceBankInvoiced null;
  1701.     #[ORM\Column(type'text'nullabletrue)]
  1702.     #[ApiProperty()]
  1703.     #[Assert\Type('string')]
  1704.     #[Groups([
  1705.         'contract:item:get'
  1706.         'contract:item:put'
  1707.         'contract:collection:get'
  1708.         'contract:collection:post'
  1709.     ])]
  1710.     private ?string $demurrageInvoiceComments null;
  1711.     public function __construct()
  1712.     {
  1713.         $this->id Uuid::uuid4();
  1714.         $this->documents = new ArrayCollection();
  1715.         $this->portCalls = new ArrayCollection();
  1716.         $this->operationReports = new ArrayCollection();
  1717.         // $this->reportedIncidents = new ArrayCollection();
  1718.         $this->cargoItems = new ArrayCollection();
  1719.         $this->checkedTasks = new ArrayCollection();
  1720.         $this->payments = new ArrayCollection();
  1721.         $this->hires = new ArrayCollection();
  1722.         $this->liftings = new ArrayCollection();
  1723.         $this->deliveryNotices = new ArrayCollection();
  1724.         $this->redeliveryNotices = new ArrayCollection();
  1725.     }
  1726.     public function getId(): ?UuidInterface
  1727.     {
  1728.         return $this->id;
  1729.     }
  1730.     public function setContractNumber(?string $contractNumber): void
  1731.     {
  1732.         $this->contractNumber $contractNumber;
  1733.     }
  1734.     public function getContractNumber(): ?string
  1735.     {
  1736.         return $this->contractNumber;
  1737.     }
  1738.     public function setContractType(?string $contractType): void
  1739.     {
  1740.         $this->contractType $contractType;
  1741.     }
  1742.     public function getContractType(): ?string
  1743.     {
  1744.         return $this->contractType;
  1745.     }
  1746.     public function setLaycanStart(?\DateTimeInterface $laycanStart): void
  1747.     {
  1748.         $this->laycanStart $laycanStart;
  1749.     }
  1750.     public function getLaycanStart(): ?\DateTimeInterface
  1751.     {
  1752.         return $this->laycanStart;
  1753.     }
  1754.     public function getLaycanStartDate(): ?string
  1755.     {
  1756.         return $this->laycanStart $this->laycanStart->format('Y-m-d') : null;
  1757.     }
  1758.     public function getLaycanStartTime(): ?string
  1759.     {
  1760.         return $this->laycanStart $this->laycanStart->format('H:i') : null;
  1761.     }
  1762.     public function setLaycanEnd(?\DateTimeInterface $laycanEnd): void
  1763.     {
  1764.         $this->laycanEnd $laycanEnd;
  1765.     }
  1766.     public function getLaycanEnd(): ?\DateTimeInterface
  1767.     {
  1768.         return $this->laycanEnd;
  1769.     }
  1770.     public function getLaycanEndDate(): ?string
  1771.     {
  1772.         return $this->laycanEnd $this->laycanEnd->format('Y-m-d') : null;
  1773.     }
  1774.     public function getLaycanEndTime(): ?string
  1775.     {
  1776.         return $this->laycanEnd $this->laycanEnd->format('H:i') : null;
  1777.     }
  1778.     public function setVessel(?Vessel $vessel): void
  1779.     {
  1780.         $this->vessel $vessel;
  1781.     }
  1782.     public function getVessel(): ?Vessel
  1783.     {
  1784.         return $this->vessel;
  1785.     }
  1786.     public function setOwner(?Owner $owner): void
  1787.     {
  1788.         $this->owner $owner;
  1789.     }
  1790.     public function getOwner(): ?Owner
  1791.     {
  1792.         return $this->owner;
  1793.     }
  1794.     public function setCharterer(?Charterer $charterer): void
  1795.     {
  1796.         $this->charterer $charterer;
  1797.     }
  1798.     public function getCharterer(): ?Charterer
  1799.     {
  1800.         return $this->charterer;
  1801.     }
  1802.     public function addDocument(Media $document): void
  1803.     {
  1804.         $document->setContract($this);
  1805.         $this->documents[] = $document;
  1806.     }
  1807.     public function removeDocument(Media $document): void
  1808.     {
  1809.         $this->documents->removeElement($document);
  1810.     }
  1811.     public function getDocuments(): Collection
  1812.     {
  1813.         return $this->documents;
  1814.     }
  1815.     public function setBroker(?User $broker): void
  1816.     {
  1817.         $this->broker $broker;
  1818.     }
  1819.     public function getBroker(): ?User
  1820.     {
  1821.         return $this->broker;
  1822.     }
  1823.     public function setOperator(?User $operator): void
  1824.     {
  1825.         $this->operator $operator;
  1826.     }
  1827.     public function getOperator(): ?User
  1828.     {
  1829.         return $this->operator;
  1830.     }
  1831.     public function setDemurragePerDay(?string $demurragePerDay): void
  1832.     {
  1833.         $this->demurragePerDay $demurragePerDay;
  1834.     }
  1835.     public function getDemurragePerDay(): ?string
  1836.     {
  1837.         return $this->demurragePerDay;
  1838.     }
  1839.     public function getDemurragePerDayCurrency(): ?string
  1840.     {
  1841.         return $this->demurragePerDayCurrency;
  1842.     }
  1843.     public function setDemurragePerDayCurrency(?string $demurragePerDayCurrency): void
  1844.     {
  1845.         $this->demurragePerDayCurrency $demurragePerDayCurrency;
  1846.     }
  1847.     public function setAddressCommission(?string $addressCommission): void
  1848.     {
  1849.         $this->addressCommission $addressCommission;
  1850.     }
  1851.     public function getAddressCommission(): ?string
  1852.     {
  1853.         return $this->addressCommission;
  1854.     }
  1855.     public function setBrokerageCommission(?string $brokerageCommission): void
  1856.     {
  1857.         $this->brokerageCommission $brokerageCommission;
  1858.     }
  1859.     public function getBrokerageCommission(): ?string
  1860.     {
  1861.         return $this->brokerageCommission;
  1862.     }
  1863.     public function setLiftingsMin(?int $liftingsMin): void
  1864.     {
  1865.         $this->liftingsMin $liftingsMin;
  1866.     }
  1867.     public function getLiftingsMin(): ?int
  1868.     {
  1869.         return $this->liftingsMin;
  1870.     }
  1871.     public function setLiftingsMax(?int $liftingsMax): void
  1872.     {
  1873.         $this->liftingsMax $liftingsMax;
  1874.     }
  1875.     public function getLiftingsMax(): ?int
  1876.     {
  1877.         return $this->liftingsMax;
  1878.     }
  1879.     public function addPortCall(PortCall $portCall): void
  1880.     {
  1881.         $portCall->setContract($this);
  1882.         $this->portCalls[] = $portCall;
  1883.     }
  1884.     public function removePortCall(PortCall $portCall): void
  1885.     {
  1886.         $this->portCalls->removeElement($portCall);
  1887.     }
  1888.     public function getPortCalls(): Collection
  1889.     {
  1890.         return $this->portCalls;
  1891.     }
  1892.     public function addOperationReport(OperationReport $operationReport): void
  1893.     {
  1894.         $operationReport->setContract($this);
  1895.         $this->operationReports[] = $operationReport;
  1896.     }
  1897.     public function removeOperationReport(OperationReport $operationReport): void
  1898.     {
  1899.         $this->operationReports->removeElement($operationReport);
  1900.     }
  1901.     public function getOperationReports(): Collection
  1902.     {
  1903.         return $this->operationReports;
  1904.     }
  1905.     public function addCargoItem(ContractCargo $cargoItem): void
  1906.     {
  1907.         $cargoItem->setContract($this);
  1908.         $this->cargoItems[] = $cargoItem;
  1909.     }
  1910.     public function removeCargoItem(ContractCargo $cargoItem): void
  1911.     {
  1912.         $this->cargoItems->removeElement($cargoItem);
  1913.     }
  1914.     public function getCargoItems(): Collection
  1915.     {
  1916.         return $this->cargoItems;
  1917.     }
  1918.     public function getPayments(): Collection
  1919.     {
  1920.         return $this->payments;
  1921.     }
  1922.     public function addPayment(Payment $payment): void
  1923.     {
  1924.         $payment->setContract($this);
  1925.         $this->payments[] = $payment;
  1926.     }
  1927.     public function removePayment(Payment $payment): void
  1928.     {
  1929.         $this->payments->removeElement($payment);
  1930.     }
  1931.     public function getHires(): Collection
  1932.     {
  1933.         return $this->hires;
  1934.     }
  1935.     public function addHire(Hire $hire): void
  1936.     {
  1937.         $hire->setContract($this);
  1938.         $this->hires[] = $hire;
  1939.     }
  1940.     public function removeHire(Hire $hire): void
  1941.     {
  1942.         $this->hires->removeElement($hire);
  1943.     }
  1944.     public function addLifting(Contract $lifting): void
  1945.     {
  1946.         $lifting->setContractCoa($this);
  1947.         $this->liftings[] = $lifting;
  1948.     }
  1949.     public function removeLifting(Contract $lifting): void
  1950.     {
  1951.         $this->liftings->removeElement($lifting);
  1952.     }
  1953.     public function getLiftings(): Collection
  1954.     {
  1955.         return $this->liftings;
  1956.     }
  1957.     public function getFreightCost(): ?string
  1958.     {
  1959.         return $this->freightCost;
  1960.     }
  1961.     public function setFreightCost(?string $freightCost): void
  1962.     {
  1963.         $this->freightCost $freightCost;
  1964.     }
  1965.     public function getFreightCostCurrency(): ?string
  1966.     {
  1967.         return $this->freightCostCurrency;
  1968.     }
  1969.     public function setFreightCostCurrency(?string $freightCostCurrency): void
  1970.     {
  1971.         $this->freightCostCurrency $freightCostCurrency;
  1972.     }
  1973.     public function getFreightType(): ?string
  1974.     {
  1975.         return $this->freightType;
  1976.     }
  1977.     public function setFreightType(?string $freightType): void
  1978.     {
  1979.         $this->freightType $freightType;
  1980.     }
  1981.     public function addAdditionalCost(AdditionalCost $additionalCost): void
  1982.     {
  1983.         $additionalCost->setContract($this);
  1984.         $this->additionalCosts[] = $additionalCost;
  1985.     }
  1986.     public function removeAdditionalCost(AdditionalCost $additionalCost): void
  1987.     {
  1988.         $this->additionalCosts->removeElement($additionalCost);
  1989.     }
  1990.     public function getAdditionalCosts(): ?Collection
  1991.     {
  1992.         return $this->additionalCosts;
  1993.     }
  1994.     public function setStatus(?string $status): void
  1995.     {
  1996.         $this->status $status;
  1997.     }
  1998.     public function getStatus(): ?string
  1999.     {
  2000.         return $this->status;
  2001.     }
  2002.     public function setChecklist(?Checklist $checklist): void
  2003.     {
  2004.         $this->checklist $checklist;
  2005.     }
  2006.     public function getChecklist(): ?Checklist
  2007.     {
  2008.         return $this->checklist;
  2009.     }
  2010.     public function addCheckedTask(Task $checkedTask): void
  2011.     {
  2012.         $this->checkedTasks[] = $checkedTask;
  2013.     }
  2014.     public function removeCheckedTask(Task $checkedTask): void
  2015.     {
  2016.         $this->checkedTasks->removeElement($checkedTask);
  2017.     }
  2018.     public function getCheckedTasks(): Collection
  2019.     {
  2020.         return $this->checkedTasks;
  2021.     }
  2022.     public function setChecklistNotes(?string $checklistNotes): void
  2023.     {
  2024.         $this->checklistNotes $checklistNotes;
  2025.     }
  2026.     public function getChecklistNotes(): ?string
  2027.     {
  2028.         return $this->checklistNotes;
  2029.     }
  2030.     public function setDemurrageStatus(?string $demurrageStatus): void
  2031.     {
  2032.         $this->demurrageStatus $demurrageStatus;
  2033.     }
  2034.     public function getDemurrageStatus(): ?string
  2035.     {
  2036.         return $this->demurrageStatus;
  2037.     }
  2038.     public function setDemurrageTimeBar(?int $demurrageTimeBar): void
  2039.     {
  2040.         $this->demurrageTimeBar $demurrageTimeBar;
  2041.     }
  2042.     public function getDemurrageTimeBar(): ?int
  2043.     {
  2044.         return $this->demurrageTimeBar;
  2045.     }
  2046.     public function setDemurragePaymentDate(?\DateTimeInterface $demurragePaymentDate): void
  2047.     {
  2048.         $this->demurragePaymentDate $demurragePaymentDate;
  2049.     }
  2050.     public function getDemurragePaymentDate(): ?string
  2051.     {
  2052.         return $this->demurragePaymentDate?->format('Y-m-d');
  2053.     }
  2054.     public function setDemurrageClaimDate(?\DateTimeInterface $demurrageClaimDate): void
  2055.     {
  2056.         $this->demurrageClaimDate $demurrageClaimDate;
  2057.     }
  2058.     public function getDemurrageClaimDate(): ?string
  2059.     {
  2060.         return $this->demurrageClaimDate?->format('Y-m-d');
  2061.     }
  2062.     public function getDemurragePaidByCharterer(): ?string
  2063.     {
  2064.         return $this->demurragePaidByCharterer;
  2065.     }
  2066.     public function setDemurragePaidByCharterer(?string $demurragePaidByCharterer): void
  2067.     {
  2068.         $this->demurragePaidByCharterer $demurragePaidByCharterer;
  2069.     }
  2070.     public function getDemurragePaidByChartererCurrency(): ?string
  2071.     {
  2072.         return $this->demurragePaidByChartererCurrency;
  2073.     }
  2074.     public function setDemurragePaidByChartererCurrency(?string $demurragePaidByChartererCurrency): void
  2075.     {
  2076.         $this->demurragePaidByChartererCurrency $demurragePaidByChartererCurrency;
  2077.     }
  2078.     public function getFinalDemurrageCost(): ?string
  2079.     {
  2080.         return $this->finalDemurrageCost;
  2081.     }
  2082.     public function setFinalDemurrageCost(?string $finalDemurrageCost): void
  2083.     {
  2084.         $this->finalDemurrageCost $finalDemurrageCost;
  2085.     }
  2086.     public function getFinalDemurrageCostCurrency(): ?string
  2087.     {
  2088.         return $this->finalDemurrageCostCurrency;
  2089.     }
  2090.     public function setFinalDemurrageCostCurrency(?string $finalDemurrageCostCurrency): void
  2091.     {
  2092.         $this->finalDemurrageCostCurrency $finalDemurrageCostCurrency;
  2093.     }
  2094.     public function getEtaArrival(): ?\DateTimeInterface
  2095.     {
  2096.         return $this->etaArrival;
  2097.     }
  2098.     public function getEtaArrivalDate(): ?string
  2099.     {
  2100.         return $this->etaArrival $this->etaArrival->format('Y-m-d') : null;
  2101.     }
  2102.     public function getEtaArrivalTime(): ?string
  2103.     {
  2104.         return $this->etaArrival $this->etaArrival->format('H:i') : null;
  2105.     }
  2106.     public function setEtaArrival(?\DateTimeInterface $etaArrival): void
  2107.     {
  2108.         $this->etaArrival $etaArrival;
  2109.     }
  2110.     public function getRedeliveryEtaArrival(): ?\DateTimeInterface
  2111.     {
  2112.         return $this->redeliveryEtaArrival;
  2113.     }
  2114.     public function getRedeliveryEtaArrivalDate(): ?string
  2115.     {
  2116.         return $this->redeliveryEtaArrival $this->redeliveryEtaArrival->format('Y-m-d') : null;
  2117.     }
  2118.     public function getRedeliveryEtaArrivalTime(): ?string
  2119.     {
  2120.         return $this->redeliveryEtaArrival $this->redeliveryEtaArrival->format('H:i') : null;
  2121.     }
  2122.     public function setRedeliveryEtaArrival(?\DateTimeInterface $redeliveryEtaArrival): void
  2123.     {
  2124.         $this->redeliveryEtaArrival $redeliveryEtaArrival;
  2125.     }
  2126.     public function getDeliveryAproxNotice1(): ?int
  2127.     {
  2128.         return $this->deliveryAproxNotice1;
  2129.     }
  2130.     public function setDeliveryAproxNotice1(?int $deliveryAproxNotice1): void
  2131.     {
  2132.         $this->deliveryAproxNotice1 $deliveryAproxNotice1;
  2133.     }
  2134.     public function getDeliveryAproxNotice2(): ?int
  2135.     {
  2136.         return $this->deliveryAproxNotice2;
  2137.     }
  2138.     public function setDeliveryAproxNotice2(?int $deliveryAproxNotice2): void
  2139.     {
  2140.         $this->deliveryAproxNotice2 $deliveryAproxNotice2;
  2141.     }
  2142.     public function getDeliveryAproxNotice3(): ?int
  2143.     {
  2144.         return $this->deliveryAproxNotice3;
  2145.     }
  2146.     public function setDeliveryAproxNotice3(?int $deliveryAproxNotice3): void
  2147.     {
  2148.         $this->deliveryAproxNotice3 $deliveryAproxNotice3;
  2149.     }
  2150.     public function getDeliveryAproxNotice4(): ?int
  2151.     {
  2152.         return $this->deliveryAproxNotice4;
  2153.     }
  2154.     public function setDeliveryAproxNotice4(?int $deliveryAproxNotice4): void
  2155.     {
  2156.         $this->deliveryAproxNotice4 $deliveryAproxNotice4;
  2157.     }
  2158.     public function getDeliveryAproxNotice5(): ?int
  2159.     {
  2160.         return $this->deliveryAproxNotice5;
  2161.     }
  2162.     public function setDeliveryAproxNotice5(?int $deliveryAproxNotice5): void
  2163.     {
  2164.         $this->deliveryAproxNotice5 $deliveryAproxNotice5;
  2165.     }
  2166.     public function getDeliveryAproxNotice6(): ?int
  2167.     {
  2168.         return $this->deliveryAproxNotice6;
  2169.     }
  2170.     public function setDeliveryAproxNotice6(?int $deliveryAproxNotice6): void
  2171.     {
  2172.         $this->deliveryAproxNotice6 $deliveryAproxNotice6;
  2173.     }
  2174.     public function getDeliveryAproxNotice7(): ?int
  2175.     {
  2176.         return $this->deliveryAproxNotice7;
  2177.     }
  2178.     public function setDeliveryAproxNotice7(?int $deliveryAproxNotice7): void
  2179.     {
  2180.         $this->deliveryAproxNotice7 $deliveryAproxNotice7;
  2181.     }
  2182.     public function getDeliveryFirmNotice1(): ?int
  2183.     {
  2184.         return $this->deliveryFirmNotice1;
  2185.     }
  2186.     public function setDeliveryFirmNotice1(?int $deliveryFirmNotice1): void
  2187.     {
  2188.         $this->deliveryFirmNotice1 $deliveryFirmNotice1;
  2189.     }
  2190.     public function getDeliveryFirmNotice2(): ?int
  2191.     {
  2192.         return $this->deliveryFirmNotice2;
  2193.     }
  2194.     public function setDeliveryFirmNotice2(?int $deliveryFirmNotice2): void
  2195.     {
  2196.         $this->deliveryFirmNotice2 $deliveryFirmNotice2;
  2197.     }
  2198.     public function getDeliveryFirmNotice3(): ?int
  2199.     {
  2200.         return $this->deliveryFirmNotice3;
  2201.     }
  2202.     public function setDeliveryFirmNotice3(?int $deliveryFirmNotice3): void
  2203.     {
  2204.         $this->deliveryFirmNotice3 $deliveryFirmNotice3;
  2205.     }
  2206.     public function getDeliveryFirmNotice4(): ?int
  2207.     {
  2208.         return $this->deliveryFirmNotice4;
  2209.     }
  2210.     public function setDeliveryFirmNotice4(?int $deliveryFirmNotice4): void
  2211.     {
  2212.         $this->deliveryFirmNotice4 $deliveryFirmNotice4;
  2213.     }
  2214.     public function getDeliveryFirmNotice5(): ?int
  2215.     {
  2216.         return $this->deliveryFirmNotice5;
  2217.     }
  2218.     public function setDeliveryFirmNotice5(?int $deliveryFirmNotice5): void
  2219.     {
  2220.         $this->deliveryFirmNotice5 $deliveryFirmNotice5;
  2221.     }
  2222.     public function getDeliveryFirmNotice6(): ?int
  2223.     {
  2224.         return $this->deliveryFirmNotice6;
  2225.     }
  2226.     public function setDeliveryFirmNotice6(?int $deliveryFirmNotice6): void
  2227.     {
  2228.         $this->deliveryFirmNotice6 $deliveryFirmNotice6;
  2229.     }
  2230.     public function getDeliveryFirmNotice7(): ?int
  2231.     {
  2232.         return $this->deliveryFirmNotice7;
  2233.     }
  2234.     public function setDeliveryFirmNotice7(?int $deliveryFirmNotice7): void
  2235.     {
  2236.         $this->deliveryFirmNotice7 $deliveryFirmNotice7;
  2237.     }
  2238.     public function getRedeliveryAproxNotice1(): ?int
  2239.     {
  2240.         return $this->redeliveryAproxNotice1;
  2241.     }
  2242.     public function setRedeliveryAproxNotice1(?int $redeliveryAproxNotice1): void
  2243.     {
  2244.         $this->redeliveryAproxNotice1 $redeliveryAproxNotice1;
  2245.     }
  2246.     public function getRedeliveryAproxNotice2(): ?int
  2247.     {
  2248.         return $this->redeliveryAproxNotice2;
  2249.     }
  2250.     public function setRedeliveryAproxNotice2(?int $redeliveryAproxNotice2): void
  2251.     {
  2252.         $this->redeliveryAproxNotice2 $redeliveryAproxNotice2;
  2253.     }
  2254.     public function getRedeliveryAproxNotice3(): ?int
  2255.     {
  2256.         return $this->redeliveryAproxNotice3;
  2257.     }
  2258.     public function setRedeliveryAproxNotice3(?int $redeliveryAproxNotice3): void
  2259.     {
  2260.         $this->redeliveryAproxNotice3 $redeliveryAproxNotice3;
  2261.     }
  2262.     public function getRedeliveryAproxNotice4(): ?int
  2263.     {
  2264.         return $this->redeliveryAproxNotice4;
  2265.     }
  2266.     public function setRedeliveryAproxNotice4(?int $redeliveryAproxNotice4): void
  2267.     {
  2268.         $this->redeliveryAproxNotice4 $redeliveryAproxNotice4;
  2269.     }
  2270.     public function getRedeliveryAproxNotice5(): ?int
  2271.     {
  2272.         return $this->redeliveryAproxNotice5;
  2273.     }
  2274.     public function setRedeliveryAproxNotice5(?int $redeliveryAproxNotice5): void
  2275.     {
  2276.         $this->redeliveryAproxNotice5 $redeliveryAproxNotice5;
  2277.     }
  2278.     public function getRedeliveryAproxNotice6(): ?int
  2279.     {
  2280.         return $this->redeliveryAproxNotice6;
  2281.     }
  2282.     public function setRedeliveryAproxNotice6(?int $redeliveryAproxNotice6): void
  2283.     {
  2284.         $this->redeliveryAproxNotice6 $redeliveryAproxNotice6;
  2285.     }
  2286.     public function getRedeliveryAproxNotice7(): ?int
  2287.     {
  2288.         return $this->redeliveryAproxNotice7;
  2289.     }
  2290.     public function setRedeliveryAproxNotice7(?int $redeliveryAproxNotice7): void
  2291.     {
  2292.         $this->redeliveryAproxNotice7 $redeliveryAproxNotice7;
  2293.     }
  2294.     public function getRedeliveryFirmNotice1(): ?int
  2295.     {
  2296.         return $this->redeliveryFirmNotice1;
  2297.     }
  2298.     public function setRedeliveryFirmNotice1(?int $redeliveryFirmNotice1): void
  2299.     {
  2300.         $this->redeliveryFirmNotice1 $redeliveryFirmNotice1;
  2301.     }
  2302.     public function getRedeliveryFirmNotice2(): ?int
  2303.     {
  2304.         return $this->redeliveryFirmNotice2;
  2305.     }
  2306.     public function setRedeliveryFirmNotice2(?int $redeliveryFirmNotice2): void
  2307.     {
  2308.         $this->redeliveryFirmNotice2 $redeliveryFirmNotice2;
  2309.     }
  2310.     public function getRedeliveryFirmNotice3(): ?int
  2311.     {
  2312.         return $this->redeliveryFirmNotice3;
  2313.     }
  2314.     public function setRedeliveryFirmNotice3(?int $redeliveryFirmNotice3): void
  2315.     {
  2316.         $this->redeliveryFirmNotice3 $redeliveryFirmNotice3;
  2317.     }
  2318.     public function getRedeliveryFirmNotice4(): ?int
  2319.     {
  2320.         return $this->redeliveryFirmNotice4;
  2321.     }
  2322.     public function setRedeliveryFirmNotice4(?int $redeliveryFirmNotice4): void
  2323.     {
  2324.         $this->redeliveryFirmNotice4 $redeliveryFirmNotice4;
  2325.     }
  2326.     public function getRedeliveryFirmNotice5(): ?int
  2327.     {
  2328.         return $this->redeliveryFirmNotice5;
  2329.     }
  2330.     public function setRedeliveryFirmNotice5(?int $redeliveryFirmNotice5): void
  2331.     {
  2332.         $this->redeliveryFirmNotice5 $redeliveryFirmNotice5;
  2333.     }
  2334.     public function getRedeliveryFirmNotice6(): ?int
  2335.     {
  2336.         return $this->redeliveryFirmNotice6;
  2337.     }
  2338.     public function setRedeliveryFirmNotice6(?int $redeliveryFirmNotice6): void
  2339.     {
  2340.         $this->redeliveryFirmNotice6 $redeliveryFirmNotice6;
  2341.     }
  2342.     public function getRedeliveryFirmNotice7(): ?int
  2343.     {
  2344.         return $this->redeliveryFirmNotice7;
  2345.     }
  2346.     public function setRedeliveryFirmNotice7(?int $redeliveryFirmNotice7): void
  2347.     {
  2348.         $this->redeliveryFirmNotice7 $redeliveryFirmNotice7;
  2349.     }
  2350.     public function getDeliveryNoticesNotAplicable(): ?bool
  2351.     {
  2352.         return $this->deliveryNoticesNotAplicable ?? false;
  2353.     }
  2354.     public function setDeliveryNoticesNotAplicable(?bool $deliveryNoticesNotAplicable): void
  2355.     {
  2356.         $this->deliveryNoticesNotAplicable $deliveryNoticesNotAplicable;
  2357.     }
  2358.     public function getRedeliveryNoticesNotAplicable(): ?bool
  2359.     {
  2360.         return $this->redeliveryNoticesNotAplicable ?? false;
  2361.     }
  2362.     public function setRedeliveryNoticesNotAplicable(?bool $redeliveryNoticesNotAplicable): void
  2363.     {
  2364.         $this->redeliveryNoticesNotAplicable $redeliveryNoticesNotAplicable;
  2365.     }
  2366.     public function getShipDelivered(): ?bool
  2367.     {
  2368.         return $this->shipDelivered ?? false;
  2369.     }
  2370.     public function setShipDelivered(?bool $shipDelivered): void
  2371.     {
  2372.         $this->shipDelivered $shipDelivered;
  2373.     }
  2374.     public function getShipRedelivered(): ?bool
  2375.     {
  2376.         return $this->shipRedelivered ?? false;
  2377.     }
  2378.     public function setShipRedelivered(?bool $shipRedelivered): void
  2379.     {
  2380.         $this->shipRedelivered $shipRedelivered;
  2381.     }
  2382.     public function getDeliveryPort1(): ?Port
  2383.     {
  2384.         return $this->deliveryPort1;
  2385.     }
  2386.     public function setDeliveryPort1(?Port $deliveryPort1): void
  2387.     {
  2388.         $this->deliveryPort1 $deliveryPort1;
  2389.     }
  2390.     public function getDeliveryPort2(): ?Port
  2391.     {
  2392.         return $this->deliveryPort2;
  2393.     }
  2394.     public function setDeliveryPort2(?Port $deliveryPort2): void
  2395.     {
  2396.         $this->deliveryPort2 $deliveryPort2;
  2397.     }
  2398.     public function getRedeliveryPort1(): ?Port
  2399.     {
  2400.         return $this->redeliveryPort1;
  2401.     }
  2402.     public function setRedeliveryPort1(?Port $redeliveryPort1): void
  2403.     {
  2404.         $this->redeliveryPort1 $redeliveryPort1;
  2405.     }
  2406.     public function getRedeliveryPort2(): ?Port
  2407.     {
  2408.         return $this->redeliveryPort2;
  2409.     }
  2410.     public function setRedeliveryPort2(?Port $redeliveryPort2): void
  2411.     {
  2412.         $this->redeliveryPort2 $redeliveryPort2;
  2413.     }
  2414.     public function getHirePerDay(): ?string
  2415.     {
  2416.         return $this->hirePerDay;
  2417.     }
  2418.     public function setHirePerDay(?string $hirePerDay): void
  2419.     {
  2420.         $this->hirePerDay $hirePerDay;
  2421.     }
  2422.     public function getHirePerDayCurrency(): ?string
  2423.     {
  2424.         return $this->hirePerDayCurrency;
  2425.     }
  2426.     public function setHirePerDayCurrency(?string $hirePerDayCurrency): void
  2427.     {
  2428.         $this->hirePerDayCurrency $hirePerDayCurrency;
  2429.     }
  2430.     public function getPeriod(): ?float
  2431.     {
  2432.         return $this->period;
  2433.     }
  2434.     public function setPeriod(?float $period): void
  2435.     {
  2436.         $this->period $period;
  2437.     }
  2438.     public function addDeliveryNotice(DeliveryNotice $deliveryNotice): void
  2439.     {
  2440.         $deliveryNotice->setContract($this);
  2441.         $this->deliveryNotices[] = $deliveryNotice;
  2442.     }
  2443.     public function removeDeliveryNotice(DeliveryNotice $deliveryNotice): void
  2444.     {
  2445.         $this->deliveryNotices->removeElement($deliveryNotice);
  2446.     }
  2447.     public function getDeliveryNotices(): ?Collection
  2448.     {
  2449.         return $this->deliveryNotices;
  2450.     }
  2451.     public function addRedeliveryNotice(RedeliveryNotice $redeliveryNotice): void
  2452.     {
  2453.         $redeliveryNotice->setContract($this);
  2454.         $this->redeliveryNotices[] = $redeliveryNotice;
  2455.     }
  2456.     public function removeRedeliveryNotice(RedeliveryNotice $redeliveryNotice): void
  2457.     {
  2458.         $this->redeliveryNotices->removeElement($redeliveryNotice);
  2459.     }
  2460.     public function getRedeliveryNotices(): ?Collection
  2461.     {
  2462.         return $this->redeliveryNotices;
  2463.     }
  2464.     public function setContractCoa(?Contract $contract): void
  2465.     {
  2466.         $this->contractCoa $contract;
  2467.     }
  2468.     public function getContractCoa(): ?Contract
  2469.     {
  2470.         return $this->contractCoa;
  2471.     }
  2472.     public function getLoadPortsResume(): ?string
  2473.     {
  2474.         $portCalls array_filter($this->getPortCalls()->toArray(), function($pc) {
  2475.             return $pc->getPortCallType() === PortCall::PORT_CALL_TYPE_LOAD;
  2476.         });
  2477.         $portCount count($portCalls);
  2478.         if ($portCount === 0) {
  2479.             return null;
  2480.         }
  2481.         $portCall reset($portCalls);
  2482.         $portName $portCall $portCall->getPort()->getPortName() : '';
  2483.         $portSuffix $portCount ' (+)' '';
  2484.         return $portName $portSuffix;
  2485.     }
  2486.     public function getDischargePortsResume(): ?string
  2487.     {
  2488.         $portCalls array_filter($this->getPortCalls()->toArray(), function($pc) {
  2489.             return $pc->getPortCallType() === PortCall::PORT_CALL_TYPE_DISCHARGE;
  2490.         });
  2491.         
  2492.         $portCount count($portCalls);
  2493.         if ($portCount === 0) {
  2494.             return null;
  2495.         }
  2496.         $portCall reset($portCalls);
  2497.         $portName $portCall $portCall->getPort()->getPortName() : '';
  2498.         $portSuffix $portCount ' (+)' '';
  2499.         return $portName $portSuffix;
  2500.     }
  2501.     public function getCargoResume(): ?string
  2502.     {
  2503.         $cargoCount $this->getCargoItems()->count();
  2504.         if ($cargoCount === 0) {
  2505.             return null;
  2506.         }
  2507.         $cargoItems $this->getCargoItems();
  2508.         $cargoItem $cargoItems->first();
  2509.         if (!$cargoItem instanceof ContractCargo) {
  2510.             return null;
  2511.         }
  2512.         $cargoName $cargoItem->getCargo()->getName();
  2513.         $cargoSuffix $cargoCount ' (+)' '';
  2514.         return $cargoName $cargoSuffix;
  2515.     }
  2516.     public function getCargoVolumeM3(): ?string
  2517.     {
  2518.         $totalVolume 0.0;
  2519.         foreach ($this->getCargoItems() as $cargoItem) {
  2520.             // $totalVolume += (float) $cargoItem->getQuantityM3();
  2521.             $totalVolume += (float) str_replace(',''.'str_replace('.'''$cargoItem->getQuantityM3() ?? ''));
  2522.         }
  2523.         // return number_format($totalVolume, 3, '.', '');
  2524.         return $totalVolume str_replace(',00'''number_format($totalVolume2',''.')) : null;
  2525.     }
  2526.     public function getCargoVolumeMT(): ?string
  2527.     {
  2528.         $totalVolume 0.0;
  2529.         foreach ($this->getCargoItems() as $cargoItem) {
  2530.             // $totalVolume += (float) $cargoItem->getQuantityMT();
  2531.             $totalVolume += (float) str_replace(',''.'str_replace('.'''$cargoItem->getQuantityMT() ?? ''));
  2532.         }
  2533.         // return number_format($totalVolume, 3, '.', '');
  2534.         return $totalVolume str_replace(',00'''number_format($totalVolume2',''.')) : null;
  2535.     }
  2536.     public function getTotalAmount(): ?string
  2537.     {
  2538.         $totalAmount 0.0;
  2539.         if ($this->getContractType() === self::CONTRACT_TYPE_SPOT) {
  2540.             foreach ($this->getPayments() as $invoice) {
  2541.                 $amount = (float) str_replace('.'''$invoice->getAmount() ?? '');
  2542.                 $totalAmount += $amount;
  2543.             }
  2544.             return number_format($totalAmount2',''.');  
  2545.         } elseif ($this->getContractType() === self::CONTRACT_TYPE_TIME_CHARTER) {
  2546.             foreach ($this->getHires() as $hire) {
  2547.                 $amount = (float) str_replace('.'''$hire->getTotalInvoice() ?? '');
  2548.                 $totalAmount += $amount;
  2549.             }
  2550.             return number_format($totalAmount2',''.');
  2551.         } else {
  2552.             return null;
  2553.         }
  2554.     }
  2555.     public function getTotalAmountCurrency(): ?string
  2556.     {
  2557.         if ($this->getContractType() === self::CONTRACT_TYPE_SPOT && $this->getPayments()->count() > 0) {
  2558.             return $this->getPayments()->first()->getAmountCurrency() ?? '';
  2559.         } elseif ($this->getContractType() === self::CONTRACT_TYPE_TIME_CHARTER && $this->getHires()->count() > 0) {
  2560.             return $this->getHires()->first()->getTotalInvoiceCurrency() ?? '';
  2561.         } else {
  2562.             return null;
  2563.         }
  2564.     }
  2565.     public function getDemurrageDeadline(): ?\DateTimeInterface {
  2566.         if (!$this->demurrageDeadline) {
  2567.             $dischargePortCalls array_filter($this->getPortCalls()->toArray(), function($pc) {
  2568.                 return $pc->getPortCallType() === PortCall::PORT_CALL_TYPE_DISCHARGE;
  2569.             });
  2570.             $dischargePortCallWithLaterDeparture array_reduce($dischargePortCalls, function($prev$curr) {
  2571.                 if (!$prev || ($curr->getDeparture() && $curr->getDeparture() > $prev->getDeparture())) {
  2572.                     return $curr;
  2573.                 }
  2574.                 return $prev;
  2575.             }, null);
  2576.             if (!$dischargePortCallWithLaterDeparture || !$dischargePortCallWithLaterDeparture->getDeparture()) {
  2577.                 $this->demurrageDeadline null;
  2578.             } else {
  2579.                 // $baseDate = new \DateTime($dischargePortCallWithLaterDeparture->getDeparture());
  2580.                 $baseDate $dischargePortCallWithLaterDeparture->getDeparture();
  2581.                 if ($baseDate->getTimestamp() === false) {
  2582.                     $this->demurrageDeadline null;
  2583.                 } else {
  2584.                     // Normalize time to noon to avoid day changes due to timezone
  2585.                     $baseDate->setTime(1200);
  2586.                     $days $this->getDemurrageTimeBar() ?? 0;
  2587.                     $baseDate->modify('+' $days ' days');
  2588.                     $this->demurrageDeadline $baseDate;
  2589.                 }
  2590.             }
  2591.         }
  2592.         return $this->demurrageDeadline;
  2593.     }
  2594.     public function getDemurrageDaysLeft(): ?int {
  2595.         $demurrageDeadline $this->getDemurrageDeadline();
  2596.         if (!$demurrageDeadline) {
  2597.             return null;
  2598.         }
  2599.         $now = new \DateTime();
  2600.         $daysLeft = (int) ceil(($demurrageDeadline->getTimestamp() - $now->getTimestamp()) / (60 60 24));
  2601.         return $daysLeft null $daysLeft;
  2602.     }
  2603.     public function setFreightInvoiceStatus(?string $freightInvoiceStatus): void
  2604.     {
  2605.         $this->freightInvoiceStatus $freightInvoiceStatus;
  2606.     }
  2607.     public function getFreightInvoiceStatus(): ?string
  2608.     {
  2609.         return $this->freightInvoiceStatus;
  2610.     }
  2611.     public function setFreightInvoiceNumber(?string $freightInvoiceNumber): void
  2612.     {
  2613.         $this->freightInvoiceNumber $freightInvoiceNumber;
  2614.     }
  2615.     public function getFreightInvoiceNumber(): ?string
  2616.     {
  2617.         return $this->freightInvoiceNumber;
  2618.     }
  2619.     public function setFreightInvoiceOwnerNumber(?string $freightInvoiceOwnerNumber): void
  2620.     {
  2621.         $this->freightInvoiceOwnerNumber $freightInvoiceOwnerNumber;
  2622.     }
  2623.     public function getFreightInvoiceOwnerNumber(): ?string
  2624.     {
  2625.         return $this->freightInvoiceOwnerNumber;
  2626.     }
  2627.     public function getFreightInvoiceTaxAction(): ?bool
  2628.     {
  2629.         return $this->freightInvoiceTaxAction ?? false;
  2630.     }
  2631.     public function setFreightInvoiceTaxAction(?bool $freightInvoiceTaxAction): void
  2632.     {
  2633.         $this->freightInvoiceTaxAction $freightInvoiceTaxAction;
  2634.     }
  2635.     public function getFreightInvoiceFreightOrHire(): ?string
  2636.     {
  2637.         if ($this->getContractType() === self::CONTRACT_TYPE_TIME_CHARTER) {
  2638.             return $this->getHirePerDay();
  2639.         } else {
  2640.             return $this->getFreightCost();
  2641.         }
  2642.     }
  2643.     public function getFreightInvoiceFreightOrHireCurrency(): ?string
  2644.     {
  2645.         if ($this->getContractType() === self::CONTRACT_TYPE_TIME_CHARTER) {
  2646.             return $this->getHirePerDayCurrency();
  2647.         } else {
  2648.             return $this->getFreightCostCurrency();
  2649.         }
  2650.     }
  2651.     public function getFreightInvoiceAdditionalCost(): ?string
  2652.     {
  2653.         if (!$this->freightInvoiceAdditionalCost) {
  2654.             $additionalCosts $this->getAdditionalCosts();
  2655.             if ($additionalCosts === null) {
  2656.                 return null;
  2657.             }
  2658.             $total 0;
  2659.             foreach ($additionalCosts as $additionalCost) {
  2660.                 if ($additionalCost->getAdditionalCost() !== null) {
  2661.                     $total += (float) str_replace(',''.'str_replace('.'''$additionalCost->getAdditionalCost()));
  2662.                 }
  2663.             }
  2664.             return $total === null number_format($total2',''.');
  2665.         }
  2666.         return $this->freightInvoiceAdditionalCost;
  2667.     }
  2668.     public function setFreightInvoiceAdditionalCost(?string $freightInvoiceAdditionalCost): void
  2669.     {
  2670.         $this->freightInvoiceAdditionalCost $freightInvoiceAdditionalCost;
  2671.     }
  2672.     public function getFreightInvoiceAdditionalCostCurrency(): ?string
  2673.     {
  2674.         if (!$this->freightInvoiceAdditionalCostCurrency) {
  2675.             $additionalCosts $this->getAdditionalCosts();
  2676.             if ($additionalCosts === null) {
  2677.                 return null;
  2678.             }
  2679.             if ($additionalCosts->count() > 0) {
  2680.                 return $additionalCosts->first()->getAdditionalCostCurrency();
  2681.             }
  2682.             return null;
  2683.         }
  2684.         return $this->freightInvoiceAdditionalCostCurrency;
  2685.     }
  2686.     public function setFreightInvoiceAdditionalCostCurrency(?string $freightInvoiceAdditionalCostCurrency): void
  2687.     {
  2688.         $this->freightInvoiceAdditionalCostCurrency $freightInvoiceAdditionalCostCurrency;
  2689.     }
  2690.     public function getFreightInvoiceTotalFreightOrHire(): ?string // TODO: review mathematical formula
  2691.     {
  2692.         // if (!$this->freightInvoiceTotalFreightOrHire) {
  2693.             $freightOrHire $this->getFreightInvoiceFreightOrHire();
  2694.             if (!$freightOrHire) {
  2695.                 return null;
  2696.             }
  2697.             $freightOrHire = (float) str_replace(',''.'str_replace('.'''$freightOrHire));
  2698.             $additionalCost $this->getFreightInvoiceAdditionalCost();
  2699.             $additionalCost $additionalCost ? (float) str_replace(',''.'str_replace('.'''$additionalCost)) : 0;
  2700.             $total 0;
  2701.             if ($this->getFreightType() === self::COST_TYPE_LUMPSUM) {
  2702.                 $total $freightOrHire $additionalCost;
  2703.             } elseif ($this->getFreightType() === self::COST_TYPE_PMT) {
  2704.                 // o valor da coluna “Freight/hire” será multiplicado pela quantidade de carga e somar o custo adicional, se aplicável.
  2705.                 $cargoVolumeMT $this->getCargoVolumeMT();
  2706.                 $cargoVolumeMT = (float) str_replace(',''.'str_replace('.'''$cargoVolumeMT ?? ''));
  2707.                 $total $freightOrHire $cargoVolumeMT $additionalCost;
  2708.             } elseif ($this->getFreightType() === self::COST_TYPE_WS) {
  2709.                 // o valor da coluna “Freight/hire” será multiplicado pela coluna “TC days” e somar o custo adicional, se aplicável.
  2710.                 $totalHirePeriod $this->getPeriod();
  2711.                 $total $freightOrHire $totalHirePeriod $additionalCost;   
  2712.             } else {
  2713.                 // TC
  2714.                 $totalHirePeriod $this->getPeriod();
  2715.                 $total $freightOrHire $totalHirePeriod $additionalCost;
  2716.             }
  2717.             return $total === null number_format($total2',''.');
  2718.         // }
  2719.         // return $this->freightInvoiceTotalFreightOrHire;
  2720.     }
  2721.     // public function setFreightInvoiceTotalFreightOrHire(?string $freightInvoiceTotalFreightOrHire): void
  2722.     // {
  2723.     //     $this->freightInvoiceTotalFreightOrHire = $freightInvoiceTotalFreightOrHire;
  2724.     // }
  2725.     public function getFreightInvoiceTotalFreightOrHireCurrency(): ?string
  2726.     {
  2727.         // if (!$this->freightInvoiceTotalFreightOrHireCurrency) {
  2728.             return $this->getFreightInvoiceFreightOrHireCurrency();   
  2729.         // }
  2730.         // return $this->freightInvoiceTotalFreightOrHireCurrency;
  2731.     }
  2732.     // public function setFreightInvoiceTotalFreightOrHireCurrency(?string $freightInvoiceTotalFreightOrHireCurrency): void
  2733.     // {
  2734.     //     $this->freightInvoiceTotalFreightOrHireCurrency = $freightInvoiceTotalFreightOrHireCurrency;
  2735.     // }
  2736.     public function getFreightInvoiceTotalCommission(): ?string
  2737.     {
  2738.         /*
  2739.         valor da coluna “totalFreight/hire” multiplicado pela porcentagem da comissão.
  2740.         */
  2741.         $total $this->getFreightInvoiceTotalFreightOrHire();
  2742.         $brokerageCommission $this->getBrokerageCommission();
  2743.         if (!$total || !$brokerageCommission) {
  2744.             return null;
  2745.         }
  2746.         $total = (float) str_replace(',''.'str_replace('.'''$total));
  2747.         // $total = $total * (((float) $brokerageCommission) / 100);
  2748.         $total $total * (((float) str_replace(',''.'str_replace('.'''$brokerageCommission))) / 100);
  2749.         return $total === null number_format($total2',''.');
  2750.     }
  2751.     public function getFreightInvoiceTotalCommissionCurrency(): ?string
  2752.     {
  2753.        return $this->getFreightInvoiceTotalFreightOrHireCurrency();
  2754.     }
  2755.     public function setFreightInvoiceTotalCommissionCurrency(?string $freightInvoiceTotalCommissionCurrency): void
  2756.     {
  2757.         $this->freightInvoiceTotalCommissionCurrency $freightInvoiceTotalCommissionCurrency;
  2758.     }
  2759.     public function setFreightInvoiceCabotagePtax(?string $freightInvoiceCabotagePtax): void
  2760.     {
  2761.         $this->freightInvoiceCabotagePtax $freightInvoiceCabotagePtax;
  2762.     }
  2763.     public function getFreightInvoiceCabotagePtax(): ?string
  2764.     {
  2765.         return $this->freightInvoiceCabotagePtax;
  2766.     }
  2767.     public function getFreightInvoiceCabotageTotalFreight(): ?string
  2768.     {
  2769.         /*
  2770.         valor da coluna “total Freight/hire” multiplicado pela PTAX
  2771.         */
  2772.         $total $this->getFreightInvoiceTotalFreightOrHire();
  2773.         $ptax $this->getFreightInvoiceCabotagePtax();
  2774.         if (!$total || !$ptax) {
  2775.             return null;
  2776.         }
  2777.         $total = (float) str_replace(',''.'str_replace('.'''$total));
  2778.         $total $total * ((float) str_replace(',''.'str_replace('.'''$ptax)));
  2779.         return $total === null number_format($total2',''.');
  2780.     }
  2781.     public function getFreightInvoiceCabotageTotalFreightCurrency(): ?string
  2782.     {
  2783.         // return $this->getFreightInvoiceTotalFreightOrHireCurrency();
  2784.         return $this->freightInvoiceCabotageTotalFreightCurrency;
  2785.     }
  2786.     public function getFreightInvoiceCabotageTotalCommission(): ?string
  2787.     {
  2788.         // if (!$this->freightInvoiceCabotageTotalCommission) {
  2789.             /*
  2790.             valor da coluna “total commission” multiplicado pela PTAX 
  2791.             */
  2792.             $total $this->getFreightInvoiceTotalCommission();
  2793.             $ptax $this->getFreightInvoiceCabotagePtax();
  2794.             if (!$total || !$ptax) {
  2795.                 return null;
  2796.             }
  2797.             $total = (float) str_replace(',''.'str_replace('.'''$total));
  2798.             $total $total * ((float) str_replace(',''.'str_replace('.'''$ptax)));
  2799.             return $total === null number_format($total2',''.');
  2800.         // }
  2801.         // return $this->freightInvoiceCabotageTotalCommission;
  2802.     }
  2803.     // public function setFreightInvoiceCabotageTotalCommission(?string $freightInvoiceCabotageTotalCommission): void
  2804.     // {
  2805.     //     $this->freightInvoiceCabotageTotalCommission = $freightInvoiceCabotageTotalCommission;
  2806.     // }
  2807.     public function getFreightInvoiceCabotageTotalCommissionCurrency(): ?string
  2808.     {
  2809.         // if (!$this->freightInvoiceCabotageTotalCommissionCurrency) {
  2810.         //     return $this->getFreightInvoiceTotalCommissionCurrency();
  2811.         // }
  2812.         return $this->freightInvoiceCabotageTotalCommissionCurrency;
  2813.     }
  2814.     // public function setFreightInvoiceCabotageTotalCommissionCurrency(?string $freightInvoiceCabotageTotalCommissionCurrency): void
  2815.     // {
  2816.     //     $this->freightInvoiceCabotageTotalCommissionCurrency = $freightInvoiceCabotageTotalCommissionCurrency;
  2817.     // }
  2818.     public function getFreightInvoiceAmountReceived(): ?string
  2819.     {
  2820.         return $this->freightInvoiceAmountReceived;
  2821.     }
  2822.     public function setFreightInvoiceAmountReceived(?string $freightInvoiceAmountReceived): void
  2823.     {
  2824.         $this->freightInvoiceAmountReceived $freightInvoiceAmountReceived;
  2825.     }
  2826.     public function getFreightInvoiceAmountReceivedCurrency(): ?string
  2827.     {
  2828.         return $this->freightInvoiceAmountReceivedCurrency;
  2829.     }
  2830.     public function setFreightInvoiceAmountReceivedCurrency(?string $freightInvoiceAmountReceivedCurrency): void
  2831.     {
  2832.         $this->freightInvoiceAmountReceivedCurrency $freightInvoiceAmountReceivedCurrency;
  2833.     }
  2834.     public function getFreightInvoiceDifference(): ?string
  2835.     {
  2836.         /*
  2837.         amount received menos “total commission” em USD.
  2838.         (Nessa ordem, para quando o valor recebido for menor 
  2839.         que o fatura ficar com o valor negativo).
  2840.         */
  2841.         $amountReceived $this->getFreightInvoiceAmountReceived();
  2842.         $totalCommission $this->getFreightInvoiceTotalCommission();
  2843.         if (!$amountReceived || !$totalCommission) {
  2844.             return null;
  2845.         }
  2846.         $amountReceived = (float) str_replace(',''.'str_replace('.'''$amountReceived));
  2847.         $totalCommission = (float) str_replace(',''.'str_replace('.'''$totalCommission));
  2848.         $total $amountReceived $totalCommission;
  2849.         return $total === null number_format($total2',''.');
  2850.     }
  2851.     public function getFreightInvoiceDifferenceCurrency(): ?string
  2852.     {
  2853.         return $this->getFreightInvoiceAmountReceivedCurrency(); 
  2854.     }
  2855.     public function setFreightInvoicePaymentDate(?\DateTimeInterface $freightInvoicePaymentDate): void
  2856.     {
  2857.         $this->freightInvoicePaymentDate $freightInvoicePaymentDate;
  2858.     }
  2859.     public function getFreightInvoicePaymentDate(): ?string
  2860.     {
  2861.         return $this->freightInvoicePaymentDate $this->freightInvoicePaymentDate->format('Y-m-d') : null;
  2862.     }
  2863.     public function setFreightInvoiceDate(?\DateTimeInterface $freightInvoiceDate): void
  2864.     {
  2865.         $this->freightInvoiceDate $freightInvoiceDate;
  2866.     }
  2867.     public function getFreightInvoiceDate(): ?string
  2868.     {
  2869.         return $this->freightInvoiceDate $this->freightInvoiceDate->format('Y-m-d') : null;
  2870.     }
  2871.     public function setFreightInvoicePaymentInvoiceDiff(?int $freightInvoicePaymentInvoiceDiff): void
  2872.     {
  2873.         $this->freightInvoicePaymentInvoiceDiff $freightInvoicePaymentInvoiceDiff;
  2874.     }
  2875.     public function getFreightInvoicePaymentInvoiceDiff(): ?int
  2876.     {
  2877.         if (!$this->freightInvoicePaymentInvoiceDiff) {
  2878.             /*
  2879.             data da invoice (coluna “invoice date”) menos data de pagamento (coluna “payment date”)
  2880.             */
  2881.             $payment $this->getFreightInvoicePaymentDate();
  2882.             $invoice $this->getFreightInvoiceDate();
  2883.             if (!$payment || !$invoice) {
  2884.                 return null;
  2885.             }
  2886.             $paymentDate \DateTime::createFromFormat('Y-m-d'$payment);
  2887.             $invoiceDate \DateTime::createFromFormat('Y-m-d'$invoice);
  2888.             $diff $invoiceDate->diff($paymentDate);
  2889.             return $diff->days;
  2890.         }
  2891.         return $this->freightInvoicePaymentInvoiceDiff;
  2892.     }
  2893.     public function getFreightInvoiceBankInvoiced(): ?string
  2894.     {
  2895.         return $this->freightInvoiceBankInvoiced;
  2896.     }
  2897.     public function setFreightInvoiceBankInvoiced(?string $freightInvoiceBankInvoiced): void
  2898.     {
  2899.         $this->freightInvoiceBankInvoiced $freightInvoiceBankInvoiced;
  2900.     }
  2901.     public function setFreightInvoiceComments(?string $freightInvoiceComments): void
  2902.     {
  2903.         $this->freightInvoiceComments $freightInvoiceComments;
  2904.     }
  2905.     public function getFreightInvoiceComments(): ?string
  2906.     {
  2907.         return $this->freightInvoiceComments;
  2908.     }
  2909.     public function setDemurrageInvoiceStatus(?string $demurrageInvoiceStatus): void
  2910.     {
  2911.         $this->demurrageInvoiceStatus $demurrageInvoiceStatus;
  2912.     }
  2913.     public function getDemurrageInvoiceStatus(): ?string
  2914.     {
  2915.         return $this->demurrageInvoiceStatus;
  2916.     }
  2917.     public function setDemurrageInvoiceNumber(?string $demurrageInvoiceNumber): void
  2918.     {
  2919.         $this->demurrageInvoiceNumber $demurrageInvoiceNumber;
  2920.     }
  2921.     public function getDemurrageInvoiceNumber(): ?string
  2922.     {
  2923.         return $this->demurrageInvoiceNumber;
  2924.     }
  2925.     public function setDemurrageInvoiceOwnerNumber(?string $demurrageInvoiceOwnerNumber): void
  2926.     {
  2927.         $this->demurrageInvoiceOwnerNumber $demurrageInvoiceOwnerNumber;
  2928.     }
  2929.     public function getDemurrageInvoiceOwnerNumber(): ?string
  2930.     {
  2931.         return $this->demurrageInvoiceOwnerNumber;
  2932.     }
  2933.     public function getDemurrageInvoiceTaxAction(): ?bool
  2934.     {
  2935.         return $this->demurrageInvoiceTaxAction ?? false;
  2936.     }
  2937.     public function setDemurrageInvoiceTaxAction(?bool $demurrageInvoiceTaxAction): void
  2938.     {
  2939.         $this->demurrageInvoiceTaxAction $demurrageInvoiceTaxAction;
  2940.     }
  2941.     public function getDemurrageInvoiceTotalCommission(): ?string
  2942.     {
  2943.         /*
  2944.         valor da coluna “totalFreight/hire” multiplicado pela porcentagem da comissão.
  2945.         */
  2946.         $total $this->getFinalDemurrageCost();
  2947.         $brokerageCommission $this->getBrokerageCommission();
  2948.         if (!$total || !$brokerageCommission) {
  2949.             return null;
  2950.         }
  2951.         $total = (float) str_replace(',''.'str_replace('.'''$total));
  2952.         $total $total * (((float) str_replace(',''.'str_replace('.'''$brokerageCommission))) / 100);
  2953.         return $total === null number_format($total2',''.');
  2954.     }
  2955.     public function getDemurrageInvoiceTotalCommissionCurrency(): ?string
  2956.     {
  2957.         return $this->getFinalDemurrageCostCurrency(); 
  2958.     }
  2959.     public function setDemurrageInvoiceCabotagePtax(?string $demurrageInvoiceCabotagePtax): void
  2960.     {
  2961.         $this->demurrageInvoiceCabotagePtax $demurrageInvoiceCabotagePtax;
  2962.     }
  2963.     public function getDemurrageInvoiceCabotagePtax(): ?string
  2964.     {
  2965.         return $this->demurrageInvoiceCabotagePtax;
  2966.     }
  2967.     public function getDemurrageInvoiceCabotageTotalDemurrage(): ?string
  2968.     {
  2969.         // if (!$this->demurrageInvoiceCabotageTotalDemurrage) {
  2970.             // $this->setDemurrageInvoiceCabotageTotalDemurrageCurrency('USD');
  2971.             /*
  2972.             valor da coluna “total demurrage” multiplicado pela PTAX 
  2973.             */
  2974.             $total $this->getFinalDemurrageCost();
  2975.             $ptax $this->getDemurrageInvoiceCabotagePtax();
  2976.             if (!$total || !$ptax) {
  2977.                 return null;
  2978.             }
  2979.             $total = (float) str_replace(',''.'str_replace('.'''$total));
  2980.             $total $total * ((float) str_replace(',''.'str_replace('.'''$ptax)));
  2981.             return $total === null number_format($total2',''.');
  2982.         // }
  2983.         // return $this->demurrageInvoiceCabotageTotalDemurrage;
  2984.     }
  2985.     // public function setDemurrageInvoiceCabotageTotalDemurrage(?string $demurrageInvoiceCabotageTotalDemurrage): void
  2986.     // {
  2987.     //     $this->demurrageInvoiceCabotageTotalDemurrage = $demurrageInvoiceCabotageTotalDemurrage;
  2988.     // }
  2989.     public function getDemurrageInvoiceCabotageTotalDemurrageCurrency(): ?string
  2990.     {
  2991.         // return $this->demurrageInvoiceCabotageTotalDemurrageCurrency;
  2992.         // if (!$this->demurrageInvoiceCabotageTotalDemurrageCurrency) {
  2993.         //     return $this->getFinalDemurrageCostCurrency();
  2994.         // }
  2995.         return $this->demurrageInvoiceCabotageTotalDemurrageCurrency;
  2996.     }
  2997.     // public function setDemurrageInvoiceCabotageTotalDemurrageCurrency(?string $demurrageInvoiceCabotageTotalDemurrageCurrency): void
  2998.     // {
  2999.     //     $this->demurrageInvoiceCabotageTotalDemurrageCurrency = $demurrageInvoiceCabotageTotalDemurrageCurrency;
  3000.     // }
  3001.     public function getDemurrageInvoiceCabotageTotalCommission(): ?string
  3002.     {
  3003.         // if (!$this->demurrageInvoiceCabotageTotalCommission) {
  3004.             /*
  3005.             valor da coluna “total commission” multiplicado pela PTAX 
  3006.             */
  3007.             $total $this->getDemurrageInvoiceTotalCommission();
  3008.             $ptax $this->getDemurrageInvoiceCabotagePtax();
  3009.             if (!$total || !$ptax) {
  3010.                 return null;
  3011.             }
  3012.             $total = (float) str_replace(',''.'str_replace('.'''$total));
  3013.             $total $total * ((float) str_replace(',''.'str_replace('.'''$ptax)));
  3014.             return $total === null number_format($total2',''.');
  3015.         // }
  3016.         // return $this->demurrageInvoiceCabotageTotalCommission;
  3017.     }
  3018.     // public function setDemurrageInvoiceCabotageTotalCommission(?string $demurrageInvoiceCabotageTotalCommission): void
  3019.     // {
  3020.     //     $this->demurrageInvoiceCabotageTotalCommission = $demurrageInvoiceCabotageTotalCommission;
  3021.     // }
  3022.     public function getDemurrageInvoiceCabotageTotalCommissionCurrency(): ?string
  3023.     {
  3024.         // if (!$this->demurrageInvoiceCabotageTotalCommissionCurrency) {
  3025.         //     return $this->getDemurrageInvoiceTotalCommissionCurrency();
  3026.         // }
  3027.         return $this->demurrageInvoiceCabotageTotalCommissionCurrency;
  3028.     }
  3029.     // public function setDemurrageInvoiceCabotageTotalCommissionCurrency(?string $demurrageInvoiceCabotageTotalCommissionCurrency): void
  3030.     // {
  3031.     //     $this->demurrageInvoiceCabotageTotalCommissionCurrency = $demurrageInvoiceCabotageTotalCommissionCurrency;
  3032.     // }
  3033.     public function getDemurrageInvoiceAmountReceived(): ?string
  3034.     {
  3035.         return $this->demurrageInvoiceAmountReceived;
  3036.     }
  3037.     public function setDemurrageInvoiceAmountReceived(?string $demurrageInvoiceAmountReceived): void
  3038.     {
  3039.         $this->demurrageInvoiceAmountReceived $demurrageInvoiceAmountReceived;
  3040.     }
  3041.     public function getDemurrageInvoiceAmountReceivedCurrency(): ?string
  3042.     {
  3043.         return $this->demurrageInvoiceAmountReceivedCurrency;
  3044.     }
  3045.     public function setDemurrageInvoiceAmountReceivedCurrency(?string $demurrageInvoiceAmountReceivedCurrency): void
  3046.     {
  3047.         $this->demurrageInvoiceAmountReceivedCurrency $demurrageInvoiceAmountReceivedCurrency;
  3048.     }
  3049.     public function getDemurrageInvoiceDifference(): ?string
  3050.     {
  3051.         /*
  3052.         amount received menos “total commission” em USD.
  3053.         (Nessa ordem, para quando o valor recebido for menor 
  3054.         que o fatura ficar com o valor negativo).
  3055.         */
  3056.         $amountReceived $this->getDemurrageInvoiceAmountReceived();
  3057.         $totalCommission $this->getDemurrageInvoiceTotalCommission();
  3058.         if (!$amountReceived || !$totalCommission) {
  3059.             return null;
  3060.         }
  3061.         $amountReceived = (float) str_replace(',''.'str_replace('.'''$amountReceived));
  3062.         $totalCommission = (float) str_replace(',''.'str_replace('.'''$totalCommission));
  3063.         $total $amountReceived $totalCommission;
  3064.         return $total === null number_format($total2',''.');
  3065.     }
  3066.     public function getDemurrageInvoiceDifferenceCurrency(): ?string
  3067.     {
  3068.         return $this->getDemurrageInvoiceAmountReceivedCurrency(); 
  3069.     }
  3070.     public function setDemurrageInvoicePaymentDate(?\DateTimeInterface $demurrageInvoicePaymentDate): void
  3071.     {
  3072.         $this->demurrageInvoicePaymentDate $demurrageInvoicePaymentDate;
  3073.     }
  3074.     public function getDemurrageInvoicePaymentDate(): ?string
  3075.     {
  3076.         return $this->demurrageInvoicePaymentDate $this->demurrageInvoicePaymentDate->format('Y-m-d') : null;
  3077.     }
  3078.     public function setDemurrageInvoiceDate(?\DateTimeInterface $demurrageInvoiceDate): void
  3079.     {
  3080.         $this->demurrageInvoiceDate $demurrageInvoiceDate;
  3081.     }
  3082.     public function getDemurrageInvoiceDate(): ?string
  3083.     {
  3084.         return $this->demurrageInvoiceDate $this->demurrageInvoiceDate->format('Y-m-d') : null;
  3085.     }
  3086.     public function setDemurrageInvoicePaymentInvoiceDiff(?int $demurrageInvoicePaymentInvoiceDiff): void
  3087.     {
  3088.         $this->demurrageInvoicePaymentInvoiceDiff $demurrageInvoicePaymentInvoiceDiff;
  3089.     }
  3090.     public function getDemurrageInvoicePaymentInvoiceDiff(): ?int
  3091.     {
  3092.         if (!$this->demurrageInvoicePaymentInvoiceDiff) {
  3093.             /*
  3094.             data da invoice (coluna “invoice date”) menos data de pagamento (coluna “payment date”)
  3095.             */
  3096.             $payment $this->getDemurrageInvoicePaymentDate();
  3097.             $invoice $this->getDemurrageInvoiceDate();
  3098.             if (!$payment || !$invoice) {
  3099.                 return null;
  3100.             }
  3101.             $paymentDate \DateTime::createFromFormat('Y-m-d'$payment);
  3102.             $invoiceDate \DateTime::createFromFormat('Y-m-d'$invoice);
  3103.             $diff $invoiceDate->diff($paymentDate);
  3104.             return $diff->days;
  3105.         }
  3106.         return $this->demurrageInvoicePaymentInvoiceDiff;
  3107.     }
  3108.     public function getDemurrageInvoiceBankInvoiced(): ?string
  3109.     {
  3110.         return $this->demurrageInvoiceBankInvoiced;
  3111.     }
  3112.     public function setDemurrageInvoiceBankInvoiced(?string $demurrageInvoiceBankInvoiced): void
  3113.     {
  3114.         $this->demurrageInvoiceBankInvoiced $demurrageInvoiceBankInvoiced;
  3115.     }
  3116.     public function setDemurrageInvoiceComments(?string $demurrageInvoiceComments): void
  3117.     {
  3118.         $this->demurrageInvoiceComments $demurrageInvoiceComments;
  3119.     }
  3120.     public function getDemurrageInvoiceComments(): ?string
  3121.     {
  3122.         return $this->demurrageInvoiceComments;
  3123.     }
  3124. }