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\PromptTone; |
| 6 | use Illuminate\Support\Collection; |
| 7 | |
| 8 | /** |
| 9 | * Interface for prompt tone data access operations. |
| 10 | * |
| 11 | * Abstracts prompt tone database queries, providing methods |
| 12 | * to manage tone of voice options used by engage and post AI features. |
| 13 | */ |
| 14 | interface IPromptToneRepository |
| 15 | { |
| 16 | /** |
| 17 | * Get all prompt tones ordered by newest first. |
| 18 | * |
| 19 | * @return Collection<int, PromptTone> Collection of prompt tones |
| 20 | */ |
| 21 | public function getAll(): Collection; |
| 22 | |
| 23 | /** |
| 24 | * Find a prompt tone by its ID. |
| 25 | * |
| 26 | * @param string $id The prompt tone ID |
| 27 | * @return PromptTone|null The prompt tone or null if not found |
| 28 | */ |
| 29 | public function findById(string $id): ?PromptTone; |
| 30 | |
| 31 | /** |
| 32 | * Create a new prompt tone. |
| 33 | * |
| 34 | * @param array{name: string, prompt: string} $data The prompt tone data |
| 35 | * @return PromptTone The created prompt tone |
| 36 | */ |
| 37 | public function create(array $data): PromptTone; |
| 38 | |
| 39 | /** |
| 40 | * Update an existing prompt tone. |
| 41 | * |
| 42 | * @param PromptTone $promptTone The prompt tone to update |
| 43 | * @param array{name?: string, prompt?: string} $data The update data |
| 44 | * @return PromptTone The updated prompt tone |
| 45 | */ |
| 46 | public function update(PromptTone $promptTone, array $data): PromptTone; |
| 47 | |
| 48 | /** |
| 49 | * Delete a prompt tone. |
| 50 | * |
| 51 | * @param PromptTone $promptTone The prompt tone to delete |
| 52 | * @return bool True if deleted successfully |
| 53 | */ |
| 54 | public function delete(PromptTone $promptTone): bool; |
| 55 | } |