Skip to content

CROSSLINK-303 Add closing action mapping - #690

Merged
JanisSaldabols merged 3 commits into
mainfrom
CROSSLINK-303
Jul 24, 2026
Merged

CROSSLINK-303 Add closing action mapping#690
JanisSaldabols merged 3 commits into
mainfrom
CROSSLINK-303

Conversation

@JanisSaldabols

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings July 24, 2026 06:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a closingAction concept to the patron-request state model and wires scheduler “request aging” to use that state-driven closing action (instead of hard-coded borrower/lender defaults), aligning batch closures with the configured workflow.

Changes:

  • Add closingAction to the state model (YAML) and expose it via schema/OpenAPI.
  • Extend action-mapping to parse and expose a per-state closing action.
  • Update request-aging batch action to invoke the mapped closing action and adjust tests accordingly.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
misc/state-models.yaml Adds closingAction: cannot-supply to selected SUPPLIER states used by request-aging defaults.
misc/state-model.json Extends the state-model schema with closingAction.
broker/scheduler/service/batch_action.go Request aging now derives the background action from the state model’s closing action.
broker/scheduler/service/batch_action_test.go Updates request-aging tests to reflect state-model-derived actions and new error behavior.
broker/patron_request/service/action_mapping.go Parses closingAction into the state config and exposes GetClosingAction; records model name for error reporting.
broker/patron_request/service/action_mapping_test.go Adds unit coverage for GetClosingAction.
broker/oapi/open-api.yaml Adds closingAction to the API schema for states.
Comments suppressed due to low confidence (1)

broker/scheduler/service/batch_action.go:154

  • Failing the entire batch when a state has no closingAction configured means one unexpected state (or a config drift) stops processing for all other requests. Since the loop already tolerates CreateTask failures, consider treating a missing closing action similarly (record and continue) so the batch run remains best-effort.
			action := actionMapping.GetClosingAction(pr)
			if action == nil {
				return events.NewErrorResult("could not find closing action for patron request state: "+string(pr.State)+" within state model: "+actionMapping.StateModelName, "closing action not found")
			}

Comment thread broker/scheduler/service/batch_action.go
Comment thread broker/patron_request/service/action_mapping.go
@JanisSaldabols
JanisSaldabols merged commit c8c488f into main Jul 24, 2026
6 checks passed
@JanisSaldabols
JanisSaldabols deleted the CROSSLINK-303 branch July 24, 2026 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants