src/AtechNet/CoreBundle/Entity/ClaimStatus.php line 19

Open in your IDE?
  1. <?php
  2. namespace App\AtechNet\CoreBundle\Entity;
  3. use Doctrine\ORM\Mapping\Column;
  4. use Doctrine\ORM\Mapping\Entity;
  5. use Doctrine\ORM\Mapping\HasLifecycleCallbacks;
  6. use Doctrine\ORM\Mapping\JoinColumn;
  7. use Doctrine\ORM\Mapping\ManyToOne;
  8. use Doctrine\ORM\Mapping\Table as Table;
  9. /**
  10.  * ClaimStatus
  11.  *
  12.  * @Table(name="claim_statuses")
  13.  * @Entity()
  14.  * @HasLifecycleCallbacks
  15.  */
  16. class ClaimStatus extends AbstractSignedEntity
  17. {
  18.     public const int STATUS_TYPE_REGISTERED = 1;
  19.     public const int STATUS_TYPE_PARCEL_ORDERED = 2;
  20.     public const int STATUS_TYPE_ACCEPTED_ITEM_ARRIVED = 3;
  21.     public const int STATUS_TYPE_IN_PROGRESS = 4;
  22.     public const int STATUS_TYPE_ACCEPTED = 5;
  23.     public const int STATUS_TYPE_ACCEPTED_ITEM_SENT = 6;
  24.     public const int STATUS_TYPE_REJECTED = 7;
  25.     public const int STATUS_TYPE_REJECTED_ITEM_SENT = 8;
  26.     public const int STATUS_TYPE_CANCELED_BY_CUSTOMER = 9;
  27.     public const int STATUS_TYPE_CANCELED = 20;
  28.     public const int STATUS_TYPE_RETURNED = 10;
  29.     public const int STATUS_TYPE_WAITING_FOR_SALES = 11;
  30.     public const int STATUS_TYPE_WAITING_FOR_SERVIS = 12;
  31.     public const int STATUS_TYPE_WAITING_FOR_PARTS = 13;
  32.     public const int STATUS_TYPE_WAITING_FOR_AIKEN = 16;
  33.     public const int STATUS_TYPE_ACCEPTED_CREDIT_NOTE = 14;
  34.     public const int STATUS_TYPE_SEND_BACK = 15;
  35.     public const int STATUS_TYPE_WAITING_FOR_PARTNER = 17;
  36.     public const int STATUS_TYPE_WAITING_FOR_RMA = 18;
  37.     public const int STATUS_TYPE_WAITING_FOR_REFUND = 19;
  38.     public const int STATUS_TYPE_WAITING_FOR_EXCHANGE = 21;
  39.     public const int STATUS_TYPE_UNSOLVED = 30;
  40.     public const int STATUS_TYPE_WAITING_FOR_CUSTOMER = 31;
  41.     public const int STATUS_TYPE_WAITING_FOR_MARKETPLACE = 32;
  42.     public const int STATUS_TYPE_WAITING_FOR_CUSTOMER_SERVICE = 33;
  43.     public const int STATUS_TYPE_WAITING_FOR_DECISION = 34;
  44.     public const int STATUS_TYPE_WAITING_FOR_LEGAL_RESOLUTION = 35;
  45.     /**
  46.      * @return array
  47.      */
  48.     public static function getStatusChoices(): array
  49.     {
  50.         return [
  51.             self::STATUS_TYPE_REGISTERED            => 'Registered',
  52.             self::STATUS_TYPE_PARCEL_ORDERED        => 'Parcel ordered',
  53.             self::STATUS_TYPE_ACCEPTED_ITEM_ARRIVED => 'Accepted, item arrived',
  54.             self::STATUS_TYPE_SEND_BACK             => 'Send back',
  55.             self::STATUS_TYPE_IN_PROGRESS           => 'In progress',
  56.             self::STATUS_TYPE_WAITING_FOR_SALES     => 'Waiting for sales',
  57.             self::STATUS_TYPE_WAITING_FOR_SERVIS    => 'Waiting for servis',
  58.             self::STATUS_TYPE_WAITING_FOR_PARTS     => 'Waiting for parts',
  59.             self::STATUS_TYPE_WAITING_FOR_AIKEN     => 'Waiting for AIKEN',
  60.             self::STATUS_TYPE_WAITING_FOR_RMA       => 'Waiting for RMA',
  61.             self::STATUS_TYPE_WAITING_FOR_PARTNER   => 'Waiting for Partner',
  62.             self::STATUS_TYPE_WAITING_FOR_EXCHANGE  => 'Waiting for exchange',
  63.             self::STATUS_TYPE_ACCEPTED              => 'Accepted',
  64.             self::STATUS_TYPE_ACCEPTED_CREDIT_NOTE  => 'Accepted, credit note',
  65.             self::STATUS_TYPE_WAITING_FOR_REFUND    => 'Waiting for refund',
  66.             self::STATUS_TYPE_ACCEPTED_ITEM_SENT    => 'Accepted, item sent',
  67.             self::STATUS_TYPE_REJECTED              => 'Rejected',
  68.             self::STATUS_TYPE_REJECTED_ITEM_SENT    => 'Rejected, item sent',
  69.             self::STATUS_TYPE_CANCELED                        => 'Canceled',
  70.             self::STATUS_TYPE_CANCELED_BY_CUSTOMER            => 'Canceled by customer',
  71.             self::STATUS_TYPE_RETURNED                        => 'Returned claim',
  72.             self::STATUS_TYPE_UNSOLVED                        => 'Unsolved',
  73.             self::STATUS_TYPE_WAITING_FOR_CUSTOMER            => 'Waiting for customer',
  74.             self::STATUS_TYPE_WAITING_FOR_MARKETPLACE         => 'Waiting for marketplace',
  75.             self::STATUS_TYPE_WAITING_FOR_CUSTOMER_SERVICE    => 'Waiting for customer service',
  76.             self::STATUS_TYPE_WAITING_FOR_DECISION            => 'Waiting for decision',
  77.             self::STATUS_TYPE_WAITING_FOR_LEGAL_RESOLUTION    => 'Waiting for legal resolution',
  78.         ];
  79.     }
  80.     public const int STATUS_GROUP_REGISTERED = 10;
  81.     public const int STATUS_GROUP_PARCEL_ORDERED = 20;
  82.     public const int STATUS_GROUP_ACCEPTED_ITEM_ARRIVED = 30;
  83.     public const int STATUS_GROUP_SEND_BACK = 35;
  84.     public const int STATUS_GROUP_IN_PROGRESS = 40;
  85.     public const int STATUS_GROUP_WAITING = 50;
  86.     public const int STATUS_GROUP_ACCEPTED = 60;
  87.     public const int STATUS_GROUP_REJECTED = 70;
  88.     public const int STATUS_GROUP_RETURNED = 80;
  89.     public const int STATUS_GROUP_UNSOLVED = 90;
  90.     public static function getGroupedStatusChoices(): array
  91.     {
  92.         return [
  93.             self::STATUS_GROUP_REGISTERED            => 'Registered',
  94.             self::STATUS_GROUP_PARCEL_ORDERED        => 'Carrier ordered',
  95.             self::STATUS_GROUP_ACCEPTED_ITEM_ARRIVED => 'Item arrived',
  96.             self::STATUS_GROUP_SEND_BACK             => 'Send back',
  97.             self::STATUS_GROUP_IN_PROGRESS           => 'In progress',
  98.             self::STATUS_GROUP_WAITING               => 'Waiting',
  99.             self::STATUS_GROUP_ACCEPTED              => 'Accepted',
  100.             self::STATUS_GROUP_REJECTED              => 'Rejected',
  101.             self::STATUS_GROUP_RETURNED              => 'Returned.short',
  102.             self::STATUS_GROUP_UNSOLVED              => 'Unsolved',
  103.         ];
  104.     }
  105.     /**
  106.      * @return \int[][]
  107.      */
  108.     public static function getGroupedStatusChoiceStructure(): array
  109.     {
  110.         return [
  111.             self::STATUS_GROUP_REGISTERED            => [
  112.                 self::STATUS_TYPE_REGISTERED,
  113.             ],
  114.             self::STATUS_GROUP_PARCEL_ORDERED        => [
  115.                 self::STATUS_TYPE_PARCEL_ORDERED,
  116.             ],
  117.             self::STATUS_GROUP_ACCEPTED_ITEM_ARRIVED => [
  118.                 self::STATUS_TYPE_ACCEPTED_ITEM_ARRIVED,
  119.             ],
  120.             self::STATUS_GROUP_SEND_BACK             => [
  121.                 self::STATUS_TYPE_SEND_BACK,
  122.             ],
  123.             self::STATUS_GROUP_IN_PROGRESS           => [
  124.                 self::STATUS_TYPE_IN_PROGRESS,
  125.             ],
  126.             self::STATUS_GROUP_WAITING               => [
  127.                 self::STATUS_TYPE_WAITING_FOR_SALES,
  128.                 self::STATUS_TYPE_WAITING_FOR_SERVIS,
  129.                 self::STATUS_TYPE_WAITING_FOR_PARTS,
  130.                 self::STATUS_TYPE_WAITING_FOR_AIKEN,
  131.                 self::STATUS_TYPE_WAITING_FOR_PARTNER,
  132.                 self::STATUS_TYPE_WAITING_FOR_RMA,
  133.                 self::STATUS_TYPE_WAITING_FOR_REFUND,
  134.                 self::STATUS_TYPE_WAITING_FOR_EXCHANGE
  135.             ],
  136.             self::STATUS_GROUP_ACCEPTED              => [
  137.                 self::STATUS_TYPE_ACCEPTED,
  138.                 self::STATUS_TYPE_ACCEPTED_CREDIT_NOTE,
  139.                 self::STATUS_TYPE_ACCEPTED_ITEM_SENT,
  140.             ],
  141.             self::STATUS_GROUP_REJECTED              => [
  142.                 self::STATUS_TYPE_REJECTED,
  143.                 self::STATUS_TYPE_REJECTED_ITEM_SENT,
  144.                 self::STATUS_TYPE_CANCELED_BY_CUSTOMER,
  145.             ],
  146.             self::STATUS_GROUP_RETURNED              => [
  147.                 self::STATUS_TYPE_RETURNED,
  148.             ],
  149.             self::STATUS_GROUP_UNSOLVED            => [
  150.                 self::STATUS_TYPE_UNSOLVED,
  151.                 self::STATUS_TYPE_WAITING_FOR_CUSTOMER,
  152.                 self::STATUS_TYPE_WAITING_FOR_MARKETPLACE,
  153.                 self::STATUS_TYPE_WAITING_FOR_CUSTOMER_SERVICE,
  154.                 self::STATUS_TYPE_WAITING_FOR_DECISION,
  155.                 self::STATUS_TYPE_WAITING_FOR_LEGAL_RESOLUTION,
  156.             ],
  157.         ];
  158.     }
  159.     /**
  160.      * @return array
  161.      */
  162.     public static function getNotifiableStatuses(): array
  163.     {
  164.         return [
  165.             self::STATUS_TYPE_REGISTERED,
  166.             self::STATUS_TYPE_PARCEL_ORDERED,
  167.             self::STATUS_TYPE_ACCEPTED_ITEM_ARRIVED,
  168.             self::STATUS_GROUP_SEND_BACK,
  169.             self::STATUS_TYPE_IN_PROGRESS,
  170.             self::STATUS_TYPE_ACCEPTED,
  171.             self::STATUS_TYPE_ACCEPTED_CREDIT_NOTE,
  172.             self::STATUS_TYPE_ACCEPTED_ITEM_SENT,
  173.             self::STATUS_TYPE_REJECTED,
  174.             self::STATUS_TYPE_REJECTED_ITEM_SENT,
  175.             self::STATUS_TYPE_RETURNED,
  176.         ];
  177.     }
  178.     /**
  179.      * @var Claim
  180.      *
  181.      * @ManyToOne(targetEntity="Claim", inversedBy="statuses")
  182.      * @JoinColumn(name="claim_id", referencedColumnName="id")
  183.      */
  184.     private Claim $claim;
  185.     /**
  186.      * @var int
  187.      *
  188.      * @Column(name="status_type", type="integer")
  189.      */
  190.     private int $statusType;
  191.     /**
  192.      * @return Claim
  193.      */
  194.     public function getClaim(): Claim
  195.     {
  196.         return $this->claim;
  197.     }
  198.     /**
  199.      * @param Claim $claim
  200.      */
  201.     public function setClaim(Claim $claim): void
  202.     {
  203.         $this->claim = $claim;
  204.     }
  205.     /**
  206.      * @return int
  207.      */
  208.     public function getStatusType(): int
  209.     {
  210.         return $this->statusType;
  211.     }
  212.     /**
  213.      * @param int $statusType
  214.      */
  215.     public function setStatusType(int $statusType): void
  216.     {
  217.         $this->statusType = $statusType;
  218.     }
  219. }