Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Http\Repositories\interfaces; |
| 4 | |
| 5 | use App\Http\Models\PromptWritingGoal; |
| 6 | use Illuminate\Support\Collection; |
| 7 | |
| 8 | /** |
| 9 | * Interface for prompt writing goal data access operations. |
| 10 | * |
| 11 | * Abstracts prompt writing goal database queries, providing methods |
| 12 | * to manage writing goal options used by engage and post AI features. |
| 13 | */ |
| 14 | interface IPromptWritingGoalRepository |
| 15 | { |
| 16 | /** |
| 17 | * Get all prompt writing goals ordered by newest first. |
| 18 | * |
| 19 | * @return Collection<int, PromptWritingGoal> Collection of goals |
| 20 | */ |
| 21 | public function getAll(): Collection; |
| 22 | |
| 23 | /** |
| 24 | * Find a prompt writing goal by its ID. |
| 25 | * |
| 26 | * @param string $id The goal ID |
| 27 | * @return PromptWritingGoal|null The goal or null if not found |
| 28 | */ |
| 29 | public function findById(string $id): ?PromptWritingGoal; |
| 30 | |
| 31 | /** |
| 32 | * Create a new prompt writing goal. |
| 33 | * |
| 34 | * @param array{title: string, description: string, prompt: string} $data The goal data |
| 35 | * @return PromptWritingGoal The created goal |
| 36 | */ |
| 37 | public function create(array $data): PromptWritingGoal; |
| 38 | |
| 39 | /** |
| 40 | * Update an existing prompt writing goal. |
| 41 | * |
| 42 | * @param PromptWritingGoal $promptWritingGoal The goal to update |
| 43 | * @param array{title?: string, description?: string, prompt?: string} $data The update data |
| 44 | * @return PromptWritingGoal The updated goal |
| 45 | */ |
| 46 | public function update(PromptWritingGoal $promptWritingGoal, array $data): PromptWritingGoal; |
| 47 | |
| 48 | /** |
| 49 | * Delete a prompt writing goal. |
| 50 | * |
| 51 | * @param PromptWritingGoal $promptWritingGoal The goal to delete |
| 52 | * @return bool True if deleted successfully |
| 53 | */ |
| 54 | public function delete(PromptWritingGoal $promptWritingGoal): bool; |
| 55 | } |