package de.assecutor.votianlt.pages.service;

import de.assecutor.votianlt.model.Company;
import de.assecutor.votianlt.pages.domain.AddCompanyRepository;
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 AddCompanyService {
    private final AddCompanyRepository addCompanyRepository;

    AddCompanyService(AddCompanyRepository addCompanyRepository) {
        this.addCompanyRepository = addCompanyRepository;
    }

    public void addCompany(Company company) {
        addCompanyRepository.save(company);
    }
}
