Skip to content

Scope billing run deletion filters to the current container#1146

Open
labkey-martyp wants to merge 1 commit into
release25.7-SNAPSHOTfrom
25.7_fb_scope_ehr_billing_delete
Open

Scope billing run deletion filters to the current container#1146
labkey-martyp wants to merge 1 commit into
release25.7-SNAPSHOTfrom
25.7_fb_scope_ehr_billing_delete

Conversation

@labkey-martyp

Copy link
Copy Markdown
Contributor

Rationale

EHR_BillingManager.deleteBillingRuns() filtered the invoice, invoicedItems, and miscCharges tables by objectid/invoiceId alone, with no container clause. Since DeleteBillingPeriodAction only checks EHR_BillingAdminPermission in the current container, a billing admin in one container could delete invoices and invoiced items, or detach misc charges, in any other container by submitting foreign objectids. All filters are now container-scoped via SimpleFilter.createContainerFilter().

Related Pull Requests

  • None

Changes

  • EHR_BillingManager: all delete/preview filters in deleteBillingRuns() are now container-scoped via a new createContainerScopedInFilter() helper.
  • EHR_BillingManager.TestCase: new integration test that seeds a complete billing run in each of two folders and verifies cross-container ids are ignored by both the testOnly preview and the actual delete, while same-container deletion still removes the run and detaches its misc charges.
  • EHR_BillingModule: registers the test via getIntegrationTests().

deleteBillingRuns() filtered the invoice, invoicedItems, and miscCharges tables by objectid/invoiceId alone, so a billing admin in one container could delete or detach billing data in any other container by passing foreign objectids. All filters are now container-scoped via SimpleFilter.createContainerFilter().

Adds an EHR_BillingManager.TestCase integration test, registered through EHR_BillingModule.getIntegrationTests(), that seeds a complete billing run in each of two folders and verifies that ids from another container are ignored by both the testOnly preview and the actual delete, while same-container deletion continues to remove the run and detach its misc charges.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant