package com.alterdekim.game.service;

import com.alterdekim.game.entity.Miniquest;
import com.alterdekim.game.repository.MiniquestRepository;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

@AllArgsConstructor
@Service
public class MiniquestService {
    private final MiniquestRepository repository;

    public List<Miniquest> getAllMiniquests() {
        return repository.findAll();
    }

    public Miniquest getMiniquestById(long id) {
        return repository.findById(id).orElse(null);
    }

    public void removeById(long id) {
        repository.deleteById(id);
    }

    public void saveMiniquest(Miniquest miniquest) {
        repository.save(miniquest);
    }
}
