Skip to content
This repository has been archived by the owner on Sep 15, 2023. It is now read-only.

Commit

Permalink
Release/version 1.2 (#45)
Browse files Browse the repository at this point in the history
* VACCINECER-1013: changed pdf file name to only have uvci with _ instead of :. Removed unused id on bean
  • Loading branch information
NicolaKellerTIM authored Jun 18, 2021
1 parent 1cce0c9 commit 07b00c7
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
@AllArgsConstructor
public abstract class CertificateCsvBean {

@CsvBindByName(column = "id")
private String id;
@CsvBindByName(column = "givenName")
private String givenName;
@CsvBindByName(column = "familyName")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,16 +224,15 @@ private void checkSize(List<CertificateCsvBean> csvBeans) {
}
}

private String getCertificateFileName(String givenName, String familyName, String uvci) {
return PDF_FILE_NAME_PREFIX + givenName + "-" + familyName + "-" + uvci;
private String getCertificateFileName(String uvci) {
return PDF_FILE_NAME_PREFIX + uvci.replace(":", "_");
}

private Map<String, byte[]> getPdfMap(List<CovidCertificateCreateResponseDto> responseDtos, List<CertificateCreateDto> createDtos) {
Map<String, byte[]> responseMap = new HashMap<>();
for (int i = 0; i < responseDtos.size(); i++) {
CovidCertificatePersonNameDto nameDto = createDtos.get(i).getPersonData().getName();
String certificateFileName = getCertificateFileName(nameDto.getGivenName(), nameDto.getFamilyName(), responseDtos.get(i).getUvci());
responseMap.put(certificateFileName, responseDtos.get(i).getPdf());
for (CovidCertificateCreateResponseDto responseDto : responseDtos) {
String certificateFileName = getCertificateFileName(responseDto.getUvci());
responseMap.put(certificateFileName, responseDto.getPdf());
}
return responseMap;
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/csv/recovery_csv_empty.csv
Original file line number Diff line number Diff line change
@@ -1 +1 @@
id,givenName,familyName,dateOfBirth,language,streetAndNr,zipCode,city,cantonCodeSender,dateOfFirstPositiveTestResult,countryOfTest
givenName,familyName,dateOfBirth,language,streetAndNr,zipCode,city,cantonCodeSender,dateOfFirstPositiveTestResult,countryOfTest
2 changes: 0 additions & 2 deletions src/test/resources/csv/recovery_csv_error_response.csv

This file was deleted.

4 changes: 2 additions & 2 deletions src/test/resources/csv/recovery_csv_invalid.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
id,givenName,familyName,dateOfBirth,language,streetAndNr,zipCode,city,cantonCodeSender,dateOfFirstPositiveTestResult,countryOfTest
1,Max,Muster,1985-09-20,de,MusterStrasse 1,998,Bern,BE,2020-12-20,CH
givenName,familyName,dateOfBirth,language,streetAndNr,zipCode,city,cantonCodeSender,dateOfFirstPositiveTestResult,countryOfTest
Max,Muster,1985-09-20,de,MusterStrasse 1,998,Bern,BE,2020-12-20,CH
4 changes: 2 additions & 2 deletions src/test/resources/csv/recovery_csv_valid.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
id,givenName,familyName,dateOfBirth,language,streetAndNr,zipCode,city,cantonCodeSender,dateOfFirstPositiveTestResult,countryOfTest
1,Max,Muster,1985-09-20,de,MusterStrasse 1,1234,Bern,BE,2020-12-20,CH
givenName,familyName,dateOfBirth,language,streetAndNr,zipCode,city,cantonCodeSender,dateOfFirstPositiveTestResult,countryOfTest
Max,Muster,1985-09-20,de,MusterStrasse 1,1234,Bern,BE,2020-12-20,CH
4 changes: 2 additions & 2 deletions src/test/resources/csv/test_csv_valid.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
id,givenName,familyName,dateOfBirth,language,streetAndNr,zipCode,city,cantonCodeSender,manufacturerCode,typeCode,sampleDateTime,testingCentreOrFacility,memberStateOfTest
1,Max,Muster,1985-09-20,de,MusterStrasse 1,1234,Bern,BE,1304,LP217198-3,2021-06-01T11:34Z,test,CH
givenName,familyName,dateOfBirth,language,streetAndNr,zipCode,city,cantonCodeSender,manufacturerCode,typeCode,sampleDateTime,testingCentreOrFacility,memberStateOfTest
Max,Muster,1985-09-20,de,MusterStrasse 1,1234,Bern,BE,1304,LP217198-3,2021-06-01T11:34Z,test,CH
4 changes: 2 additions & 2 deletions src/test/resources/csv/vaccination_csv_valid.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
id,givenName,familyName,dateOfBirth,language,streetAndNr,zipCode,city,cantonCodeSender,medicinalProductCode,numberOfDoses,totalNumberOfDoses,vaccinationDate,countryOfVaccination
1,Max,Muster,1985-09-20,de,MusterStrasse 1,1234,Bern,BE,EU/1/20/1507,2,2,2021-05-28,CH
givenName,familyName,dateOfBirth,language,streetAndNr,zipCode,city,cantonCodeSender,medicinalProductCode,numberOfDoses,totalNumberOfDoses,vaccinationDate,countryOfVaccination
Max,Muster,1985-09-20,de,MusterStrasse 1,1234,Bern,BE,EU/1/20/1507,2,2,2021-05-28,CH

0 comments on commit 07b00c7

Please sign in to comment.