package cz.moneta.test.dsl.util.task.retail.loans.constants;

public class BridgeLoanSQL {

    public static String DU_APPLICANT_DATA_BY_RC_SQL = "select json_value(p.data, '$.households[0].clients[0].firstName') as FIRSTNAME, " +
            "json_value(p.data, '$.households[0].clients[0].lastName') as LASTNAME, " +
            "json_value(du.cache_data, '$.code') as CODE " +
            "from loancl.w_bridge_loan p left join udebsge.cbl_general_cache du on 'document-uploader-process-' || json_value(p.data, '$.households[0].clients[0].documentUploaderToken') = du.cache_code " +
            "where 1 = 1 " +
            "and p.modified > trunc(sysdate) - 1 " +
            "and p.data like '%_BIRTHNUMBER_%' " +
            "order by p.modified DESC";

    public static String DU_CO_APPLICANT_DATA_BY_RC_SQL = "select coalesce(json_value(p.data, '$.households[0].clients[1].firstName'), json_value(p.data, '$.households[1].clients[0].firstName')) as FIRSTNAME, " +
            "coalesce(json_value(p.data, '$.households[0].clients[1].lastName'), json_value(p.data, '$.households[1].clients[0].lastName')) as LASTNAME, " +
            "json_value(du.cache_data, '$.code') as CODE " +
            "from loancl.w_bridge_loan p left join udebsge.cbl_general_cache du on 'document-uploader-process-' || coalesce(json_value(p.data, '$.households[0].clients[1].documentUploaderToken'),json_value(p.data, '$.households[1].clients[0].documentUploaderToken')) = du.cache_code " +
            "where 1 = 1 " +
            "and p.modified > trunc(sysdate) - 1 " +
            "and p.data like '%_BIRTHNUMBER_%' " +
            "order by p.modified DESC";

    private BridgeLoanSQL() {
    }
}
