Add Member, MemberCase, and UserCase and associated repositories

This commit is contained in:
2024-12-08 17:07:16 -05:00
parent 49c033f3b8
commit 1f82c8006f
6 changed files with 1012 additions and 0 deletions

360
src/Entity/MemberCase.php Normal file
View File

@ -0,0 +1,360 @@
<?php
namespace App\Entity;
use App\Enums\CaseLevel;
use App\Enums\County;
use App\Repository\MemberCaseRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Types\UuidType;
use Symfony\Component\Uid\Uuid;
#[ORM\Entity(repositoryClass: MemberCaseRepository::class)]
class MemberCase
{
#[ORM\Id]
#[ORM\Column(type: UuidType::NAME, unique: true)]
#[ORM\GeneratedValue(strategy: 'CUSTOM')]
#[ORM\CustomIdGenerator(class: 'doctrine.uuid_generator')]
private ?Uuid $id = null;
#[ORM\Column(length: 15)]
private ?string $caseNumber = null;
#[ORM\Column(length: 45)]
private ?string $firstName = null;
#[ORM\Column(length: 45)]
private ?string $lastName = null;
#[ORM\Column(length: 45)]
private ?string $referralType = null;
#[ORM\ManyToOne]
#[ORM\JoinColumn(nullable: false)]
private ?ReferralSource $referralSource = null;
#[ORM\ManyToOne]
private ?ReferralSource $referralSource2 = null;
#[ORM\Column(type: Types::DATE_MUTABLE, nullable: true)]
private ?\DateTimeInterface $admitDate = null;
#[ORM\Column(type: Types::DATE_MUTABLE, nullable: true)]
private ?\DateTimeInterface $closeDate = null;
#[ORM\Column(length: 15, nullable: true)]
private ?string $dcsCaseId = null;
#[ORM\Column(length: 45, nullable: true)]
private ?string $insurance = null;
#[ORM\Column(length: 45, nullable: true)]
private ?string $medicaid = null;
#[ORM\Column(length: 64, nullable: true)]
private ?string $caseEmail = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $address = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $address2 = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $city = null;
#[ORM\Column(length: 10, nullable: true)]
private ?string $state = null;
#[ORM\Column(nullable: true)]
private ?int $zip = null;
#[ORM\Column(enumType: County::class)]
private ?County $county = null;
#[ORM\Column(enumType: CaseLevel::class)]
private ?CaseLevel $level = null;
/**
* @var Collection<int, UserCase>
*/
#[ORM\OneToMany(targetEntity: UserCase::class, mappedBy: 'memberCase')]
private Collection $userCases;
public function __construct()
{
$this->userCases = new ArrayCollection();
}
public function getId(): ?Uuid
{
return $this->id;
}
public function getCaseNumber(): ?string
{
return $this->caseNumber;
}
public function setCaseNumber(string $caseNumber): static
{
$this->caseNumber = $caseNumber;
return $this;
}
public function getFirstName(): ?string
{
return $this->firstName;
}
public function setFirstName(string $firstName): static
{
$this->firstName = $firstName;
return $this;
}
public function getLastName(): ?string
{
return $this->lastName;
}
public function setLastName(string $lastName): static
{
$this->lastName = $lastName;
return $this;
}
public function getCaseName(): string
{
return "{$this->lastName}, {$this->firstName}";
}
public function getReferralType(): ?string
{
return $this->referralType;
}
public function setReferralType(string $referralType): static
{
$this->referralType = $referralType;
return $this;
}
public function getReferralSource(): ?ReferralSource
{
return $this->referralSource;
}
public function setReferralSource(?ReferralSource $referralSource): static
{
$this->referralSource = $referralSource;
return $this;
}
public function getReferralSource2(): ?ReferralSource
{
return $this->referralSource2;
}
public function setReferralSource2(?ReferralSource $referralSource2): static
{
$this->referralSource2 = $referralSource2;
return $this;
}
public function getAdmitDate(): ?\DateTimeInterface
{
return $this->admitDate;
}
public function setAdmitDate(?\DateTimeInterface $admitDate): static
{
$this->admitDate = $admitDate;
return $this;
}
public function getCloseDate(): ?\DateTimeInterface
{
return $this->closeDate;
}
public function setCloseDate(?\DateTimeInterface $closeDate): static
{
$this->closeDate = $closeDate;
return $this;
}
public function getDcsCaseId(): ?int
{
return $this->dcsCaseId;
}
public function setDcsCaseId(?int $dcsCaseId): static
{
$this->dcsCaseId = $dcsCaseId;
return $this;
}
public function getInsurance(): ?string
{
return $this->insurance;
}
public function setInsurance(?string $insurance): static
{
$this->insurance = $insurance;
return $this;
}
public function getMedicaid(): ?string
{
return $this->medicaid;
}
public function setMedicaid(?string $medicaid): static
{
$this->medicaid = $medicaid;
return $this;
}
public function getCaseEmail(): ?string
{
return $this->caseEmail;
}
public function setCaseEmail(?string $caseEmail): static
{
$this->caseEmail = $caseEmail;
return $this;
}
public function getAddress(): ?string
{
return $this->address;
}
public function setAddress(?string $address): static
{
$this->address = $address;
return $this;
}
public function getCounty(): ?County
{
return $this->county;
}
public function setCounty(County $county): static
{
$this->county = $county;
return $this;
}
public function getLevel(): ?CaseLevel
{
return $this->level;
}
public function setLevel(CaseLevel $level): static
{
$this->level = $level;
return $this;
}
public function getAddress2(): ?string
{
return $this->address2;
}
public function setAddress2(?string $address2): static
{
$this->address2 = $address2;
return $this;
}
public function getCity(): ?string
{
return $this->city;
}
public function setCity(?string $city): static
{
$this->city = $city;
return $this;
}
public function getState(): ?string
{
return $this->state;
}
public function setState(?string $state): static
{
$this->state = $state;
return $this;
}
public function getZip(): ?int
{
return $this->zip;
}
public function setZip(?int $zip): static
{
$this->zip = $zip;
return $this;
}
/**
* @return Collection<int, UserCase>
*/
public function getUserCases(): Collection
{
return $this->userCases;
}
public function addUserCase(UserCase $userCase): static
{
if (!$this->userCases->contains($userCase)) {
$this->userCases->add($userCase);
$userCase->setMemberCase($this);
}
return $this;
}
public function removeUserCase(UserCase $userCase): static
{
if ($this->userCases->removeElement($userCase)) {
// set the owning side to null (unless already changed)
if ($userCase->getMemberCase() === $this) {
$userCase->setMemberCase(null);
}
}
return $this;
}
}