Fix existing cancel workflow

This commit is contained in:
Deon George 2022-08-03 15:47:09 +10:00
parent dd76fda274
commit a52c20993b
2 changed files with 20 additions and 1 deletions

View File

@ -40,6 +40,21 @@ class ServiceController extends Controller
return $o->save();
}
private function action_cancel_pending_enter(Service $o): bool
{
$o->order_status = 'CANCEL-PENDING';
return $o->save();
}
private function action_cancelled(Service $o): bool
{
$o->order_status = 'CANCELLED';
$o->active = FALSE;
return $o->save();
}
/**
* Cancel a request to change a service
*

View File

@ -263,6 +263,10 @@ class Service extends Model implements IDs
'exit_method'=>'action_cancel_pending_exit',
'title'=>'Cancel Pending',
],
'CANCELLED'=> [
'title'=>'Service Cancelled',
'enter_method'=>'action_cancelled',
],
// Service to be Upgraded
'CHANGE-CANCEL' => [
'next'=>[
@ -280,7 +284,7 @@ class Service extends Model implements IDs
'enter_method'=>'action_request_enter_redirect',
'title'=>'Change Service',
],
// Service is waiting on a supplier to activate a change
'CHANGE-PENDING' => [
'next'=>[
'ACTIVE'=>['wholesaler'],