OverridesRepository.php 1.52 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php


namespace Source\Gateways\Overrides;

use Carbon\Carbon;
use Source\Entities\Override;

interface OverridesRepository
{
    /**
     * @param string $doorId
     * @return \Source\Entities\Override[]
     */
    public function overrideHistoryForDoor(string $doorId): array;

    /**
     * @param \Carbon\Carbon $begin
     * @param \Carbon\Carbon $end
     * @return \Source\Entities\Override[]
     */
    public function overrideHistoryBetween(Carbon $begin, Carbon $end): array;

    /**
Jacob Priddy's avatar
Jacob Priddy committed
25
     * Gets active override during date (if any). Returns null otherwise.
26
     *
Jacob Priddy's avatar
Jacob Priddy committed
27
     * @param string         $doorId
28
29
     * @param \Carbon\Carbon $begin
     * @param \Carbon\Carbon $end
30
31
     * @return \Source\Entities\Override|null
     */
32
    public function activeOverrideForDoorBetween(string $doorId, Carbon $begin, Carbon $end): ?Override;
33
34
35
36
37
38

    /**
     * @param \Source\Entities\Override $override
     * @return \Source\Entities\Override|null
     */
    public function addOverride(Override $override): ?Override;
39
40

    /**
41
     * Update an override
42
43
44
45
46
47
48
     *
     * @param string                    $overrideId
     * @param \Source\Entities\Override $override
     * @return \Source\Entities\Override|null
     * @throws \Source\Exceptions\EntityNotFoundException
     */
    public function updateOverride(string $overrideId, Override $override): ?Override;
49
50
51
52
53
54
55
56

    /**
     * Retrieves an override
     *
     * @param string $overrideId
     * @return \Source\Entities\Override|null
     */
    public function get(string $overrideId): ?Override;
57
}