Checkpoint: Added docs, improved ExchangeEntity

This commit is contained in:
y0rune committed 2021-01-06 17:12:20 +01:00
1 parent b633d2c2df
commit 90f154f23b
3 files changed
+8 -3

No files matched your search

@@ -18,7 +18,7 @@ public class Exchange {
private Long id;
@OneToOne
@JoinColumn(name = "owned_id")
@JoinColumn(name = "owned_id", unique = true)
private Assignment ownedAssignment;
@OneToOne
@@ -24,6 +24,12 @@ public class ExchangeService {
return this.repo.save(exchange);
}
/**
* @param assignment Assignment to trade for
* @param group Desired group
* @return Optional with Exchange if exist
*/
public Optional<Exchange> checkForExchange(Assignment assignment, Groups group){
return this.repo.checkForExchange(assignment, group);
}