feat: AfterSales CRM - SOP compliant real-estate customer care system
- Departments + cross-department transfer workflow - Role-based closing (staff→resolved, manager→closed) with proof_of_resolution - Private file storage with collection system + temporary signed URLs - Dashboard: resolved tickets table, stats, handler performance bar chart - Spatie RBAC (admin/manager/staff) - Notifications: TicketTransferred, TicketClosed (database + mail) - Pest tests: 8 tests, 21 assertions - Docker production-ready (Dockerfile + compose + entrypoint)
This commit is contained in:
32
app/Rules/RequireProofOfResolution.php
Normal file
32
app/Rules/RequireProofOfResolution.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Rules;
|
||||
|
||||
use App\Models\Feedback;
|
||||
use App\Services\FileService;
|
||||
use Closure;
|
||||
use Illuminate\Contracts\Validation\ValidationRule;
|
||||
use Illuminate\Support\Facades\App;
|
||||
|
||||
class RequireProofOfResolution implements ValidationRule
|
||||
{
|
||||
protected Feedback $feedback;
|
||||
|
||||
public function __construct(Feedback $feedback)
|
||||
{
|
||||
$this->feedback = $feedback;
|
||||
}
|
||||
|
||||
public function validate(string $attribute, mixed $value, Closure $fail): void
|
||||
{
|
||||
if ($value !== 'closed') {
|
||||
return;
|
||||
}
|
||||
|
||||
$fileService = App::make(FileService::class);
|
||||
|
||||
if (! $fileService->hasCollection($this->feedback, 'proof_of_resolution')) {
|
||||
$fail(__('Yêu cầu cung cấp tài liệu bằng chứng để hoàn tất quy trình.'));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user