X-Git-Url: https://code.wpia.club/?p=gigi.git;a=blobdiff_plain;f=src%2Forg%2Fcacert%2Fgigi%2FdbObjects%2FAssurance.java;h=486b5a340d2b468010a9d16d9564c3da422d7ac4;hp=d4ebe333089cbcdc2ca86774b75bd20802535574;hb=b59c37e88149d0463ab4b802cacb6f0ea883acfb;hpb=3e123160ad59a2e1162518923965562ff947b6d1 diff --git a/src/org/cacert/gigi/dbObjects/Assurance.java b/src/org/cacert/gigi/dbObjects/Assurance.java index d4ebe333..486b5a34 100644 --- a/src/org/cacert/gigi/dbObjects/Assurance.java +++ b/src/org/cacert/gigi/dbObjects/Assurance.java @@ -1,14 +1,29 @@ package org.cacert.gigi.dbObjects; -import org.cacert.gigi.database.GigiResultSet; +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"), NUCLEUS("Nucleus Bonus"); + + private final String description; + + private AssuranceType(String description) { + this.description = description; + } + + public String getDescription() { + return description; + } + } + private int id; private User from; - private User to; + private Name to; private String location; @@ -18,15 +33,18 @@ public class Assurance { 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 CountryCode country; + + public Assurance(int id, User from, Name to, String location, String method, int points, String date, CountryCode 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() { @@ -45,7 +63,7 @@ public class Assurance { return points; } - public User getTo() { + public Name getTo() { return to; } @@ -57,4 +75,7 @@ public class Assurance { return date; } + public CountryCode getCountry() { + return country; + } }