<?php
namespace App\Entity;
use App\Repository\MpesaTransactionVerificationRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use JMS\Serializer\Annotation as Serializer;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Component\Serializer\Annotation\Ignore;
use JMS\Serializer\Annotation\Exclude;
/**
* @ORM\Entity(repositoryClass=MpesaTransactionVerificationRepository::class)
* @UniqueEntity("transactionId")
* @ORM\Table(name = "neema.mpesa_transaction_verification")
*/
class MpesaTransactionVerification
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=50)
*/
private $transactionType;
/**
*
* @ORM\Column(type="string", length=12, unique=true)
*/
private $transactionId;
// 2019-11-09 00:00:00
/**
*
* @Serializer\Type("DateTime<'Y-m-d H:i:s'>")
* @ORM\Column(type="datetime")
*/
private $transactionTime;
/**
* @ORM\Column(type="float")
*/
private $transactionAmount;
/**
* @ORM\Column(type="integer")
*/
private $shortCode;
/**
* @ORM\Column(type="string", length=20)
*/
private $billReferenceNumber;
/**
* @ORM\Column(type="string", length=20, nullable=true)
*/
private $invoiceNumber;
/**
* @ORM\Column(type="float")
*/
private $accountBalance;
/**
* @ORM\Column(type="string", length=20, nullable=true)
*/
private $thirdPartyTransactionId;
/**
* @ORM\Column(type="string", length=20)
*/
private $msisdn;
/**
* @ORM\Column(type="string", length=50, nullable=true)
*/
private $firstName;
/**
* @ORM\Column(type="string", length=50, nullable=true)
*/
private $middleName;
/**
* @ORM\Column(type="string", length=50, nullable=true)
*/
private $lastName;
/**
* @ORM\Column(type="boolean")
*/
private $isComplete;
/**
* @Serializer\Type("DateTime<'Y-m-d H:i:s'>")
* @ORM\Column(type="datetime", options={"default": "CURRENT_TIMESTAMP"}, nullable=true)
*/
private $createdAt;
/**
* @ORM\Column(type="boolean")
*/
private $isUsed;
/**
* @ORM\Column(type="boolean")
*/
private $isSeen;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $readAt;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $usedAt;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $completedAt;
/**
* @ORM\Column(type="string", length=16, nullable=true)
*/
private $seenFromIp;
/**
* @ORM\Column(type="string", length=16, nullable=true)
*/
private $mpesaFromIp;
/**
* @ORM\Column(type="string", length=16, nullable=true)
*/
private $completedMpesaFromIp;
/**
* @ORM\Column(type="boolean")
*/
private $isValidated;
/**
* @Exclude()
* @ORM\OneToMany(targetEntity=MpesaManual::class, mappedBy="mpesaTransaction")
*/
private $createdBy;
/**
* @Exclude()
* @ORM\OneToMany(targetEntity=MpesaManual::class, mappedBy="mpesaTransaction")
*/
private $mpesaManuals;
public function __construct()
{
$this->createdBy = new ArrayCollection();
$this->mpesaManuals = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getTransactionType(): ?string
{
return $this->transactionType;
}
public function setTransactionType(string $transactionType): self
{
$this->transactionType = $transactionType;
return $this;
}
public function getTransactionId(): ?string
{
return $this->transactionId;
}
public function setTransactionId(string $transactionId): self
{
$this->transactionId = $transactionId;
return $this;
}
public function getTransactionTime(): ?\DateTimeInterface
{
return $this->transactionTime;
}
public function setTransactionTime(\DateTimeInterface $transactionTime): self
{
$this->transactionTime = $transactionTime;
return $this;
}
public function getTransactionAmount(): ?float
{
return $this->transactionAmount;
}
public function setTransactionAmount(float $transactionAmount): self
{
$this->transactionAmount = $transactionAmount;
return $this;
}
public function getShortCode(): ?int
{
return $this->shortCode;
}
public function setShortCode(int $shortCode): self
{
$this->shortCode = $shortCode;
return $this;
}
public function getBillReferenceNumber(): ?string
{
return $this->billReferenceNumber;
}
public function setBillReferenceNumber(string $billReferenceNumber): self
{
$this->billReferenceNumber = $billReferenceNumber;
return $this;
}
public function getInvoiceNumber(): ?string
{
return $this->invoiceNumber;
}
public function setInvoiceNumber(?string $invoiceNumber): self
{
$this->invoiceNumber = $invoiceNumber;
return $this;
}
public function getAccountBalance(): ?float
{
return $this->accountBalance;
}
public function setAccountBalance(float $accountBalance): self
{
$this->accountBalance = $accountBalance;
return $this;
}
public function getThirdPartyTransactionId(): ?string
{
return $this->thirdPartyTransactionId;
}
public function setThirdPartyTransactionId(?string $thirdPartyTransactionId): self
{
$this->thirdPartyTransactionId = $thirdPartyTransactionId;
return $this;
}
public function getMsisdn(): ?string
{
return $this->msisdn;
}
public function setMsisdn(string $msisdn): self
{
$this->msisdn = $msisdn;
return $this;
}
public function getFirstName(): ?string
{
return $this->firstName;
}
public function setFirstName(?string $firstName): self
{
$this->firstName = $firstName;
return $this;
}
public function getMiddleName(): ?string
{
return $this->middleName;
}
public function setMiddleName(?string $middleName): self
{
$this->middleName = $middleName;
return $this;
}
public function getLastName(): ?string
{
return $this->lastName;
}
public function setLastName(?string $lastName): self
{
$this->lastName = $lastName;
return $this;
}
public function getIsComplete(): ?bool
{
return $this->isComplete;
}
public function setIsComplete(bool $isComplete): self
{
$this->isComplete = $isComplete;
return $this;
}
public function getCreatedAt(): ?\DateTime
{
return $this->createdAt;
}
public function setCreatedAt(\DateTime $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getIsUsed(): ?bool
{
return $this->isUsed;
}
public function setIsUsed(bool $isUsed): self
{
$this->isUsed = $isUsed;
return $this;
}
public function getIsSeen(): ?bool
{
return $this->isSeen;
}
public function setIsSeen(bool $isSeen): self
{
$this->isSeen = $isSeen;
return $this;
}
public function getReadAt(): ?\DateTimeInterface
{
return $this->readAt;
}
public function setReadAt(?\DateTimeInterface $readAt): self
{
$this->readAt = $readAt;
return $this;
}
public function getUsedAt(): ?\DateTimeInterface
{
return $this->usedAt;
}
public function setUsedAt(?\DateTimeInterface $usedAt): self
{
$this->usedAt = $usedAt;
return $this;
}
public function getCompletedAt(): ?\DateTimeInterface
{
return $this->completedAt;
}
public function setCompletedAt(?\DateTimeInterface $completedAt): self
{
$this->completedAt = $completedAt;
return $this;
}
public function getSeenFromIp(): ?string
{
return $this->seenFromIp;
}
public function setSeenFromIp(string $seenFromIp): self
{
$this->seenFromIp = $seenFromIp;
return $this;
}
public function getMpesaFromIp(): ?string
{
return $this->mpesaFromIp;
}
public function setMpesaFromIp(string $mpesaFromIp): self
{
$this->mpesaFromIp = $mpesaFromIp;
return $this;
}
public function getCompletedMpesaFromIp(): ?string
{
return $this->completedMpesaFromIp;
}
public function setCompletedMpesaFromIp(?string $completedMpesaFromIp): self
{
$this->completedMpesaFromIp = $completedMpesaFromIp;
return $this;
}
public function getIsValidated(): ?bool
{
return $this->isValidated;
}
public function setIsValidated(bool $isValidated): self
{
$this->isValidated = $isValidated;
return $this;
}
/**
* @return Collection|MpesaManual[]
*/
public function getCreatedBy(): Collection
{
return $this->createdBy;
}
public function addCreatedBy(MpesaManual $createdBy): self
{
if (!$this->createdBy->contains($createdBy)) {
$this->createdBy[] = $createdBy;
$createdBy->setMpesaTransaction($this);
}
return $this;
}
public function removeCreatedBy(MpesaManual $createdBy): self
{
if ($this->createdBy->removeElement($createdBy)) {
// set the owning side to null (unless already changed)
if ($createdBy->getMpesaTransaction() === $this) {
$createdBy->setMpesaTransaction(null);
}
}
return $this;
}
/**
*
*
* @return Collection|MpesaManual[]
*/
public function getMpesaManuals(): Collection
{
return $this->mpesaManuals;
}
public function addMpesaManual(MpesaManual $mpesaManual): self
{
if (!$this->mpesaManuals->contains($mpesaManual)) {
$this->mpesaManuals[] = $mpesaManual;
$mpesaManual->setMpesaTransaction($this);
}
return $this;
}
public function removeMpesaManual(MpesaManual $mpesaManual): self
{
if ($this->mpesaManuals->removeElement($mpesaManual)) {
// set the owning side to null (unless already changed)
if ($mpesaManual->getMpesaTransaction() === $this) {
$mpesaManual->setMpesaTransaction(null);
}
}
return $this;
}
}