]> WPIA git - gigi.git/blobdiff - src/club/wpia/gigi/util/Notary.java
upd: precise SQL statements for verification
[gigi.git] / src / club / wpia / gigi / util / Notary.java
index a619da53563e3b60f5d0849458ddf17f50b26b0a..36f1fa48c3c603c3c1dd5ed7ab3a30437bf5d2a1 100644 (file)
@@ -45,7 +45,7 @@ public class Notary {
     }
 
     public static boolean checkVerificationIsPossible(User agent, Name target) {
-        try (GigiPreparedStatement ps = new GigiPreparedStatement("SELECT 1 FROM `notary` where `to`=? and `from`=? and `method` = ? ::`notaryType` AND `deleted` IS NULL AND `when` > (now() - interval '1 days' * ?)")) {
+        try (GigiPreparedStatement ps = new GigiPreparedStatement("SELECT 1 FROM `notary` where `to`=? and `from`=? and `method` = ? ::`notaryType` AND `deleted` IS NULL AND `when` > (now() - interval '1 days' * ?::INTEGER)")) {
             ps.setInt(1, target.getId());
             ps.setInt(2, agent.getId());
             ps.setEnum(3, VerificationType.FACE_TO_FACE);
@@ -55,9 +55,9 @@ public class Notary {
         }
     }
 
-    public static final Group AGENT_BLOCKED = Group.BLOCKEDASSURER;
+    public static final Group AGENT_BLOCKED = Group.BLOCKED_AGENT;
 
-    public static final Group APPLICANT_BLOCKED = Group.BLOCKEDASSUREE;
+    public static final Group APPLICANT_BLOCKED = Group.BLOCKED_APPLICANT;
 
     public static final Group VERIFY_NOTIFICATION = Group.VERIFY_NOTIFICATION;
 
@@ -207,12 +207,12 @@ public class Notary {
         }
 
         if (t == VerificationType.NUCLEUS) {
-            if ( !agent.isInGroup(Group.NUCLEUS_ASSURER)) {
+            if ( !agent.isInGroup(Group.NUCLEUS_AGENT)) {
                 throw new GigiApiException("RA Agent needs to be Nucleus RA Agent.");
             }
             return;
         } else if (t == VerificationType.TTP_ASSISTED) {
-            if ( !agent.isInGroup(Group.TTP_ASSURER)) {
+            if ( !agent.isInGroup(Group.TTP_AGENT)) {
                 throw new GigiApiException("RA Agent needs to be TTP RA Agent.");
             }
             if ( !applicant.isInGroup(Group.TTP_APPLICANT)) {