Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
1 / 1
n/a
0 / 0
CRAP
n/a
0 / 0
1<?php
2
3declare(strict_types=1);
4
5/** @license For full copyright and license information, please see the LICENSE.md file. */
6
7namespace App\Modules\Discount\Domain\Repository;
8
9defined('AMMONLY_APP') || exit('Direct script access is forbidden.');
10
11use App\Modules\Discount\Domain\Model\DiscountRate;
12
13/**
14 * Repository interface for managing DiscountRate domain aggregates.
15 */
16interface DiscountRepositoryInterface
17{
18    /**
19     * Find DiscountRate by primary key ID.
20     */
21    public function findById(int $id): ?DiscountRate;
22
23    /**
24     * Find DiscountRate by unique discount code.
25     */
26    public function findByCode(string $code): ?DiscountRate;
27
28    /**
29     * Get default active discount rate for the system.
30     */
31    public function findDefault(): ?DiscountRate;
32
33    /**
34     * List all discount rates matching optional filters.
35     *
36     * @param array<string, mixed> $filters
37     * @return DiscountRate[]
38     */
39    public function findAll(array $filters = []): array;
40
41    /**
42     * Save (insert or update) a DiscountRate aggregate.
43     */
44    public function save(DiscountRate $discount): DiscountRate;
45
46    /**
47     * Delete or soft-delete a DiscountRate by ID.
48     */
49    public function delete(int $id): bool;
50}