package org.openhds.controller.service.impl;

import org.openhds.controller.service.SettingsService;
import org.openhds.domain.model.GeneralSettings;
import org.openhds.domain.service.SitePropertiesService;

public class SettingsServiceImpl implements SettingsService {

	private SitePropertiesService siteProperties;
	
	public SettingsServiceImpl(SitePropertiesService siteProperties){
		this.siteProperties = siteProperties;
	}
	
	@Override
	public GeneralSettings getSettings() {
		GeneralSettings gs = new GeneralSettings();
		int minimumAgeOfParents = siteProperties.getMinimumAgeOfMarriage();
		int minimumAgeOfHouseholdHead = siteProperties.getMinimumAgeOfMarriage();
		int minMarriageAge = siteProperties.getMinimumAgeOfMarriage();
		int minimumAgeOfPregnancy = siteProperties.getMinimumAgeOfMarriage();
		
		gs.setMinimumAgeOfParents(minimumAgeOfParents);
		gs.setMinimumAgeOfHouseholdHead(minimumAgeOfHouseholdHead);
		gs.setMinMarriageAge(minMarriageAge);
		gs.setMinimumAgeOfPregnancy(minimumAgeOfPregnancy);
		return gs;
	}
}

@@ -576,32 +576,31 @@
 MinimumAgeOf
-Marriage
+Parents
 ();%0A%09%09int mi
@@ -651,32 +651,37 @@
 MinimumAgeOf
-Marriage
+HouseholdHead
 ();%0A%09%09int mi
@@ -793,32 +793,33 @@
 MinimumAgeOf
-Marriage
+Pregnancy
 ();%0A%09%09%0A%09%09gs.

Call to correct methods