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\Dashboard\Application\Service;
8
9defined('AMMONLY_APP') || exit('Direct script access is forbidden.');
10
11use App\Core\Engine\Domain\Model\PermissionContext;
12
13/**
14 * Contract for Dashboard Calendar Action Service.
15 *
16 * @package App\Modules\Dashboard\Application\Service
17 */
18interface DashboardCalendarActionServiceInterface
19{
20    /**
21     * Fetches detailed information for a single calendar event.
22     *
23     * @param int               $eventId Record identifier in calendar table.
24     * @param PermissionContext $context Security permission context.
25     * @return array<string, mixed>|null Event record or null if not found.
26     */
27    public function getEventDetails(int $eventId, PermissionContext $context): ?array;
28
29    /**
30     * Marks a calendar event as completed.
31     *
32     * @param int               $eventId Record identifier.
33     * @param PermissionContext $context Security permission context.
34     * @return bool True on success.
35     */
36    public function completeEvent(int $eventId, PermissionContext $context): bool;
37
38    /**
39     * Marks a calendar event as cancelled.
40     *
41     * @param int               $eventId Record identifier.
42     * @param PermissionContext $context Security permission context.
43     * @return bool True on success.
44     */
45    public function cancelEvent(int $eventId, PermissionContext $context): bool;
46
47    /**
48     * Postpones a calendar event to a new date and sets status to planned.
49     *
50     * @param int               $eventId      Target event record ID.
51     * @param string            $newStartDate New start datetime string (Y-m-d H:i:s).
52     * @param string|null       $newEndDate   New end datetime string (Y-m-d H:i:s).
53     * @param PermissionContext $context      Security context.
54     * @return bool True on success.
55     */
56    public function postponeEvent(
57        int               $eventId,
58        string            $newStartDate,
59        ?string           $newEndDate,
60        PermissionContext $context
61    ): bool;
62}