package de.assecutor.votianlt.pages.service;

import de.assecutor.votianlt.model.User;
import de.assecutor.votianlt.pages.domain.RegisterRepository;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional(propagation = Propagation.REQUIRES_NEW)
public class RegisterService {

    private final RegisterRepository registerRepository;

    RegisterService(RegisterRepository registerRepository) {
        this.registerRepository = registerRepository;
    }

    public void registerUser(User user) {
        registerRepository.save(user);
    }
}
