validate([ 'month' => 'required|date_format:Y-m', 'team_member_id' => 'required|exists:team_members,id', ]); $capacity = $this->capacityService->calculateIndividualCapacity($data['team_member_id'], $data['month']); return response()->json($capacity); } /** * Get Team Capacity * * Summarize the combined capacity for all active team members in a month. * * @group Capacity Planning * @urlParam month string required The month in YYYY-MM format. Example: 2026-02 * @response { * "month": "2026-02", * "person_days": 180.5, * "hours": 1444, * "members": [ * { * "id": "550e8400-e29b-41d4-a716-446655440000", * "name": "Ada Lovelace", * "person_days": 18.5, * "hours": 148 * } * ] * } */ public function team(Request $request): JsonResponse { $data = $request->validate([ 'month' => 'required|date_format:Y-m', ]); $payload = $this->capacityService->calculateTeamCapacity($data['month']); return response()->json($payload); } /** * Get Possible Revenue * * Estimate monthly revenue based on capacity hours and hourly rates. * * @group Capacity Planning * @urlParam month string required The month in YYYY-MM format. Example: 2026-02 * @response { * "month": "2026-02", * "possible_revenue": 21500.25 * } */ public function revenue(Request $request): JsonResponse { $data = $request->validate([ 'month' => 'required|date_format:Y-m', ]); $revenue = $this->capacityService->calculatePossibleRevenue($data['month']); return response()->json([ 'month' => $data['month'], 'possible_revenue' => $revenue, ]); } }