-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #134 from pagopa/uat
breaking: promotion to prod - report v2
- Loading branch information
Showing
41 changed files
with
928 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
@startuml | ||
class FileReport { | ||
-senderCodes: String[] | ||
-filesUploaded: FileMetadata[] | ||
-ackToDownload: String[] | ||
+addFileUploaded(file) | ||
+removeFileUploaded(file) | ||
+addSenderCode(senderCode) | ||
+addAckToDownload(file) | ||
+removeAckToDownload(file) | ||
+addFileOrUpdateStatus(file) | ||
+removeFilesOlderThan(days) | ||
+addSquaringDataToFile(file) | ||
} | ||
|
||
class FileMetadata { | ||
-name: String | ||
-path: String | ||
-size: Long | ||
-status: Enum | ||
-transmissionDate: Date | ||
-dataSummary: AggregatesDataSummary | ||
|
||
+enrichWithSquaringData() | ||
} | ||
|
||
class AggregatesDataSummary { | ||
-minAccountingDate: Date | ||
-maxAccountingDate: Date | ||
-numberOfMerchants: Integer | ||
-countNegativeTransactions: Long | ||
-countPositiveTransactions: Long | ||
-sumAmountNegativeTransactions: Long | ||
-sumAmountPositiveTransactions: Long | ||
-sha256OriginFile: String | ||
} | ||
|
||
FileReport "1" *-- "n" FileMetadata | ||
FileMetadata *-- AggregatesDataSummary | ||
@enduml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 6 additions & 3 deletions
9
src/main/java/it/gov/pagopa/rtd/ms/rtdmsfilereporter/RtdMsFileReporterApplication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
package it.gov.pagopa.rtd.ms.rtdmsfilereporter; | ||
|
||
import it.gov.pagopa.rtd.ms.rtdmsfilereporter.feign.config.StorageProperties; | ||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.boot.context.properties.EnableConfigurationProperties; | ||
|
||
@SpringBootApplication | ||
@EnableConfigurationProperties(StorageProperties.class) | ||
public class RtdMsFileReporterApplication { | ||
|
||
public static void main(String[] args) { | ||
SpringApplication.run(RtdMsFileReporterApplication.class, args); | ||
} | ||
public static void main(String[] args) { | ||
SpringApplication.run(RtdMsFileReporterApplication.class, args); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ter/controller/model/FileMetadataDto.java → .../controller/model/v1/FileMetadataDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...orter/controller/model/FileReportDto.java → ...er/controller/model/v1/FileReportDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...controller/model/FileReportDtoMapper.java → ...troller/model/v1/FileReportDtoMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
...in/java/it/gov/pagopa/rtd/ms/rtdmsfilereporter/controller/model/v2/FileMetadataV2Dto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package it.gov.pagopa.rtd.ms.rtdmsfilereporter.controller.model.v2; | ||
|
||
import it.gov.pagopa.rtd.ms.rtdmsfilereporter.controller.model.v1.FileMetadataDto; | ||
import it.gov.pagopa.rtd.ms.rtdmsfilereporter.domain.model.AggregatesDataSummary; | ||
import jakarta.validation.constraints.NotNull; | ||
import lombok.Data; | ||
import lombok.EqualsAndHashCode; | ||
|
||
@EqualsAndHashCode(callSuper = true) | ||
@Data | ||
public class FileMetadataV2Dto extends FileMetadataDto { | ||
|
||
@NotNull | ||
private AggregatesDataSummary dataSummary; | ||
} |
10 changes: 10 additions & 0 deletions
10
...main/java/it/gov/pagopa/rtd/ms/rtdmsfilereporter/controller/model/v2/FileReportV2Dto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package it.gov.pagopa.rtd.ms.rtdmsfilereporter.controller.model.v2; | ||
|
||
import java.util.Collection; | ||
import lombok.Data; | ||
|
||
@Data | ||
public class FileReportV2Dto { | ||
|
||
Collection<FileMetadataV2Dto> filesRecentlyUploaded; | ||
} |
16 changes: 16 additions & 0 deletions
16
...ava/it/gov/pagopa/rtd/ms/rtdmsfilereporter/controller/model/v2/FileReportV2DtoMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package it.gov.pagopa.rtd.ms.rtdmsfilereporter.controller.model.v2; | ||
|
||
import it.gov.pagopa.rtd.ms.rtdmsfilereporter.domain.model.FileMetadata; | ||
import it.gov.pagopa.rtd.ms.rtdmsfilereporter.domain.model.FileReport; | ||
import org.mapstruct.Mapper; | ||
import org.mapstruct.Mapping; | ||
|
||
@Mapper(componentModel = "spring") | ||
public interface FileReportV2DtoMapper { | ||
|
||
@Mapping(source = "filesUploaded", target = "filesRecentlyUploaded") | ||
FileReportV2Dto fileReportToDto(FileReport fileReport); | ||
|
||
@Mapping(source = "aggregatesDataSummary", target = "dataSummary") | ||
FileMetadataV2Dto fileMetadataToDto(FileMetadata fileMetadata); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
src/main/java/it/gov/pagopa/rtd/ms/rtdmsfilereporter/domain/model/AggregatesDataSummary.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package it.gov.pagopa.rtd.ms.rtdmsfilereporter.domain.model; | ||
|
||
import java.time.LocalDate; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Data | ||
@Builder | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class AggregatesDataSummary { | ||
|
||
private LocalDate minAccountingDate; | ||
private LocalDate maxAccountingDate; | ||
private int numberOfMerchants; | ||
private long countNegativeTransactions; | ||
private long countPositiveTransactions; | ||
private long sumAmountNegativeTransactions; | ||
private long sumAmountPositiveTransactions; | ||
// sha256 of the initial input file containing the transactions | ||
private String sha256OriginFile; | ||
|
||
public static AggregatesDataSummary createInvalidDataSummary() { | ||
return AggregatesDataSummary.builder() | ||
.sumAmountPositiveTransactions(-1) | ||
.sumAmountNegativeTransactions(-1) | ||
.countPositiveTransactions(-1) | ||
.countNegativeTransactions(-1) | ||
.numberOfMerchants(-1) | ||
.minAccountingDate(null) | ||
.maxAccountingDate(null) | ||
.build(); | ||
} | ||
} |
Oops, something went wrong.