package br.gov.sigefp.rh.api;

import br.gov.sigefp.rh.api.dto.CareerRegimeDTO;
import br.gov.sigefp.rh.service.CareerRegimeService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/api/rh/career-regimes")
@RequiredArgsConstructor
public class CareerRegimeController {

    private final CareerRegimeService service;

    @GetMapping
    public List<CareerRegimeDTO> findAll() {
        return service.findAll();
    }

    @PostMapping
    public CareerRegimeDTO create(@RequestBody CareerRegimeDTO dto) {
        return service.create(dto);
    }

    @PutMapping("/{id}")
    public CareerRegimeDTO update(@PathVariable java.util.UUID id, @RequestBody CareerRegimeDTO dto) {
        return service.update(id, dto);
    }

    @DeleteMapping("/{id}")
    public void delete(@PathVariable java.util.UUID id) {
        service.delete(id);
    }
}
