diff --git a/application/aam-backend-service/src/main/kotlin/com/aamdigital/aambackendservice/reporting/report/dto/ControllerDtos.kt b/application/aam-backend-service/src/main/kotlin/com/aamdigital/aambackendservice/reporting/report/dto/ControllerDtos.kt index 9910e92..13f3582 100644 --- a/application/aam-backend-service/src/main/kotlin/com/aamdigital/aambackendservice/reporting/report/dto/ControllerDtos.kt +++ b/application/aam-backend-service/src/main/kotlin/com/aamdigital/aambackendservice/reporting/report/dto/ControllerDtos.kt @@ -20,8 +20,8 @@ data class ReportDoc( @JsonProperty("_rev") val rev: String, val title: String, - val mode: String, - val aggregationDefinition: String, + val mode: String = "unknown", + val aggregationDefinition: String?, val created: EditAtBy?, val updated: EditAtBy?, ) diff --git a/application/aam-backend-service/src/main/kotlin/com/aamdigital/aambackendservice/reporting/storage/DefaultReportingStorage.kt b/application/aam-backend-service/src/main/kotlin/com/aamdigital/aambackendservice/reporting/storage/DefaultReportingStorage.kt index 644da36..2b63235 100644 --- a/application/aam-backend-service/src/main/kotlin/com/aamdigital/aambackendservice/reporting/storage/DefaultReportingStorage.kt +++ b/application/aam-backend-service/src/main/kotlin/com/aamdigital/aambackendservice/reporting/storage/DefaultReportingStorage.kt @@ -50,9 +50,9 @@ class DefaultReportingStorage( id = it.id, name = it.doc.title, mode = it.doc.mode, - query = it.doc.aggregationDefinition, + query = it.doc.aggregationDefinition ?: "", schema = ReportSchema( - fields = reportSchemaGenerator.getTableNamesByQuery(it.doc.aggregationDefinition) + fields = reportSchemaGenerator.getTableNamesByQuery(it.doc.aggregationDefinition ?: "") ) ) } @@ -68,10 +68,10 @@ class DefaultReportingStorage( Report( id = reportDoc.id, name = reportDoc.title, - query = reportDoc.aggregationDefinition, + query = reportDoc.aggregationDefinition ?: "", mode = reportDoc.mode, schema = ReportSchema( - fields = reportSchemaGenerator.getTableNamesByQuery(reportDoc.aggregationDefinition) + fields = reportSchemaGenerator.getTableNamesByQuery(reportDoc.aggregationDefinition ?: "") ) ) )