<?hh // strict

namespace App\Models;

use DateTime;

class Application
{
    private int $id;
    private int $jobId;
    private int $userId;
    private string $resumeUrl;
    private string $coverLetter;
    private string $status; // 'pending', 'reviewed', 'accepted', 'rejected'
    private string $tenantId;
    private DateTime $createdAt;
    private DateTime $updatedAt;
    
    public function __construct(
        int $id,
        int $jobId,
        int $userId,
        string $resumeUrl,
        string $coverLetter,
        string $status,
        string $tenantId
    ) {
        $this->id = $id;
        $this->jobId = $jobId;
        $this->userId = $userId;
        $this->resumeUrl = $resumeUrl;
        $this->coverLetter = $coverLetter;
        $this->status = $status;
        $this->tenantId = $tenantId;
        $this->createdAt = new DateTime();
        $this->updatedAt = new DateTime();
    }
    
    // Getters
    public function getId(): int
    {
        return $this->id;
    }
    
    public function getJobId(): int
    {
        return $this->jobId;
    }
    
    public function getUserId(): int
    {
        return $this->userId;
    }
    
    public function getResumeUrl(): string
    {
        return $this->resumeUrl;
    }
    
    public function getCoverLetter(): string
    {
        return $this->coverLetter;
    }
    
    public function getStatus(): string
    {
        return $this->status;
    }
    
    public function getTenantId(): string
    {
        return $this->tenantId;
    }
    
    public function getCreatedAt(): DateTime
    {
        return $this->createdAt;
    }
    
    public function getUpdatedAt(): DateTime
    {
        return $this->updatedAt;
    }
    
    // Setters
    public function setResumeUrl(string $resumeUrl): void
    {
        $this->resumeUrl = $resumeUrl;
        $this->updatedAt = new DateTime();
    }
    
    public function setCoverLetter(string $coverLetter): void
    {
        $this->coverLetter = $coverLetter;
        $this->updatedAt = new DateTime();
    }
    
    public function setStatus(string $status): void
    {
        $this->status = $status;
        $this->updatedAt = new DateTime();
    }
}