Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 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\Core\Engine\Application\Service;
8
9defined('AMMONLY_APP') || exit('Direct script access is forbidden.');
10
11use App\Core\Engine\Domain\Model\FieldMetadata;
12use App\Core\Engine\Domain\Model\ModuleMetadata;
13
14/**
15 * System Level Resolver Interface.
16 *
17 * Provides resolution of multi-tier system levels (admin, client, helpdesk, shop)
18 * for level-scoped modules (logs_auth, logs_sessions, logs_audit_*).
19 *
20 * @package App\Core\Engine\Application\Service
21 */
22interface SystemLevelResolverInterface
23{
24    /**
25     * Checks whether the given module is scoped by system level.
26     *
27     * @param string $moduleName Module machine name.
28     * @return bool True if module supports level filtering.
29     */
30    public function isLevelScopedModule(string $moduleName): bool;
31
32    /**
33     * Resolves the database table prefix for the specified level.
34     *
35     * @param string $level System level key ('admin', 'client', 'helpdesk', etc.).
36     * @return string Database table prefix (e.g. 'a_', 'c_', 'h_').
37     */
38    public function resolvePrefix(string $level): string;
39
40    /**
41     * Resolves the physical table name for a module according to the selected level.
42     *
43     * @param ModuleMetadata $module Module metadata.
44     * @param string         $level  System level key.
45     * @return string Physical database table name.
46     */
47    public function resolveTableName(ModuleMetadata $module, string $level): string;
48
49    /**
50     * Adapts module fields for the target level (e.g. adjusts user_id relation table).
51     *
52     * @param array<int, FieldMetadata> $fields Original field metadata list.
53     * @param string                    $level  System level key.
54     * @return array<int, FieldMetadata> Adapted field metadata list.
55     */
56    public function adaptFieldsForLevel(array $fields, string $level): array;
57
58    /**
59     * Returns the list of available system levels registered in the picklist.
60     *
61     * @return list<array{value: string, label: string, color: ?string, icon: ?string}>
62     */
63    public function getAvailableLevels(): array;
64}