vendor/launchpad/backend/src/Base/Entity/Transaction/Transaction.php line 1053

Open in your IDE?
  1. <?php
  2. namespace  LaunchPad\Bundle\LaunchPadBundle\Base\Entity\Transaction;
  3. use DateTime;
  4. use DateTimeImmutable;
  5. use DateTimeInterface;
  6. use Doctrine\Common\Inflector\Inflector;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Doctrine\ORM\Mapping\JoinColumn;
  9. use Doctrine\ORM\Mapping\ManyToOne;
  10. use Doctrine\ORM\Mapping\OneToOne;
  11. use LaunchPad\Bundle\LaunchPadBundle\Base\Entity\Account\Account;
  12. use LaunchPad\Bundle\LaunchPadBundle\Base\Entity\BaseEntity;
  13. use LaunchPad\Bundle\LaunchPadBundle\Base\Entity\Country;
  14. use LaunchPad\Bundle\LaunchPadBundle\Base\Entity\Payment\PaymentCard;
  15. use LaunchPad\Bundle\LaunchPadBundle\Base\Entity\PaymentDevice\PaymentDevice;
  16. use LaunchPad\Bundle\LaunchPadBundle\Base\Entity\User\User;
  17. use Symfony\Component\Serializer\Annotation\Groups;
  18. /**
  19.  * @ORM\Entity
  20.  * @ORM\Table(name="transaction")
  21.  */
  22. class Transaction extends BaseEntity
  23. {
  24.     /** @var string */
  25.     public const TYPE_LOAD 'load';
  26.     /** @var string */
  27.     public const TYPE_UNLOAD 'unload';
  28.     /** @var string */
  29.     public const TYPE_PAYMENT 'payment';
  30.     /** @var string */
  31.     public const TYPE_SPEND 'spend';
  32.     /** @var string */
  33.     public const TYPE_CORRECTION 'correction';
  34.     /** @var string */
  35.     public const TYPE_REFUND 'refund';
  36.     /** @var string */
  37.     public const TYPE_BALANCE_ADJUSTMENT 'balance_adjustment';
  38.     /** @var string */
  39.     public const STATUS_ACCEPTED 'accepted';
  40.     /** @var string */
  41.     public const STATUS_COMPLETED 'completed';
  42.     /** @var string */
  43.     public const STATUS_PENDING 'pending';
  44.     /** @var string */
  45.     public const STATUS_FAILED'failed';
  46.     /** @var string */
  47.     public const STATUS_DECLINED 'declined';
  48.     /** @var string */
  49.     public const STATUS_SETTLED 'settled';
  50.     /** @var string */
  51.     public const GROUP_POS 'pos';
  52.     /** @var string */
  53.     public const GROUP_ATM 'atm';
  54.     /**
  55.      * @var int|null
  56.      * @ORM\Id
  57.      * @ORM\Column(type="integer")
  58.      * @ORM\GeneratedValue(strategy="AUTO")
  59.      * @Groups({"transaction_data"})
  60.      */
  61.     protected $id;
  62.     /**
  63.      * @var User|null
  64.      * @ManyToOne(targetEntity="LaunchPad\Bundle\LaunchPadBundle\Base\Entity\User\User")
  65.      * @JoinColumn(name="user_id", referencedColumnName="id", nullable=true)
  66.      * @Groups({"transaction_data"})
  67.      */
  68.     private $user;
  69.     /**
  70.      * @var string|null
  71.      * @ORM\Column(name="title", type="string", length=50, nullable=true)
  72.      * @Groups({"transaction_data"})
  73.      */
  74.     private $title;
  75.     /**
  76.      * @var Account|null
  77.      * @ManyToOne(targetEntity="LaunchPad\Bundle\LaunchPadBundle\Base\Entity\Account\Account")
  78.      * @JoinColumn(name="account_id", referencedColumnName="id", nullable=true)
  79.      * @Groups({"transaction_data"})
  80.      */
  81.     private $account;
  82.     /**
  83.      * @var PaymentDevice|null
  84.      * @ManyToOne(targetEntity="LaunchPad\Bundle\LaunchPadBundle\Base\Entity\PaymentDevice\PaymentDevice")
  85.      * @JoinColumn(name="payment_device_id", referencedColumnName="id", nullable=true)
  86.      * @Groups({"transaction_data"})
  87.      */
  88.     private $paymentDevice;
  89.     /**
  90.      * @var TransactionCategory|null
  91.      * @ManyToOne(targetEntity="TransactionCategory")
  92.      * @JoinColumn(name="category_id", referencedColumnName="id", nullable=true)
  93.      * @Groups({"transaction_data"})
  94.      */
  95.     private $category;
  96.     /**
  97.      * @var TransactionMerchant|null
  98.      * @ManyToOne(targetEntity="TransactionMerchant")
  99.      * @JoinColumn(name="merchant_id", referencedColumnName="id", nullable=true)
  100.      * @Groups({"transaction_data"})
  101.      */
  102.     private $merchant;
  103.     /**
  104.      * @var Country|null
  105.      * @ManyToOne(targetEntity="LaunchPad\Bundle\LaunchPadBundle\Base\Entity\Country")
  106.      * @JoinColumn(name="country_id", referencedColumnName="id", nullable=true)
  107.      * @Groups({"transaction_data"})
  108.      */
  109.     private $country;
  110.     /**
  111.      * @var PaymentCard|null
  112.      * @ManyToOne(targetEntity="LaunchPad\Bundle\LaunchPadBundle\Base\Entity\Payment\PaymentCard")
  113.      * @JoinColumn(name="payment_card_id", referencedColumnName="id", nullable=true)
  114.      */
  115.     private $paymentCard;
  116.     /**
  117.      * @var string|null
  118.      * @ORM\Column(name="note", type="string", length=500, nullable=true)
  119.      * @Groups({"transaction_data"})
  120.      */
  121.     private $note;
  122.     /**
  123.      * @var string|null
  124.      * @ORM\Column(name="merchant_name", type="string", length=50, nullable=true)
  125.      * @Groups({"transaction_data"})
  126.      */
  127.     private $merchantName;
  128.     /**
  129.      * @var string|null
  130.      * @ORM\Column(name="merchant_street", type="string", length=50, nullable=true)
  131.      * @Groups({"transaction_data"})
  132.      */
  133.     private $merchantStreet;
  134.     /**
  135.      * @var string|null
  136.      * @ORM\Column(name="merchant_city", type="string", length=50, nullable=true)
  137.      * @Groups({"transaction_data"})
  138.      */
  139.     private $merchantCity;
  140.     /**
  141.      * @var string|null
  142.      * @ORM\Column(name="merchant_region", type="string", length=50, nullable=true)
  143.      * @Groups({"transaction_data"})
  144.      */
  145.     private $merchantRegion;
  146.     /**
  147.      * @var string|null
  148.      * @ORM\Column(name="merchant_postcode", type="string", length=50, nullable=true)
  149.      * @Groups({"transaction_data"})
  150.      */
  151.     private $merchantPostcode;
  152.     /**
  153.      * @var string|null
  154.      * @ORM\Column(name="merchant_country", type="string", length=50, nullable=true)
  155.      * @Groups({"transaction_data"})
  156.      */
  157.     private $merchantCountry;
  158.     /**
  159.      * @var string|null
  160.      * @ORM\Column(name="country_code", type="string", length=50, nullable=true)
  161.      * @Groups({"transaction_data"})
  162.      */
  163.     private $countryCode;
  164.     /**
  165.      * @var float|null
  166.      * @ORM\Column(name="amount", type="float", scale=2, nullable=true)
  167.      * @Groups({"transaction_data"})
  168.      */
  169.     private $amount;
  170.     /**
  171.      * @var string|null
  172.      * @ORM\Column(name="amount_currency", type="string", length=3, nullable=true)
  173.      * @Groups({"transaction_data"})
  174.      */
  175.     private $amountCurrency;
  176.     /**
  177.      * @var string|null
  178.      * @ORM\Column(name="original_amount", type="float", scale=2, nullable=true)
  179.      * @Groups({"transaction_data"})
  180.      */
  181.     private $originalAmount;
  182.     /**
  183.      * @var string|null
  184.      * @ORM\Column(name="original_amount_currency", type="string", length=3, nullable=true)
  185.      * @Groups({"transaction_data"})
  186.      */
  187.     private $originalAmountCurrency;
  188.     /**
  189.      * @var float|null
  190.      * @ORM\Column(name="fee", type="float", scale=2, nullable=true)
  191.      * @Groups({"transaction_data"})
  192.      */
  193.     private $fee 0.0;
  194.     /**
  195.      * @var string|null
  196.      * @ORM\Column(name="fee_currency", type="string", length=3, nullable=true)
  197.      * @Groups({"transaction_data"})
  198.      */
  199.     private $feeCurrency;
  200.     /**
  201.      * @var string|null
  202.      * @ORM\Column(name="card_token", type="string", length=50, nullable=true)
  203.      * @Groups({"transaction_data"})
  204.      */
  205.     private $cardToken;
  206.     /**
  207.      * @var string|null
  208.      * @ORM\Column(name="mcc", type="string", length=10, nullable=true)
  209.      * @Groups({"transaction_data"})
  210.      */
  211.     private $mcc;
  212.     /**
  213.      * @var DateTimeInterface|null
  214.      * @ORM\Column(name="transaction_date", type="datetime", nullable=true)
  215.      * @Groups({"transaction_data"})
  216.      */
  217.     private $transactionDate;
  218.     /**
  219.      * @var DateTimeInterface|null
  220.      * @ORM\Column(name="post_date", type="datetime", nullable=true)
  221.      * @Groups({"transaction_data"})
  222.      */
  223.     private $postDate;
  224.     /**
  225.      * @var string|null
  226.      * @ORM\Column(name="external_reference", type="string", length=255, nullable=true)
  227.      * @Groups({"transaction_data"})
  228.      */
  229.     private $externalReference;
  230.     /**
  231.      * @var string|null
  232.      * @ORM\Column(name="transaction_group", type="string", length=20, nullable=true)
  233.      * @Groups({"transaction_data"})
  234.      */
  235.     private $group;
  236.     /**
  237.      * @var string|null
  238.      * @ORM\Column(name="status", type="string", length=20, nullable=true)
  239.      * @Groups({"transaction_data"})
  240.      */
  241.     private $status self::STATUS_PENDING;
  242.     /**
  243.      * @var string|null
  244.      * @ORM\Column(name="type", type="string", length=20, nullable=true)
  245.      * @Groups({"transaction_data"})
  246.      */
  247.     private $type self::TYPE_SPEND;
  248.     /**
  249.      * @var string|null
  250.      * @ORM\Column(name="gps_latitude", type="string", length=20, nullable=true)
  251.      * @Groups({"transaction_data"})
  252.      */
  253.     private $gpsLatitude;
  254.     /**
  255.      * @var string|null
  256.      * @ORM\Column(name="gps_longitude", type="string", length=20, nullable=true)
  257.      * @Groups({"transaction_data"})
  258.      */
  259.     private $gpsLongitude;
  260.     /**
  261.      * @var float|null
  262.      * @ORM\Column(name="running_balance", type="float", scale=2, nullable=true, options={"default":0})
  263.      * @Groups({"transaction_data"})
  264.      */
  265.     private $runningBalance 0;
  266.     /**
  267.      * @var string|null
  268.      * @ORM\Column(name="auth_id", type="string", length=20, nullable=true)
  269.      * @Groups({"transaction_data"})
  270.      */
  271.     private $authId;
  272.     /**
  273.      * @var string|null
  274.      * @ORM\Column(name="fin_id", type="string", length=20, nullable=true)
  275.      * @Groups({"transaction_data"})
  276.      */
  277.     private $finId;
  278.     /**
  279.      * @var string|null
  280.      * @ORM\Column(name="load_id", type="string", length=20, nullable=true)
  281.      * @Groups({"transaction_data"})
  282.      */
  283.     private $loadId;
  284.     /**
  285.      * @var string|null
  286.      * @ORM\Column(name="load_source", type="string", length=20, nullable=true)
  287.      * @Groups({"transaction_data"})
  288.      */
  289.     private $loadSource;
  290.     /**
  291.      * @var boolean|null
  292.      * @ORM\Column(name="is_fx", type="boolean", nullable=true)
  293.      * @Groups({"transaction_data"})
  294.      */
  295.     private $isFx;
  296.     /**
  297.      * @OneToOne(targetEntity="LaunchPad\Bundle\LaunchPadBundle\Base\Entity\Transaction\ForeignExchangeFee")
  298.      * @Groups({"transaction_data"})
  299.      */
  300.     protected $fxFee;
  301.     public function __construct()
  302.     {
  303.         $this->transactionDate = new DateTimeImmutable();
  304.     }
  305.     /**
  306.      * @return int|null
  307.      */
  308.     public function getId(): ?int
  309.     {
  310.         return $this->id;
  311.     }
  312.     /**
  313.      * @param int|null $id
  314.      * @return Transaction
  315.      */
  316.     public function setId(?int $id): Transaction
  317.     {
  318.         $this->id $id;
  319.         return $this;
  320.     }
  321.     /**
  322.      * @return User|null
  323.      */
  324.     public function getUser(): ?User
  325.     {
  326.         return $this->user;
  327.     }
  328.     /**
  329.      * @param User|null $user
  330.      * @return Transaction
  331.      */
  332.     public function setUser(?User $user): Transaction
  333.     {
  334.         $this->user $user;
  335.         return $this;
  336.     }
  337.     /**
  338.      * @return string|null
  339.      */
  340.     public function getTitle(): ?string
  341.     {
  342.         return $this->title;
  343.     }
  344.     /**
  345.      * @param string|null $title
  346.      * @return Transaction
  347.      */
  348.     public function setTitle(?string $title): Transaction
  349.     {
  350.         $this->title $title;
  351.         return $this;
  352.     }
  353.     /**
  354.      * @return Account|null
  355.      */
  356.     public function getAccount(): ?Account
  357.     {
  358.         return $this->account;
  359.     }
  360.     /**
  361.      * @param Account|null $account
  362.      * @return Transaction
  363.      */
  364.     public function setAccount(?Account $account): Transaction
  365.     {
  366.         $this->account $account;
  367.         return $this;
  368.     }
  369.     /**
  370.      * @return PaymentDevice|null
  371.      */
  372.     public function getPaymentDevice(): ?PaymentDevice
  373.     {
  374.         return $this->paymentDevice;
  375.     }
  376.     /**
  377.      * @param PaymentDevice|null $paymentDevice
  378.      * @return Transaction
  379.      */
  380.     public function setPaymentDevice(?PaymentDevice $paymentDevice): Transaction
  381.     {
  382.         $this->paymentDevice $paymentDevice;
  383.         return $this;
  384.     }
  385.     /**
  386.      * @return TransactionCategory|null
  387.      */
  388.     public function getCategory(): ?TransactionCategory
  389.     {
  390.         return $this->category;
  391.     }
  392.     /**
  393.      * @param TransactionCategory|null $category
  394.      * @return Transaction
  395.      */
  396.     public function setCategory(?TransactionCategory $category): Transaction
  397.     {
  398.         $this->category $category;
  399.         return $this;
  400.     }
  401.     /**
  402.      * @return TransactionMerchant|null
  403.      */
  404.     public function getMerchant(): ?TransactionMerchant
  405.     {
  406.         return $this->merchant;
  407.     }
  408.     /**
  409.      * @param TransactionMerchant|null $merchant
  410.      * @return Transaction
  411.      */
  412.     public function setMerchant(?TransactionMerchant $merchant): Transaction
  413.     {
  414.         $this->merchant $merchant;
  415.         return $this;
  416.     }
  417.     /**
  418.      * @return Country|null
  419.      */
  420.     public function getCountry(): ?Country
  421.     {
  422.         return $this->country;
  423.     }
  424.     /**
  425.      * @param Country|null $country
  426.      * @return Transaction
  427.      */
  428.     public function setCountry(?Country $country): Transaction
  429.     {
  430.         $this->country $country;
  431.         return $this;
  432.     }
  433.     /**
  434.      * @return string|null
  435.      */
  436.     public function getNote(): ?string
  437.     {
  438.         return $this->note;
  439.     }
  440.     /**
  441.      * @param string|null $note
  442.      * @return Transaction
  443.      */
  444.     public function setNote(?string $note): Transaction
  445.     {
  446.         $this->note $note;
  447.         return $this;
  448.     }
  449.     /**
  450.      * @return string|null
  451.      */
  452.     public function getMerchantName(): ?string
  453.     {
  454.         return $this->merchantName;
  455.     }
  456.     /**
  457.      * @param string|null $merchantName
  458.      * @return Transaction
  459.      */
  460.     public function setMerchantName(?string $merchantName): Transaction
  461.     {
  462.         $this->merchantName $merchantName;
  463.         return $this;
  464.     }
  465.     /**
  466.      * @return string|null
  467.      */
  468.     public function getMerchantStreet(): ?string
  469.     {
  470.         return $this->merchantStreet;
  471.     }
  472.     /**
  473.      * @param string|null $merchantStreet
  474.      * @return Transaction
  475.      */
  476.     public function setMerchantStreet(?string $merchantStreet): Transaction
  477.     {
  478.         $this->merchantStreet $merchantStreet;
  479.         return $this;
  480.     }
  481.     /**
  482.      * @return string|null
  483.      */
  484.     public function getMerchantCity(): ?string
  485.     {
  486.         return $this->merchantCity;
  487.     }
  488.     /**
  489.      * @param string|null $merchantCity
  490.      * @return Transaction
  491.      */
  492.     public function setMerchantCity(?string $merchantCity): Transaction
  493.     {
  494.         $this->merchantCity $merchantCity;
  495.         return $this;
  496.     }
  497.     /**
  498.      * @return string|null
  499.      */
  500.     public function getMerchantRegion(): ?string
  501.     {
  502.         return $this->merchantRegion;
  503.     }
  504.     /**
  505.      * @param string|null $merchantRegion
  506.      * @return Transaction
  507.      */
  508.     public function setMerchantRegion(?string $merchantRegion): Transaction
  509.     {
  510.         $this->merchantRegion $merchantRegion;
  511.         return $this;
  512.     }
  513.     /**
  514.      * @return string|null
  515.      */
  516.     public function getMerchantPostcode(): ?string
  517.     {
  518.         return $this->merchantPostcode;
  519.     }
  520.     /**
  521.      * @param string|null $merchantPostcode
  522.      * @return Transaction
  523.      */
  524.     public function setMerchantPostcode(?string $merchantPostcode): Transaction
  525.     {
  526.         $this->merchantPostcode $merchantPostcode;
  527.         return $this;
  528.     }
  529.     /**
  530.      * @return string|null
  531.      */
  532.     public function getMerchantCountry(): ?string
  533.     {
  534.         return $this->merchantCountry;
  535.     }
  536.     /**
  537.      * @param string|null $merchantCountry
  538.      * @return Transaction
  539.      */
  540.     public function setMerchantCountry(?string $merchantCountry): Transaction
  541.     {
  542.         $this->merchantCountry $merchantCountry;
  543.         return $this;
  544.     }
  545.     /**
  546.      * @return string|null
  547.      */
  548.     public function getCountryCode(): ?string
  549.     {
  550.         return $this->countryCode;
  551.     }
  552.     /**
  553.      * @param string|null $countryCode
  554.      * @return Transaction
  555.      */
  556.     public function setCountryCode(?string $countryCode): Transaction
  557.     {
  558.         $this->countryCode $countryCode;
  559.         return $this;
  560.     }
  561.     /**
  562.      * @return float|null
  563.      */
  564.     public function getAmount(): ?float
  565.     {
  566.         return $this->amount;
  567.     }
  568.     /**
  569.      * @param float|null $amount
  570.      * @return Transaction
  571.      */
  572.     public function setAmount(?float $amount): Transaction
  573.     {
  574.         $this->amount $amount;
  575.         return $this;
  576.     }
  577.     /**
  578.      * @return string|null
  579.      */
  580.     public function getAmountCurrency(): ?string
  581.     {
  582.         return $this->amountCurrency;
  583.     }
  584.     /**
  585.      * @param string|null $amountCurrency
  586.      * @return Transaction
  587.      */
  588.     public function setAmountCurrency(?string $amountCurrency): Transaction
  589.     {
  590.         $this->amountCurrency $amountCurrency;
  591.         return $this;
  592.     }
  593.     /**
  594.      * @return string|null
  595.      */
  596.     public function getOriginalAmount(): ?string
  597.     {
  598.         return $this->originalAmount;
  599.     }
  600.     /**
  601.      * @param string|null $originalAmount
  602.      * @return Transaction
  603.      */
  604.     public function setOriginalAmount(?string $originalAmount): Transaction
  605.     {
  606.         $this->originalAmount $originalAmount;
  607.         return $this;
  608.     }
  609.     /**
  610.      * @return string|null
  611.      */
  612.     public function getOriginalAmountCurrency(): ?string
  613.     {
  614.         return $this->originalAmountCurrency;
  615.     }
  616.     /**
  617.      * @param string|null $originalAmountCurrency
  618.      * @return Transaction
  619.      */
  620.     public function setOriginalAmountCurrency(?string $originalAmountCurrency): Transaction
  621.     {
  622.         $this->originalAmountCurrency $originalAmountCurrency;
  623.         return $this;
  624.     }
  625.     /**
  626.      * @return float|null
  627.      */
  628.     public function getFee(): ?float
  629.     {
  630.         return $this->fee;
  631.     }
  632.     /**
  633.      * @param float|null $fee
  634.      * @return Transaction
  635.      */
  636.     public function setFee(?float $fee): Transaction
  637.     {
  638.         $this->fee $fee;
  639.         return $this;
  640.     }
  641.     /**
  642.      * @return string|null
  643.      */
  644.     public function getFeeCurrency(): ?string
  645.     {
  646.         return $this->feeCurrency;
  647.     }
  648.     /**
  649.      * @param string|null $feeCurrency
  650.      * @return Transaction
  651.      */
  652.     public function setFeeCurrency(?string $feeCurrency): Transaction
  653.     {
  654.         $this->feeCurrency $feeCurrency;
  655.         return $this;
  656.     }
  657.     /**
  658.      * @return string|null
  659.      */
  660.     public function getCardToken(): ?string
  661.     {
  662.         return $this->cardToken;
  663.     }
  664.     /**
  665.      * @param string|null $cardToken
  666.      * @return Transaction
  667.      */
  668.     public function setCardToken(?string $cardToken): Transaction
  669.     {
  670.         $this->cardToken $cardToken;
  671.         return $this;
  672.     }
  673.     /**
  674.      * @return string|null
  675.      */
  676.     public function getMcc(): ?string
  677.     {
  678.         return $this->mcc;
  679.     }
  680.     /**
  681.      * @param string|null $mcc
  682.      * @return Transaction
  683.      */
  684.     public function setMcc(?string $mcc): Transaction
  685.     {
  686.         $this->mcc $mcc;
  687.         return $this;
  688.     }
  689.     /**
  690.      * @return DateTimeInterface|null
  691.      */
  692.     public function getTransactionDate(): ?DateTimeInterface
  693.     {
  694.         return $this->transactionDate;
  695.     }
  696.     /**
  697.      * @param DateTimeInterface|null $transactionDate
  698.      * @return Transaction
  699.      */
  700.     public function setTransactionDate(?DateTimeInterface $transactionDate): Transaction
  701.     {
  702.         $this->transactionDate $transactionDate;
  703.         return $this;
  704.     }
  705.     /**
  706.      * @return DateTime|null
  707.      */
  708.     public function getPostDate(): ?DateTime
  709.     {
  710.         return $this->postDate;
  711.     }
  712.     /**
  713.      * @param DateTime|null $postDate
  714.      * @return Transaction
  715.      */
  716.     public function setPostDate(?DateTime $postDate): Transaction
  717.     {
  718.         $this->postDate $postDate;
  719.         return $this;
  720.     }
  721.     /**
  722.      * @return string|null
  723.      */
  724.     public function getExternalReference(): ?string
  725.     {
  726.         return $this->externalReference;
  727.     }
  728.     /**
  729.      * @param string|null $externalReference
  730.      * @return Transaction
  731.      */
  732.     public function setExternalReference(?string $externalReference): Transaction
  733.     {
  734.         $this->externalReference $externalReference;
  735.         return $this;
  736.     }
  737.     /**
  738.      * @return string|null
  739.      */
  740.     public function getGroup(): ?string
  741.     {
  742.         return $this->group;
  743.     }
  744.     /**
  745.      * @param string|null $group
  746.      * @return Transaction
  747.      */
  748.     public function setGroup(?string $group): Transaction
  749.     {
  750.         $this->group $group;
  751.         return $this;
  752.     }
  753.     /**
  754.      * @return string|null
  755.      */
  756.     public function getStatus(): ?string
  757.     {
  758.         return $this->status;
  759.     }
  760.     /**
  761.      * @param string|null $status
  762.      * @return Transaction
  763.      */
  764.     public function setStatus(?string $status): Transaction
  765.     {
  766.         $this->status $status;
  767.         return $this;
  768.     }
  769.     /**
  770.      * @return string|null
  771.      */
  772.     public function getType(): ?string
  773.     {
  774.         return $this->type;
  775.     }
  776.     /**
  777.      * @param string|null $type
  778.      * @return Transaction
  779.      */
  780.     public function setType(?string $type): Transaction
  781.     {
  782.         $this->type $type;
  783.         return $this;
  784.     }
  785.     /**
  786.      * @return string|null
  787.      */
  788.     public function getGpsLatitude(): ?string
  789.     {
  790.         return $this->gpsLatitude;
  791.     }
  792.     /**
  793.      * @param string|null $gpsLatitude
  794.      * @return Transaction
  795.      */
  796.     public function setGpsLatitude(?string $gpsLatitude): Transaction
  797.     {
  798.         $this->gpsLatitude $gpsLatitude;
  799.         return $this;
  800.     }
  801.     /**
  802.      * @return string|null
  803.      */
  804.     public function getGpsLongitude(): ?string
  805.     {
  806.         return $this->gpsLongitude;
  807.     }
  808.     /**
  809.      * @param string|null $gpsLongitude
  810.      * @return Transaction
  811.      */
  812.     public function setGpsLongitude(?string $gpsLongitude): Transaction
  813.     {
  814.         $this->gpsLongitude $gpsLongitude;
  815.         return $this;
  816.     }
  817.     /**
  818.      * @return float|null
  819.      */
  820.     public function getRunningBalance(): ?float
  821.     {
  822.         return $this->runningBalance;
  823.     }
  824.     /**
  825.      * @param float|null $runningBalance
  826.      * @return Transaction
  827.      */
  828.     public function setRunningBalance(?float $runningBalance): Transaction
  829.     {
  830.         $this->runningBalance $runningBalance;
  831.         return $this;
  832.     }
  833.     /**
  834.      * @return string|null
  835.      */
  836.     public function getAuthId(): ?string
  837.     {
  838.         return $this->authId;
  839.     }
  840.     /**
  841.      * @param string|null $authId
  842.      * @return Transaction
  843.      */
  844.     public function setAuthId(?string $authId): Transaction
  845.     {
  846.         $this->authId $authId;
  847.         return $this;
  848.     }
  849.     /**
  850.      * @return string|null
  851.      */
  852.     public function getFinId(): ?string
  853.     {
  854.         return $this->finId;
  855.     }
  856.     /**
  857.      * @param string|null $finId
  858.      * @return Transaction
  859.      */
  860.     public function setFinId(?string $finId): Transaction
  861.     {
  862.         $this->finId $finId;
  863.         return $this;
  864.     }
  865.     /**
  866.      * @return string|null
  867.      */
  868.     public function getLoadId(): ?string
  869.     {
  870.         return $this->loadId;
  871.     }
  872.     /**
  873.      * @param string|null $loadId
  874.      * @return Transaction
  875.      */
  876.     public function setLoadId(?string $loadId): Transaction
  877.     {
  878.         $this->loadId $loadId;
  879.         return $this;
  880.     }
  881.     /**
  882.      * @return string|null
  883.      */
  884.     public function getLoadSource(): ?string
  885.     {
  886.         return $this->loadSource;
  887.     }
  888.     /**
  889.      * @param string|null $loadSource
  890.      * @return Transaction
  891.      */
  892.     public function setLoadSource(?string $loadSource): Transaction
  893.     {
  894.         $this->loadSource $loadSource;
  895.         return $this;
  896.     }
  897.     /**
  898.      * @return PaymentCard|null
  899.      */
  900.     public function getPaymentCard(): ?PaymentCard
  901.     {
  902.         return $this->paymentCard;
  903.     }
  904.     /**
  905.      * @param PaymentCard|null $paymentCard
  906.      * @return Transaction
  907.      */
  908.     public function setPaymentCard(?PaymentCard $paymentCard): Transaction
  909.     {
  910.         $this->paymentCard $paymentCard;
  911.         return $this;
  912.     }
  913.     /**
  914.      * @Groups({"transaction_data"})
  915.      * @return string|null
  916.      */
  917.     public function getStatusReadable(): ?string
  918.     {
  919.         return $this->status Inflector::ucwords($this->status) : null;
  920.     }
  921.     /**
  922.      * @Groups({"transaction_data"})
  923.      * @return string|null
  924.      */
  925.     public function getTypeReadable(): ?string
  926.     {
  927.         return $this->type Inflector::ucwords($this->type) : null;
  928.     }
  929.     /**
  930.      * @Groups({"transaction_data"})
  931.      * @return string
  932.      */
  933.     public function getCategoryIcon(): string
  934.     {
  935.         return $this->category $this->category->getIcon() : 'fa.info';
  936.     }
  937.     /**
  938.      * @Groups({"transaction_data"})
  939.      */
  940.     public function getCardPan()
  941.     {
  942.         return $this->paymentDevice $this->paymentDevice->getPan() : null;
  943.     }
  944.     /**
  945.      * @return string
  946.      */
  947.     public function __toString(): string
  948.     {
  949.         return $this->note ?: '';
  950.     }
  951.     /**
  952.      * @return bool|null
  953.      */
  954.     public function getIsFx()
  955.     {
  956.         return $this->isFx;
  957.     }
  958.     /**
  959.      * @param bool|null $isFx
  960.      */
  961.     public function setIsFx($isFx)
  962.     {
  963.         $this->isFx $isFx;
  964.     }
  965.     /**
  966.      * @return mixed
  967.      */
  968.     public function getFxFee()
  969.     {
  970.         return $this->fxFee;
  971.     }
  972.     /**
  973.      * @param mixed $fxFee
  974.      * @return Transaction
  975.      */
  976.     public function setFxFee($fxFee)
  977.     {
  978.         $this->fxFee $fxFee;
  979.         return $this;
  980.     }
  981. }