Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix merge error and avoid gent in progress as sent #2307

Open
wants to merge 3 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
public class SurveyServiceStrategy extends ASurveyServiceStrategy {

public static List<SurveyDB> getUnsentSurveys(String programUId){
List<SurveyDB> surveyDBs = SurveyDB.getAllSurveysByProgram(programUId);
List<SurveyDB> surveyDBs = SurveyDB.getAllNotInProgressSurveysByProgram(programUId);
return surveyDBs;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -356,13 +356,14 @@ public static List<SurveyDB> getAllUnsentMalariaSurveys(String malariaProgramUid
SurveyDB_Table.id_org_unit_fk.withTable(surveyAlias))).queryList();
}

public static List<SurveyDB> getAllSurveysByProgram(String malariaProgramUid) {
public static List<SurveyDB> getAllNotInProgressSurveysByProgram(String malariaProgramUid) {
return new Select().from(SurveyDB.class).as(surveyName).join(ProgramDB.class,
Join.JoinType.LEFT_OUTER).as(programName)
.on(SurveyDB_Table.id_program_fk.withTable(surveyAlias)
.eq(ProgramDB_Table.id_program.withTable(programAlias)))
.where(ProgramDB_Table.uid_program.withTable(programAlias)
.is(malariaProgramUid))
.and(SurveyDB_Table.status.withTable(surveyAlias).isNot(Constants.SURVEY_IN_PROGRESS))
.orderBy(OrderBy.fromProperty(SurveyDB_Table.event_date.withTable(surveyAlias)))
.orderBy(OrderBy.fromProperty(
SurveyDB_Table.id_org_unit_fk.withTable(surveyAlias))).queryList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,9 @@ private void getAllUnsentSurveys() {
@Override
public void onSuccess(String uid) {
List<SurveyDB> surveyDBs = SurveyServiceStrategy.getUnsentSurveys(uid);
List<SurveyDB> unsentSurveyDBs = new ArrayList<SurveyDB>();

//Since intents does NOT admit NON serializable as values we use Session instead
Session.putServiceValue(ALL_UNSENT_SURVEYS_ACTION, unsentSurveyDBs);
Session.putServiceValue(ALL_UNSENT_SURVEYS_ACTION, surveyDBs);

//Returning result to anyone listening
Intent resultIntent = new Intent(ALL_UNSENT_SURVEYS_ACTION);
Expand Down