Skip to content

Commit

Permalink
Merge pull request #56 from consiglionazionaledellericerche/29-nella-…
Browse files Browse the repository at this point in the history
…anagrafica-manca-la-residenza-e-la-data-di-nascita

Aggiunta campo residenza alle persone.
  • Loading branch information
criluc authored Sep 4, 2023
2 parents 473c470 + 9be7833 commit b10da44
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [2.8.0] - UNRELEASED
### Added
- Gestito invio segnalazioni anonime ad epas-helpdesk-service.
- Aggiunto campo residenza all'anagrafica delle persone

### Changed
- Mostrato un messaggio di avvertimento in caso di segnalazione non inviata correttamente
- Corretta gestione caso JWT necessario ma non presente.
- Inviata la sessione play al epas-helpdesk-service (se configurato)
- Risolto bug nello scaricamento dell'allegato per richieste congedo parentale per il padre
- Gestiti campi data di nascita e residenza nell'interfacce REST di gestione delle persone


## [2.7.0] - 2023-08-10
Expand Down
2 changes: 2 additions & 0 deletions app/cnr/sync/dto/v2/PersonCreateDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ public class PersonCreateDto {
private String telephone;
private String fax;
private String mobile;
private LocalDate birthday;
private String residence;
@Required
private Integer qualification;
@Required
Expand Down
3 changes: 3 additions & 0 deletions app/cnr/sync/dto/v2/PersonShowDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import lombok.EqualsAndHashCode;
import lombok.val;
import models.Person;
import org.joda.time.LocalDate;
import org.modelmapper.ModelMapper;

/**
Expand All @@ -43,6 +44,8 @@ public class PersonShowDto extends PersonShowTerseDto {
private String telephone;
private String fax;
private String mobile;
private LocalDate birthday;
private String residence;
private Integer qualification;
private Set<String> badges = Sets.newHashSet();
private OfficeDto office;
Expand Down
4 changes: 3 additions & 1 deletion app/cnr/sync/dto/v2/PersonUpdateDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ public void update(Person person) {
person.setEppn(getEppn());
person.setTelephone(getTelephone());
person.setFax(getFax());
person.setMobile(getMobile());
person.setMobile(getMobile());
person.setBirthday(getBirthday());
person.setResidence(getResidence());
if (getQualification() != null) {
person.setQualification(
((Qualification) Qualification.findAll().stream()
Expand Down
5 changes: 4 additions & 1 deletion app/models/Person.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ public class Person extends PeriodModel implements IPropertiesInPeriodOwner {

private LocalDate birthday;

private String residence;

@Email
@Unique
@Required
Expand Down Expand Up @@ -358,7 +360,8 @@ private void onUpdate() {
@PrePersist
private void onCreation() {
// TODO meglio rendere non necessario questo barbatrucco...
this.setBeginDate(LocalDate.now().minusYears(1).withMonthOfYear(12).withDayOfMonth(31));
this.setBeginDate(
org.joda.time.LocalDate.now().minusYears(1).withMonthOfYear(12).withDayOfMonth(31));
this.updatedAt = LocalDateTime.now();
if (user != null) {
user.setSubjectId(eppn);
Expand Down
1 change: 1 addition & 0 deletions app/views/Persons/edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
#{panel title:'Altre informazioni', color:'primary'}
#{f.input 'person.telephone'/}
#{f.date 'person.birthday', view:'year'/}
#{f.input 'person.residence' /}
#{secure.check 'Persons.updatePerseoId'}
#{f.input 'person.perseoId', custom_popover: true /}
#{/secure.check}
Expand Down
1 change: 1 addition & 0 deletions conf/messages.it
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,7 @@ person.office= Sede
person=Persona
person.qualification= Livello
personQualification= Livello
person.residence=Residenza
person.surname=Cognome
person.telephone=Telefono
person.user.username= Username in ePAS
Expand Down
10 changes: 10 additions & 0 deletions db/evolutions/207.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# --- !Ups

ALTER TABLE persons ADD COLUMN residence TEXT;
ALTER TABLE persons_history ADD COLUMN residence TEXT;


# --- !Downs

ALTER TABLE persons DROP COLUMN residence;
ALTER TABLE persons_history DROP COLUMN residence;
2 changes: 2 additions & 0 deletions docs/rest/personsServices.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ Il campo *number* corrisponde alla matricola.
"badges": [
"15409"
],
"birthday": "1564-02-15",
"email": "[email protected]",
"eppn": "[email protected]",
"fax": null,
Expand All @@ -65,6 +66,7 @@ Il campo *number* corrisponde alla matricola.
},
"othersSurnames": null,
"qualification": 1,
"residence": "Via Giuseppe Giusti, 24, 56127 Pisa",
"surname": "Galilei",
"telephone": null
}
Expand Down

0 comments on commit b10da44

Please sign in to comment.