X-Git-Url: https://code.wpia.club/?a=blobdiff_plain;f=src%2Fclub%2Fwpia%2Fgigi%2FdbObjects%2FVerification.java;fp=src%2Fclub%2Fwpia%2Fgigi%2FdbObjects%2FVerification.java;h=3edaa57070353b715dc3373f17f85893cae19963;hb=08c941629aea14473e5c42ab6f5d590be4af4bf8;hp=0000000000000000000000000000000000000000;hpb=c2da35eb9f4b6d3a3c055de1229afe0c07dc47da;p=gigi.git diff --git a/src/club/wpia/gigi/dbObjects/Verification.java b/src/club/wpia/gigi/dbObjects/Verification.java new file mode 100644 index 00000000..3edaa570 --- /dev/null +++ b/src/club/wpia/gigi/dbObjects/Verification.java @@ -0,0 +1,106 @@ +package club.wpia.gigi.dbObjects; + +import java.util.Date; + +import club.wpia.gigi.database.DBEnum; +import club.wpia.gigi.dbObjects.wrappers.DataContainer; + +@DataContainer +public class Verification { + + public enum VerificationType implements DBEnum { + FACE_TO_FACE("Face to Face Meeting"), TOPUP("TOPUP"), TTP_ASSISTED("TTP-Assisted"), NUCLEUS("Nucleus Bonus"); + + private final String description; + + private VerificationType(String description) { + this.description = description; + } + + public String getDescription() { + return description; + } + + @Override + public String getDBName() { + return description; + } + } + + private int id; + + private User from; + + private Name to; + + private String location; + + private String method; + + private int points; + + private String date; + + private Country country; + + private Date expireDate; + + public Verification(int id, User from, Name to, String location, String method, int points, String date, Country country, Date expireDate) { + this.id = id; + this.from = from; + this.to = to; + this.location = location; + this.method = method; + this.points = points; + this.date = date; + this.country = country; + this.expireDate = expireDate; + } + + public User getFrom() { + return from; + } + + public int getId() { + return id; + } + + public String getLocation() { + return location; + } + + public int getPoints() { + return points; + } + + public Name getTo() { + return to; + } + + public String getMethod() { + return method; + } + + public String getDate() { + return date; + } + + public Country getCountry() { + return country; + } + + public Date getExpireDate() { + return expireDate; + } + + public boolean isExpired() { + boolean expired = false; + if (expireDate == null) { + expired = false; + } else { + Date now = new Date(); + expired = expireDate.before(now); + } + return expired; + } +}