FINERACT-1375:ClientPersonEntity

This commit is contained in:
rrpawar96
2022-01-06 06:29:29 +08:00
committed by Petri Tuomola
parent 83c83e1dd7
commit 4a4048561e
14 changed files with 101 additions and 46 deletions
@@ -99,12 +99,13 @@ public class LoanImportHandlerTest {
String lastName = Utils.randomNameGenerator("Client_LastName_", 4);
String externalId = Utils.randomStringGenerator("ID_", 7, "ABCDEFGHIJKLMNOPQRSTUVWXYZ");
final HashMap<String, String> clientMap = new HashMap<>();
final HashMap<String, Object> clientMap = new HashMap<>();
clientMap.put("officeId", outcome_office_creation.toString());
clientMap.put("firstname", firstName);
clientMap.put("lastname", lastName);
clientMap.put("externalId", externalId);
clientMap.put("dateFormat", DATE_FORMAT);
clientMap.put("legalFormId", 1);
clientMap.put("locale", "en");
clientMap.put("active", "true");
clientMap.put("activationDate", "04 March 2011");
@@ -89,8 +89,9 @@ public class SavingsImportHandlerTest {
String lastName = Utils.randomNameGenerator("Client_LastName_", 4);
String externalId = Utils.randomStringGenerator("ID_", 7, "ABCDEFGHIJKLMNOPQRSTUVWXYZ");
final HashMap<String, String> clientMap = new HashMap<>();
final HashMap<String, Object> clientMap = new HashMap<>();
clientMap.put("officeId", outcome_office_creation.toString());
clientMap.put("legalFormId", 1);
clientMap.put("firstname", firstName);
clientMap.put("lastname", lastName);
clientMap.put("externalId", externalId);
@@ -55,8 +55,8 @@ public class ClientTest extends IntegrationTest {
// TODO activationDate() why String? https://issues.apache.org/jira/browse/FINERACT-1232
// TODO why dateFormat and locale required even when no activationDate?!
// https://issues.apache.org/jira/browse/FINERACT-1233
return (long) ok(fineract().clients
.create6(new PostClientsRequest().officeId(1).fullname("TestClient").dateFormat(dateFormat()).locale("en_US")))
return (long) ok(fineract().clients.create6(
new PostClientsRequest().legalFormId(1).officeId(1).fullname("TestClient").dateFormat(dateFormat()).locale("en_US")))
.getClientId();
}
@@ -156,8 +156,9 @@ public final class BatchHelper {
extId = externalId;
}
final String body = "{ \"officeId\": 1, \"firstname\": \"Petra\", \"lastname\": \"Yton\"," + "\"externalId\": " + extId
+ ", \"dateFormat\": \"dd MMMM yyyy\", \"locale\": \"en\"," + "\"active\": false, \"submittedOnDate\": \"04 March 2009\"}";
final String body = "{ \"officeId\": 1, \"legalFormId\":1, \"firstname\": \"Petra\", \"lastname\": \"Yton\"," + "\"externalId\": "
+ extId + ", \"dateFormat\": \"dd MMMM yyyy\", \"locale\": \"en\","
+ "\"active\": false, \"submittedOnDate\": \"04 March 2009\"}";
br.setBody(body);
@@ -186,8 +187,8 @@ public final class BatchHelper {
extId = externalId;
}
final String body = "{ \"officeId\": 1, \"firstname\": \"Petra\", \"lastname\": \"Yton\"," + "\"externalId\": \"" + externalId
+ "\", \"dateFormat\": \"dd MMMM yyyy\", \"locale\": \"en\","
final String body = "{ \"officeId\": 1, \"legalFormId\":1, \"firstname\": \"Petra\", \"lastname\": \"Yton\"," + "\"externalId\": \""
+ externalId + "\", \"dateFormat\": \"dd MMMM yyyy\", \"locale\": \"en\","
+ "\"active\": true, \"activationDate\": \"04 March 2010\", \"submittedOnDate\": \"04 March 2010\"}";
br.setBody(body);
@@ -55,6 +55,7 @@ public class ClientHelper {
private static final String WITHDRAW_CLIENT_COMMAND = "withdraw";
private static final String UNDOREJECT_CLIENT_COMMAND = "undoRejection";
private static final String UNDOWITHDRAWN_CLIENT_COMMAND = "undoWithdrawal";
private static final Integer LEGALFORM_ID_PERSON = 1;
public static final String CREATED_DATE = "27 November 2014";
public static final String CREATED_DATE_PLUS_ONE = "28 November 2014";
@@ -181,8 +182,9 @@ public class ClientHelper {
}
public static String getTestClientAsJSON(final String dateOfJoining, final String officeId) {
final HashMap<String, String> map = new HashMap<>();
final HashMap<String, Object> map = new HashMap<>();
map.put("officeId", officeId);
map.put("legalFormId", LEGALFORM_ID_PERSON);
map.put("firstname", Utils.randomNameGenerator("Client_FirstName_", 5));
map.put("lastname", Utils.randomNameGenerator("Client_LastName_", 4));
map.put("externalId", randomIDGenerator("ID_", 7));
@@ -195,8 +197,9 @@ public class ClientHelper {
}
public static String getTestClientAsJSONPending(final String submittedOnDate, final String officeId) {
final HashMap<String, String> map = new HashMap<>();
final HashMap<String, Object> map = new HashMap<>();
map.put("officeId", officeId);
map.put("legalFormId", LEGALFORM_ID_PERSON);
map.put("firstname", Utils.randomNameGenerator("Client_FirstName_", 5));
map.put("lastname", Utils.randomNameGenerator("Client_LastName_", 4));
map.put("externalId", randomIDGenerator("ID_", 7));
@@ -211,6 +214,7 @@ public class ClientHelper {
public static String getTestPendingClientWithDatatableAsJson(final String registeredTableName) {
final HashMap<String, Object> map = new HashMap<>();
map.put("officeId", "1");
map.put("legalFormId", LEGALFORM_ID_PERSON);
map.put("firstname", Utils.randomNameGenerator("Client_FirstName_", 5));
map.put("lastname", Utils.randomNameGenerator("Client_LastName_", 4));
map.put("externalId", randomIDGenerator("ID_", 7));
@@ -276,8 +280,9 @@ public class ClientHelper {
}
public static String getTestClientWithClientTypeAsJSON(final String dateOfJoining, final String officeId, final String clientType) {
final HashMap<String, String> map = new HashMap<>();
final HashMap<String, Object> map = new HashMap<>();
map.put("officeId", officeId);
map.put("legalFormId", LEGALFORM_ID_PERSON);
map.put("firstname", Utils.randomNameGenerator("Client_FirstName_", 5));
map.put("lastname", Utils.randomNameGenerator("Client_LastName_", 4));
map.put("externalId", randomIDGenerator("ID_", 7));
@@ -72,6 +72,7 @@ public class DatatableHelper {
final List<HashMap<String, Object>> datatableColumnsList = new ArrayList<>();
map.put("datatableName", Utils.randomNameGenerator(apptableName + "_", 5));
map.put("apptableName", apptableName);
map.put("entitySubType", "PERSON");
map.put("multiRow", multiRow);
addDatatableColumns(datatableColumnsList, "Spouse Name", "String", true, 25);
addDatatableColumns(datatableColumnsList, "Number of Dependents", "Number", true, null);