]> WPIA git - gigi.git/blobdiff - src/org/cacert/gigi/dbObjects/Assurance.java
general cleanup
[gigi.git] / src / org / cacert / gigi / dbObjects / Assurance.java
index b1c9ccd507c79fc4981ea7d364ff8280e67a7f79..8f172e51a62f98aafd0d381fcc2b3b6400b3544c 100644 (file)
@@ -1,10 +1,24 @@
 package org.cacert.gigi.dbObjects;
 
-import java.sql.ResultSet;
-import java.sql.SQLException;
-
+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");
+
+        private final String description;
+
+        private AssuranceType(String description) {
+            this.description = description;
+        }
+
+        public String getDescription() {
+            return description;
+        }
+    }
+
     private int id;
 
     private User from;
@@ -19,15 +33,15 @@ public class Assurance {
 
     private String date;
 
-    public Assurance(ResultSet result) throws SQLException {
-        super();
-        this.id = result.getInt("id");
-        this.from = User.getById(result.getInt("from"));
-        this.to = User.getById(result.getInt("to"));
-        this.location = result.getString("location");
-        this.method = result.getString("method");
-        this.points = result.getInt("points");
-        this.date = result.getString("date");
+    public Assurance(int id, User from, User to, String location, String method, int points, String date) {
+        this.id = id;
+        this.from = from;
+        this.to = to;
+        this.location = location;
+        this.method = method;
+        this.points = points;
+        this.date = date;
+
     }
 
     public User getFrom() {