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

Transition Requisition state to WITHDRAWN when Measurement is cancelled or failed #1739

Closed
3 tasks done
SanjayVas opened this issue Aug 6, 2024 · 1 comment
Closed
3 tasks done
Labels
enhancement New feature or request

Comments

@SanjayVas
Copy link
Member

SanjayVas commented Aug 6, 2024

If a Measurement is put into the CANCELLED or FAILED state by another actor, the CMMS public API provides no way for the DataProvider to determine from the Requisition resource that it can no longer be fulfilled. The DataProvider will get a FAILED_PRECONDITION error when attempting to fulfill, but the Requisition state will remain UNFULFILLED.

This is an API design flaw. The fix probably involves adding a new Requisition state to the public API.

@SanjayVas SanjayVas added the bug Something isn't working label Aug 6, 2024
@SanjayVas
Copy link
Member Author

It turns out this isn't entirely true, as Requisition has a denormalized measurement_state field. It's still better to have this be encapsulated in Requisition state rather than having to check both fields. This way the caller doesn't have to inspect the error to determine whether it's due to Requisition state or Measurement state.

@SanjayVas SanjayVas added enhancement New feature or request and removed bug Something isn't working labels Aug 9, 2024
@SanjayVas SanjayVas changed the title DataProvider has no way to determine if Measurement state is invalid for Requisition Transition Requisition state to WITHDRAWN when Measurement is cancelled or failed Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant