use of de.symeda.sormas.app.backend.event.EventJurisdictionDto in project SORMAS-Project by hzi-braunschweig.
the class JurisdictionHelper method createEventJurisdictionDto.
public static EventJurisdictionDto createEventJurisdictionDto(Event event) {
if (event == null) {
return null;
}
Location eventLocation = event.getEventLocation();
if (eventLocation == null) {
return null;
}
EventJurisdictionDto eventJurisdiction = new EventJurisdictionDto();
if (event.getReportingUser() != null) {
eventJurisdiction.setReportingUserUuid(event.getReportingUser().getUuid());
}
if (event.getResponsibleUser() != null) {
eventJurisdiction.setResponsibleUserUuid(event.getResponsibleUser().getUuid());
}
if (eventLocation.getRegion() != null) {
eventJurisdiction.setRegionUuid(eventLocation.getRegion().getUuid());
}
if (eventLocation.getDistrict() != null) {
eventJurisdiction.setDistrictUuid(eventLocation.getDistrict().getUuid());
}
if (eventLocation.getCommunity() != null) {
eventJurisdiction.setCommunityUuid(eventLocation.getCommunity().getUuid());
}
return eventJurisdiction;
}
use of de.symeda.sormas.app.backend.event.EventJurisdictionDto in project SORMAS-Project by hzi-braunschweig.
the class TaskJurisdictionBooleanValidator method of.
public static TaskJurisdictionBooleanValidator of(TaskJurisdictionDto taskJurisdictionDto, UserJurisdiction userJurisdiction) {
final List<BooleanJurisdictionValidator> associatedJurisdictionValidators = new ArrayList<>();
final CaseJurisdictionDto caseJurisdiction = taskJurisdictionDto.getCaseJurisdiction();
if (caseJurisdiction != null) {
associatedJurisdictionValidators.add(CaseJurisdictionBooleanValidator.of(caseJurisdiction, userJurisdiction));
}
final ContactJurisdictionDto contactJurisdiction = taskJurisdictionDto.getContactJurisdiction();
if (contactJurisdiction != null) {
associatedJurisdictionValidators.add(ContactJurisdictionBooleanValidator.of(contactJurisdiction, userJurisdiction));
}
final EventJurisdictionDto eventJurisdiction = taskJurisdictionDto.getEventJurisdiction();
if (eventJurisdiction != null) {
associatedJurisdictionValidators.add(EventJurisdictionBooleanValidator.of(eventJurisdiction, userJurisdiction));
}
return new TaskJurisdictionBooleanValidator(taskJurisdictionDto, userJurisdiction, associatedJurisdictionValidators);
}
Aggregations