package com.example.fostracker.models;

import java.sql.Timestamp;
import java.time.ZoneId;
import java.time.ZonedDateTime;

/**
 * Serves as a model for store objects that will be used in to communicate information about GPay Merchants' stores
 * and businesses
 */
public class Verification {
    String agentEmail;
    String storePhone;
    Coordinates verificationCoordinates;
    String verificationStatus;
    Timestamp verificationCreationDateTime;

    /**
     * If store verification is successful then database table stores "green" String.
     * else if merchant is not registered then database table stores "yellow" String
     * else if store verification is  unsuccessful then database table stores "red" String
     */
    public static final String VERIFICATION_SUCCESSFUL = "green";
    public static final String NOT_VERIFIED = "yellow";
    public static final String VERIFICATION_UNSUCCESSFUL = "red";
    public static final int VERIFICATION_SUCCESSFUL_INT = 1;
    public static final int NOT_VERIFIED_INT = 0;
    public static final int VERIFICATION_UNSUCCESSFUL_INT = -1;

    /**
     * @param agentEmail              - email id of the agent who completed the verification
     * @param storePhone              - the store phone number that was verified
     * @param verificationCoordinates - the location the agent was at at the time of verification
     * @param verificationStatus      - whether the verification was successful/unsuccessful/incomplete
     *                                verificationDateTime is set by default to the current time of Asia/Kolkata and cannot be changed later
     */
    public Verification(String agentEmail, String storePhone, Coordinates verificationCoordinates, int verificationStatus) {
        this.agentEmail = agentEmail;
        this.storePhone = storePhone;
        this.verificationCoordinates = verificationCoordinates;
        this.verificationStatus = getStoreVerificationString(verificationStatus);
        this.verificationCreationDateTime = Timestamp.valueOf(ZonedDateTime.now(ZoneId.of("Asia/Kolkata")).toLocalDateTime());
    }

    /**
     * @param agentEmail                   - email id of the agent who completed the verification
     * @param storePhone                   - the store phone number that was verified
     * @param verificationCoordinates      - the location the agent was at at the time of verification
     * @param verificationStatus           - whether the verification was successful/unsuccessful/incomplete
     * @param verificationCreationDateTime -is absolute time when verification had been done.
     */
    public Verification(String agentEmail, String storePhone, Coordinates verificationCoordinates, int verificationStatus, Timestamp verificationCreationDateTime) {
        this.agentEmail = agentEmail;
        this.storePhone = storePhone;
        this.verificationCoordinates = verificationCoordinates;
        this.verificationStatus = getStoreVerificationString(verificationStatus);
        this.verificationCreationDateTime = verificationCreationDateTime;
    }

    //Based on the status integral value it sets to required status string
    private String getStoreVerificationString(int verificationStatus) {
        switch (verificationStatus) {
            case VERIFICATION_UNSUCCESSFUL_INT:
                return VERIFICATION_UNSUCCESSFUL;
            case VERIFICATION_SUCCESSFUL_INT:
                return VERIFICATION_SUCCESSFUL;
            case NOT_VERIFIED_INT:
                return NOT_VERIFIED;
            default:
                return null;
        }
    }

    public String getAgentEmail() {
        return agentEmail;
    }

    public void setAgentEmail(String agentID) {
        this.agentEmail = agentID;
    }

    public String getStorePhone() {
        return storePhone;
    }

    public void setStorePhone(String storeID) {
        this.storePhone = storeID;
    }

    public Coordinates getVerificationCoordinates() {
        return verificationCoordinates;
    }

    public void setVerificationCoordinates(Coordinates coordinates) {
        this.verificationCoordinates = coordinates;
    }

    public String getStoreVerificationStatus() {
        return verificationStatus;
    }

    public void setStoreVerificationStatus(String status) {
        this.verificationStatus = status;
    }

    public Timestamp getStoreVerificationDateTime() {
        return verificationCreationDateTime;
    }
}
@@ -615,22 +615,20 @@
 stores %22
-yellow
+grey
 %22 String
@@ -715,24 +715,111 @@
 red%22 String%0A
+     * else if merchant needs to be revisited then database table stores %22grey%22 String%0A
      */%0A    
@@ -931,14 +931,12 @@
  = %22
-yellow
+grey
 %22;%0A 
@@ -1000,16 +1000,73 @@
  %22red%22;%0A
+    public static final String NEEDS_REVISIT = %22yellow%22;%0A
     publ
@@ -1115,17 +1115,17 @@
 L_INT = 
-1
+2
 ;%0A    pu
@@ -1231,16 +1231,67 @@
 NT = -1;
+%0A    public static final int NEEDS_REVISIT_INT = 1;
 %0A%0A    /*
@@ -3721,16 +3721,90 @@
 RIFIED;%0A
+            case NEEDS_REVISIT_INT:%0A                return NEEDS_REVISIT;%0A
         

Add another field NEEDS_REVISIT in Verification.java