-
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 #39 from consiglionazionaledellericerche/38-svilup…
…po-api-rest-per-inserimento-delle-assenze 38 sviluppo api rest per inserimento delle assenze
- Loading branch information
Showing
36 changed files
with
2,150 additions
and
154 deletions.
There are no files selected for viewing
451 changes: 446 additions & 5 deletions
451
src/main/java/it/cnr/iit/epas/controller/v4/AbsencesGroupsController.java
Large diffs are not rendered by default.
Oops, something went wrong.
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,40 @@ | ||
/* | ||
* 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 java.time.LocalDate; | ||
import java.util.List; | ||
import java.util.Set; | ||
import lombok.Data; | ||
|
||
/** | ||
* DTO per una specifica giornata all'interno di un periodo di assenze. | ||
* | ||
* @author Cristian Lucchesi | ||
* | ||
*/ | ||
@Data | ||
public class AbsenceErrorDto { | ||
|
||
public AbsenceShowDto absence; | ||
public String absenceProblem; | ||
|
||
public Set<AbsenceShowDto> conflictingAbsences; | ||
|
||
} |
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,78 @@ | ||
/* | ||
* 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 com.google.common.collect.Maps; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import it.cnr.iit.epas.models.absences.CategoryGroupAbsenceType; | ||
import it.cnr.iit.epas.models.absences.GroupAbsenceType; | ||
import java.time.LocalDate; | ||
import java.util.List; | ||
import java.util.Map; | ||
import java.util.SortedMap; | ||
import lombok.Data; | ||
|
||
/** | ||
* DTO per i gruppi di assenza. | ||
* | ||
* @author Cristian Lucchesi | ||
* | ||
*/ | ||
@Data | ||
public class AbsenceFormDto { | ||
@Schema(description = "Persona") | ||
private PersonShowDto person; | ||
// switch date | ||
private LocalDate from; | ||
private LocalDate to; | ||
private List<GroupAbsenceTypeDto> groupsPermitted = Lists.newArrayList(); | ||
private SortedMap<Integer, CategoryTabDto> tabsVisibile = Maps.newTreeMap(); | ||
private boolean permissionDenied = false; | ||
|
||
//tab selected | ||
private CategoryTabDto categoryTabSelected; | ||
private boolean hasGroupChoice; | ||
private boolean hasAbsenceTypeChoice; | ||
private boolean hasJustifiedTypeChoice; | ||
private Long theOnlyAbsenceType; | ||
private GroupAbsenceTypeDto groupSelected; | ||
private List<GroupAbsenceTypeDto> groups; | ||
private Map<String, List<GroupAbsenceTypeDto>> groupsByCategory; | ||
private boolean hasHourMinutesChoice; | ||
private List<Integer> selectableHours; | ||
private List<Integer> selectableMinutes; | ||
|
||
//for those absences who need future recovery of time | ||
private LocalDate recoveryDate; | ||
|
||
//automatic choice | ||
private boolean automaticChoiceExists; | ||
private boolean automaticChoiceSelected; | ||
|
||
//switch absenceType | ||
private List<AbsenceTypeDto> absenceTypes; | ||
private AbsenceTypeDto absenceTypeSelected; | ||
|
||
//switch justifiedType | ||
private List<String> justifiedTypes = Lists.newArrayList(); | ||
private String justifiedTypeSelected; | ||
|
||
//quantity | ||
private Integer minutes = 0; | ||
private Integer hours = 0;} |
42 changes: 42 additions & 0 deletions
42
src/main/java/it/cnr/iit/epas/dto/v4/AbsenceFormSaveDto.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,42 @@ | ||
/* | ||
* 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 java.util.Optional; | ||
import lombok.Data; | ||
|
||
/** | ||
* DTO per le tab della modale delle assenze. | ||
* | ||
* @author Cristian Lucchesi | ||
* | ||
*/ | ||
@Data | ||
public class AbsenceFormSaveDto { | ||
private Optional<Long> idPerson; | ||
private Optional<String> fiscalCode; | ||
private String from; | ||
private String to; | ||
private String recoveryDate; | ||
private String groupAbsenceTypeName; | ||
private String absenceTypeCode; | ||
private String justifiedTypeName; | ||
private int hours; | ||
private int minutes; | ||
private boolean forceInsert; | ||
} |
35 changes: 35 additions & 0 deletions
35
src/main/java/it/cnr/iit/epas/dto/v4/AbsenceFormSaveResponseDto.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,35 @@ | ||
/* | ||
* 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 java.util.Optional; | ||
import lombok.Data; | ||
|
||
/** | ||
* DTO per le tab della modale delle assenze. | ||
* | ||
* @author Cristian Lucchesi | ||
* | ||
*/ | ||
@Data | ||
public class AbsenceFormSaveResponseDto { | ||
private Long idPerson; | ||
private int year; | ||
private int month; | ||
private boolean isSavedSuccessfully; | ||
} |
34 changes: 34 additions & 0 deletions
34
src/main/java/it/cnr/iit/epas/dto/v4/AbsenceFormSimulationDto.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,34 @@ | ||
/* | ||
* 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 lombok.Data; | ||
import lombok.EqualsAndHashCode; | ||
|
||
/** | ||
* DTO per le tab della modale delle assenze. | ||
* | ||
* @author Cristian Lucchesi | ||
* | ||
*/ | ||
@Data | ||
@EqualsAndHashCode(callSuper = true) | ||
public class AbsenceFormSimulationDto extends AbsenceFormSaveDto { | ||
private String categoryTabName; | ||
private boolean switchGroup; | ||
} |
45 changes: 45 additions & 0 deletions
45
src/main/java/it/cnr/iit/epas/dto/v4/AbsenceFormSimulationResponseDto.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,45 @@ | ||
/* | ||
* 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 java.util.List; | ||
import lombok.Data; | ||
|
||
/** | ||
* DTO per la risposta della simulazione dell'inserimento assenza. | ||
* | ||
* @author Cristian Lucchesi | ||
* | ||
*/ | ||
@Data | ||
public class AbsenceFormSimulationResponseDto { | ||
private List<CriticalErrorDto> criticalErrors = Lists.newArrayList(); | ||
private List<TemplateRowDto> insertTemplateRows = Lists.newArrayList(); | ||
private boolean usableColumn; | ||
private boolean complationColumn; | ||
private List<AbsenceShowDto> absencesToPersist = Lists.newArrayList(); | ||
|
||
private List<String> warningsPreviousVersion = Lists.newArrayList(); | ||
|
||
private int howManyWarning; | ||
private int howManyError; | ||
private int howManySuccess; | ||
private int howManyReplacing; | ||
private int howManyIgnored; | ||
} |
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
46 changes: 46 additions & 0 deletions
46
src/main/java/it/cnr/iit/epas/dto/v4/CategoryGroupAbsenceTypeDto.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,46 @@ | ||
/* | ||
* 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 io.swagger.v3.oas.annotations.media.Schema; | ||
import java.util.Set; | ||
import lombok.Data; | ||
|
||
/** | ||
* DTO per le private ContractualClauseDto contractualClause; | ||
* | ||
* @author Cristian Lucchesi | ||
* | ||
*/ | ||
@Data | ||
public class CategoryGroupAbsenceTypeDto { | ||
|
||
@Schema(description = "Nome categoria.") | ||
private String name; | ||
@Schema(description = "Descrizione categoria.") | ||
private String description; | ||
@Schema(description = "Priorità categoria.") | ||
private int priority; | ||
@Schema(description = "Tipologia di gruppo di assenze.") | ||
private Set<GroupAbsenceTypeDto> groupAbsenceTypes; | ||
@Schema(description = "Categorie di tab da mostrare nel menu per la gestione delle assenze.") | ||
private CategoryTabDto tab; | ||
@Schema(description = "Documentazione delle varie disposizioni contrattuali raggruppate per tipologia di assenza") | ||
private ContractualClauseDto contractualClause; | ||
|
||
} |
Oops, something went wrong.