package com.devjob.dto;

import com.devjob.domain.Job;
import com.devjob.domain.JobStatus;

public record JobResponse(
        Long id,
        Long companyId,
        String title,
        String description,
        Integer salary,
        JobStatus status
) {

    public static JobResponse from(Job job) {
        return new JobResponse(
                job.getId(),
                job.getCompany().getId(),
                job.getTitle(),
                job.getDescription(),
                job.getSalary(),
                job.getStatus()
        );
    }
}
