|
@@ -6,6 +6,7 @@ use App\Models\Action;
|
|
|
use App\Models\Enums\ActionObjectType;
|
|
|
use App\Models\Enums\ObjectAction;
|
|
|
use App\Models\Project;
|
|
|
+use App\Models\Requirement;
|
|
|
use Carbon\Carbon;
|
|
|
use Illuminate\Support\Collection;
|
|
|
use Illuminate\Support\Facades\Auth;
|
|
@@ -33,11 +34,11 @@ class ActionRepository
|
|
|
}
|
|
|
|
|
|
public static function createByProject(
|
|
|
- Project $project,
|
|
|
- ObjectAction $action,
|
|
|
- string $comment = null,
|
|
|
- array $extraFields = []
|
|
|
- ): \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Builder
|
|
|
+ Project $project,
|
|
|
+ ObjectAction $action,
|
|
|
+ string $comment = null,
|
|
|
+ array $extraFields = []
|
|
|
+): \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Builder
|
|
|
{
|
|
|
return self::create(
|
|
|
$project->id,
|
|
@@ -49,6 +50,23 @@ class ActionRepository
|
|
|
);
|
|
|
}
|
|
|
|
|
|
+ public static function createRequirement(
|
|
|
+ Requirement $requiremen,
|
|
|
+ ObjectAction $action,
|
|
|
+ string $comment = null,
|
|
|
+ array $extraFields = []
|
|
|
+): \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Builder
|
|
|
+ {
|
|
|
+ return self::create(
|
|
|
+ $requiremen->id,
|
|
|
+ ActionObjectType::REQUIREMENT,
|
|
|
+ $action,
|
|
|
+ $requiremen->id,
|
|
|
+ $comment,
|
|
|
+ $extraFields
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
public static function latestDynamic(Project $project)
|
|
|
{
|
|
|
$actions = Action::query()
|