src/Entity/System/ServiceProduct.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity\System;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5. * @ORM\Entity
  6. *
  7. * @ORM\Table(name="ps_service_product")
  8. *
  9. * @ORM\Entity(repositoryClass="App\Repository\System\ServiceProductRepository")
  10. */
  11. class ServiceProduct
  12. {
  13. public const AMAZON_EBAY_SERVICE_ID = 95289;
  14. public const ALIEXPRESS_SERVICE_ID = 102221;
  15. public const FNAC_SERVICE_ID = 116983;
  16. public const CDISCOUNT_SERVICE_ID = 120519;
  17. public const RAKUTEN_SERVICE_ID = 102222;
  18. public const CARREFOUR_SERVICE_ID = 116984;
  19. public const DARTY_SERVICE_ID = 120520;
  20. public const EPRICE_SERVICE_ID = 121729;
  21. public const RUEDUCOMMERCE_SERVICE_ID = 121731;
  22. public const CONFORAMA_SERVICE_ID = 121730;
  23. public const REAL_SERVICE_ID = 131973;
  24. public const BOL_SERVICE_ID = 131974;
  25. public const SHOPIFY_CONECTOR_ID = 95291;
  26. public const PRESTASHOP_CONECTOR_ID = 95290;
  27. public const WOOCOMMERCE_CONECTOR_ID = 121732;
  28. public const MAGENTO_CONECTOR_ID = 169260;
  29. public const SHOP_IBIZA = 41256;
  30. public const SHOP_SHOPIFY = 95084;
  31. public const BOL_CONECTOR_ID = 131974;
  32. public const MARKETPLACES_5x = 218735;
  33. public const PC_COMPONENTES_SERVICE_ID = 206126;
  34. public const WORTEN_SERVICE_ID = 270665;
  35. public const ALLEGRO_SERVICE_ID = 314083;
  36. public const LEROY_MERLIN_SERVICE_ID = 347188;
  37. public const WIX_SERVICE_ID = 364343;
  38. public const CDON_SERVICE_ID = 442297;
  39. public const WISH_SERVICE_ID = 448860;
  40. public const BACKMARKET_SERVICE_ID = 448991;
  41. public const CARREFOUR_FR_SERVICE_ID = 449719;
  42. public const SERVICE_PRODUCT_SHOP_SHOPIFY_360_TYPE_ID = 10;
  43. public const ELECLERC_SERVICE_ID = 477824;
  44. public const AMAZON_RAKUTEN_SERVICE_ID = 756394;
  45. public const AMAZON_WORTEN_SERVICE_ID = 758387;
  46. public const AMAZON_KAUFLAND_SERVICE_ID = 758391;
  47. public const AMAZON_FNAC_SERVICE_ID = 758419;
  48. public const AMAZON_EPRICE_SERVICE_ID = 758421;
  49. public const AMAZON_CDON_SERVICE_ID = 758422;
  50. public const EBAY_SERVICE_ID = 758423;
  51. public const AMAZON_SERVICE_ID = 806955;
  52. public const VIDAXL_SERVICE_ID = 131972;
  53. public const VENCA_SERVICE_ID = 131976;
  54. public const PERFUMESCLUB_SERVICE_ID = 491253;
  55. public const MEDIAMARKT_ES_SERVICE_ID = 1014998;
  56. public const MEDIAMARKT_DE_SERVICE_ID = 1015099;
  57. public const MEDIAMARKT_IT_SERVICE_ID = 1106825;
  58. public const MANOMANO_SERVICE_ID = 1118101;
  59. public const REFURBED_SERVICE_ID = 1118102;
  60. public const SPRINTER_SERVICE_ID = 1118103;
  61. public const CLUBEFASHION_SERVICE_ID = 1118104;
  62. public const MIRAVIA_SERVICE_ID = 673854;
  63. public const ECOMMERCE_PACK_ALLOWED_SERVICES = [
  64. self::SHOP_IBIZA,
  65. self::SHOP_SHOPIFY,
  66. self::PRESTASHOP_CONECTOR_ID,
  67. self::SHOPIFY_CONECTOR_ID,
  68. self::WOOCOMMERCE_CONECTOR_ID,
  69. self::MAGENTO_CONECTOR_ID,
  70. self::WIX_SERVICE_ID,
  71. ];
  72. public const COMBO_CONECTOR_PRODUCTS = [
  73. self::MARKETPLACES_5x,
  74. self::AMAZON_RAKUTEN_SERVICE_ID,
  75. self::AMAZON_WORTEN_SERVICE_ID,
  76. self::AMAZON_KAUFLAND_SERVICE_ID,
  77. self::AMAZON_FNAC_SERVICE_ID,
  78. self::AMAZON_EPRICE_SERVICE_ID,
  79. self::CDON_SERVICE_ID,
  80. ];
  81. public const AVAILABLE_COUNTRY_ISO_CODES_INDEXED_BY_SERVICE_ID = [
  82. self::AMAZON_SERVICE_ID => ['es', 'fr', 'it', 'de', 'be', 'sv', 'nl', 'pl', 'en', 'ir', ],
  83. self::EBAY_SERVICE_ID => ['es', 'fr', 'it', 'de', 'be', 'sw', 'au', 'nl', 'pl', 'en', 'ir', ],
  84. self::RAKUTEN_SERVICE_ID => ['fr', ],
  85. self::WORTEN_SERVICE_ID => ['es', 'pt', ],
  86. self::REAL_SERVICE_ID => ['fr', 'it', 'de', 'sk', 'cz', 'pl', 'au', ],
  87. self::FNAC_SERVICE_ID => ['es', 'fr', 'pt', 'be', 'sw', ],
  88. self::EPRICE_SERVICE_ID => ['it', ],
  89. self::CDON_SERVICE_ID => ['se', 'no', 'dk', 'fi', ],
  90. self::ALIEXPRESS_SERVICE_ID => ['es', 'fr', 'it', ],
  91. self::CDISCOUNT_SERVICE_ID => ['fr', ],
  92. self::CARREFOUR_SERVICE_ID => ['es', ],
  93. self::DARTY_SERVICE_ID => ['fr', ],
  94. self::RUEDUCOMMERCE_SERVICE_ID => ['fr', ],
  95. self::CONFORAMA_SERVICE_ID => ['fr', ],
  96. self::ALLEGRO_SERVICE_ID => ['pl', 'cz', 'sk', 'hu', ],
  97. self::LEROY_MERLIN_SERVICE_ID => ['fr', 'it', 'es', 'pt', ],
  98. self::CARREFOUR_FR_SERVICE_ID => ['fr', ],
  99. self::WISH_SERVICE_ID => ['es', 'pt', 'fr', 'de', 'it', 'en', 'no', 'sw', 'be', 'nl', 'au', 'cz', ],
  100. self::ELECLERC_SERVICE_ID => ['fr', ],
  101. self::BACKMARKET_SERVICE_ID => ['fr', 'au', 'be', 'de', 'es', 'en', 'gr', 'ir', 'it', 'nl', 'se', 'sk', ],
  102. self::MEDIAMARKT_ES_SERVICE_ID => ['es', ],
  103. self::MEDIAMARKT_DE_SERVICE_ID => ['de', ],
  104. self::MEDIAMARKT_IT_SERVICE_ID => ['it', ],
  105. self::MANOMANO_SERVICE_ID => ['es', 'de', 'fr', 'it'],
  106. self::REFURBED_SERVICE_ID => ['de', ],
  107. self::SPRINTER_SERVICE_ID => ['pt', ],
  108. self::CLUBEFASHION_SERVICE_ID => ['pt', ],
  109. self::MIRAVIA_SERVICE_ID => ['es', ],
  110. ];
  111. public const MIP_ADDITIONAL_SERVICE_DATA_INDEXED_BY_NAME = [
  112. 'marketplaces' => ['id' => self::AMAZON_EBAY_SERVICE_ID, 'price' => '199'],
  113. 'prestashop' => ['id' => self::PRESTASHOP_CONECTOR_ID, 'price' => '149'],
  114. 'shopify' => ['id' => self::SHOPIFY_CONECTOR_ID, 'price' => '129'],
  115. 'wooCommerce' => ['id' => self::WOOCOMMERCE_CONECTOR_ID, 'price' => '149'],
  116. 'aliexpress' => ['id' => self::ALIEXPRESS_SERVICE_ID, 'price' => '29'],
  117. 'rakuten' => ['id' => self::RAKUTEN_SERVICE_ID, 'price' => '29'],
  118. 'fnac' => ['id' => self::FNAC_SERVICE_ID, 'price' => '49'],
  119. 'carrefour' => ['id' => self::CARREFOUR_SERVICE_ID, 'price' => '29'],
  120. 'darty' => ['id' => self::DARTY_SERVICE_ID, 'price' => '29'],
  121. 'cdiscount' => ['id' => self::CDISCOUNT_SERVICE_ID, 'price' => '49'],
  122. 'eprice' => ['id' => self::EPRICE_SERVICE_ID, 'price' => '29'],
  123. 'rueducommerce' => ['id' => self::RUEDUCOMMERCE_SERVICE_ID, 'price' => '29'],
  124. 'conforama' => ['id' => self::CONFORAMA_SERVICE_ID, 'price' => '29'],
  125. 'vidaxl' => ['id' => self::VIDAXL_SERVICE_ID, 'price' => '199'],
  126. 'real' => ['id' => self::REAL_SERVICE_ID, 'price' => '49'],
  127. 'bolcom' => ['id' => self::BOL_SERVICE_ID, 'price' => '199'],
  128. 'venca' => ['id' => self::VENCA_SERVICE_ID, 'price' => '199'],
  129. 'magento' => ['id' => self::MAGENTO_CONECTOR_ID, 'price' => '199'],
  130. '5xconectores' => ['id' => self::MARKETPLACES_5x, 'price' => '159'],
  131. 'pc_componentes' => ['id' => self::PC_COMPONENTES_SERVICE_ID, 'price' => '29'],
  132. 'worten' => ['id' => self::WORTEN_SERVICE_ID, 'price' => '149'],
  133. 'allegro' => ['id' => self::ALLEGRO_SERVICE_ID, 'price' => '29'],
  134. 'leroy_merlin' => ['id' => self::LEROY_MERLIN_SERVICE_ID, 'price' => '49'],
  135. 'wix' => ['id' => self::WIX_SERVICE_ID, 'price' => '129'],
  136. 'carrefour_fr' => ['id' => self::CARREFOUR_FR_SERVICE_ID, 'price' => '29'],
  137. 'wish' => ['id' => self::WISH_SERVICE_ID, 'price' => '49'],
  138. 'cdon' => ['id' => self::CDON_SERVICE_ID, 'price' => '49'],
  139. 'eleclerc' => ['id' => self::ELECLERC_SERVICE_ID, 'price' => '29'],
  140. 'perfumes_club' => ['id' => self::PERFUMESCLUB_SERVICE_ID, 'price' => '0.00001'],
  141. 'amazon_rakuten' => ['id' => self::AMAZON_RAKUTEN_SERVICE_ID, 'price' => '299'],
  142. 'amazon_worten' => ['id' => self::AMAZON_WORTEN_SERVICE_ID, 'price' => '299'],
  143. 'amazon_kaufland' => ['id' => self::AMAZON_KAUFLAND_SERVICE_ID, 'price' => '299'],
  144. 'amazon_fnac' => ['id' => self::AMAZON_FNAC_SERVICE_ID, 'price' => '299'],
  145. 'amazon_eprice' => ['id' => self::AMAZON_EPRICE_SERVICE_ID, 'price' => '0.00001'],
  146. 'amazon_cdon' => ['id' => self::AMAZON_CDON_SERVICE_ID, 'price' => '299'],
  147. 'ebay' => ['id' => self::EBAY_SERVICE_ID, 'price' => '99'],
  148. 'amazon' => ['id' => self::AMAZON_SERVICE_ID, 'price' => '119'],
  149. 'mediamarkt_es' => ['id' => self::MEDIAMARKT_ES_SERVICE_ID, 'price' => '69'],
  150. 'mediamarkt_de' => ['id' => self::MEDIAMARKT_DE_SERVICE_ID, 'price' => '69'],
  151. 'mediamarkt_it' => ['id' => self::MEDIAMARKT_IT_SERVICE_ID, 'price' => '49'],
  152. 'manomano' => ['id' => self::MANOMANO_SERVICE_ID, 'price' => '69'],
  153. 'refurbed' => ['id' => self::REFURBED_SERVICE_ID, 'price' => '49'],
  154. 'backmarket' => ['id' => self::BACKMARKET_SERVICE_ID, 'price' => '49'],
  155. 'sprinter' => ['id' => self::SPRINTER_SERVICE_ID, 'price' => '49'],
  156. 'clubefashion' => ['id' => self::CLUBEFASHION_SERVICE_ID, 'price' => '49'],
  157. 'miravia' => ['id' => self::MIRAVIA_SERVICE_ID, 'price' => '99'],
  158. ];
  159. /**
  160. * @var int
  161. *
  162. * @ORM\Id()
  163. *
  164. * @ORM\GeneratedValue()
  165. *
  166. * @ORM\Column(type="integer", name="id_service_product")
  167. */
  168. private $id;
  169. /**
  170. * @ORM\ManyToOne(targetEntity="App\Entity\System\Service")
  171. *
  172. * @ORM\JoinColumn(name="id_service", referencedColumnName="id_service",referencedColumnName="id_service")
  173. */
  174. private $service;
  175. /**
  176. * @var int
  177. *
  178. * @ORM\Column(type="integer", name="id_product")
  179. */
  180. private $productId;
  181. /**
  182. * @var ServiceProductType
  183. *
  184. * @ORM\ManyToOne(targetEntity="App\Entity\System\ServiceProductType")
  185. *
  186. * @ORM\JoinColumn(nullable=false, name="type")
  187. */
  188. private $type;
  189. public function getId(): int
  190. {
  191. return $this->id;
  192. }
  193. public function setId(int $id): ServiceProduct
  194. {
  195. $this->id = $id;
  196. return $this;
  197. }
  198. public function getService(): Service
  199. {
  200. return $this->service;
  201. }
  202. public function setService($service): ServiceProduct
  203. {
  204. $this->service = $service;
  205. return $this;
  206. }
  207. public function getProductId(): string
  208. {
  209. return $this->productId;
  210. }
  211. public function setProductId(string $productId): ServiceProduct
  212. {
  213. $this->productId = $productId;
  214. return $this;
  215. }
  216. public function getType(): ServiceProductType
  217. {
  218. return $this->type;
  219. }
  220. public function setType(ServiceProductType $type): ServiceProduct
  221. {
  222. $this->type = $type;
  223. return $this;
  224. }
  225. }