|
@@ -11,12 +11,8 @@ import org.springframework.context.annotation.Profile;
|
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
import scot.carricksoftware.grants.commands.certificates.birthcertificates.BirthCertificateCommand;
|
|
import scot.carricksoftware.grants.commands.certificates.birthcertificates.BirthCertificateCommand;
|
|
|
import scot.carricksoftware.grants.commands.certificates.birthcertificates.BirthCertificateCommandImpl;
|
|
import scot.carricksoftware.grants.commands.certificates.birthcertificates.BirthCertificateCommandImpl;
|
|
|
-import scot.carricksoftware.grants.enums.certificates.CertificateType;
|
|
|
|
|
-import scot.carricksoftware.grants.enums.general.Sex;
|
|
|
|
|
import scot.carricksoftware.grants.services.certificates.birthcertificates.BirthCertificateService;
|
|
import scot.carricksoftware.grants.services.certificates.birthcertificates.BirthCertificateService;
|
|
|
import scot.carricksoftware.grants.services.people.PersonService;
|
|
import scot.carricksoftware.grants.services.people.PersonService;
|
|
|
-import scot.carricksoftware.grants.services.places.organisations.OrganisationService;
|
|
|
|
|
-import scot.carricksoftware.grants.services.places.places.PlaceService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Component
|
|
@Component
|
|
@@ -24,18 +20,13 @@ import scot.carricksoftware.grants.services.places.places.PlaceService;
|
|
|
public class DataLoadBirthCertificates {
|
|
public class DataLoadBirthCertificates {
|
|
|
|
|
|
|
|
private static final Logger logger = LogManager.getLogger(DataLoadBirthCertificates.class);
|
|
private static final Logger logger = LogManager.getLogger(DataLoadBirthCertificates.class);
|
|
|
- private final OrganisationService organisationService;
|
|
|
|
|
private final BirthCertificateService birthCertificateService;
|
|
private final BirthCertificateService birthCertificateService;
|
|
|
private final PersonService personService;
|
|
private final PersonService personService;
|
|
|
- private final PlaceService placeService;
|
|
|
|
|
|
|
|
|
|
- public DataLoadBirthCertificates(OrganisationService organisationService,
|
|
|
|
|
- BirthCertificateService birthCertificateService,
|
|
|
|
|
- PersonService personService, PlaceService placeService) {
|
|
|
|
|
- this.organisationService = organisationService;
|
|
|
|
|
|
|
+ public DataLoadBirthCertificates(BirthCertificateService birthCertificateService,
|
|
|
|
|
+ PersonService personService) {
|
|
|
this.birthCertificateService = birthCertificateService;
|
|
this.birthCertificateService = birthCertificateService;
|
|
|
this.personService = personService;
|
|
this.personService = personService;
|
|
|
- this.placeService = placeService;
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void load() {
|
|
public void load() {
|
|
@@ -47,38 +38,11 @@ public class DataLoadBirthCertificates {
|
|
|
logger.debug("DataLoadBirthCertificates::LoadBirthCertificates");
|
|
logger.debug("DataLoadBirthCertificates::LoadBirthCertificates");
|
|
|
BirthCertificateCommand birthCertificateCommand = new BirthCertificateCommandImpl();
|
|
BirthCertificateCommand birthCertificateCommand = new BirthCertificateCommandImpl();
|
|
|
|
|
|
|
|
- birthCertificateCommand.setCertificateNumber("999");
|
|
|
|
|
- birthCertificateCommand.setCertificateDate("25/01/1953");
|
|
|
|
|
- birthCertificateCommand.setCertificateType(CertificateType.EXTRACT);
|
|
|
|
|
-
|
|
|
|
|
- birthCertificateCommand.setRegistrationAuthority(organisationService.findById(2L));
|
|
|
|
|
- birthCertificateCommand.setVolume("01");
|
|
|
|
|
- birthCertificateCommand.setNumber("02");
|
|
|
|
|
- birthCertificateCommand.setCertificateSource(organisationService.findById(1L));
|
|
|
|
|
-
|
|
|
|
|
- birthCertificateCommand.setNewBorn(personService.findById(3L));
|
|
|
|
|
- birthCertificateCommand.setSex(Sex.MALE);
|
|
|
|
|
- birthCertificateCommand.setWhenBorn("25/01/1953 01:01");
|
|
|
|
|
- birthCertificateCommand.setUntrackedWhereBorn("Edinburgh");
|
|
|
|
|
birthCertificateCommand.setFather(personService.findById(1L));
|
|
birthCertificateCommand.setFather(personService.findById(1L));
|
|
|
- birthCertificateCommand.setUntrackedFather("Untracked Father");
|
|
|
|
|
-
|
|
|
|
|
birthCertificateCommand.setMother(personService.findById(2L));
|
|
birthCertificateCommand.setMother(personService.findById(2L));
|
|
|
- birthCertificateCommand.setWhereBorn(placeService.findById(1L));
|
|
|
|
|
- birthCertificateCommand.setInformant(personService.findById(1L));
|
|
|
|
|
- birthCertificateCommand.setUntrackedInformant("Untracked Informant");
|
|
|
|
|
- birthCertificateCommand.setInformantQualification("Qualification");
|
|
|
|
|
- birthCertificateCommand.setWhenRegistered("22/01/1978");
|
|
|
|
|
- birthCertificateCommand.setWhereRegistered("Where Registered");
|
|
|
|
|
- birthCertificateCommand.setFatherUsualResidence(placeService.findById(1L));
|
|
|
|
|
- birthCertificateCommand.setUntrackedFatherUsualResidence("57 Back Street, Edinburgh");
|
|
|
|
|
- birthCertificateCommand.setInformantResidence("2 Wilson Avenue, Edinburgh");
|
|
|
|
|
- birthCertificateCommand.setMotherUsualResidence(placeService.findById(1L));
|
|
|
|
|
- birthCertificateCommand.setUntrackedMotherUsualResidence("92 Broughton Road, Edinburgh");
|
|
|
|
|
- birthCertificateCommand.setMotherPlaceOfBirth("Drop");
|
|
|
|
|
- birthCertificateCommand.setFatherPlaceOfBirth("Drip");
|
|
|
|
|
|
|
+ birthCertificateCommand.setNewBorn(personService.findById(3L));
|
|
|
|
|
+
|
|
|
birthCertificateService.saveBirthCertificateCommand(birthCertificateCommand);
|
|
birthCertificateService.saveBirthCertificateCommand(birthCertificateCommand);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
}
|
|
}
|