Skip to content

Make Acquisition Order aware it is for a Document Reqeust during its creation #1053

@JakobMiesner

Description

@JakobMiesner

When navigating to a pending Document Request edit and creating an Order from it (see image below), the Order is not aware it is created for a Document Request during its indexing.
This becomes a problem when we want to index information from Document Request onto the Order.

One of those cases was implemented here.
The PR added the field document_request_waiting_time to the Order index, which requires the creation date of the related document request.

The problem happens as follows:

  1. Document Request X exists with state PENDING and has no Order attached to it
  2. Librarian goes into the edit page for Document Request X and presses "create new Order".
  3. Librarian gets forwarded to the Order creation page.
  4. Librarian finishes creating Order Y.
  5. Order Y gets indexed and looks for a related Document Request. No Document Request is found, as the pid of Order Y was not yet added to Document Request X.
  6. The pid of Order Y gets added to Document Request X.
  7. Document Request X gets indexed.

This results in a state where Order Y has a related Document Request X, but the index of Order Y does nto reflect it.

In the PR mentioned above this problem was solved by reindexing the related order when a document request is indexed as can be seen here, but this is rather unclean.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions