feat: complete Epic 0 — foundation migration & infrastructure setup
Stories 0.2-0.5: rename folders→declarations (backend+frontend), configure Redis for cache/queue/sessions, add foundation database migrations (permissions, archived_at), replace DeclarationStatus enum with architecture lifecycle values, create DeclarationObserver for status transition validation and auto-archive, fix controller status transitions to respect observer rules. 93 tests pass (240 assertions). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -81,20 +81,19 @@ class WorkspaceController extends Controller
|
||||
$workspace->load('users');
|
||||
|
||||
$clientsCount = $workspace->clients()->count();
|
||||
$foldersCount = $workspace->folders()->count();
|
||||
$foldersByStatus = $workspace->folders()
|
||||
$declarationsCount = $workspace->declarations()->count();
|
||||
$declarationsByStatus = $workspace->declarations()
|
||||
->selectRaw('status, count(*) as count')
|
||||
->groupBy('status')
|
||||
->pluck('count', 'status')
|
||||
->all();
|
||||
$foldersThisMonth = $workspace->folders()
|
||||
$declarationsThisMonth = $workspace->declarations()
|
||||
->whereMonth('created_at', now()->month)
|
||||
->whereYear('created_at', now()->year)
|
||||
->count();
|
||||
$foldersNeedingAttention = $workspace->folders()
|
||||
$declarationsNeedingAttention = $workspace->declarations()
|
||||
->whereIn('status', [
|
||||
\App\Enums\FolderStatus::WaitingDocuments,
|
||||
\App\Enums\FolderStatus::WaitingClientValidation,
|
||||
\App\Enums\DeclarationStatus::EnAttenteClient,
|
||||
])
|
||||
->count();
|
||||
|
||||
@@ -112,10 +111,10 @@ class WorkspaceController extends Controller
|
||||
],
|
||||
'stats' => [
|
||||
'clients' => $clientsCount,
|
||||
'folders' => $foldersCount,
|
||||
'folders_by_status' => $foldersByStatus,
|
||||
'folders_this_month' => $foldersThisMonth,
|
||||
'folders_needing_attention' => $foldersNeedingAttention,
|
||||
'declarations' => $declarationsCount,
|
||||
'declarations_by_status' => $declarationsByStatus,
|
||||
'declarations_this_month' => $declarationsThisMonth,
|
||||
'declarations_needing_attention' => $declarationsNeedingAttention,
|
||||
],
|
||||
'indexUrl' => route('workspaces.index'),
|
||||
'editUrl' => route('workspaces.edit', $workspace),
|
||||
|
||||
Reference in New Issue
Block a user