Skip to content

UXPROD-5562: spike - self-draining scheduled loan anonymization - #1687

Draft
slaemmer wants to merge 1 commit into
masterfrom
UXPROD-5562-spike-anonymization-side-table
Draft

slaemmer wants to merge 1 commit into
masterfrom
UXPROD-5562-spike-anonymization-side-table

Conversation

@slaemmer

Copy link
Copy Markdown
Contributor

Purpose

The current approach to loan anonymization already can lead to wasted throughput and could sometimes lead to starvation. This would certainly be the case when user specific anonymization would be added.

This is a prototypical implementation that resulted from a spike for User specific loan anonymization. It is intended to stay a draft.

Approach

Replace the seven anonymization checker classes with a single AnonymizationEligibility.dueAt() function and rework the scheduled job into a two-pass evaluate/drain over a derived due-date held in mod-circulation-storage's loan_anonymization_due table.

  • Evaluate: stamp a due-date on one page of closed loans that have no row yet.
  • Drain: fetch loans whose due-date has arrived, re-check them, and strip the eligible ones (the strip deletes the row); re-stamp any no-longer-eligible.

Invalidation hooks clear the relevant rows on a fee/fine closure and on any loan_history change. Adds the storage client, the eligibility kernel and its tests, and a wire-format contract test for due_at.

@slaemmer
slaemmer force-pushed the UXPROD-5562-spike-anonymization-side-table branch from 27fff21 to 8394b1b Compare July 27, 2026 13:38
Replace the seven anonymization checker classes with a single
AnonymizationEligibility.dueAt() function and rework the scheduled job into a
two-pass evaluate/drain over a derived due-date held in mod-circulation-storage's
loan_anonymization_due table.

- Evaluate: stamp a due-date on one page of closed loans that have no row yet.
- Drain: fetch loans whose due-date has arrived, re-check them, and strip the
  eligible ones (the strip deletes the row); re-stamp any no-longer-eligible.

Invalidation hooks clear the relevant rows on a fee/fine closure and on any
loan_history change. Adds the storage client, the eligibility kernel and its
tests, and a wire-format contract test for due_at.
@slaemmer
slaemmer force-pushed the UXPROD-5562-spike-anonymization-side-table branch from 8394b1b to 6a4117b Compare July 27, 2026 14:16
@sonarqubecloud

Copy link
Copy Markdown

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