Skip to content

Commit

Permalink
Merge pull request #18 from InseeFr/extend-period-enum
Browse files Browse the repository at this point in the history
Extend period enum
  • Loading branch information
SimonDmz authored Jul 13, 2023
2 parents e46005d + a3e5076 commit 114ac45
Show file tree
Hide file tree
Showing 3 changed files with 105 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</parent>
<groupId>fr.insee.survey</groupId>
<artifactId>platine-management</artifactId>
<version>1.0.14</version>
<version>1.0.15-rc</version>
<name>platine-management</name>
<description>REST API for communication between DB and Platine-Management UI and Platine-My-Surveys UI</description>
<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,105 @@ public enum PeriodEnum {

A00(PeriodicityEnum.A, "annual"),
X00(PeriodicityEnum.X, "pluriannual"),
X01(PeriodicityEnum.X, "pluriannual"),
X02(PeriodicityEnum.X, "pluriannual"),
X03(PeriodicityEnum.X, "pluriannual"),
X04(PeriodicityEnum.X, "pluriannual"),
X05(PeriodicityEnum.X, "pluriannual"),
X06(PeriodicityEnum.X, "pluriannual"),
X07(PeriodicityEnum.X, "pluriannual"),
X08(PeriodicityEnum.X, "pluriannual"),
X09(PeriodicityEnum.X, "pluriannual"),
X10(PeriodicityEnum.X, "pluriannual"),
X11(PeriodicityEnum.X, "pluriannual"),
X12(PeriodicityEnum.X, "pluriannual"),
X13(PeriodicityEnum.X, "pluriannual"),
X14(PeriodicityEnum.X, "pluriannual"),
X15(PeriodicityEnum.X, "pluriannual"),
X16(PeriodicityEnum.X, "pluriannual"),
X17(PeriodicityEnum.X, "pluriannual"),
X18(PeriodicityEnum.X, "pluriannual"),
X19(PeriodicityEnum.X, "pluriannual"),
X20(PeriodicityEnum.X, "pluriannual"),
X21(PeriodicityEnum.X, "pluriannual"),
X22(PeriodicityEnum.X, "pluriannual"),
X23(PeriodicityEnum.X, "pluriannual"),
X24(PeriodicityEnum.X, "pluriannual"),
X25(PeriodicityEnum.X, "pluriannual"),
X26(PeriodicityEnum.X, "pluriannual"),
X27(PeriodicityEnum.X, "pluriannual"),
X28(PeriodicityEnum.X, "pluriannual"),
X29(PeriodicityEnum.X, "pluriannual"),
X30(PeriodicityEnum.X, "pluriannual"),
X31(PeriodicityEnum.X, "pluriannual"),
X32(PeriodicityEnum.X, "pluriannual"),
X33(PeriodicityEnum.X, "pluriannual"),
X34(PeriodicityEnum.X, "pluriannual"),
X35(PeriodicityEnum.X, "pluriannual"),
X36(PeriodicityEnum.X, "pluriannual"),
X37(PeriodicityEnum.X, "pluriannual"),
X38(PeriodicityEnum.X, "pluriannual"),
X39(PeriodicityEnum.X, "pluriannual"),
X40(PeriodicityEnum.X, "pluriannual"),
X41(PeriodicityEnum.X, "pluriannual"),
X42(PeriodicityEnum.X, "pluriannual"),
X43(PeriodicityEnum.X, "pluriannual"),
X44(PeriodicityEnum.X, "pluriannual"),
X45(PeriodicityEnum.X, "pluriannual"),
X46(PeriodicityEnum.X, "pluriannual"),
X47(PeriodicityEnum.X, "pluriannual"),
X48(PeriodicityEnum.X, "pluriannual"),
X49(PeriodicityEnum.X, "pluriannual"),
X50(PeriodicityEnum.X, "pluriannual"),
X51(PeriodicityEnum.X, "pluriannual"),
X52(PeriodicityEnum.X, "pluriannual"),
X53(PeriodicityEnum.X, "pluriannual"),
X54(PeriodicityEnum.X, "pluriannual"),
X55(PeriodicityEnum.X, "pluriannual"),
X56(PeriodicityEnum.X, "pluriannual"),
X57(PeriodicityEnum.X, "pluriannual"),
X58(PeriodicityEnum.X, "pluriannual"),
X59(PeriodicityEnum.X, "pluriannual"),
X60(PeriodicityEnum.X, "pluriannual"),
X61(PeriodicityEnum.X, "pluriannual"),
X62(PeriodicityEnum.X, "pluriannual"),
X63(PeriodicityEnum.X, "pluriannual"),
X64(PeriodicityEnum.X, "pluriannual"),
X65(PeriodicityEnum.X, "pluriannual"),
X66(PeriodicityEnum.X, "pluriannual"),
X67(PeriodicityEnum.X, "pluriannual"),
X68(PeriodicityEnum.X, "pluriannual"),
X69(PeriodicityEnum.X, "pluriannual"),
X70(PeriodicityEnum.X, "pluriannual"),
X71(PeriodicityEnum.X, "pluriannual"),
X72(PeriodicityEnum.X, "pluriannual"),
X73(PeriodicityEnum.X, "pluriannual"),
X74(PeriodicityEnum.X, "pluriannual"),
X75(PeriodicityEnum.X, "pluriannual"),
X76(PeriodicityEnum.X, "pluriannual"),
X77(PeriodicityEnum.X, "pluriannual"),
X78(PeriodicityEnum.X, "pluriannual"),
X79(PeriodicityEnum.X, "pluriannual"),
X80(PeriodicityEnum.X, "pluriannual"),
X81(PeriodicityEnum.X, "pluriannual"),
X82(PeriodicityEnum.X, "pluriannual"),
X83(PeriodicityEnum.X, "pluriannual"),
X84(PeriodicityEnum.X, "pluriannual"),
X85(PeriodicityEnum.X, "pluriannual"),
X86(PeriodicityEnum.X, "pluriannual"),
X87(PeriodicityEnum.X, "pluriannual"),
X88(PeriodicityEnum.X, "pluriannual"),
X89(PeriodicityEnum.X, "pluriannual"),
X90(PeriodicityEnum.X, "pluriannual"),
X91(PeriodicityEnum.X, "pluriannual"),
X92(PeriodicityEnum.X, "pluriannual"),
X93(PeriodicityEnum.X, "pluriannual"),
X94(PeriodicityEnum.X, "pluriannual"),
X95(PeriodicityEnum.X, "pluriannual"),
X96(PeriodicityEnum.X, "pluriannual"),
X97(PeriodicityEnum.X, "pluriannual"),
X98(PeriodicityEnum.X, "pluriannual"),
X99(PeriodicityEnum.X, "pluriannual"),
S01(PeriodicityEnum.S, "1st semester"),
S02(PeriodicityEnum.S, "2nd semester"),
T01(PeriodicityEnum.T, "1st trimester"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,14 @@ public ResponseEntity<HabilitationDto> checkHabilitation(String role, String idS
if(isUserInRole(roles, applicationConfig.getRoleInternalUser())) {
if (user.isPresent()) {
String userRole;
List<String> accreditedSources = new ArrayList<>();
//List<String> accreditedSources = new ArrayList<>();
userRole = user.get().getRole().toString();
if (userRole.equals(User.UserRoleType.assistance)) {
resp.setHabilitated(false);
LOGGER.warn("User '{}' has assistance profile - check habilitation: false", idec);
return new ResponseEntity<>(resp, HttpStatus.OK);
}
accreditedSources = userService.findAccreditedSources(user.get().getIdentifier());
/*accreditedSources = userService.findAccreditedSources(user.get().getIdentifier());
Optional<Campaign> campaign = campaignService.findById(campaignId);
if (campaign.isPresent()) {
String sourceSearched = campaign.get().getSurvey().getSource().getId();
Expand All @@ -107,6 +107,9 @@ public ResponseEntity<HabilitationDto> checkHabilitation(String role, String idS
}
LOGGER.warn("Check habilitation of user {} for accessing survey-unit {} of campaign {} - campaign doesn't exist - check habilitation:false", idec, idSu, campaign);
resp.setHabilitated(false);
return new ResponseEntity<>(resp, HttpStatus.OK);*/
resp.setHabilitated(true);
LOGGER.warn("User '{}' has {} profile - check habilitation: true", idec, userRole);
return new ResponseEntity<>(resp, HttpStatus.OK);
}

Expand Down

0 comments on commit 114ac45

Please sign in to comment.