Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
12 / 12 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
| IndexAIRequestLogRequest | |
100.00% |
12 / 12 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
| rules | |
100.00% |
12 / 12 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Http\Requests\v2\AIRequestLog; |
| 4 | |
| 5 | use App\Http\Requests\v2\Parameter\Concerns\AuthorizesVengresoAdmin; |
| 6 | use Illuminate\Foundation\Http\FormRequest; |
| 7 | |
| 8 | /** |
| 9 | * Request for listing AI request logs with optional filters. |
| 10 | * |
| 11 | * @property int|null $page Current page number |
| 12 | * @property int|null $per_page Number of items per page (default: 25, max: 100) |
| 13 | * @property string|null $user_id Filter by user ID |
| 14 | * @property string|null $company_id Filter by company ID |
| 15 | * @property string|null $feature Filter by feature (engage_generate, post_generate, rewrite, check_sentences, persona_generate) |
| 16 | * @property string|null $status Filter by status (pending, success, error) |
| 17 | * @property string|null $search Text search across prompt_input and prompt_output |
| 18 | * @property string|null $sort_order Sort direction for created_at (asc or desc, default: desc) |
| 19 | * @property string|null $date_from Filter logs created on or after this date (Y-m-d) |
| 20 | * @property string|null $date_to Filter logs created on or before this date (Y-m-d) |
| 21 | */ |
| 22 | class IndexAIRequestLogRequest extends FormRequest |
| 23 | { |
| 24 | use AuthorizesVengresoAdmin; |
| 25 | |
| 26 | /** |
| 27 | * Get the validation rules that apply to the request. |
| 28 | * |
| 29 | * @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string> |
| 30 | */ |
| 31 | public function rules(): array |
| 32 | { |
| 33 | return [ |
| 34 | 'page' => 'sometimes|integer|min:1', |
| 35 | 'per_page' => 'sometimes|integer|min:1|max:100', |
| 36 | 'user_id' => 'sometimes|string|max:255', |
| 37 | 'company_id' => 'sometimes|string|max:255', |
| 38 | 'feature' => 'sometimes|string|max:255', |
| 39 | 'status' => 'sometimes|string|in:pending,success,error', |
| 40 | 'search' => 'sometimes|string|max:500', |
| 41 | 'sort_order' => 'sometimes|string|in:asc,desc', |
| 42 | 'date_from' => 'sometimes|date', |
| 43 | 'date_to' => 'sometimes|date', |
| 44 | ]; |
| 45 | } |
| 46 | } |