Skip to content

Make Return Directives configurable and localize them in DE and EN#13

Open
MedGhazal wants to merge 1 commit into
lukaslerche:mainfrom
MedGhazal:returnDirectiveFeature
Open

Make Return Directives configurable and localize them in DE and EN#13
MedGhazal wants to merge 1 commit into
lukaslerche:mainfrom
MedGhazal:returnDirectiveFeature

Conversation

@MedGhazal

Copy link
Copy Markdown

Configurable return directives for returned media items

We introduced a configurable return directive system to make the handling of returned items more flexible across different libraries and circulation desks.

Previously, the return logic was fixed in code. The new approach moves the decision-making into configuration files, allowing administrators to define which return bin an item should go to based on configurable conditions.

The solution now supports:

  • Global return directives as defaults.
  • Library/circulation desk-specific overrides.
  • Priority-based rule evaluation (higher priority rules are checked first).
  • Configurable messages and labels per language.
  • Conditional matching based on item attributes.

Example use cases:

  • Items with exceptional statuses (e.g. lost, missing, claimed returned) can be routed to a red bin requiring staff attention.
  • Items requiring normal staff workflow (e.g. hold shelf, transit, resource sharing/ILL) can be routed to a yellow bin.
  • Normal returns can fall back to a blue bin.

The MediaItem model was extended to provide the necessary information for these decisions:

  • process_type
  • destination_library_code
  • destination_location_code
  • has_request
  • request_type

The configuration supports conditions such as:

  • Field values:
when:
  any:
    - field: process_type
      in:
        - LOST_LOAN
        - MISSING
  • Existence checks:
when:
  any:
    - field: destination_library_code
      exists: true
  • Boolean checks:
when:
  any:
    - field: has_request
      equals: true

Return directives are evaluated by priority, and the first matching directive is applied.

This keeps the return workflow flexible without requiring code changes whenever a library wants to adjust its local handling rules.

@vercel

vercel Bot commented Jul 15, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the lerche's projects Team on Vercel.

A member of the Team first needs to authorize it.

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