<?php
declare(strict_types=1);
namespace JanusHercules\RecurrentJobsCheapSearch\Domain\Entity;
use DateTime;
use Doctrine\ORM\Mapping as ORM;
/**
* Denormalized, pre-computed data structure for cheap/fast MariaDB-based job search.
* This table is populated via sync command and swapped atomically for zero-downtime updates.
*/
#[ORM\Entity]
#[ORM\Table(name: 'cheap_search_recurrent_jobs')]
#[ORM\Index(name: 'csrj_status_locked_paused_idx', columns: ['status', 'is_locked', 'profile_paused_since'])]
#[ORM\Index(name: 'csrj_effective_zipcode_idx', columns: ['effective_zipcode'])]
#[ORM\Index(name: 'csrj_freshness_date_idx', columns: ['freshness_date'])]
class CheapSearchRecurrentJob
{
#[ORM\Id]
#[ORM\Column(name: 'recurrent_job_id', type: 'string', length: 36)]
private string $recurrentJobId;
/**
* Cleaned searchterm for FULLTEXT matching (gender suffixes, prices, years removed).
*/
#[ORM\Column(name: 'occupational_field_searchterm', type: 'string', length: 1024)]
private string $occupationalFieldSearchterm;
#[ORM\Column(name: 'title', type: 'string', length: 512)]
private string $title;
#[ORM\Column(name: 'company_name', type: 'string', length: 255)]
private string $companyName;
/**
* COALESCE(recurrent_jobs.zipcode, jobofferer_profiles.zipcode).
*/
#[ORM\Column(name: 'effective_zipcode', type: 'string', length: 8)]
private string $effectiveZipcode;
/**
* Pre-computed zipcodes within 1km (comma-separated).
*/
#[ORM\Column(name: 'zipcode_radius_1', type: 'text')]
private string $zipcodeRadius1;
/**
* Pre-computed zipcodes within 2km (comma-separated).
*/
#[ORM\Column(name: 'zipcode_radius_2', type: 'text')]
private string $zipcodeRadius2;
/**
* Pre-computed zipcodes within 5km (comma-separated).
*/
#[ORM\Column(name: 'zipcode_radius_5', type: 'text')]
private string $zipcodeRadius5;
/**
* Pre-computed zipcodes within 10km (comma-separated).
*/
#[ORM\Column(name: 'zipcode_radius_10', type: 'text')]
private string $zipcodeRadius10;
/**
* Pre-computed zipcodes within 15km (comma-separated).
*/
#[ORM\Column(name: 'zipcode_radius_15', type: 'text')]
private string $zipcodeRadius15;
/**
* Pre-computed zipcodes within 20km (comma-separated).
*/
#[ORM\Column(name: 'zipcode_radius_20', type: 'text')]
private string $zipcodeRadius20;
/**
* Pre-computed zipcodes within 30km (comma-separated).
*/
#[ORM\Column(name: 'zipcode_radius_30', type: 'text')]
private string $zipcodeRadius30;
/**
* Pre-computed zipcodes within 50km (comma-separated).
*/
#[ORM\Column(name: 'zipcode_radius_50', type: 'text')]
private string $zipcodeRadius50;
/**
* Pre-computed zipcodes within 100km (comma-separated).
*/
#[ORM\Column(name: 'zipcode_radius_100', type: 'text')]
private string $zipcodeRadius100;
/**
* Pre-computed zipcodes within 200km (comma-separated).
*/
#[ORM\Column(name: 'zipcode_radius_200', type: 'text')]
private string $zipcodeRadius200;
/**
* Comma-separated integers (e.g., "1,2").
*/
#[ORM\Column(name: 'career_levels', type: 'string', length: 32)]
private string $careerLevels;
/**
* Comma-separated integers (e.g., "0,1,2,3").
*/
#[ORM\Column(name: 'employment_types', type: 'string', length: 32)]
private string $employmentTypes;
/**
* RecurrentJob status (1 = active).
*/
#[ORM\Column(name: 'status', type: 'smallint')]
private int $status;
/**
* Denormalized from users.is_locked_by_admin.
*/
#[ORM\Column(name: 'is_locked', type: 'boolean')]
private bool $isLocked;
#[ORM\Column(name: 'profile_paused_since', type: 'datetime', nullable: true)]
private ?DateTime $profilePausedSince;
#[ORM\Column(name: 'freshness_date', type: 'datetime', nullable: true)]
private ?DateTime $freshnessDate;
#[ORM\Column(name: 'profile_lastseen_at', type: 'datetime', nullable: true)]
private ?DateTime $profileLastseenAt;
public function getRecurrentJobId(): string
{
return $this->recurrentJobId;
}
public function setRecurrentJobId(string $recurrentJobId): self
{
$this->recurrentJobId = $recurrentJobId;
return $this;
}
public function getOccupationalFieldSearchterm(): string
{
return $this->occupationalFieldSearchterm;
}
public function setOccupationalFieldSearchterm(string $occupationalFieldSearchterm): self
{
$this->occupationalFieldSearchterm = $occupationalFieldSearchterm;
return $this;
}
public function getTitle(): string
{
return $this->title;
}
public function setTitle(string $title): self
{
$this->title = $title;
return $this;
}
public function getCompanyName(): string
{
return $this->companyName;
}
public function setCompanyName(string $companyName): self
{
$this->companyName = $companyName;
return $this;
}
public function getEffectiveZipcode(): string
{
return $this->effectiveZipcode;
}
public function setEffectiveZipcode(string $effectiveZipcode): self
{
$this->effectiveZipcode = $effectiveZipcode;
return $this;
}
public function getZipcodeRadius1(): string
{
return $this->zipcodeRadius1;
}
public function setZipcodeRadius1(string $zipcodeRadius1): self
{
$this->zipcodeRadius1 = $zipcodeRadius1;
return $this;
}
public function getZipcodeRadius2(): string
{
return $this->zipcodeRadius2;
}
public function setZipcodeRadius2(string $zipcodeRadius2): self
{
$this->zipcodeRadius2 = $zipcodeRadius2;
return $this;
}
public function getZipcodeRadius5(): string
{
return $this->zipcodeRadius5;
}
public function setZipcodeRadius5(string $zipcodeRadius5): self
{
$this->zipcodeRadius5 = $zipcodeRadius5;
return $this;
}
public function getZipcodeRadius10(): string
{
return $this->zipcodeRadius10;
}
public function setZipcodeRadius10(string $zipcodeRadius10): self
{
$this->zipcodeRadius10 = $zipcodeRadius10;
return $this;
}
public function getZipcodeRadius15(): string
{
return $this->zipcodeRadius15;
}
public function setZipcodeRadius15(string $zipcodeRadius15): self
{
$this->zipcodeRadius15 = $zipcodeRadius15;
return $this;
}
public function getZipcodeRadius20(): string
{
return $this->zipcodeRadius20;
}
public function setZipcodeRadius20(string $zipcodeRadius20): self
{
$this->zipcodeRadius20 = $zipcodeRadius20;
return $this;
}
public function getZipcodeRadius30(): string
{
return $this->zipcodeRadius30;
}
public function setZipcodeRadius30(string $zipcodeRadius30): self
{
$this->zipcodeRadius30 = $zipcodeRadius30;
return $this;
}
public function getZipcodeRadius50(): string
{
return $this->zipcodeRadius50;
}
public function setZipcodeRadius50(string $zipcodeRadius50): self
{
$this->zipcodeRadius50 = $zipcodeRadius50;
return $this;
}
public function getZipcodeRadius100(): string
{
return $this->zipcodeRadius100;
}
public function setZipcodeRadius100(string $zipcodeRadius100): self
{
$this->zipcodeRadius100 = $zipcodeRadius100;
return $this;
}
public function getZipcodeRadius200(): string
{
return $this->zipcodeRadius200;
}
public function setZipcodeRadius200(string $zipcodeRadius200): self
{
$this->zipcodeRadius200 = $zipcodeRadius200;
return $this;
}
public function getCareerLevels(): string
{
return $this->careerLevels;
}
public function setCareerLevels(string $careerLevels): self
{
$this->careerLevels = $careerLevels;
return $this;
}
public function getEmploymentTypes(): string
{
return $this->employmentTypes;
}
public function setEmploymentTypes(string $employmentTypes): self
{
$this->employmentTypes = $employmentTypes;
return $this;
}
public function getStatus(): int
{
return $this->status;
}
public function setStatus(int $status): self
{
$this->status = $status;
return $this;
}
public function isLocked(): bool
{
return $this->isLocked;
}
public function setIsLocked(bool $isLocked): self
{
$this->isLocked = $isLocked;
return $this;
}
public function getProfilePausedSince(): ?DateTime
{
return $this->profilePausedSince;
}
public function setProfilePausedSince(?DateTime $profilePausedSince): self
{
$this->profilePausedSince = $profilePausedSince;
return $this;
}
public function getFreshnessDate(): ?DateTime
{
return $this->freshnessDate;
}
public function setFreshnessDate(?DateTime $freshnessDate): self
{
$this->freshnessDate = $freshnessDate;
return $this;
}
public function getProfileLastseenAt(): ?DateTime
{
return $this->profileLastseenAt;
}
public function setProfileLastseenAt(?DateTime $profileLastseenAt): self
{
$this->profileLastseenAt = $profileLastseenAt;
return $this;
}
}