Progress on order progress

This commit is contained in:
Deon George
2020-04-19 08:33:41 +10:00
parent e6f823da39
commit 6480f40b22
16 changed files with 505 additions and 224 deletions

View File

@@ -23,10 +23,10 @@ class ServicePolicy
// If this is a service for an account managed by a user.
return ($user->services->pluck('id')->search($o->id))
// The user is the wholesaler
// The user is the wholesaler
OR $user->isWholesaler()
// The user is the reseller
// The user is the reseller
OR $user->all_accounts()->pluck('id')->search($o->account_id);
}
@@ -41,6 +41,18 @@ class ServicePolicy
return TRUE;
}
/**
* Can the user progress an order status
*
* @param User $user
* @param Service $o
* @return bool
*/
public function progress(User $user, Service $o,string $next)
{
return $o->actions()->has($next);
}
/**
* Determine whether the user can update the service.
*