-
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.
feat: date range support for sql reports
- Loading branch information
1 parent
1ed881f
commit d4d821e
Showing
16 changed files
with
136 additions
and
20 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
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
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
37 changes: 37 additions & 0 deletions
37
...kotlin/com/aamdigital/aambackendservice/reporting/reportcalculation/dto/ControllerDtos.kt
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,37 @@ | ||
package com.aamdigital.aambackendservice.reporting.reportcalculation.dto | ||
|
||
import com.aamdigital.aambackendservice.domain.DomainReference | ||
import com.aamdigital.aambackendservice.reporting.domain.ReportCalculationOutcome | ||
import com.aamdigital.aambackendservice.reporting.domain.ReportCalculationParams | ||
import com.aamdigital.aambackendservice.reporting.domain.ReportCalculationStatus | ||
import com.fasterxml.jackson.databind.ObjectMapper | ||
import java.security.MessageDigest | ||
|
||
/** | ||
* This is the interface shared to external users of the API endpoints. | ||
*/ | ||
data class ReportCalculationDto( | ||
val id: String, | ||
val report: DomainReference, | ||
var status: ReportCalculationStatus, | ||
var startDate: String? = null, | ||
var endDate: String? = null, | ||
var params: ReportCalculationParams?, | ||
var outcome: ReportCalculationOutcome? = null, | ||
) | ||
|
||
data class ReportDataDto( | ||
val id: String, | ||
val report: DomainReference, | ||
val calculation: DomainReference, | ||
var data: List<*>, | ||
) { | ||
@OptIn(ExperimentalStdlibApi::class) | ||
fun getDataHash(): String { | ||
val mapper = ObjectMapper() | ||
val md = MessageDigest.getInstance("SHA-256") | ||
val input = mapper.writeValueAsString(data).toByteArray() | ||
val bytes = md.digest(input) | ||
return bytes.toHexString() | ||
} | ||
} |
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