Skip to content
This repository was archived by the owner on May 29, 2026. It is now read-only.
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
2 changes: 1 addition & 1 deletion lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @category AppInfo
* @package OCA\Procest\AppInfo
*
* @author Conduction Development Team <dev@conductio.nl>
* @author Conduction Development Team <info@conduction.nl>
* @copyright 2024 Conduction B.V.
* @license EUPL-1.2 https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
*
Expand Down
22 changes: 13 additions & 9 deletions lib/BackgroundJob/AppointmentReminderJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@
private LoggerInterface $logger,
) {
parent::__construct($time);
$this->setInterval(86400); // Daily.
}
$this->setInterval(86400);
// Daily.
}//end __construct()

protected function run($argument): void
{
Expand Down Expand Up @@ -50,19 +51,22 @@
);

foreach (($result['objects'] ?? []) as $apt) {
$data = is_object($apt) ? $apt->jsonSerialize() : $apt;
$data = is_object($apt) ? $apt->jsonSerialize() : $apt;
$aptDate = substr($data['dateTime'] ?? '', 0, 10);

if ($aptDate === $tomorrow && empty($data['reminderSent'])) {
$data['reminderSent'] = true;
$objectService->saveObject((int) $register, (int) $schema, $data);
$this->logger->info('Procest: Reminder sent for appointment', [
'appointmentId' => $data['uuid'] ?? $data['id'] ?? '',
]);
$this->logger->info(
'Procest: Reminder sent for appointment',
[
'appointmentId' => $data['uuid'] ?? $data['id'] ?? '',

Check failure on line 63 in lib/BackgroundJob/AppointmentReminderJob.php

View workflow job for this annotation

GitHub Actions / quality / PHP Quality (phpstan)

Offset 'uuid' on array{reminderSent: true} on left side of ?? does not exist.

Check failure on line 63 in lib/BackgroundJob/AppointmentReminderJob.php

View workflow job for this annotation

GitHub Actions / quality / PHP Quality (phpstan)

Offset 'id' on array{reminderSent: true} on left side of ?? does not exist.
]
);
}
}
} catch (\Exception $e) {
$this->logger->error('Procest: Reminder job error: '.$e->getMessage());
}
}
}
}//end try
}//end run()
}//end class
9 changes: 5 additions & 4 deletions lib/BackgroundJob/BerichtenboxReadStatusJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,18 @@
{
public function __construct(
ITimeFactory $time,
private BerichtenboxService $berichtenboxService,

Check failure on line 16 in lib/BackgroundJob/BerichtenboxReadStatusJob.php

View workflow job for this annotation

GitHub Actions / quality / PHP Quality (phpstan)

Property OCA\Procest\BackgroundJob\BerichtenboxReadStatusJob::$berichtenboxService is never read, only written.
private LoggerInterface $logger,
) {
parent::__construct($time);
$this->setInterval(86400); // Daily.
}
$this->setInterval(86400);
// Daily.
}//end __construct()

protected function run($argument): void
{
$this->logger->info('Procest: Running Berichtenbox read status poll');
// The actual polling happens in BerichtenboxService::pollReadStatus
// This job would iterate unread messages and poll each one.
}
}
}//end run()
}//end class
4 changes: 2 additions & 2 deletions lib/BackgroundJob/ShareMaintenanceJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @category BackgroundJob
* @package OCA\Procest\BackgroundJob
*
* @author Conduction Development Team <dev@conductio.nl>
* @author Conduction Development Team <info@conduction.nl>
* @copyright 2024 Conduction B.V.
* @license EUPL-1.2 https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
*
Expand Down Expand Up @@ -47,7 +47,7 @@ class ShareMaintenanceJob extends TimedJob
* @param ITimeFactory $time The time factory
* @param SettingsService $settingsService The settings service
* @param IAppManager $appManager The app manager
* @param ContainerInterface $container The DI container
* @param ContainerInterface $container The DI container
* @param LoggerInterface $logger The logger
*
* @return void
Expand Down
2 changes: 1 addition & 1 deletion lib/Controller/AcController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* @category Controller
* @package OCA\Procest\Controller
*
* @author Conduction Development Team <dev@conductio.nl>
* @author Conduction Development Team <info@conduction.nl>
* @copyright 2024 Conduction B.V.
* @license EUPL-1.2 https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
*
Expand Down
26 changes: 14 additions & 12 deletions lib/Controller/AiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* @category Controller
* @package OCA\Procest\Controller
*
* @author Conduction Development Team <dev@conductio.nl>
* @author Conduction Development Team <info@conduction.nl>
* @copyright 2024 Conduction B.V.
* @license EUPL-1.2 https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
*
Expand Down Expand Up @@ -47,12 +47,12 @@
/**
* Constructor for AiController.
*
* @param string $appName The application name
* @param IRequest $request The request object
* @param AiService $aiService The AI service
* @param SettingsService $settingsService The settings service
* @param IUserSession $userSession The user session
* @param LoggerInterface $logger The logger interface
* @param string $appName The application name
* @param IRequest $request The request object
* @param AiService $aiService The AI service
* @param SettingsService $settingsService The settings service
* @param IUserSession $userSession The user session
* @param LoggerInterface $logger The logger interface
*
* @return void
*/
Expand All @@ -62,7 +62,7 @@
private AiService $aiService,
private SettingsService $settingsService,
private IUserSession $userSession,
private LoggerInterface $logger,

