package ru.somecompany.controller;

import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.RestController;
import ru.somecompany.domain.CompanyEntity;
import ru.somecompany.domain.CreateCompanyRequest;
import ru.somecompany.service.CompanyService;

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

@RestController
@RequiredArgsConstructor
public class CompanyControllerImpl implements CompanyController {

    private final CompanyService companyService;

    @Override
    public List<CompanyEntity> getCompanies() {
        return companyService.getCompanies();
    }

    @Override
    public CompanyEntity createCompany(CreateCompanyRequest companyRequest) {
        return companyService.createCompany(companyRequest);
    }

    @Override
    public CompanyEntity getCompany(UUID companyId) {
        return companyService.getCompany(companyId);
    }

    @Override
    public CompanyEntity updateCompany(UUID companyId, CreateCompanyRequest companyRequest) {
        return companyService.updateCompany(companyId, companyRequest);
    }

    @Override
    public void deleteCompany(UUID companyId) {
        companyService.deleteCompany(companyId);
    }
}
