BestowalCancellationService
in package
uses
LocatorAwareTrait
Cancels an in-flight bestowal and unwinds linked recommendations.
Table of Contents
Constants
- EVENT_NAME : mixed = 'Awards.BestowalCancelled'
- RECONSIDERATION_STATE : mixed = 'Submitted'
- TODO_CANCELLATION_NOTE : mixed = 'Bestowal cancelled for complete reconsideration.'
Properties
- $actionItemService : ActionItemService
- $approvalLifecycleService : RecommendationApprovalWorkflowLifecycleService
- $bestowalRecommendationsTable : Table
- $bestowalsTable : Table
- $recommendationsTable : Table
- $syncService : BestowalRecommendationSyncService
- $transitionService : RecommendationTransitionService
Methods
- __construct() : mixed
- cancel() : array<string, mixed>
- Cancel a bestowal, unwind linked recommendations, and clear bestowal links.
- cancelOpenTodos() : array<string|int, int>
- Audit-cancel every open to-do while the locked bestowal still permits mutations.
- failureResult() : array<string, mixed>
- resolveLinkedRecommendations() : array<int, Recommendation>
Constants
EVENT_NAME
public
mixed
EVENT_NAME
= 'Awards.BestowalCancelled'
RECONSIDERATION_STATE
public
mixed
RECONSIDERATION_STATE
= 'Submitted'
TODO_CANCELLATION_NOTE
public
mixed
TODO_CANCELLATION_NOTE
= 'Bestowal cancelled for complete reconsideration.'
Properties
$actionItemService
private
ActionItemService
$actionItemService
$approvalLifecycleService
private
RecommendationApprovalWorkflowLifecycleService
$approvalLifecycleService
$bestowalRecommendationsTable
private
Table
$bestowalRecommendationsTable
$bestowalsTable
private
Table
$bestowalsTable
$recommendationsTable
private
Table
$recommendationsTable
$syncService
private
BestowalRecommendationSyncService
$syncService
$transitionService
private
RecommendationTransitionService
$transitionService
Methods
__construct()
public
__construct([Table|null $bestowalsTable = null ][, Table|null $recommendationsTable = null ][, Table|null $bestowalRecommendationsTable = null ][, BestowalRecommendationSyncService|null $syncService = null ][, RecommendationApprovalWorkflowLifecycleService|null $approvalLifecycleService = null ][, ActionItemService|null $actionItemService = null ][, RecommendationTransitionService|null $transitionService = null ]) : mixed
Parameters
- $bestowalsTable : Table|null = null
-
Optional injected bestowals table.
- $recommendationsTable : Table|null = null
-
Optional injected recommendations table.
- $bestowalRecommendationsTable : Table|null = null
-
Optional injected join table.
- $syncService : BestowalRecommendationSyncService|null = null
-
Optional injected sync service.
- $approvalLifecycleService : RecommendationApprovalWorkflowLifecycleService|null = null
-
Optional lifecycle service.
- $actionItemService : ActionItemService|null = null
-
Optional action-item service.
- $transitionService : RecommendationTransitionService|null = null
-
Optional transition service.
cancel()
Cancel a bestowal, unwind linked recommendations, and clear bestowal links.
public
cancel(int $bestowalId, int $actorId, string $closeReason) : array<string, mixed>
Parameters
- $bestowalId : int
-
Bestowal ID.
- $actorId : int
-
Actor performing the cancellation.
- $closeReason : string
-
Required cancellation reason.
Return values
array<string, mixed>cancelOpenTodos()
Audit-cancel every open to-do while the locked bestowal still permits mutations.
private
cancelOpenTodos(int $bestowalId, int $actorId) : array<string|int, int>
Parameters
- $bestowalId : int
-
Bestowal ID.
- $actorId : int
-
Actor performing the cancellation.
Return values
array<string|int, int> —Cancelled action-item IDs.
failureResult()
private
failureResult(string $error) : array<string, mixed>
Parameters
- $error : string
Return values
array<string, mixed>resolveLinkedRecommendations()
private
resolveLinkedRecommendations(Bestowal $bestowal) : array<int, Recommendation>
Parameters
- $bestowal : Bestowal
-
Bestowal with optional recommendations contain.