package org.cacert.gigi.dbObjects;
-import org.cacert.gigi.database.GigiResultSet;
+import org.cacert.gigi.database.DBEnum;
import org.cacert.gigi.dbObjects.wrappers.DataContainer;
@DataContainer
public class Assurance {
- public enum AssuranceType {
- FACE_TO_FACE("Face to Face Meeting"), TOPUP("TOPUP"), TTP_ASSISTED("TTP-Assisted");
+ public enum AssuranceType implements DBEnum {
+ FACE_TO_FACE("Face to Face Meeting"), TOPUP("TOPUP"), TTP_ASSISTED("TTP-Assisted"), NUCLEUS("Nucleus Bonus");
private final String description;
public String getDescription() {
return description;
}
+
+ @Override
+ public String getDBName() {
+ return description;
+ }
}
private int id;
private User from;
- private User to;
+ private Name to;
private String location;
private String date;
- public Assurance(GigiResultSet res) {
- super();
- this.id = res.getInt("id");
- this.from = User.getById(res.getInt("from"));
- this.to = User.getById(res.getInt("to"));
- this.location = res.getString("location");
- this.method = res.getString("method");
- this.points = res.getInt("points");
- this.date = res.getString("date");
+ private Country country;
+
+ public Assurance(int id, User from, Name to, String location, String method, int points, String date, Country country) {
+ this.id = id;
+ this.from = from;
+ this.to = to;
+ this.location = location;
+ this.method = method;
+ this.points = points;
+ this.date = date;
+ this.country = country;
+
}
public User getFrom() {
return points;
}
- public User getTo() {
+ public Name getTo() {
return to;
}
return date;
}
+ public Country getCountry() {
+ return country;
+ }
}