feat: restrict report submission to accepted proposals owned by the authenticated user
This commit is contained in:
parent
a03f3e3a7b
commit
d39754ecfc
@ -214,6 +214,10 @@ public function table(Table $table): Table
|
||||
return $this->getOwnerRecord()->status === CooperationStatus::ASSIGNMENT
|
||||
&& $taskAssignment->start_date->toDateString() <= now()->toDateString()
|
||||
&& $taskAssignment->end_date->toDateString() >= now()->toDateString()
|
||||
&& $this->getOwnerRecord()->proposal()
|
||||
->whereHas('partnerMedia.company', fn ($q) => $q->where('user_id', auth()->id()))
|
||||
->accepted()
|
||||
->exists()
|
||||
&& $taskAssignment->reports()
|
||||
->whereHas('mediaTaskAssignment.partnerMedia.company', fn ($q) => $q->where('user_id', auth()->id()))
|
||||
->where('reports.status', '!=', ApprovalStatus::REJECTED)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user