Skip to content

Commit

Permalink
Merge pull request #85 from SimonDmz/fix-person-birthdate-mapping
Browse files Browse the repository at this point in the history
Fix Person birthdate mapping when creating surveyUnit
  • Loading branch information
SimonDmz authored Sep 30, 2022
2 parents 3ab1df9 + 4e47537 commit 4905614
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>fr.insee.pearljam</groupId>
<artifactId>pearljam-back-office</artifactId>
<version>4.0.2</version>
<version>4.0.3</version>
<packaging>war</packaging>
<name>Pearl-Jam-Back-Office</name>
<description>Back-office services for for PearlJam</description>
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/fr/insee/pearljam/api/domain/Person.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,14 @@ public Person() {
/**
* Constructor with all args
*/
public Person(Title title, String firstName, String lastName, String email, boolean favoriteEmail, boolean privileged) {
public Person(Title title, String firstName, String lastName, String email, boolean favoriteEmail, boolean privileged, Long birthdate) {
this.title = title;
this.firstName = firstName;
this.lastName = lastName;
this.email = email;
this.favoriteEmail = favoriteEmail;
this.privileged = privileged;
this.birthdate = birthdate;
}

public Person(PersonDto p, SurveyUnit su) {
Expand All @@ -110,6 +111,7 @@ public Person(PersonDto p, SurveyUnit su) {
this.email = p.getEmail();
this.favoriteEmail = p.isFavoriteEmail();
this.privileged = p.isPrivileged();
this.birthdate = p.getBirthdate();
this.phoneNumbers = p.getPhoneNumbers().stream().map(pn -> new PhoneNumber(pn, this)).collect(Collectors.toSet());
this.surveyUnit = su;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,14 @@ public PersonDto(Person person) {
/**
* Constructor with all args
*/
public PersonDto(Title title, String firstName, String lastName, String email, boolean favoriteEmail, boolean privileged) {
public PersonDto(Title title, String firstName, String lastName, String email, boolean favoriteEmail, boolean privileged, Long birthdate) {
this.title = title;
this.firstName = firstName;
this.lastName = lastName;
this.email = email;
this.favoriteEmail = favoriteEmail;
this.privileged = privileged;
this.birthdate = birthdate;
}

/**
Expand Down

0 comments on commit 4905614

Please sign in to comment.