package de.avatic.taric.controller;

import de.avatic.taric.model.ConditionType;
import de.avatic.taric.repository.ConditionTypeRepository;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/v1/conditions")
public class ConditionController {

    private final ConditionTypeRepository conditionTypeRepository;

    public ConditionController(ConditionTypeRepository conditionTypeRepository) {
        this.conditionTypeRepository = conditionTypeRepository;
    }

    @GetMapping
    public Iterable<ConditionType> getConditions() {
        return conditionTypeRepository.findAll();
    }
}
