-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #67 from consiglionazionaledellericerche/66-aggior…
…namento-e-creazione-dto-per-userinfo-e-personinfo aggiunti nuovi dto e nuove endpoint per ottenere le informazioni sui turni e reperibilità di una persona e i suoi eventuali ruoli
- Loading branch information
Showing
9 changed files
with
239 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Copyright (C) 2022 Consiglio Nazionale delle Ricerche | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as | ||
* published by the Free Software Foundation, either version 3 of the | ||
* License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package it.cnr.iit.epas.dto.v4; | ||
|
||
import lombok.Data; | ||
import lombok.EqualsAndHashCode; | ||
|
||
/** | ||
* DTO per l'esportazione via REST delle informazioni | ||
* principali di un'assenza. | ||
* | ||
* @since versione 4 dell'API REST | ||
* @author Cristian Lucchesi | ||
* | ||
*/ | ||
@Data | ||
@EqualsAndHashCode(callSuper = true) | ||
public class PersonShiftDto extends BaseModelDto { | ||
|
||
private String description; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
src/main/java/it/cnr/iit/epas/dto/v4/PersonShowExtendedDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* Copyright (C) 2023 Consiglio Nazionale delle Ricerche | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as | ||
* published by the Free Software Foundation, either version 3 of the | ||
* License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package it.cnr.iit.epas.dto.v4; | ||
|
||
import com.google.common.collect.Lists; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import it.cnr.iit.epas.models.PersonReperibilityType; | ||
import it.cnr.iit.epas.models.PersonShift; | ||
import it.cnr.iit.epas.models.ShiftCategories; | ||
import java.time.LocalDate; | ||
import java.time.LocalDateTime; | ||
import java.util.List; | ||
import lombok.Data; | ||
import lombok.EqualsAndHashCode; | ||
|
||
/** | ||
* DTO per mostrare i dati estesi di una persona. | ||
*/ | ||
@Data | ||
@EqualsAndHashCode(callSuper = true) | ||
public class PersonShowExtendedDto extends PersonShowDto { | ||
|
||
private boolean available; | ||
private List<ShiftCategoryDto> shiftCategories = Lists.newArrayList(); | ||
private List<PersonReperibilityTypeDto> reperibilityTypes = Lists.newArrayList(); | ||
private List<ShiftCategoryDto> categories = Lists.newArrayList(); | ||
private List<PersonReperibilityTypeDto> reperibilities = Lists.newArrayList(); | ||
private List<PersonShiftDto> personShifts = Lists.newArrayList(); | ||
} |
30 changes: 30 additions & 0 deletions
30
src/main/java/it/cnr/iit/epas/dto/v4/ShiftCategoryDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Copyright (C) 2022 Consiglio Nazionale delle Ricerche | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as | ||
* published by the Free Software Foundation, either version 3 of the | ||
* License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package it.cnr.iit.epas.dto.v4; | ||
|
||
import java.time.YearMonth; | ||
import lombok.Data; | ||
|
||
/** | ||
* DTO per ShiftCategory. | ||
*/ | ||
@Data | ||
public class ShiftCategoryDto { | ||
|
||
private String description; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
src/main/java/it/cnr/iit/epas/dto/v4/mapper/PersonShowExtendedMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
* Copyright (C) 2023 Consiglio Nazionale delle Ricerche | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as | ||
* published by the Free Software Foundation, either version 3 of the | ||
* License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package it.cnr.iit.epas.dto.v4.mapper; | ||
|
||
import it.cnr.iit.epas.dto.v4.OfficeShowTerseDto; | ||
import it.cnr.iit.epas.dto.v4.PersonReperibilityTypeDto; | ||
import it.cnr.iit.epas.dto.v4.PersonReperibilityTypeTerseDto; | ||
import it.cnr.iit.epas.dto.v4.PersonShiftDto; | ||
import it.cnr.iit.epas.dto.v4.PersonShowDto; | ||
import it.cnr.iit.epas.dto.v4.PersonShowExtendedDto; | ||
import it.cnr.iit.epas.dto.v4.ShiftCategoryDto; | ||
import it.cnr.iit.epas.dto.v4.UserShowTerseDto; | ||
import it.cnr.iit.epas.models.Office; | ||
import it.cnr.iit.epas.models.Person; | ||
import it.cnr.iit.epas.models.PersonReperibilityType; | ||
import it.cnr.iit.epas.models.PersonShift; | ||
import it.cnr.iit.epas.models.ShiftCategories; | ||
import it.cnr.iit.epas.models.User; | ||
import java.util.List; | ||
import org.mapstruct.Mapper; | ||
import org.mapstruct.Mapping; | ||
|
||
/** | ||
* Mapper da Person al suo DTO per la visualizzazione via REST. | ||
*/ | ||
@Mapper(componentModel = "spring") | ||
public interface PersonShowExtendedMapper { | ||
List<ShiftCategoryDto> convertShiftCategories(List<ShiftCategories> shiftCategories); | ||
List<PersonReperibilityTypeDto> convertPersonReperibility(List<PersonReperibilityType> reperibilities); | ||
List<PersonShiftDto> convertPersonShift(List<PersonShift> personShift); | ||
|
||
PersonReperibilityTypeTerseDto convert(PersonReperibilityType reperibility); | ||
|
||
|
||
@Mapping(target = "birthDate", source = "birthday") | ||
@Mapping(target = "qualification", source = "qualification.id") | ||
PersonShowExtendedDto convert(Person person); | ||
|
||
OfficeShowTerseDto convert(Office office); | ||
|
||
UserShowTerseDto convert(User user); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters