backend/buisnesslogic/src/main/java/com/plannaplan/services/ExchangeService.java
Marcin Woźniak b633d2c2df
Checkpoints: WORKS but not for all
Signed-off-by: Marcin Woźniak <y0rune@aol.com>
2021-01-06 16:50:08 +01:00

31 lines
821 B
Java

package com.plannaplan.services;
import java.util.Optional;
import com.plannaplan.entities.Assignment;
import com.plannaplan.entities.Exchange;
import com.plannaplan.entities.Groups;
import com.plannaplan.repositories.ExchangeRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class ExchangeService {
@Autowired
private ExchangeRepository repo;
/**
* @param exchange Instance to save in database
* @return Exchange Instance contains database id
*/
public Exchange save(Exchange exchange){
return this.repo.save(exchange);
}
public Optional<Exchange> checkForExchange(Assignment assignment, Groups group){
return this.repo.checkForExchange(assignment, group);
}
}