Check failure on line 65 in lib/Controller/AiController.php

View workflow job for this annotation

GitHub Actions / quality / PHP Quality (phpstan)

Property OCA\Procest\Controller\AiController::$logger is never read, only written.
) {
parent::__construct($appName, $request);
}//end __construct()
Expand Down Expand Up @@ -277,11 +277,13 @@
'offset' => (int) $this->request->getParam('offset', '0'),
];

return new JSONResponse([
'success' => true,
'filters' => array_filter($filters),
'message' => 'Audit trail query — implement with OpenRegister object listing',
]);
return new JSONResponse(
[
'success' => true,
'filters' => array_filter($filters),
'message' => 'Audit trail query — implement with OpenRegister object listing',
]
);
}//end auditIndex()

/**
Expand Down
34 changes: 22 additions & 12 deletions lib/Controller/AppointmentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,21 @@ public function __construct(
private AppointmentService $appointmentService,
) {
parent::__construct(appName: Application::APP_ID, request: $request);
}
}//end __construct()

/** @NoAdminRequired */
/**
* @NoAdminRequired
*/
public function index(): JSONResponse
{
$caseId = $this->request->getParam('caseId');
$appointments = $this->appointmentService->getAppointmentsForCase($caseId ?? '');
return new JSONResponse(['success' => true, 'appointments' => $appointments]);
}
}//end index()

/** @NoAdminRequired */
/**
* @NoAdminRequired
*/
public function create(): JSONResponse
{
$caseId = $this->request->getParam('caseId');
Expand All @@ -48,23 +52,29 @@ public function create(): JSONResponse

$result = $this->appointmentService->bookAppointment($caseId, $data);
return new JSONResponse(['success' => true, 'appointment' => $result]);
}
}//end create()

/** @NoAdminRequired */
/**
* @NoAdminRequired
*/
public function cancel(string $appointmentId): JSONResponse
{
$result = $this->appointmentService->cancelAppointment($appointmentId);
return new JSONResponse(['success' => true, 'appointment' => $result]);
}
}//end cancel()

/** @NoAdminRequired */
/**
* @NoAdminRequired
*/
public function noShow(string $appointmentId): JSONResponse
{
$result = $this->appointmentService->markNoShow($appointmentId);
return new JSONResponse(['success' => true, 'appointment' => $result]);
}
}//end noShow()

/** @NoAdminRequired */
/**
* @NoAdminRequired
*/
public function timeslots(): JSONResponse
{
$productId = $this->request->getParam('productId', '');
Expand All @@ -73,5 +83,5 @@ public function timeslots(): JSONResponse

$slots = $this->appointmentService->getTimeslots($productId, $locationId, $date);
return new JSONResponse(['success' => true, 'timeslots' => $slots]);
}
}
}//end timeslots()
}//end class
39 changes: 25 additions & 14 deletions lib/Controller/BerichtenboxController.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,45 +17,56 @@ public function __construct(
private BerichtenboxService $berichtenboxService,
) {
parent::__construct(appName: Application::APP_ID, request: $request);
}
}//end __construct()

/** @NoAdminRequired */
/**
* @NoAdminRequired
*/
public function send(): JSONResponse
{
$caseId = $this->request->getParam('caseId');
$bsn = $this->request->getParam('bsn', '');
$subject = $this->request->getParam('subject', '');
$body = $this->request->getParam('body', '');
$typeCode = $this->request->getParam('berichtTypeCode', '');
$caseId = $this->request->getParam('caseId');
$bsn = $this->request->getParam('bsn', '');
$subject = $this->request->getParam('subject', '');
$body = $this->request->getParam('body', '');
$typeCode = $this->request->getParam('berichtTypeCode', '');
$attachmentFileId = $this->request->getParam('attachmentFileId');

if (empty($caseId) === true) {
return new JSONResponse(['success' => false, 'error' => 'caseId is required'], 400);
}

$result = $this->berichtenboxService->sendMessage(
$caseId, $bsn, $subject, $body, $typeCode, $attachmentFileId
$caseId,
$bsn,
$subject,
$body,
$typeCode,
$attachmentFileId
);

if (isset($result['error']) === true) {
return new JSONResponse(['success' => false, 'error' => $result['error']], 400);
}

return new JSONResponse(['success' => true, 'message' => $result]);
}
}//end send()

/** @NoAdminRequired */
/**
* @NoAdminRequired
*/
public function messages(): JSONResponse
{
$caseId = $this->request->getParam('caseId', '');
$messages = $this->berichtenboxService->getMessagesForCase($caseId);
return new JSONResponse(['success' => true, 'messages' => $messages]);
}
}//end messages()

