Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

quick fix for deliveries query for ELIMS reports #17136

Merged
merged 1 commit into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,15 @@ class DatabaseDeliveryAccess(
val org = BaseEngine.settingsProviderSingleton.findOrganization(organization)

var filter = if (org?.featureFlags?.contains("ELIMS_DATA") == true) {
REPORT_FILE.NEXT_ACTION.isNull
.and(REPORT_FILE.TRANSPORT_PARAMS.isNotNull)
.and(REPORT_FILE.TRANSPORT_RESULT.notLike("%downloadedBy%"))
.and(REPORT_FILE.SCHEMA_TOPIC.equalIgnoreCase(Topic.ELR_ELIMS.jsonVal))
.and(REPORT_FILE.RECEIVING_ORG.eq(organization))
REPORT_FILE.NEXT_ACTION.eq(TaskAction.send)
.and(REPORT_FILE.SCHEMA_TOPIC.notEqualIgnoreCase(Topic.ELR_ELIMS.jsonVal))
.or(
REPORT_FILE.NEXT_ACTION.isNull
.and(REPORT_FILE.TRANSPORT_PARAMS.isNotNull)
.and(REPORT_FILE.TRANSPORT_RESULT.notLike("%downloadedBy%"))
.and(REPORT_FILE.SCHEMA_TOPIC.equalIgnoreCase(Topic.ELR_ELIMS.jsonVal))
)
.and(REPORT_FILE.RECEIVING_ORG.eq(organization))
} else {
REPORT_FILE.NEXT_ACTION.eq(TaskAction.send)
.and(REPORT_FILE.RECEIVING_ORG.eq(organization))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,18 @@ class HistoryDatabaseAccessTests {
fun `test organizationFilter with feature flag`() {
var conditionExpected = """
(
"public"."report_file"."next_action" is null
and "public"."report_file"."transport_params" is not null
and "public"."report_file"."transport_result" not like '%downloadedBy%'
and lower(cast("public"."report_file"."schema_topic" as varchar)) = lower('elr-elims')
(
(
"public"."report_file"."next_action" = 'send'
and lower(cast("public"."report_file"."schema_topic" as varchar)) <> lower('elr-elims')
)
or (
"public"."report_file"."next_action" is null
and "public"."report_file"."transport_params" is not null
and "public"."report_file"."transport_result" not like '%downloadedBy%'
and lower(cast("public"."report_file"."schema_topic" as varchar)) = lower('elr-elims')
)
)
and "public"."report_file"."receiving_org" = 'test'
and "public"."report_file"."receiving_org_svc" = 'test'
)
Expand Down
Loading