<?php
namespace App\Entity;
use App\Repository\PaymentRepository;
use DateTimeInterface;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=PaymentRepository::class)
* @ORM\Table(name="payments", indexes={
* @ORM\Index(columns={"ip_text"}, name="idx_ip_text"),
* @ORM\Index(columns={"receipt_id"}, name="idx_receipt_id"),
* @ORM\Index(columns={"opdate"}, name="idx_opdate"),
* @ORM\Index(columns={"aggregated"}, name="idx_aggregated"),
* @ORM\Index(columns={"aggregated", "opdate"}, name="idx_aggregated_opdate"),
* @ORM\Index(columns={"exported_to_clickhouse"}, name="idx_exported_to_clickhouse")
* })
*/
class Payment
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer", options={"unsigned": true})
*/
private ?int $id = null;
/**
* @ORM\ManyToOne(targetEntity=User::class, inversedBy="payments")
* @ORM\JoinColumn(nullable=true)
*/
private $operator;
/**
* @ORM\ManyToOne(targetEntity=Club::class, inversedBy="payments")
* @ORM\JoinColumn(nullable=true)
*/
private $club;
/**
* @ORM\Column(type="datetime", columnDefinition="TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
*/
private $opdate;
/**
* @ORM\Column(type="bigint", options={"default": 0})
*/
private ?int $amount = 0;
/**
* @ORM\Column(type="string", length=255, nullable=true, options={"default": ""})
*/
private string $ip_text = "";
/**
* @ORM\Column(type="text", nullable=true, options={"default": ""})
*/
private string $description = "";
/**
* @ORM\ManyToOne(targetEntity=Opcode::class)
*/
private $opcode;
/**
* @ORM\ManyToOne(targetEntity=Cashdesk::class, inversedBy="payments")
* @ORM\JoinColumn(nullable=true)
*/
private $cashdesk;
/**
* @ORM\ManyToOne(targetEntity=User::class, inversedBy="payments_user")
*/
private $user;
/**
* @ORM\Column(type="integer", nullable=true, options={"default": 0, "unsigned": true})
*/
private ?int $user_id = 0;
/**
* @ORM\Column(type="integer", nullable=true, options={"default": 0, "unsigned": true})
*/
private ?int $receipt_id = 0;
/**
* @ORM\Column(type="integer", nullable=true, options={"default": 0, "unsigned": true})
*/
private ?int $bank_check_id = 0;
/**
* @ORM\Column(type="integer", nullable=true, options={"default": 0, "unsigned": true})
*/
private ?int $status_id = 0;
/**
* @ORM\Column(type="bigint", options={"default": 0})
*/
private int $balance_before = 0;
/**
* @ORM\Column(type="bigint", options={"default": 0})
*/
private int $balance_after = 0;
/**
* @ORM\Column(type="bigint", options={"default": 0})
*/
private int $user_balance_before = 0;
/**
* @ORM\Column(type="bigint", options={"default": 0})
*/
private int $user_balance_after = 0;
/**
* @ORM\ManyToOne(targetEntity=Partner::class)
*/
private $partner;
/**
* @ORM\Column(type="boolean", options={"unsigned": true, "default": 0})
*/
private bool $exported_to_clickhouse = false;
/**
* @ORM\Column(type="boolean", options={"unsigned": true, "default": 0})
*/
private bool $aggregated = false;
public function getId(): ?int
{
return $this->id;
}
public function getOperator(): ?User
{
return $this->operator;
}
public function setOperator(?User $operator): self
{
$this->operator = $operator;
return $this;
}
public function getClub(): ?Club
{
return $this->club;
}
public function setClub(?Club $club): self
{
$this->club = $club;
return $this;
}
public function getOpdate(): ?DateTimeInterface
{
return $this->opdate;
}
public function setOpdate(DateTimeInterface $opdate): self
{
$this->opdate = $opdate;
return $this;
}
public function getAmount(): ?int
{
return $this->amount;
}
public function setAmount(int $amount): self
{
$this->amount = $amount;
return $this;
}
public function getIpText(): ?string
{
return $this->ip_text;
}
public function setIpText(string $ip_text): self
{
$this->ip_text = $ip_text;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(string $description): self
{
$this->description = $description;
return $this;
}
public function getOpcode(): ?Opcode
{
return $this->opcode;
}
public function setOpcode(?Opcode $opcode): self
{
$this->opcode = $opcode;
return $this;
}
public function getCashdesk(): ?Cashdesk
{
return $this->cashdesk;
}
public function setCashdesk(?Cashdesk $cashdesk): self
{
$this->cashdesk = $cashdesk;
return $this;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): self
{
$this->user = $user;
return $this;
}
public function getUserId(): ?int
{
return $this->user_id;
}
public function setUserId(?int $user_id): self
{
$this->user_id = $user_id;
return $this;
}
public function getReceiptId(): ?int
{
return $this->receipt_id;
}
public function setReceiptId(?int $receipt_id): self
{
$this->receipt_id = $receipt_id;
return $this;
}
public function getBankCheckId(): ?int
{
return $this->bank_check_id;
}
public function setBankCheckId(?int $bank_check_id): self
{
$this->bank_check_id = $bank_check_id;
return $this;
}
public function getStatusId(): ?int
{
return $this->status_id;
}
public function setStatusId(?int $status_id): self
{
$this->status_id = $status_id;
return $this;
}
public function getBalanceBefore(): int
{
return $this->balance_before;
}
public function setBalanceBefore(int $balance_before): self
{
$this->balance_before = $balance_before;
return $this;
}
public function getBalanceAfter(): int
{
return $this->balance_after;
}
public function setBalanceAfter(int $balance_after): self
{
$this->balance_after = $balance_after;
return $this;
}
public function getUserBalanceBefore(): int
{
return $this->user_balance_before;
}
public function setUserBalanceBefore(int $user_balance_before): self
{
$this->user_balance_before = $user_balance_before;
return $this;
}
public function getUserBalanceAfter(): int
{
return $this->user_balance_after;
}
public function setUserBalanceAfter(int $user_balance_after): self
{
$this->user_balance_after = $user_balance_after;
return $this;
}
public function getPartner(): ?Partner
{
return $this->partner;
}
public function setPartner(?Partner $partner): self
{
$this->partner = $partner;
return $this;
}
public function isExportedToClickhouse(): bool
{
return $this->exported_to_clickhouse;
}
public function setExportedToClickhouse(bool $exported_to_clickhouse): self
{
$this->exported_to_clickhouse = $exported_to_clickhouse;
return $this;
}
public function isAggregated(): ?bool
{
return $this->aggregated;
}
public function setAggregated(bool $aggregated): self
{
$this->aggregated = $aggregated;
return $this;
}
}