/** @NoAdminRequired */
/**
* @NoAdminRequired
*/
public function poll(string $messageId): JSONResponse
{
$result = $this->berichtenboxService->pollReadStatus($messageId);
return new JSONResponse(['success' => true, 'message' => $result]);
}
}
}//end poll()
}//end class
2 changes: 1 addition & 1 deletion lib/Controller/BrcController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* @category Controller
* @package OCA\Procest\Controller
*
* @author Conduction Development Team <dev@conductio.nl>
* @author Conduction Development Team <info@conduction.nl>
* @copyright 2024 Conduction B.V.
* @license EUPL-1.2 https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
*
Expand Down
44 changes: 21 additions & 23 deletions lib/Controller/CaseDefinitionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* @category Controller
* @package OCA\Procest\Controller
*
* @author Conduction Development Team <dev@conductio.nl>
* @author Conduction Development Team <info@conduction.nl>
* @copyright 2024 Conduction B.V.
* @license EUPL-1.2 https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
*
Expand Down Expand Up @@ -41,11 +41,11 @@
/**
* Constructor.
*
* @param string $appName The app name.
* @param IRequest $request The request object.
* @param CaseDefinitionExportService $exportService The export service.
* @param CaseDefinitionImportService $importService The import service.
* @param LoggerInterface $logger The logger.
* @param string $appName The app name.
* @param IRequest $request The request object.
* @param CaseDefinitionExportService $exportService The export service.
* @param CaseDefinitionImportService $importService The import service.
* @param LoggerInterface $logger The logger.
*/
public function __construct(
string $appName,
Expand All @@ -55,7 +55,7 @@
private readonly LoggerInterface $logger,
) {
parent::__construct($appName, $request);
}
}//end __construct()

/**
* Export a case definition as a ZIP archive.
Expand Down Expand Up @@ -104,13 +104,13 @@
Http::STATUS_BAD_REQUEST
);
} catch (\Throwable $e) {
$this->logger->error('Case definition export failed: ' . $e->getMessage());
$this->logger->error('Case definition export failed: '.$e->getMessage());
return new JSONResponse(
['error' => 'Export failed: ' . $e->getMessage()],
['error' => 'Export failed: '.$e->getMessage()],
Http::STATUS_INTERNAL_SERVER_ERROR
);
}
}
}//end try
}//end export()

/**
* Validate a case definition package without importing it.
Expand All @@ -124,7 +124,7 @@
try {
$file = $this->request->getUploadedFile('package');

if ($file === null || !isset($file['tmp_name'])) {

Check failure on line 127 in lib/Controller/CaseDefinitionController.php

View workflow job for this annotation

GitHub Actions / quality / PHP Quality (phpstan)

Strict comparison using === between array and null will always evaluate to false.
return new JSONResponse(
['error' => 'No package file uploaded'],
Http::STATUS_BAD_REQUEST
Expand All @@ -135,13 +135,13 @@

return new JSONResponse($result);
} catch (\Throwable $e) {
$this->logger->error('Case definition validation failed: ' . $e->getMessage());
$this->logger->error('Case definition validation failed: '.$e->getMessage());
return new JSONResponse(
['error' => 'Validation failed: ' . $e->getMessage()],
['error' => 'Validation failed: '.$e->getMessage()],
Http::STATUS_INTERNAL_SERVER_ERROR
);
}
}
}//end validate()

/**
* Import a case definition package.
Expand All @@ -153,10 +153,10 @@
public function import(): JSONResponse
{
try {
$file = $this->request->getUploadedFile('package');
$file = $this->request->getUploadedFile('package');
$strategy = $this->request->getParam('strategy', 'skip');

if ($file === null || !isset($file['tmp_name'])) {

Check failure on line 159 in lib/Controller/CaseDefinitionController.php

View workflow job for this annotation

GitHub Actions / quality / PHP Quality (phpstan)

Strict comparison using === between array and null will always evaluate to false.
return new JSONResponse(
['error' => 'No package file uploaded'],
Http::STATUS_BAD_REQUEST
Expand All @@ -175,17 +175,15 @@
$strategy
);

$statusCode = $result['success']
? Http::STATUS_OK
: Http::STATUS_UNPROCESSABLE_ENTITY;
$statusCode = $result['success'] ? Http::STATUS_OK : Http::STATUS_UNPROCESSABLE_ENTITY;

return new JSONResponse($result, $statusCode);
} catch (\Throwable $e) {
$this->logger->error('Case definition import failed: ' . $e->getMessage());
$this->logger->error('Case definition import failed: '.$e->getMessage());
return new JSONResponse(
['error' => 'Import failed: ' . $e->getMessage()],
['error' => 'Import failed: '.$e->getMessage()],
Http::STATUS_INTERNAL_SERVER_ERROR
);
}
}
}
}//end try
}//end import()
}//end class
Loading
Loading