docs(openspec): add reporting API contract documentation

Add comprehensive API documentation for the reporting endpoint:
- Request/response structure
- View type inference (did/is/will)
- Blank vs explicit zero semantics
- Status values and error responses

Related to enhanced-allocation change.
This commit is contained in:
2026-03-08 18:22:27 -04:00
parent 3324c4f156
commit b7bbfb45c0
27 changed files with 1632 additions and 35 deletions

View File

@@ -14,6 +14,7 @@ class AllocationResource extends BaseResource
'team_member_id' => $this->team_member_id,
'month' => $this->month?->format('Y-m'),
'allocated_hours' => $this->formatDecimal($this->allocated_hours),
'allocation_indicator' => $this->allocation_indicator ?? 'gray',
'created_at' => $this->formatDate($this->created_at),
'updated_at' => $this->formatDate($this->updated_at),
'project' => $this->whenLoaded('project', fn () => new ProjectResource($this->project)),

View File

@@ -0,0 +1,21 @@
<?php
namespace App\Http\Resources;
use Illuminate\Http\Request;
class ProjectMonthPlanResource extends BaseResource
{
public function toArray(Request $request): array
{
return [
'id' => $this->id,
'project_id' => $this->project_id,
'month' => $this->month?->format('Y-m'),
'planned_hours' => $this->formatDecimal($this->planned_hours),
'is_blank' => $this->planned_hours === null,
'created_at' => $this->formatDate($this->created_at),
'updated_at' => $this->formatDate($this->updated_at),
];
}
}