src/JanusHercules/RecurrentJobsCheapSearch/Domain/Entity/CheapSearchRecurrentJob.php line 19

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace JanusHercules\RecurrentJobsCheapSearch\Domain\Entity;
  4. use DateTime;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7. * Denormalized, pre-computed data structure for cheap/fast MariaDB-based job search.
  8. * This table is populated via sync command and swapped atomically for zero-downtime updates.
  9. */
  10. #[ORM\Entity]
  11. #[ORM\Table(name: 'cheap_search_recurrent_jobs')]
  12. #[ORM\Index(name: 'csrj_status_locked_paused_idx', columns: ['status', 'is_locked', 'profile_paused_since'])]
  13. #[ORM\Index(name: 'csrj_effective_zipcode_idx', columns: ['effective_zipcode'])]
  14. #[ORM\Index(name: 'csrj_freshness_date_idx', columns: ['freshness_date'])]
  15. class CheapSearchRecurrentJob
  16. {
  17. #[ORM\Id]
  18. #[ORM\Column(name: 'recurrent_job_id', type: 'string', length: 36)]
  19. private string $recurrentJobId;
  20. /**
  21. * Cleaned searchterm for FULLTEXT matching (gender suffixes, prices, years removed).
  22. */
  23. #[ORM\Column(name: 'occupational_field_searchterm', type: 'string', length: 1024)]
  24. private string $occupationalFieldSearchterm;
  25. #[ORM\Column(name: 'title', type: 'string', length: 512)]
  26. private string $title;
  27. #[ORM\Column(name: 'company_name', type: 'string', length: 255)]
  28. private string $companyName;
  29. /**
  30. * COALESCE(recurrent_jobs.zipcode, jobofferer_profiles.zipcode).
  31. */
  32. #[ORM\Column(name: 'effective_zipcode', type: 'string', length: 8)]
  33. private string $effectiveZipcode;
  34. /**
  35. * Pre-computed zipcodes within 1km (comma-separated).
  36. */
  37. #[ORM\Column(name: 'zipcode_radius_1', type: 'text')]
  38. private string $zipcodeRadius1;
  39. /**
  40. * Pre-computed zipcodes within 2km (comma-separated).
  41. */
  42. #[ORM\Column(name: 'zipcode_radius_2', type: 'text')]
  43. private string $zipcodeRadius2;
  44. /**
  45. * Pre-computed zipcodes within 5km (comma-separated).
  46. */
  47. #[ORM\Column(name: 'zipcode_radius_5', type: 'text')]
  48. private string $zipcodeRadius5;
  49. /**
  50. * Pre-computed zipcodes within 10km (comma-separated).
  51. */
  52. #[ORM\Column(name: 'zipcode_radius_10', type: 'text')]
  53. private string $zipcodeRadius10;
  54. /**
  55. * Pre-computed zipcodes within 15km (comma-separated).
  56. */
  57. #[ORM\Column(name: 'zipcode_radius_15', type: 'text')]
  58. private string $zipcodeRadius15;
  59. /**
  60. * Pre-computed zipcodes within 20km (comma-separated).
  61. */
  62. #[ORM\Column(name: 'zipcode_radius_20', type: 'text')]
  63. private string $zipcodeRadius20;
  64. /**
  65. * Pre-computed zipcodes within 30km (comma-separated).
  66. */
  67. #[ORM\Column(name: 'zipcode_radius_30', type: 'text')]
  68. private string $zipcodeRadius30;
  69. /**
  70. * Pre-computed zipcodes within 50km (comma-separated).
  71. */
  72. #[ORM\Column(name: 'zipcode_radius_50', type: 'text')]
  73. private string $zipcodeRadius50;
  74. /**
  75. * Pre-computed zipcodes within 100km (comma-separated).
  76. */
  77. #[ORM\Column(name: 'zipcode_radius_100', type: 'text')]
  78. private string $zipcodeRadius100;
  79. /**
  80. * Pre-computed zipcodes within 200km (comma-separated).
  81. */
  82. #[ORM\Column(name: 'zipcode_radius_200', type: 'text')]
  83. private string $zipcodeRadius200;
  84. /**
  85. * Comma-separated integers (e.g., "1,2").
  86. */
  87. #[ORM\Column(name: 'career_levels', type: 'string', length: 32)]
  88. private string $careerLevels;
  89. /**
  90. * Comma-separated integers (e.g., "0,1,2,3").
  91. */
  92. #[ORM\Column(name: 'employment_types', type: 'string', length: 32)]
  93. private string $employmentTypes;
  94. /**
  95. * RecurrentJob status (1 = active).
  96. */
  97. #[ORM\Column(name: 'status', type: 'smallint')]
  98. private int $status;
  99. /**
  100. * Denormalized from users.is_locked_by_admin.
  101. */
  102. #[ORM\Column(name: 'is_locked', type: 'boolean')]
  103. private bool $isLocked;
  104. #[ORM\Column(name: 'profile_paused_since', type: 'datetime', nullable: true)]
  105. private ?DateTime $profilePausedSince;
  106. #[ORM\Column(name: 'freshness_date', type: 'datetime', nullable: true)]
  107. private ?DateTime $freshnessDate;
  108. #[ORM\Column(name: 'profile_lastseen_at', type: 'datetime', nullable: true)]
  109. private ?DateTime $profileLastseenAt;
  110. public function getRecurrentJobId(): string
  111. {
  112. return $this->recurrentJobId;
  113. }
  114. public function setRecurrentJobId(string $recurrentJobId): self
  115. {
  116. $this->recurrentJobId = $recurrentJobId;
  117. return $this;
  118. }
  119. public function getOccupationalFieldSearchterm(): string
  120. {
  121. return $this->occupationalFieldSearchterm;
  122. }
  123. public function setOccupationalFieldSearchterm(string $occupationalFieldSearchterm): self
  124. {
  125. $this->occupationalFieldSearchterm = $occupationalFieldSearchterm;
  126. return $this;
  127. }
  128. public function getTitle(): string
  129. {
  130. return $this->title;
  131. }
  132. public function setTitle(string $title): self
  133. {
  134. $this->title = $title;
  135. return $this;
  136. }
  137. public function getCompanyName(): string
  138. {
  139. return $this->companyName;
  140. }
  141. public function setCompanyName(string $companyName): self
  142. {
  143. $this->companyName = $companyName;
  144. return $this;
  145. }
  146. public function getEffectiveZipcode(): string
  147. {
  148. return $this->effectiveZipcode;
  149. }
  150. public function setEffectiveZipcode(string $effectiveZipcode): self
  151. {
  152. $this->effectiveZipcode = $effectiveZipcode;
  153. return $this;
  154. }
  155. public function getZipcodeRadius1(): string
  156. {
  157. return $this->zipcodeRadius1;
  158. }
  159. public function setZipcodeRadius1(string $zipcodeRadius1): self
  160. {
  161. $this->zipcodeRadius1 = $zipcodeRadius1;
  162. return $this;
  163. }
  164. public function getZipcodeRadius2(): string
  165. {
  166. return $this->zipcodeRadius2;
  167. }
  168. public function setZipcodeRadius2(string $zipcodeRadius2): self
  169. {
  170. $this->zipcodeRadius2 = $zipcodeRadius2;
  171. return $this;
  172. }
  173. public function getZipcodeRadius5(): string
  174. {
  175. return $this->zipcodeRadius5;
  176. }
  177. public function setZipcodeRadius5(string $zipcodeRadius5): self
  178. {
  179. $this->zipcodeRadius5 = $zipcodeRadius5;
  180. return $this;
  181. }
  182. public function getZipcodeRadius10(): string
  183. {
  184. return $this->zipcodeRadius10;
  185. }
  186. public function setZipcodeRadius10(string $zipcodeRadius10): self
  187. {
  188. $this->zipcodeRadius10 = $zipcodeRadius10;
  189. return $this;
  190. }
  191. public function getZipcodeRadius15(): string
  192. {
  193. return $this->zipcodeRadius15;
  194. }
  195. public function setZipcodeRadius15(string $zipcodeRadius15): self
  196. {
  197. $this->zipcodeRadius15 = $zipcodeRadius15;
  198. return $this;
  199. }
  200. public function getZipcodeRadius20(): string
  201. {
  202. return $this->zipcodeRadius20;
  203. }
  204. public function setZipcodeRadius20(string $zipcodeRadius20): self
  205. {
  206. $this->zipcodeRadius20 = $zipcodeRadius20;
  207. return $this;
  208. }
  209. public function getZipcodeRadius30(): string
  210. {
  211. return $this->zipcodeRadius30;
  212. }
  213. public function setZipcodeRadius30(string $zipcodeRadius30): self
  214. {
  215. $this->zipcodeRadius30 = $zipcodeRadius30;
  216. return $this;
  217. }
  218. public function getZipcodeRadius50(): string
  219. {
  220. return $this->zipcodeRadius50;
  221. }
  222. public function setZipcodeRadius50(string $zipcodeRadius50): self
  223. {
  224. $this->zipcodeRadius50 = $zipcodeRadius50;
  225. return $this;
  226. }
  227. public function getZipcodeRadius100(): string
  228. {
  229. return $this->zipcodeRadius100;
  230. }
  231. public function setZipcodeRadius100(string $zipcodeRadius100): self
  232. {
  233. $this->zipcodeRadius100 = $zipcodeRadius100;
  234. return $this;
  235. }
  236. public function getZipcodeRadius200(): string
  237. {
  238. return $this->zipcodeRadius200;
  239. }
  240. public function setZipcodeRadius200(string $zipcodeRadius200): self
  241. {
  242. $this->zipcodeRadius200 = $zipcodeRadius200;
  243. return $this;
  244. }
  245. public function getCareerLevels(): string
  246. {
  247. return $this->careerLevels;
  248. }
  249. public function setCareerLevels(string $careerLevels): self
  250. {
  251. $this->careerLevels = $careerLevels;
  252. return $this;
  253. }
  254. public function getEmploymentTypes(): string
  255. {
  256. return $this->employmentTypes;
  257. }
  258. public function setEmploymentTypes(string $employmentTypes): self
  259. {
  260. $this->employmentTypes = $employmentTypes;
  261. return $this;
  262. }
  263. public function getStatus(): int
  264. {
  265. return $this->status;
  266. }
  267. public function setStatus(int $status): self
  268. {
  269. $this->status = $status;
  270. return $this;
  271. }
  272. public function isLocked(): bool
  273. {
  274. return $this->isLocked;
  275. }
  276. public function setIsLocked(bool $isLocked): self
  277. {
  278. $this->isLocked = $isLocked;
  279. return $this;
  280. }
  281. public function getProfilePausedSince(): ?DateTime
  282. {
  283. return $this->profilePausedSince;
  284. }
  285. public function setProfilePausedSince(?DateTime $profilePausedSince): self
  286. {
  287. $this->profilePausedSince = $profilePausedSince;
  288. return $this;
  289. }
  290. public function getFreshnessDate(): ?DateTime
  291. {
  292. return $this->freshnessDate;
  293. }
  294. public function setFreshnessDate(?DateTime $freshnessDate): self
  295. {
  296. $this->freshnessDate = $freshnessDate;
  297. return $this;
  298. }
  299. public function getProfileLastseenAt(): ?DateTime
  300. {
  301. return $this->profileLastseenAt;
  302. }
  303. public function setProfileLastseenAt(?DateTime $profileLastseenAt): self
  304. {
  305. $this->profileLastseenAt = $profileLastseenAt;
  306. return $this;
  307. }
  308. }