]> WPIA git - gigi.git/blobdiff - src/org/cacert/gigi/dbObjects/Assurance.java
upd: cleanup SQL statements to make them statically verifiable.
[gigi.git] / src / org / cacert / gigi / dbObjects / Assurance.java
index 65a5a59945e98deb1a0f42a57bf322540eb6825d..33dbf1ed5e26fcfbcf593214906b3332467aff7f 100644 (file)
@@ -1,11 +1,12 @@
 package org.cacert.gigi.dbObjects;
 
+import org.cacert.gigi.database.DBEnum;
 import org.cacert.gigi.dbObjects.wrappers.DataContainer;
 
 @DataContainer
 public class Assurance {
 
-    public enum AssuranceType {
+    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;
@@ -17,13 +18,18 @@ public class Assurance {
         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;
 
@@ -33,7 +39,9 @@ public class Assurance {
 
     private String date;
 
-    public Assurance(int id, User from, User to, String location, String method, int points, String 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;
@@ -41,6 +49,7 @@ public class Assurance {
         this.method = method;
         this.points = points;
         this.date = date;
+        this.country = country;
 
     }
 
@@ -60,7 +69,7 @@ public class Assurance {
         return points;
     }
 
-    public User getTo() {
+    public Name getTo() {
         return to;
     }
 
@@ -72,4 +81,7 @@ public class Assurance {
         return date;
     }
 
+    public Country getCountry() {
+        return country;
+    }
 }