|
@@ -1,16 +1,18 @@
|
|
|
package fr.jaquin.bdlg.planner.domain;
|
|
package fr.jaquin.bdlg.planner.domain;
|
|
|
|
|
|
|
|
import java.time.LocalDateTime;
|
|
import java.time.LocalDateTime;
|
|
|
-
|
|
|
|
|
|
|
+import org.optaplanner.core.api.domain.entity.PlanningEntity;
|
|
|
import org.optaplanner.core.api.domain.variable.PlanningVariable;
|
|
import org.optaplanner.core.api.domain.variable.PlanningVariable;
|
|
|
|
|
|
|
|
|
|
+@PlanningEntity
|
|
|
public class MealAssignement {
|
|
public class MealAssignement {
|
|
|
private int id;
|
|
private int id;
|
|
|
private Volonteer volonteer;
|
|
private Volonteer volonteer;
|
|
|
|
|
|
|
|
@PlanningVariable(valueRangeProviderRefs = "mealslotRange")
|
|
@PlanningVariable(valueRangeProviderRefs = "mealslotRange")
|
|
|
- private MealSlot MealSlot;
|
|
|
|
|
|
|
+ private MealSlot mealSlot;
|
|
|
|
|
|
|
|
|
|
+ public MealAssignement(){}
|
|
|
public MealAssignement(Volonteer volonteer) {
|
|
public MealAssignement(Volonteer volonteer) {
|
|
|
this.volonteer = volonteer;
|
|
this.volonteer = volonteer;
|
|
|
}
|
|
}
|
|
@@ -18,7 +20,7 @@ public class MealAssignement {
|
|
|
public MealAssignement(int id, MealSlot MealSlot, Volonteer volonteer) {
|
|
public MealAssignement(int id, MealSlot MealSlot, Volonteer volonteer) {
|
|
|
this.id = id;
|
|
this.id = id;
|
|
|
this.volonteer = volonteer;
|
|
this.volonteer = volonteer;
|
|
|
- this.MealSlot = MealSlot;
|
|
|
|
|
|
|
+ this.mealSlot = MealSlot;
|
|
|
}
|
|
}
|
|
|
// ********************************
|
|
// ********************************
|
|
|
// Getters and setters
|
|
// Getters and setters
|
|
@@ -37,25 +39,25 @@ public class MealAssignement {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public MealSlot getMealSlot() {
|
|
public MealSlot getMealSlot() {
|
|
|
- return this.MealSlot;
|
|
|
|
|
|
|
+ return this.mealSlot;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void setMealSlot(MealSlot MealSlot) {
|
|
public void setMealSlot(MealSlot MealSlot) {
|
|
|
- this.MealSlot = MealSlot;
|
|
|
|
|
|
|
+ this.mealSlot = MealSlot;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public LocalDateTime getStartDateTime() {
|
|
public LocalDateTime getStartDateTime() {
|
|
|
- if(this.MealSlot==null){
|
|
|
|
|
|
|
+ if(this.mealSlot==null){
|
|
|
return LocalDateTime.MIN;
|
|
return LocalDateTime.MIN;
|
|
|
}
|
|
}
|
|
|
- return this.MealSlot.getStartTime();
|
|
|
|
|
|
|
+ return this.mealSlot.getStartTime();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public LocalDateTime getEndDateTime() {
|
|
public LocalDateTime getEndDateTime() {
|
|
|
- if(this.MealSlot==null){
|
|
|
|
|
|
|
+ if(this.mealSlot==null){
|
|
|
return LocalDateTime.MIN;
|
|
return LocalDateTime.MIN;
|
|
|
}
|
|
}
|
|
|
- return this.MealSlot.getEndTime();
|
|
|
|
|
|
|
+ return this.mealSlot.getEndTime();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|