package ru.somecompany.controller;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RestController;
import ru.somecompany.domain.CreateVacancyRequest;
import ru.somecompany.domain.VacancyEntity;
import ru.somecompany.domain.VacancyResponse;
import ru.somecompany.service.VacancyService;

import java.util.List;
import java.util.UUID;

@Slf4j
@RestController
@RequiredArgsConstructor
public class VacancyControllerImpl implements VacancyController {

    private final VacancyService vacancyService;

    @Override
    public List<VacancyEntity> getVacancies() {
        return vacancyService.getVacancies();
    }

    @Override
    public VacancyEntity createVacancy(CreateVacancyRequest request) {
        return vacancyService.createVacancy(request);
    }

    @Override
    public VacancyResponse getVacancy(UUID vacancyId) {
        return vacancyService.getVacancy(vacancyId);
    }

    @Override
    public VacancyEntity updateVacancy(UUID vacancyId, CreateVacancyRequest request) {
        return vacancyService.updateVacancy(vacancyId, request);
    }

    @Override
    public void deleteVacancy(UUID vacancyId) {
        vacancyService.deleteVacancy(vacancyId);
    }
}
