Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions src/Dto/InstalledModule.php

This file was deleted.

43 changes: 43 additions & 0 deletions src/Service/ApplicationSettingsServiceInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php

declare(strict_types=1);

/*
* This file is part of the Novo SGA project.
*
* (c) Rogerio Lino <rogeriolino@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Novosga\Service;

use Novosga\Settings\AppearanceSettings;
use Novosga\Settings\ApplicationSettings;
use Novosga\Settings\BehaviorSettings;
use Novosga\Settings\QueueSettings;

/**
* ApplicationSettingsServiceInterface
*
* @author Rogerio Lino <rogeriolino@gmail.com>
*/
interface ApplicationSettingsServiceInterface
{
public function loadSettings(): ApplicationSettings;

public function loadAppearanceSettings(): AppearanceSettings;

public function loadQueueSettings(): QueueSettings;

public function loadBehaviorSettings(): BehaviorSettings;

public function saveSettings(ApplicationSettings $settings): void;

public function saveAppearanceSettings(AppearanceSettings $settings): void;

public function saveBehaviorSettings(BehaviorSettings $settings): void;

public function saveQueueSettings(QueueSettings $settings): void;
}
2 changes: 1 addition & 1 deletion src/Service/ModuleServiceInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace Novosga\Service;

use Novosga\Dto\InstalledModule;
use Novosga\Settings\InstalledModule;

interface ModuleServiceInterface
{
Expand Down
32 changes: 32 additions & 0 deletions src/Settings/AppearanceSettings.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

declare(strict_types=1);

/*
* This file is part of the Novo SGA project.
*
* (c) Rogerio Lino <rogeriolino@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Novosga\Settings;

/**
* AppearanceSettings
*
* @author Rogerio Lino <rogeriolino@gmail.com>
*/
class AppearanceSettings
{
public function __construct(
public string $logoNavbar = '',
public string $logoLogin = '',
public string $theme = '',
public string $navbarColor = '',
public string $customCSS = '',
public string $customJS = '',
) {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,19 @@
* file that was distributed with this source code.
*/

namespace Novosga\Service;
namespace Novosga\Settings;

/**
* ConfigurationInterface
* ApplicationSettings
*
* @author Rogerio Lino <rogeriolino@gmail.com>
*/
interface ConfigurationInterface
class ApplicationSettings
{
public function get(string $key): mixed;
public function __construct(
public AppearanceSettings $appearance,
public BehaviorSettings $behavior,
public QueueSettings $queue,
) {
}
}
31 changes: 31 additions & 0 deletions src/Settings/BehaviorSettings.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

declare(strict_types=1);

/*
* This file is part of the Novo SGA project.
*
* (c) Rogerio Lino <rogeriolino@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Novosga\Settings;

/**
* BehaviorSettings
*
* @author Rogerio Lino <rogeriolino@gmail.com>
*/
class BehaviorSettings
{
public function __construct(
public bool $prioritySwap = false,
public string $prioritySwapMethod = 'unity',
public int $prioritySwapCount = 1,
public bool $callTicketByService = false,
public bool $callTicketOutOfOrder = false,
) {
}
}
31 changes: 31 additions & 0 deletions src/Settings/InstalledModule.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

declare(strict_types=1);

/*
* This file is part of the Novo SGA project.
*
* (c) Rogerio Lino <rogeriolino@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Novosga\Settings;

/**
* InstalledModule
*
* @author Rogerio Lino <rogeriolino@gmail.com>
*/
final class InstalledModule
{
public function __construct(
public readonly bool $active,
public readonly string $key,
public readonly string $displayName,
public readonly string $iconName,
public readonly string $homeRoute,
) {
}
}
52 changes: 52 additions & 0 deletions src/Settings/QueueSettings.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?php

declare(strict_types=1);

/*
* This file is part of the Novo SGA project.
*
* (c) Rogerio Lino <rogeriolino@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Novosga\Settings;

/**
* QueueSettings
*
* @author Rogerio Lino <rogeriolino@gmail.com>
*/
class QueueSettings
{
/** @param array<array<string,string>> $ordering */
public function __construct(
public array $ordering = [],
) {
if (!count($this->ordering)) {
$this->ordering = [
[
'field' => 'dataAgendamento',
'order' => 'ASC',
],
[
'field' => 'servicoUsuario',
'order' => 'ASC',
],
[
'field' => 'prioridade',
'order' => 'DESC',
],
[
'field' => 'servicoUnidade',
'order' => 'DESC',
],
[
'field' => 'dataChegada',
'order' => 'ASC',
],
];
}
}
}
Loading