Skip to content

Commit

Permalink
Add aub dates and comments to accepted sick note mail to other manage…
Browse files Browse the repository at this point in the history
…ment
  • Loading branch information
honnel authored and derTobsch committed May 23, 2024
1 parent 88cd7d5 commit 27b2b02
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@
import org.springframework.transaction.annotation.Transactional;
import org.synyx.urlaubsverwaltung.application.application.Application;
import org.synyx.urlaubsverwaltung.application.application.ApplicationInteractionService;
import org.synyx.urlaubsverwaltung.comment.AbstractComment;
import org.synyx.urlaubsverwaltung.person.Person;
import org.synyx.urlaubsverwaltung.person.PersonDeletedEvent;
import org.synyx.urlaubsverwaltung.sicknote.comment.SickNoteCommentAction;
import org.synyx.urlaubsverwaltung.sicknote.comment.SickNoteCommentService;

import java.util.List;

import static java.lang.invoke.MethodHandles.lookup;
import static org.slf4j.LoggerFactory.getLogger;
import static org.synyx.urlaubsverwaltung.sicknote.comment.SickNoteCommentAction.EDITED;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ void sendCancelToColleagues(SickNote sickNote) {
mailService.send(mailToRelevantColleagues);
}


@Async
void sendSickNoteCreatedNotificationToOfficeAndResponsibleManagement(SickNote createdSickNote, String comment) {

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/MailMessages_de.properties
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ sick_note.cancelled.to_colleagues=eine Abwesenheit von {0} wurde zurückgenommen
sick_note.cancelled.to_colleagues.overview=Link zur Abwesenheitsübersicht

sick_note.information.title=Informationen zur Krankmeldung:
sick_note.information.comment.title=Kommentar zur Krankmeldung:
sick_note.information.comment.title=Kommentar(e) zur Krankmeldung:
sick_note.information.period=Zeitraum:
sick_note.information.aubPeriod=Zeitraum der AU:
sick_note.information.type=Art der Krankmeldung:
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/MailMessages_de_AT.properties
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ sick_note.cancelled.to_colleagues=eine Abwesenheit von {0} wurde zurückgenommen
sick_note.cancelled.to_colleagues.overview=Link zur Abwesenheitsübersicht

sick_note.information.title=Informationen zur Krankmeldung:
sick_note.information.comment.title=Kommentar zur Krankmeldung:
sick_note.information.comment.title=Kommentar(e) zur Krankmeldung:
sick_note.information.period=Zeitraum:
sick_note.information.aubPeriod=Zeitraum der AU:
sick_note.information.type=Art der Krankmeldung:
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/MailMessages_el.properties
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ sick_note.cancelled.to_colleagues=μια απουσία της {0} ακυρώθ
sick_note.cancelled.to_colleagues.overview=σύνδεσμος στην επισκόπηση απουσιών

sick_note.information.title=Πληροφορίες σχετικά με το σημείωμα ασθενείας:
sick_note.information.comment.title=Σχολιάστε το άρρωστο σημείωμα:
sick_note.information.comment.title=Σχόλιο(α) για το σημείωμα ασθενείας:
sick_note.information.period=περίοδος:
sick_note.information.aubPeriod=Περίοδος της ΑΕ:
sick_note.information.type=είδος του σημειώματος ασθενείας:
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/MailMessages_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ sick_note.cancelled.to_colleagues=an absence of {0} was cancelled:
sick_note.cancelled.to_colleagues.overview=link to absence overview

sick_note.information.title=Information on sick note:
sick_note.information.comment.title=Comment for sick note:
sick_note.information.comment.title=Comment(s) for sick note:
sick_note.information.period=Period:
sick_note.information.aubPeriod=Period of the certificate of incapacity for work:
sick_note.information.type=Type of sick note:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[(#{greeting(${recipient.niceName})})],

[(#{sick_note.accepted_by_management.to_management(${maintainer.niceName},${sickNote.person.niceName})})]

[(${baseLinkURL})]web/sicknote/[(${sickNote.id})]

[(#{sick_note.information.title})]

[(${rightPadder.rightPad('__#{sick_note.information.period}__',__#{sick_note.information.max_length}__)})] [(${#temporals.format(sickNote.startDate, 'dd.MM.yyyy')})] [(#{until})] [(${#temporals.format(sickNote.endDate, 'dd.MM.yyyy')})], [(#{__${sickNote.dayLength.name}__})][# th:if="${not #strings.isEmpty(sickNote.aubStartDate)}"]
[(${rightPadder.rightPad('__#{sick_note.information.aubPeriod}__',__#{sick_note.information.max_length}__)})] [(${#temporals.format(sickNote.aubStartDate, 'dd.MM.yyyy')})] [(#{until})] [(${#temporals.format(sickNote.aubEndDate, 'dd.MM.yyyy')})][/]
[(${rightPadder.rightPad('__#{sick_note.information.type}__',__#{sick_note.information.max_length}__)})] [(#{__${sickNote.sickNoteType.messageKey}__})]
[# th:if="${not #lists.isEmpty(comments)}"]
[(#{sick_note.information.comment.title})]
[# th:each="comment : ${comments}"]
[(${comment})]
[/][/]
[(#{notification.description(|${baseLinkURL}web/person/${recipient.id}/notifications|)})]
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,13 @@
import org.synyx.urlaubsverwaltung.person.Person;
import org.synyx.urlaubsverwaltung.person.PersonDeletedEvent;
import org.synyx.urlaubsverwaltung.sicknote.comment.SickNoteCommentAction;
import org.synyx.urlaubsverwaltung.sicknote.comment.SickNoteCommentEntity;
import org.synyx.urlaubsverwaltung.sicknote.comment.SickNoteCommentService;

import java.time.Clock;
import java.time.Instant;
import java.time.LocalDate;
import java.time.ZoneId;
import java.util.List;

import static java.time.ZoneOffset.UTC;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import org.synyx.urlaubsverwaltung.period.DayLength;
import org.synyx.urlaubsverwaltung.person.Person;
import org.synyx.urlaubsverwaltung.person.PersonService;
import org.synyx.urlaubsverwaltung.sicknote.comment.SickNoteCommentService;
import org.synyx.urlaubsverwaltung.sicknote.sicknotetype.SickNoteType;

import java.io.IOException;
Expand Down Expand Up @@ -52,6 +53,8 @@ class SickNoteMailServiceIT extends TestContainersBase {
private MailRecipientService mailRecipientService;
@MockBean
private SickNoteService sickNoteService;
@MockBean
private SickNoteCommentService sickNoteCommentService;

@Test
void sendEndOfSickPayNotification() throws MessagingException, IOException {
Expand Down Expand Up @@ -341,7 +344,6 @@ void sendSickNoteCancelToColleagues() throws MessagingException, IOException {
Deine E-Mail-Benachrichtigungen kannst du unter https://localhost:8080/web/person/%s/notifications anpassen.""".formatted(colleague.getId()));
}


@Test
void sendSickNoteCreatedNotificationToOfficeAndResponsibleManagement() throws MessagingException, IOException {

Expand Down Expand Up @@ -390,7 +392,7 @@ void sendSickNoteCreatedNotificationToOfficeAndResponsibleManagement() throws Me
Zeitraum der AU: 02.02.2022 bis 01.04.2022
Art der Krankmeldung: Krankmeldung
Kommentar zur Krankmeldung:
Kommentar(e) zur Krankmeldung:
Weiterführende Information
Expand Down

0 comments on commit 27b2b02

Please sign in to comment.