package com.bcxin.backend.domain.auth.service;

import com.bcxin.backend.domain.auth.factory.AuthFactory;
import com.bcxin.backend.domain.auth.service.impl.AuthenticationServiceAbstractImpl;
import org.springframework.stereotype.Service;

@Service
public class GeneralAuthenticationServiceServiceImpl extends AuthenticationServiceAbstractImpl {

    public GeneralAuthenticationServiceServiceImpl(AuthFactory authFactory) {
        super(authFactory);
    }

    @Override
    public String findUnAuthSql() {
        return "SELECT " +
                "idnum as 'idNumber',`name` as 'securityName'," +
                "SUBSTRING_INDEX(SUBSTRING_INDEX(one_inch_color_white_photo,\",\\\"path\\\":\\\"\",-1),'\\\"',1) as 'imgPath'" +
                "FROM " +
                "bg_screening_users " +
                "WHERE " +
                "IFNULL(authenticated_status, '0') IN ('0', '1') " +
                "AND isCertified = '1' " +
                "AND enabled = '1' " +
                "AND IFNULL(one_inch_color_white_photo,'') != ''  ORDER BY authenticated_time asc LIMIT 500";
    }
}
