RED-10297: Provide default date format file when missing on dossier template import
This commit is contained in:
parent
8202ff8ac6
commit
83a0163960
@ -108,7 +108,7 @@ public class DossierTemplateImportService {
|
||||
private final ComponentDefinitionPersistenceService componentDefinitionPersistenceService;
|
||||
private final EntityTypeImportService entityTypeImportService;
|
||||
private final SystemManagedTypesImport systemManagedTypesImport;
|
||||
private final DefaultDateFormatsProvider defaultDateFormatsProvider;
|
||||
private final DefaultDateFormatsProvider defaultDateFormatsProvider;
|
||||
|
||||
|
||||
public String importDossierTemplate(ImportDossierTemplateRequest request) {
|
||||
@ -499,11 +499,13 @@ public class DossierTemplateImportService {
|
||||
if (dateFormats == null && applicationType.equals("DocuMine")) {
|
||||
dateFormats = defaultDateFormatsProvider.getDateFormats();
|
||||
}
|
||||
List<DateFormatPatternErrorMessage> dateFormatPatternErrorMessages = dateFormatsValidationService.validateDateFormats(dateFormats);
|
||||
if (!dateFormatPatternErrorMessages.isEmpty()) {
|
||||
throw new BadRequestException("The date formats file contains errors");
|
||||
if (dateFormats != null) {
|
||||
List<DateFormatPatternErrorMessage> dateFormatPatternErrorMessages = dateFormatsValidationService.validateDateFormats(dateFormats);
|
||||
if (!dateFormatPatternErrorMessages.isEmpty()) {
|
||||
throw new BadRequestException("The date formats file contains errors");
|
||||
}
|
||||
dateFormatsPersistenceService.setDateFormats(dateFormats, dossierTemplateId, request.getDateFormatsExportModel().getVersion());
|
||||
}
|
||||
dateFormatsPersistenceService.setDateFormats(dateFormats, dossierTemplateId, request.getDateFormatsExportModel().getVersion());
|
||||
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user