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