diff --git a/config/routes.php b/config/routes.php
index 25f1bbc..dbfcfd1 100644
--- a/config/routes.php
+++ b/config/routes.php
@@ -1,220 +1,342 @@
get('/', \App\Action\Home\HomeAction::class)->setName('home');
+ $app->get('/', HomeAction::class)->setName('home');
- $app->get('/whatsapp', \App\Action\Home\HomeAction::class)->setName('whatsapp');
+ $app->get('/whatsapp', HomeAction::class)->setName('whatsapp');
// Swagger API documentation
- $app->get('/docs/v1', \App\Action\OpenApi\Version1DocAction::class)->setName('docs');
+ $app->get('/docs/v1', Version1DocAction::class)->setName('docs');
- $app->post('/doc_login', \App\Action\Auth\DocLoginSubmitAction::class)->setName('login');
+ $app->post('/doc_login', DocLoginSubmitAction::class)->setName('login');
- $app->post('/user_login', \App\Action\Auth\UserLoginSubmitAction::class)->setName('user-login');
+ $app->post('/user_login', UserLoginSubmitAction::class)->setName('user-login');
- $app->post('/register_doc', \App\Action\Users\UserCreateDocAction::class);
+ $app->post('/register_doc', UserCreateDocAction::class);
- $app->post('/register_paz', \App\Action\Users\UserCreatePazAction::class);
+ $app->post('/register_paz', UserCreatePazAction::class);
- $app->get('/logout', \App\Action\Auth\LogoutAction::class);
+ $app->get('/logout', LogoutAction::class);
$app->group('/public', function (RouteCollectorProxy $group) {
- $group->get("/doc_login", \App\Action\Pages\DocLoginPageAction::class)->setName('public_doc_login');
- $group->get("/paziente_login", \App\Action\Pages\PazLoginPageAction::class)->setName('public_paz_login');
- $group->get("/admin_login", \App\Action\Pages\AdminLoginPageAction::class)->setName('public_admin_login');
- $group->get("/register_doc", \App\Action\Pages\RegisterDocPageAction::class)->setName('register_doc');
- $group->get("/privacy", \App\Action\Pages\PrivacyPageAction::class)->setName('privacy-policy');
- $group->get("/terms", \App\Action\Pages\TermsPageAction::class)->setName('terms');
- $group->post("/stripe/webhook", \App\Action\Stripe\webhook::class)->setName('wh');
- $group->get("/consulto/{codice}", \App\Action\Pages\ConsultoPageAction::class)->setName('consulto');
- $group->post("/pincode/check", \App\Action\Consulti\PinCodeActionCheck::class)->setName('consulto-pin-check');
- $group->post("/hack/attempt", \App\Action\Security\HackAttemptAction::class)->setName('log-hack-attempt');
- $group->get('/create-checkout-session', \App\Action\Pages\CreateCheckoutSession::class)->setName('payment-page');
+ $group->get("/doc_login", DocLoginPageAction::class)->setName('public_doc_login');
+ $group->get("/paziente_login", PazLoginPageAction::class)->setName('public_paz_login');
+ $group->get("/admin_login", AdminLoginPageAction::class)->setName('public_admin_login');
+ $group->get("/register_doc", RegisterDocPageAction::class)->setName('register_doc');
+ $group->get("/privacy", PrivacyPageAction::class)->setName('privacy-policy');
+ $group->get("/terms", TermsPageAction::class)->setName('terms');
+ $group->post("/stripe/webhook", webhook::class)->setName('wh');
+ $group->get("/consult/{codice}", ConsultoPageAction::class)->setName('consult');
+ $group->post("/pincode/check", PinCodeActionCheck::class)->setName('consult-pin-check');
+ $group->post("/hack/attempt", HackAttemptAction::class)->setName('log-hack-attempt');
+ $group->get('/create-checkout-session', CreateCheckoutSession::class)->setName('payment-page');
});
$app->group('/pages', function (RouteCollectorProxy $group) {
- $group->get("/home_doctor", \App\Action\Pages\HomeDocPageAction::class)->setName('pages-home-doc');
- $group->get("/doctor_detail[/{esito}]", \App\Action\Pages\DetailDocPageAction::class)->setName('doctor-detail');
- $group->get("/messages", \App\Action\Pages\MessagesDocPageAction::class)->setName('doctor-detail');
- $group->get("/patients/detail/{paz_id}", \App\Action\Pages\PatientDetailAction::class)->setName('pages-view-patient');
- $group->get("/calendar", \App\Action\Pages\CalendarAction::class)->setName('calendar');
- $group->get("/reports", \App\Action\Pages\ReportsAction::class)->setName('reports');
- $group->get("/faq", \App\Action\Pages\FaqPageAction::class)->setName('reports');
-
- $group->get("/patients/add", \App\Action\Pages\AddPatientsAction::class)->setName('add-patient');
- $group->get("/patients/list", \App\Action\Pages\ListSmartboxAction::class)->setName('list-patient');
+ $group->get("/home_doctor", HomeDocPageAction::class)->setName('pages-home-doc');
+ $group->get("/doctor_detail[/{esito}]", DetailDocPageAction::class)->setName('doctor-detail');
+ $group->get("/messages", MessagesDocPageAction::class)->setName('doctor-detail');
+ $group->get("/patients/detail/{paz_id}", PatientDetailAction::class)->setName('pages-view-patient');
+ $group->get("/calendar", CalendarAction::class)->setName('calendar');
+ $group->get("/reports", ReportsAction::class)->setName('reports');
+ $group->get("/faq", FaqPageAction::class)->setName('reports');
+
+ $group->get("/patients/add", AddPatientsAction::class)->setName('add-patient');
+ $group->get("/patients/list", ListSmartboxAction::class)->setName('list-patient');
})->add(UserAuthMiddleware::class);
// API endpoints. This group is protected with JWT.
$app->group('/api', function (RouteCollectorProxy $group) {
- $group->post('/patients/add', \App\Action\Patients\AddPatientAction::class);
- $group->get('/patients/list', \App\Action\Patients\ListPatAction::class);
- $group->get('/patients/list/last_10_mood/{paz_id}', \App\Action\Patients\List10MoodPatientAction::class);
- $group->get('/patients/list/diary/{user_id}', \App\Action\Patients\ListDiaryPatientAction::class);
- $group->get('/patients/pharm/list/{paz_id}', \App\Action\Patients\ListPharmPatientAction::class);
- $group->post('/patients/update', \App\Action\Patients\UpdatePatientAction::class);
- $group->get('/patients/file/list/{user_id}', \App\Action\Files\DocFileListAction::class);
- $group->post('/patient/file/download', \App\Action\Files\DocFileDownloadAction::class);
- $group->post('/patient/file/upload', \App\Action\Files\DocFileUploadAction::class);
- $group->post('/patient/file/delete', \App\Action\Files\DocFileDeleteAction::class);
- $group->get('/patient/mood/all/{user_id}', \App\Action\Patients\ListAllMoodPatientAction::class);
- $group->get('/patient/depressione/all/{user_id}', \App\Action\Patients\ListAllDeprePatientAction::class);
- $group->get('/account/delete', \App\Action\Users\UserDocDeleteAction::class);
- $group->get('/login/history', \App\Action\Users\UserHistoryAction::class);
- $group->post('/password/update', \App\Action\Users\UserPasswordChange::class);
- $group->post('/drugs/list/search', \App\Action\Pharm\WebSearchByNameAction::class);
- $group->get('/search/patient/{full_name}', \App\Action\Patients\SearchPatAction::class);
- $group->get('/invoices/list', \App\Action\Invoices\ListInvoiceAction::class);
- $group->get('/patient/pills/add/{paz_id}/{pill_id}', \App\Action\Patients\AddPillPatientAction::class);
- $group->get('/patient/pills/delete/{paz_id}/{ass_id}', \App\Action\Patients\DelPillPatientAction::class);
- $group->get('/patient/delete/{paz_id}', \App\Action\Patients\DelPatientAction::class);
- $group->get('/patients/list/annotation/{paz_id}', \App\Action\Patients\ListAnnotationPatientAction::class);
- $group->post('/patients/add/annotation', \App\Action\Patients\AddAnnotationPatientAction::class);
- $group->get('/patients/delete/annotation/{ann_id}', \App\Action\Patients\DeleteAnnotationPatientAction::class);
- $group->get('/patients/relazione/{paz_id}', \App\Action\Patients\LoadRelazionePatientAction::class);
- $group->post('/patients/relazione/save', \App\Action\Patients\SalvaRelazionePatientAction::class);
- $group->get('/patient/messsages/contacts', \App\Action\Messages\ListContactsAction::class);
- $group->get('/calendar/list', \App\Action\Calendar\ListEventAction::class);
- $group->post('/calendar/add', \App\Action\Calendar\AddEventAction::class);
- $group->post('/patient/search', \App\Action\Patients\SelectSearchPatAction::class);
- $group->get('/patient/test/comportamento/{user_id}', \App\Action\Reports\WebListComportamentoTestAction::class);
- $group->get('/patient/test/emozioni/{user_id}', \App\Action\Reports\WebListEmozioniTestAction::class);
- $group->get('/patient/test/phq9/{user_id}', \App\Action\Reports\WebPhqTestAction::class);
- $group->get('/patient/report/{user_id}', \App\Action\Reports\WebReportsAction::class);
- $group->get('/doctor/stat', \App\Action\Reports\WebDocStatAction::class);
- $group->post('/dsm/list/search', \App\Action\Dsm\WebDsmSearchByNameAction::class);
- $group->post('/search/patient', \App\Action\Patients\ReportSearchPatAction::class);
- $group->post('/reports/generate', \App\Action\Reports\WebReportGenAction::class);
- $group->post('/consulto/create', \App\Action\Consulti\GeneraLinkConsultoAction::class);
- $group->get('/consulto/list/{paz_id}', \App\Action\Consulti\ListLinkConsultoAction::class);
+ $group->post('/patients/add', AddPatientAction::class);
+ $group->get('/patients/list', ListPatAction::class);
+ $group->get('/patients/list/last_10_mood/{paz_id}', List10MoodPatientAction::class);
+ $group->get('/patients/list/diary/{user_id}', ListDiaryPatientAction::class);
+ $group->get('/patients/pharm/list/{paz_id}', ListPharmPatientAction::class);
+ $group->post('/patients/update', UpdatePatientAction::class);
+ $group->get('/patients/file/list/{user_id}', DocFileListAction::class);
+ $group->post('/patient/file/download', DocFileDownloadAction::class);
+ $group->post('/patient/file/upload', DocFileUploadAction::class);
+ $group->post('/patient/file/delete', DocFileDeleteAction::class);
+ $group->get('/patient/mood/all/{user_id}', ListAllMoodPatientAction::class);
+ $group->get('/patient/depressione/all/{user_id}', ListAllDeprePatientAction::class);
+ $group->get('/account/delete', UserDocDeleteAction::class);
+ $group->get('/login/history', UserHistoryAction::class);
+ $group->post('/password/update', UserPasswordChange::class);
+ $group->post('/drugs/list/search', WebSearchByNameAction::class);
+ $group->get('/search/patient/{full_name}', SearchPatAction::class);
+ $group->get('/invoices/list', ListInvoiceAction::class);
+ $group->get('/patient/pills/add/{paz_id}/{pill_id}', AddPillPatientAction::class);
+ $group->get('/patient/pills/delete/{paz_id}/{ass_id}', DelPillPatientAction::class);
+ $group->get('/patient/delete/{paz_id}', DelPatientAction::class);
+ $group->get('/patients/list/annotation/{paz_id}', ListAnnotationPatientAction::class);
+ $group->post('/patients/add/annotation', AddAnnotationPatientAction::class);
+ $group->get('/patients/delete/annotation/{ann_id}', DeleteAnnotationPatientAction::class);
+ $group->get('/patients/relazione/{paz_id}', LoadPatientRelationAction::class);
+ $group->post('/patients/relazione/save', SavePatientRelationAction::class);
+ $group->get('/patient/messsages/contacts', ListContactsAction::class);
+ $group->get('/calendar/list', ListEventAction::class);
+ $group->post('/calendar/add', AddEventAction::class);
+ $group->post('/patient/search', SelectSearchPatAction::class);
+ $group->get('/patient/test/comportamento/{user_id}', WebListComportamentoTestAction::class);
+ $group->get('/patient/test/emozioni/{user_id}', WebListEmozioniTestAction::class);
+ $group->get('/patient/test/phq9/{user_id}', WebPhqTestAction::class);
+ $group->get('/patient/report/{user_id}', WebReportsAction::class);
+ $group->get('/doctor/stat', WebDocStatAction::class);
+ $group->post('/dsm/list/search', WebDsmSearchByNameAction::class);
+ $group->post('/search/patient', ReportSearchPatAction::class);
+ $group->post('/reports/generate', WebReportGenAction::class);
+ $group->post('/consult/create', GenerateConsultLinkAction::class);
+ $group->get('/consult/list/{paz_id}', ListConsultLinkAction::class);
/*** END PATIENTS ***/
- $group->post('/doctor/update', \App\Action\Doctors\UpdateDoctorAction::class);
- $group->get('/doctor/calendar', \App\Action\Doctors\UpdateDoctorAction::class);
-
+ $group->post('/doctor/update', UpdateDoctorAction::class);
+ $group->get('/doctor/calendar', UpdateDoctorAction::class);
- $group->get('/cities/list', \App\Action\Cities\ListCitiesAction::class);
- $group->get('/dsm/list', \App\Action\Dsm\ListDsmAction::class);
- $group->get('/pharm/list', \App\Action\Pharm\ListPharmAction::class);
- $group->get('/pharm/list/select', \App\Action\Pharm\ListPharmSelectAction::class);
+ $group->get('/cities/list', ListCitiesAction::class);
+ $group->get('/dsm/list', ListDsmAction::class);
+ $group->get('/pharm/list', ListPharmAction::class);
+ $group->get('/pharm/list/select', ListPharmSelectAction::class);
/**
* Retrieve User information
*/
- $group->get('/user/detail/{id}', \App\Action\Users\UserReadAction::class);
+ $group->get('/user/detail/{id}', UserReadAction::class);
/**
* Delete user
*/
- $group->get('/user/delete/{id}', \App\Action\Users\UserDeleteAction::class);
+ $group->get('/user/delete/{id}', UserDeleteAction::class);
/**
* List all users
*/
- $group->get('/user/list', \App\Action\Users\UserFindAction::class);
+ $group->get('/user/list', UserFindAction::class);
/**
* Add User
*/
- $group->post('/user/add', \App\Action\Users\UserCreateAction::class);
+ $group->post('/user/add', UserCreateAction::class);
/**
* Update User
*/
- $group->post('/user/update', \App\Action\Users\UserUpdateAction::class);
+ $group->post('/user/update', UserUpdateAction::class);
- $group->post('/user/password/update', \App\Action\Users\UserPasswordChange::class);
+ $group->post('/user/password/update', UserPasswordChange::class);
/********* END USER SECTION ************/
})->add(UserAuthMiddleware::class);
$app->group('/mobile/api', function (RouteCollectorProxy $group) {
- $group->post('/mood', \App\Action\Moods\AddMoodAction::class);
- $group->get('/mood/delete/{mood_id}', \App\Action\Moods\DeleteMoodAction::class);
- $group->get('/last_10_mood', \App\Action\Moods\ListMoodAction::class);
- $group->get('/last_10_mood/graph', \App\Action\Moods\ListMoodGraphAction::class);
- $group->post('/patient/update', \App\Action\Users\UserUpdateAction::class);
- $group->post('/patient/update/address', \App\Action\Users\UserUpdateAddrAction::class);
- $group->post('/invite/doctor', \App\Action\Doctors\InviteDoctorAction::class);
- $group->get('/patient/my_doctor', \App\Action\Doctors\DocDetailAppAction::class);
- $group->get('/patient/scollega_doc', \App\Action\Doctors\DocRemoveAction::class);
- $group->get('/patient/delete_account', \App\Action\Users\UserDeleteAction::class);
- $group->get('/drugs/list', \App\Action\Pharm\MobileListPharmAction::class);
- $group->get('/drugs/list/search/{drug_name}', \App\Action\Pharm\SearchByNameAction::class);
- $group->get('/patient/diary', \App\Action\Diary\GetDiaryAction::class);
- $group->post('/patient/diary', \App\Action\Diary\UploadDiaryAction::class);
- $group->get('/patient/diary/delete/{diary_id}', \App\Action\Diary\DeleteDiaryAction::class);
- $group->post('/patient/file/upload', \App\Action\Files\FileUploadAction::class);
- $group->get('/patient/file/list', \App\Action\Files\FileListAction::class);
- $group->post('/patient/file/download', \App\Action\Files\FileDownloadAction::class);
- $group->post('/patient/tracking', \App\Action\Users\UserTrackAction::class);
- $group->get('/patient/tracking/list', \App\Action\Users\UserTrackListAction::class);
- $group->get('/patient/calendar', \App\Action\Users\UserCalendarAction::class);
- $group->get('/patient/drug/list', \App\Action\Patients\ListPharmPatientMobAction::class);
- $group->get('/patient/drug/delete/{id}', \App\Action\Pharm\DeletePharmAction::class);
- $group->post('/patient/drug/add', \App\Action\Pharm\AddPharmAction::class);
- $group->get('/patient/account/delete', \App\Action\Users\UserDeleteAction::class);
- $group->get('/patient/account/download', \App\Action\Users\UserDownloadAction::class);
- $group->post('/obiettivi/add', \App\Action\Obiettivi\AddObiettivoAction::class);
- $group->post('/obiettivi/delete', \App\Action\Obiettivi\DeleteObiettivoAction::class);
- $group->post('/obiettivi/update', \App\Action\Obiettivi\UpdateObiettivoAction::class);
- $group->get('/obiettivi/list', \App\Action\Obiettivi\ListObiettivoAction::class);
- $group->get('/patient/report/pills', \App\Action\Reports\ReportGenAction::class);
- $group->post('/patient/report/mood', \App\Action\Reports\ReportMoodGenAction::class);
- $group->post('/patient/test/comportamento', \App\Action\Reports\ComportamentoTestAction::class);
- $group->get('/patient/test/comportamento', \App\Action\Reports\ListComportamentoTestAction::class);
- $group->post('/patient/test/emozioni', \App\Action\Reports\EmozioniTestAction::class);
- $group->get('/patient/test/emozioni', \App\Action\Reports\ListEmozioniTestAction::class);
- $group->post('/patient/health/passi', \App\Action\Health\AddPassiAction::class);
- $group->post('/patient/test/phq', \App\Action\Reports\Phq9TestAction::class);
- $group->get('/patient/test/phq', \App\Action\Reports\ListPhq9TestAction::class);
- $group->post('/register/notification', \App\Action\Notification\RegisterNotificationAction::class);
- })->add(\App\Middleware\JwtAuthMiddleware::class);
-
-
- /** NON ELIMINARE, RISOLVE PROBLEMA PRE-FLIGHT */
- $app->options('/mobile/api/mood', \App\CORS\CORSAction::class);
- $app->options('/mobile/api/mood/delete/{mood_id}', \App\CORS\CORSAction::class);
- $app->options('/mobile/api/last_10_mood', \App\CORS\CORSAction::class);
- $app->options('/mobile/api/last_10_mood/graph', \App\CORS\CORSAction::class);
- $app->options('/register_paz', \App\CORS\CORSAction::class);
- $app->options('/user_login', \App\CORS\CORSAction::class);
- $app->options('/mobile/api/patient/update', \App\CORS\CORSAction::class);
- $app->options('/mobile/api/patient/update/address', \App\CORS\CORSAction::class);
- $app->options('/mobile/api/invite/doctor', \App\CORS\CORSAction::class);
- $app->options('/mobile/api/patient/my_doctor', \App\CORS\CORSAction::class);
- $app->options('/mobile/api/patient/scollega_doc', \App\CORS\CORSAction::class);
- $app->options('/mobile/api/patient/delete_account', \App\CORS\CORSAction::class);
- $app->options('/mobile/api/drugs/list', \App\CORS\CORSAction::class);
- $app->options('/mobile/api/drugs/list/search/{drug_name}', \App\CORS\CORSAction::class);
- $app->options('/mobile/api/patient/diary', \App\CORS\CORSAction::class);
- $app->options('/mobile/api/patient/diary/delete/{diary_id}', \App\CORS\CORSAction::class);
- $app->options('/mobile/api/patient/file/upload', \App\CORS\CORSAction::class);
- $app->options('/mobile/api/patient/file/list', \App\CORS\CORSAction::class);
- $app->options('/mobile/api/patient/file/download', \App\CORS\CORSAction::class);
- $app->options('/mobile/api/patient/tracking', \App\CORS\CORSAction::class);
- $app->options('/mobile/api/patient/tracking/list', \App\CORS\CORSAction::class);
- $app->options('/mobile/api/patient/calendar', \App\CORS\CORSAction::class);
- $app->options('/mobile/api/patient/drug/list', \App\CORS\CORSAction::class);
- $app->options('/mobile/api/patient/drug/delete/{id}', \App\CORS\CORSAction::class);
- $app->options('/mobile/api/patient/drug/add', \App\CORS\CORSAction::class);
- $app->options('/mobile/api/patient/account/delete', \App\CORS\CORSAction::class);
- $app->options('/mobile/api/patient/account/download', \App\CORS\CORSAction::class);
- $app->options('/mobile/api/obiettivi/add', \App\CORS\CORSAction::class);
- $app->options('/mobile/api/obiettivi/delete', \App\CORS\CORSAction::class);
- $app->options('/mobile/api/obiettivi/update', \App\CORS\CORSAction::class);
- $app->options('/mobile/api/obiettivi/list', \App\CORS\CORSAction::class);
- $app->options('/mobile/api/patient/report/pills', \App\CORS\CORSAction::class);
- $app->options('/mobile/api/patient/report/mood', \App\CORS\CORSAction::class);
- $app->options('/mobile/api/patient/test/comportamento', \App\CORS\CORSAction::class);
- $app->options('/mobile/api/patient/test/emozioni', \App\CORS\CORSAction::class);
- $app->options('/mobile/api/patient/health/passi', \App\CORS\CORSAction::class);
- $app->options('/mobile/api/patient/test/phq', \App\CORS\CORSAction::class);
- $app->options('/mobile/api/register/notification', \App\CORS\CORSAction::class);
+ $group->post('/mood', AddMoodAction::class);
+ $group->get('/mood/delete/{mood_id}', DeleteMoodAction::class);
+ $group->get('/last_10_mood', ListMoodAction::class);
+ $group->get('/last_10_mood/graph', ListMoodGraphAction::class);
+ $group->post('/patient/update', UserUpdateAction::class);
+ $group->post('/patient/update/address', UserUpdateAddrAction::class);
+ $group->post('/invite/doctor', InviteDoctorAction::class);
+ $group->get('/patient/my_doctor', DocDetailAppAction::class);
+ $group->get('/patient/scollega_doc', DocRemoveAction::class);
+ $group->get('/patient/delete_account', UserDeleteAction::class);
+ $group->get('/drugs/list', MobileListPharmAction::class);
+ $group->get('/drugs/list/search/{drug_name}', SearchByNameAction::class);
+ $group->get('/patient/diary', GetDiaryAction::class);
+ $group->post('/patient/diary', UploadDiaryAction::class);
+ $group->get('/patient/diary/delete/{diary_id}', DeleteDiaryAction::class);
+ $group->post('/patient/file/upload', FileUploadAction::class);
+ $group->get('/patient/file/list', FileListAction::class);
+ $group->post('/patient/file/download', FileDownloadAction::class);
+ $group->post('/patient/tracking', UserTrackAction::class);
+ $group->get('/patient/tracking/list', UserTrackListAction::class);
+ $group->get('/patient/calendar', UserCalendarAction::class);
+ $group->get('/patient/drug/list', ListPharmPatientMobAction::class);
+ $group->get('/patient/drug/delete/{id}', DeletePharmAction::class);
+ $group->post('/patient/drug/add', AddPharmAction::class);
+ $group->get('/patient/account/delete', UserDeleteAction::class);
+ $group->get('/patient/account/download', UserDownloadAction::class);
+ $group->post('/obiettivi/add', AddObjectiveAction::class);
+ $group->post('/obiettivi/delete', DeleteObjectiveAction::class);
+ $group->post('/obiettivi/update', UpdateObjectiveAction::class);
+ $group->get('/obiettivi/list', ListObjectiveAction::class);
+ $group->get('/patient/report/pills', ReportGenAction::class);
+ $group->post('/patient/report/mood', ReportMoodGenAction::class);
+ $group->post('/patient/test/comportamento', BehaviourTestAction::class);
+ $group->get('/patient/test/comportamento', ListBehaviourTestAction::class);
+ $group->post('/patient/test/emozioni', EmotionsTestAction::class);
+ $group->get('/patient/test/emozioni', ListEmotionsTestAction::class);
+ $group->post('/patient/health/passi', AddStepsAction::class);
+ $group->post('/patient/test/phq', Phq9TestAction::class);
+ $group->get('/patient/test/phq', ListPhq9TestAction::class);
+ $group->post('/register/notification', RegisterNotificationAction::class);
+ })->add(JwtAuthMiddleware::class);
+
+
+ /**
+ * WARNING !
+ * DO NOT remove the following lines.
+ * Those lines resolve the problem on the app
+ * for the PRE-FLIGHT problem.
+ * @note To each new endpoint (get or post) must be created
+ * also here in OPTIONS mode.
+ */
+ $app->options('/mobile/api/mood', CORSAction::class);
+ $app->options('/mobile/api/mood/delete/{mood_id}', CORSAction::class);
+ $app->options('/mobile/api/last_10_mood', CORSAction::class);
+ $app->options('/mobile/api/last_10_mood/graph', CORSAction::class);
+ $app->options('/register_paz', CORSAction::class);
+ $app->options('/user_login', CORSAction::class);
+ $app->options('/mobile/api/patient/update', CORSAction::class);
+ $app->options('/mobile/api/patient/update/address', CORSAction::class);
+ $app->options('/mobile/api/invite/doctor', CORSAction::class);
+ $app->options('/mobile/api/patient/my_doctor', CORSAction::class);
+ $app->options('/mobile/api/patient/scollega_doc', CORSAction::class);
+ $app->options('/mobile/api/patient/delete_account', CORSAction::class);
+ $app->options('/mobile/api/drugs/list', CORSAction::class);
+ $app->options('/mobile/api/drugs/list/search/{drug_name}', CORSAction::class);
+ $app->options('/mobile/api/patient/diary', CORSAction::class);
+ $app->options('/mobile/api/patient/diary/delete/{diary_id}', CORSAction::class);
+ $app->options('/mobile/api/patient/file/upload', CORSAction::class);
+ $app->options('/mobile/api/patient/file/list', CORSAction::class);
+ $app->options('/mobile/api/patient/file/download', CORSAction::class);
+ $app->options('/mobile/api/patient/tracking', CORSAction::class);
+ $app->options('/mobile/api/patient/tracking/list', CORSAction::class);
+ $app->options('/mobile/api/patient/calendar', CORSAction::class);
+ $app->options('/mobile/api/patient/drug/list', CORSAction::class);
+ $app->options('/mobile/api/patient/drug/delete/{id}', CORSAction::class);
+ $app->options('/mobile/api/patient/drug/add', CORSAction::class);
+ $app->options('/mobile/api/patient/account/delete', CORSAction::class);
+ $app->options('/mobile/api/patient/account/download', CORSAction::class);
+ $app->options('/mobile/api/obiettivi/add', CORSAction::class);
+ $app->options('/mobile/api/obiettivi/delete', CORSAction::class);
+ $app->options('/mobile/api/obiettivi/update', CORSAction::class);
+ $app->options('/mobile/api/obiettivi/list', CORSAction::class);
+ $app->options('/mobile/api/patient/report/pills', CORSAction::class);
+ $app->options('/mobile/api/patient/report/mood', CORSAction::class);
+ $app->options('/mobile/api/patient/test/comportamento', CORSAction::class);
+ $app->options('/mobile/api/patient/test/emozioni', CORSAction::class);
+ $app->options('/mobile/api/patient/health/passi', CORSAction::class);
+ $app->options('/mobile/api/patient/test/phq', CORSAction::class);
+ $app->options('/mobile/api/register/notification', CORSAction::class);
};
diff --git a/resources/text/en_US/LC_MESSAGES/messages_en_US.po b/resources/text/en_US/LC_MESSAGES/messages_en_US.po
index d968fe8..ead7f54 100644
--- a/resources/text/en_US/LC_MESSAGES/messages_en_US.po
+++ b/resources/text/en_US/LC_MESSAGES/messages_en_US.po
@@ -916,7 +916,7 @@ msgid ""
msgstr "Error while sending mail. if you wrote it right contact Mental Space"
#: src/Domain/Consulti/Repository/ConsultiRepository.php:126
-msgid "Richiesta consulto inviata correttamente"
+msgid "Richiesta consult inviata correttamente"
msgstr "Medical Consultation request sent successfull"
#: src/Domain/Patients/Repository/PatientsRepository.php:103
diff --git a/src/Action/Auth/DocLoginSubmitAction.php b/src/Action/Auth/DocLoginSubmitAction.php
index 1d93bad..f8a6f47 100644
--- a/src/Action/Auth/DocLoginSubmitAction.php
+++ b/src/Action/Auth/DocLoginSubmitAction.php
@@ -53,9 +53,9 @@ public function __invoke(ServerRequestInterface $request, ResponseInterface $res
$username = (string)($data['username'] ?? '');
$password = (string)($data['password'] ?? '');
$role = (string)($data['role'] ?? '');
-// Pseudo example
-// Check user credentials. You may use an application/domain service and the database here. $user = null;
+
$userData = $this->userAuth->authenticate($username, $password, $role);
+
// Clear all flash messages
$flash = $this->session->getFlash();
$flash->clear();
diff --git a/src/Action/Auth/UserLoginSubmitAction.php b/src/Action/Auth/UserLoginSubmitAction.php
index 8f56e70..dacd39c 100644
--- a/src/Action/Auth/UserLoginSubmitAction.php
+++ b/src/Action/Auth/UserLoginSubmitAction.php
@@ -58,8 +58,7 @@ public function __invoke(ServerRequestInterface $request, ResponseInterface $res
$username = (string)($data['username'] ?? '');
$password = (string)($data['password'] ?? '');
$role = (string)($data['role'] ?? '');
-// Pseudo example
-// Check user credentials. You may use an application/domain service and the database here. $user = null;
+
$userData = $this->userAuth->authenticate_paz($username, $password, $role);
// Clear all flash messages
$flash = $this->session->getFlash();
@@ -82,21 +81,7 @@ public function __invoke(ServerRequestInterface $request, ResponseInterface $res
$flash->add('success', 'Login successfully');
set_language($userData['locale']);
- /*
- * $tokenBuilder = (new Builder(new JoseEncoder(), ChainedFormatter::default()));
- $algorithm = new Sha256();
- $signingKey = getenv('JWT_SECRET');
- $now = new \DateTimeImmutable();
- $token = $tokenBuilder
- ->issuedBy('https://app.mentalspace.com')
- ->permittedFor('http://localhost:8100')
- ->identifiedBy($userData['user_id'])
- ->expiresAt($now->modify('+15 DAY'))
- ->withClaim('uid',$userData['user_id'])
- ->withClaim('email', $userData['email'])
- ->getToken($algorithm, $signingKey);
- */
$token = $this->jwtAuth->createJwt(
[
'uid' => $userData['user_id'],
diff --git a/src/Action/Cities/ListCitiesAction.php b/src/Action/Cities/ListCitiesAction.php
index d0c790a..554b8eb 100644
--- a/src/Action/Cities/ListCitiesAction.php
+++ b/src/Action/Cities/ListCitiesAction.php
@@ -41,7 +41,7 @@ public function __construct(CitesList $citiesList, Responder $responder)
*/
public function __invoke(ServerRequestInterface $request, ResponseInterface $response): ResponseInterface
{
- // Optional: Pass parameters from the request to the findUsers method
+
$gh = $this->citiesList->listCities();
return $this->responder->withJson($response, $gh);
diff --git a/src/Action/Consulti/GeneraLinkConsultoAction.php b/src/Action/Consulti/GenerateConsultLinkAction.php
similarity index 82%
rename from src/Action/Consulti/GeneraLinkConsultoAction.php
rename to src/Action/Consulti/GenerateConsultLinkAction.php
index 4f3de06..4f16d6c 100644
--- a/src/Action/Consulti/GeneraLinkConsultoAction.php
+++ b/src/Action/Consulti/GenerateConsultLinkAction.php
@@ -5,19 +5,19 @@
namespace App\Action\Consulti;
-use App\Domain\Consulti\Repository\ConsultiRepository;
+use App\Domain\Consulti\Repository\ConsultRepository;
use App\Responder\Responder;
use Fig\Http\Message\StatusCodeInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
-final class GeneraLinkConsultoAction
+final class GenerateConsultLinkAction
{
private Responder $responder;
- private ConsultiRepository $consultiRepository;
+ private ConsultRepository $consultiRepository;
- function __construct(Responder $responder, ConsultiRepository $consultiRepository)
+ function __construct(Responder $responder, ConsultRepository $consultiRepository)
{
$this->responder = $responder;
$this->consultiRepository = $consultiRepository;
@@ -38,7 +38,7 @@ public function __invoke(
if (!filter_var($data['email'], FILTER_VALIDATE_EMAIL)) {
return $this->responder
- ->withJson($response, ['status' => 'error', 'message' => __('Indirizzo E-Mail non corretto')])
+ ->withJson($response, ['status' => 'error', 'message' => __('E-Mail Address is not correct')])
->withStatus(StatusCodeInterface::STATUS_BAD_REQUEST);
}
diff --git a/src/Action/Consulti/ListLinkConsultoAction.php b/src/Action/Consulti/ListConsultLinkAction.php
similarity index 81%
rename from src/Action/Consulti/ListLinkConsultoAction.php
rename to src/Action/Consulti/ListConsultLinkAction.php
index 38f889b..45e5f20 100644
--- a/src/Action/Consulti/ListLinkConsultoAction.php
+++ b/src/Action/Consulti/ListConsultLinkAction.php
@@ -5,19 +5,19 @@
namespace App\Action\Consulti;
-use App\Domain\Consulti\Repository\ConsultiRepository;
+use App\Domain\Consulti\Repository\ConsultRepository;
use App\Responder\Responder;
use Fig\Http\Message\StatusCodeInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
-final class ListLinkConsultoAction
+final class ListConsultLinkAction
{
private Responder $responder;
- private ConsultiRepository $consultiRepository;
+ private ConsultRepository $consultiRepository;
- function __construct(Responder $responder, ConsultiRepository $consultiRepository)
+ function __construct(Responder $responder, ConsultRepository $consultiRepository)
{
$this->responder = $responder;
$this->consultiRepository = $consultiRepository;
diff --git a/src/Action/Consulti/PinCodeActionCheck.php b/src/Action/Consulti/PinCodeActionCheck.php
index c8f254c..4c1d989 100644
--- a/src/Action/Consulti/PinCodeActionCheck.php
+++ b/src/Action/Consulti/PinCodeActionCheck.php
@@ -5,7 +5,7 @@
namespace App\Action\Consulti;
-use App\Domain\Consulti\Repository\ConsultiRepository;
+use App\Domain\Consulti\Repository\ConsultRepository;
use App\Responder\Responder;
use Fig\Http\Message\StatusCodeInterface;
use Psr\Http\Message\ResponseInterface;
@@ -15,9 +15,9 @@ final class PinCodeActionCheck
{
private Responder $responder;
- private ConsultiRepository $consultiRepository;
+ private ConsultRepository $consultiRepository;
- function __construct(Responder $responder, ConsultiRepository $consultiRepository)
+ function __construct(Responder $responder, ConsultRepository $consultiRepository)
{
$this->responder = $responder;
$this->consultiRepository = $consultiRepository;
diff --git a/src/Action/Diary/DeleteDiaryAction.php b/src/Action/Diary/DeleteDiaryAction.php
index 99dc1cb..4967d4e 100644
--- a/src/Action/Diary/DeleteDiaryAction.php
+++ b/src/Action/Diary/DeleteDiaryAction.php
@@ -51,7 +51,7 @@ public function __invoke(
}
return $this->responder
- ->withJson($response, ['status' => 'success', 'message' => __("Eliminato con successo")])
+ ->withJson($response, ['status' => 'success', 'message' => __("Deleted")])
->withStatus(StatusCodeInterface::STATUS_OK);
}
}
diff --git a/src/Action/Diary/UploadDiaryAction.php b/src/Action/Diary/UploadDiaryAction.php
index 79a3297..d75d3bb 100644
--- a/src/Action/Diary/UploadDiaryAction.php
+++ b/src/Action/Diary/UploadDiaryAction.php
@@ -44,13 +44,13 @@ public function __invoke(
$entry = $this->repository->addEntry($user_id, $data);
if ($entry) {
return $this->responder
- ->withJson($response, ['status' => 'success', 'message' => __('Inserito con Successo')])
+ ->withJson($response, ['status' => 'success', 'message' => __('Success')])
->withStatus(StatusCodeInterface::STATUS_OK);
}
return $this->responder
- ->withJson($response, ['status' => 'error', 'message' => __('Errore')])
+ ->withJson($response, ['status' => 'error', 'message' => __('Error')])
->withStatus(StatusCodeInterface::STATUS_INTERNAL_SERVER_ERROR);
}
}
diff --git a/src/Action/Doctors/DocDetailAppAction.php b/src/Action/Doctors/DocDetailAppAction.php
index 4dff430..1e149a7 100644
--- a/src/Action/Doctors/DocDetailAppAction.php
+++ b/src/Action/Doctors/DocDetailAppAction.php
@@ -37,7 +37,7 @@ public function __invoke(
->withStatus(StatusCodeInterface::STATUS_BAD_REQUEST);
}
- $docData = $this->doctorRepository->AppdoctorDetail($userId);
+ $docData = $this->doctorRepository->AppDoctorDetail($userId);
if (empty($docData)) {
return $this->responder
diff --git a/src/Action/Doctors/InviteDoctorAction.php b/src/Action/Doctors/InviteDoctorAction.php
index 04f7540..be070f6 100644
--- a/src/Action/Doctors/InviteDoctorAction.php
+++ b/src/Action/Doctors/InviteDoctorAction.php
@@ -9,6 +9,7 @@
use App\Domain\Patients\Repository\PatientsRepository;
use App\Domain\Users\Repository\UserRepository;
use App\Responder\Responder;
+use Exception;
use Fig\Http\Message\StatusCodeInterface;
use PHPMailer\PHPMailer\PHPMailer;
use Psr\Http\Message\ResponseInterface;
@@ -74,14 +75,14 @@ public function __invoke(
//Content
$mail->isHTML(true); //Set email format to HTML
- $mail->Subject = 'Invito a partecipare a Mental Space';
+ $mail->Subject = __('Invite to enter in Mental Space');
$mail_body = file_get_contents(__DIR__ . '/../../../data/mail_template/doctor_invitation');
$search = ['{{PAZ_NOME}}', '{{PAZ_COGNOME}}', '{{PAZ_EMAIL}}', '{{PAZ_USER_ID}}' ];
$replace = [$userData['name'], $userData['surname'], $userData['email'], $userData['user_id']];
$mail_body = str_replace($search, $replace, $mail_body);
$mail->Body = $mail_body;
$mail->send();
- } catch (\Exception $e) {
+ } catch (Exception $e) {
return $this->responder
->withJson($response, ['status' => 'error', 'messsage' => $e->getMessage()])
->withStatus(StatusCodeInterface::STATUS_OK);
@@ -110,14 +111,14 @@ public function __invoke(
//Content
$mail->isHTML(true); //Set email format to HTML
- $mail->Subject = 'Un Nuovo Assistito per te!';
+ $mail->Subject = __('A new Patient for you !');
$mail_body = file_get_contents(__DIR__ . '/../../../data/mail_template/patient_assigned');
$search = ["{{PAZ_NOME}}", '{{PAZ_COGNOME}}', '{{DOC_NOME}}', '{{DOC_COGNOME}}'];
$replace = [$userData['name'], $userData['surname']. $docData['doc_name'], $docData['doc_surname']];
$mail_body = str_replace($search, $replace, $mail_body);
$mail->Body = $mail_body;
$mail->send();
- } catch (\Exception $e) {
+ } catch (Exception $e) {
return $this->responder
->withJson($response, ['status' => 'error', 'messsage' => $e->getMessage()])
->withStatus(StatusCodeInterface::STATUS_OK);
@@ -128,7 +129,7 @@ public function __invoke(
->withStatus(StatusCodeInterface::STATUS_OK);
} else {
return $this->responder
- ->withJson($response, ['status' => 'error', 'message' => 'Errore durante assegnazione medico'])
+ ->withJson($response, ['status' => 'error', 'message' => __('Error while assigning doctor')])
->withStatus(StatusCodeInterface::STATUS_BAD_REQUEST);
}
}
diff --git a/src/Action/Dsm/ListDsmAction.php b/src/Action/Dsm/ListDsmAction.php
index e70252e..ab38558 100644
--- a/src/Action/Dsm/ListDsmAction.php
+++ b/src/Action/Dsm/ListDsmAction.php
@@ -23,7 +23,7 @@ final class ListDsmAction
/**
* The constructor.
*
- * @param CitiesList $citiesList The user index list viewer
+ * @param DsmList $citiesList The dsm list viewer
* @param Responder $responder The responder
*/
public function __construct(DsmList $dsmList, Responder $responder)
diff --git a/src/Action/Files/DocFileDeleteAction.php b/src/Action/Files/DocFileDeleteAction.php
index 2580be3..d704a39 100644
--- a/src/Action/Files/DocFileDeleteAction.php
+++ b/src/Action/Files/DocFileDeleteAction.php
@@ -43,14 +43,14 @@ public function __invoke(
if (!is_file($file_path)) {
return $this->responder
- ->withJson($response, ['status' => 'success', 'message' => __("File non trovato")])
+ ->withJson($response, ['status' => 'success', 'message' => __("File not found")])
->withStatus(StatusCodeInterface::STATUS_OK);
}
unlink($file_path);
return $this->responder
- ->withJson($response, ['status' => 'error', 'message' => __("File Cancellato con sucesso")])
+ ->withJson($response, ['status' => 'error', 'message' => __("File Deleted")])
->withStatus(StatusCodeInterface::STATUS_OK);
}
diff --git a/src/Action/Files/DocFileDownloadAction.php b/src/Action/Files/DocFileDownloadAction.php
index 644d2b6..066085b 100644
--- a/src/Action/Files/DocFileDownloadAction.php
+++ b/src/Action/Files/DocFileDownloadAction.php
@@ -10,6 +10,7 @@
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Message\UploadedFileInterface;
+use Slim\Psr7\Stream;
final class DocFileDownloadAction
{
@@ -42,7 +43,7 @@ public function __invoke(
if (!is_file($filePath)) {
return $this->responder
- ->withJson($response, ['status' => 'success', 'message'=>__('File non trovato')])
+ ->withJson($response, ['status' => 'success', 'message' => __('File not found')])
->withStatus(StatusCodeInterface::STATUS_OK);
}
@@ -52,6 +53,6 @@ public function __invoke(
->withAddedHeader('Cache-Control', 'no-store, no-cache, must-revalidate, max-age=0')
->withHeader('Cache-Control', 'post-check=0, pre-check=0')
->withHeader('Pragma', 'no-cache')
- ->withBody((new \Slim\Psr7\Stream(fopen($filePath, 'rb'))));
+ ->withBody((new Stream(fopen($filePath, 'rb'))));
}
}
diff --git a/src/Action/Files/DocFileListAction.php b/src/Action/Files/DocFileListAction.php
index 5e39aca..fa7db44 100644
--- a/src/Action/Files/DocFileListAction.php
+++ b/src/Action/Files/DocFileListAction.php
@@ -42,11 +42,11 @@ public function __invoke(
->withStatus(StatusCodeInterface::STATUS_OK);
}
- $listaFiles = scandir($directory);
- $listaFiles = array_diff($listaFiles, ['.', '..']);
+ $filesList = scandir($directory);
+ $filesList = array_diff($filesList, ['.', '..']);
return $this->responder
- ->withJson($response, ['status' => 'success', 'files' => $listaFiles])
+ ->withJson($response, ['status' => 'success', 'files' => $filesList])
->withStatus(StatusCodeInterface::STATUS_OK);
}
diff --git a/src/Action/Files/DocFileUploadAction.php b/src/Action/Files/DocFileUploadAction.php
index 514918a..ad3b421 100644
--- a/src/Action/Files/DocFileUploadAction.php
+++ b/src/Action/Files/DocFileUploadAction.php
@@ -40,7 +40,7 @@ public function __invoke(
if (!$uploadedFiles) {
return $this->responder
- ->withJson($response, ['status' => 'error', 'message' => __("Hai dimenticato di inviare file")])
+ ->withJson($response, ['status' => 'error', 'message' => __("Forgot to send the file ?")])
->withStatus(StatusCodeInterface::STATUS_BAD_REQUEST);
}
@@ -55,15 +55,16 @@ public function __invoke(
if ($uploadedFile->getError() === UPLOAD_ERR_OK) {
$filename = $this->moveUploadedFile($directory, $uploadedFile);
return $this->responder
- ->withJson($response, ['status' => 'success', 'message' => __("Caricato con successo")])
+ ->withJson($response, ['status' => 'success', 'message' => __("Uploaded")])
->withStatus(StatusCodeInterface::STATUS_OK);
}
return $this->responder
- ->withJson($response, ['status' => 'error', 'message' => __("Qualcosa è andato storto")])
+ ->withJson($response, ['status' => 'error', 'message' => __("Something went wrong")])
->withStatus(StatusCodeInterface::STATUS_BAD_REQUEST);
}
+ // @todo move this function in src/Support/functions.php and eliminate the duplicates
private function moveUploadedFile(string $directory, UploadedFileInterface $uploadedFile)
{
$extension = pathinfo($uploadedFile->getClientFilename(), PATHINFO_EXTENSION);
diff --git a/src/Action/Files/FileDownloadAction.php b/src/Action/Files/FileDownloadAction.php
index 45f4e75..0149459 100644
--- a/src/Action/Files/FileDownloadAction.php
+++ b/src/Action/Files/FileDownloadAction.php
@@ -10,6 +10,7 @@
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Message\UploadedFileInterface;
+use Slim\Psr7\Stream;
final class FileDownloadAction
{
@@ -42,7 +43,7 @@ public function __invoke(
if (!is_file($filePath)) {
return $this->responder
- ->withJson($response, ['status' => 'success', 'message'=>__('File non trovato')])
+ ->withJson($response, ['status' => 'success', 'message' => __('File not found')])
->withStatus(StatusCodeInterface::STATUS_OK);
}
@@ -52,6 +53,6 @@ public function __invoke(
->withAddedHeader('Cache-Control', 'no-store, no-cache, must-revalidate, max-age=0')
->withHeader('Cache-Control', 'post-check=0, pre-check=0')
->withHeader('Pragma', 'no-cache')
- ->withBody((new \Slim\Psr7\Stream(fopen($filePath, 'rb'))));
+ ->withBody((new Stream(fopen($filePath, 'rb'))));
}
}
diff --git a/src/Action/Files/FileUploadAction.php b/src/Action/Files/FileUploadAction.php
index 5d3dabe..650e3a5 100644
--- a/src/Action/Files/FileUploadAction.php
+++ b/src/Action/Files/FileUploadAction.php
@@ -38,7 +38,7 @@ public function __invoke(
if (!$uploadedFiles) {
return $this->responder
- ->withJson($response, ['status' => 'error', 'message' => __("Hai dimenticato di inviare file")])
+ ->withJson($response, ['status' => 'error', 'message' => __("Forgot to attach files ?")])
->withStatus(StatusCodeInterface::STATUS_BAD_REQUEST);
}
@@ -53,12 +53,12 @@ public function __invoke(
if ($uploadedFile->getError() === UPLOAD_ERR_OK) {
$filename = $this->moveUploadedFile($directory, $uploadedFile);
return $this->responder
- ->withJson($response, ['status' => 'success', 'message' => __("Caricato con successo")])
+ ->withJson($response, ['status' => 'success', 'message' => __("Uploaded")])
->withStatus(StatusCodeInterface::STATUS_OK);
}
return $this->responder
- ->withJson($response, ['status' => 'error', 'message' => __("Qualcosa è andato storto")])
+ ->withJson($response, ['status' => 'error', 'message' => __("Something went wrong")])
->withStatus(StatusCodeInterface::STATUS_BAD_REQUEST);
}
diff --git a/src/Action/Health/AddPassiAction.php b/src/Action/Health/AddStepsAction.php
similarity index 96%
rename from src/Action/Health/AddPassiAction.php
rename to src/Action/Health/AddStepsAction.php
index 6311d63..fe5948b 100644
--- a/src/Action/Health/AddPassiAction.php
+++ b/src/Action/Health/AddStepsAction.php
@@ -13,7 +13,7 @@
/**
* Action.
*/
-final class AddPassiAction
+final class AddStepsAction
{
private HealthRepository $health;
@@ -42,7 +42,7 @@ public function __construct(HealthRepository $health, Responder $responder)
public function __invoke(ServerRequestInterface $request, ResponseInterface $response): ResponseInterface
{
$data = $request->getParsedBody();
- $gh = $this->health->aggiungiPassi($request->getAttribute('uid'), $data['passi']);
+ $gh = $this->health->aggiungiPassi($request->getAttribute('uid'), $data['steps']);
if ($gh) {
$result = ['status' => 'success'];
diff --git a/src/Action/Messages/ListContactsAction.php b/src/Action/Messages/ListContactsAction.php
index 0a02175..7ee743c 100644
--- a/src/Action/Messages/ListContactsAction.php
+++ b/src/Action/Messages/ListContactsAction.php
@@ -50,7 +50,7 @@ public function __invoke(ServerRequestInterface $request, ResponseInterface $res
* This could also be done within a specific Responder class.
*
* @param ResponseInterface $response The response
- * @param array $users The users
+ * @param array $sbs Dont remember
*
* @return ResponseInterface The response
*/
diff --git a/src/Action/Moods/ListMoodAction.php b/src/Action/Moods/ListMoodAction.php
index 47959ff..3cd15f0 100644
--- a/src/Action/Moods/ListMoodAction.php
+++ b/src/Action/Moods/ListMoodAction.php
@@ -38,7 +38,7 @@ public function __invoke(
- $mood = $this->repository->ultimi10mood($user_id);
+ $mood = $this->repository->last10mood($user_id);
return $this->responder
->withJson($response, $mood)
diff --git a/src/Action/Moods/ListMoodGraphAction.php b/src/Action/Moods/ListMoodGraphAction.php
index acd6792..582813d 100644
--- a/src/Action/Moods/ListMoodGraphAction.php
+++ b/src/Action/Moods/ListMoodGraphAction.php
@@ -38,7 +38,7 @@ public function __invoke(
- $mood = $this->repository->ultimi10moodGraph($user_id);
+ $mood = $this->repository->last10moodGraph($user_id);
return $this->responder
->withJson($response, $mood)
diff --git a/src/Action/Obiettivi/AddObiettivoAction.php b/src/Action/Obiettivi/AddObjectiveAction.php
similarity index 72%
rename from src/Action/Obiettivi/AddObiettivoAction.php
rename to src/Action/Obiettivi/AddObjectiveAction.php
index 126f905..ff38fa0 100644
--- a/src/Action/Obiettivi/AddObiettivoAction.php
+++ b/src/Action/Obiettivi/AddObjectiveAction.php
@@ -5,7 +5,7 @@
namespace App\Action\Obiettivi;
-use App\Domain\Obiettivi\Repository\ObiettiviRepository;
+use App\Domain\Obiettivi\Repository\ObjectiveRepository;
use App\Responder\Responder;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
@@ -13,18 +13,18 @@
/**
* Action.
*/
-final class AddObiettivoAction
+final class AddObjectiveAction
{
- private ObiettiviRepository $obiettiviRepository;
+ private ObjectiveRepository $objectiveRepository;
private Responder $responder;
/**
- * @param ObiettiviRepository $obiettiviRepository
+ * @param ObjectiveRepository $obiettiviRepository
* @param Responder $responder
*/
- public function __construct(ObiettiviRepository $obiettiviRepository, Responder $responder)
+ public function __construct(ObjectiveRepository $obiettiviRepository, Responder $responder)
{
- $this->obiettiviRepository = $obiettiviRepository;
+ $this->objectiveRepository = $obiettiviRepository;
$this->responder = $responder;
}
@@ -39,7 +39,7 @@ public function __construct(ObiettiviRepository $obiettiviRepository, Responder
public function __invoke(ServerRequestInterface $request, ResponseInterface $response): ResponseInterface
{
$data = $request->getParsedBody();
- $q = $this->obiettiviRepository->addObjective($data, $request->getAttribute('uid'));
+ $q = $this->objectiveRepository->addObjective($data, $request->getAttribute('uid'));
if (!$q) {
$status = "error";
diff --git a/src/Action/Obiettivi/DeleteObiettivoAction.php b/src/Action/Obiettivi/DeleteObjectiveAction.php
similarity index 81%
rename from src/Action/Obiettivi/DeleteObiettivoAction.php
rename to src/Action/Obiettivi/DeleteObjectiveAction.php
index 2f726ec..5953fb3 100644
--- a/src/Action/Obiettivi/DeleteObiettivoAction.php
+++ b/src/Action/Obiettivi/DeleteObjectiveAction.php
@@ -5,7 +5,7 @@
namespace App\Action\Obiettivi;
-use App\Domain\Obiettivi\Repository\ObiettiviRepository;
+use App\Domain\Obiettivi\Repository\ObjectiveRepository;
use App\Responder\Responder;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
@@ -13,9 +13,9 @@
/**
* Action.
*/
-final class DeleteObiettivoAction
+final class DeleteObjectiveAction
{
- private ObiettiviRepository $obiettiviRepository;
+ private ObjectiveRepository $obiettiviRepository;
private Responder $responder;
@@ -25,9 +25,9 @@ final class DeleteObiettivoAction
* @param CitiesList $citiesList The user index list viewer
* @param Responder $responder The responder
*/
- public function __construct(ObiettiviRepository $obiettiviRepository, Responder $responder)
+ public function __construct(ObjectiveRepository $objectiveRepository, Responder $responder)
{
- $this->obiettiviRepository = $obiettiviRepository;
+ $this->obiettiviRepository = $objectiveRepository;
$this->responder = $responder;
}
diff --git a/src/Action/Obiettivi/ListObiettivoAction.php b/src/Action/Obiettivi/ListObjectiveAction.php
similarity index 80%
rename from src/Action/Obiettivi/ListObiettivoAction.php
rename to src/Action/Obiettivi/ListObjectiveAction.php
index 43474b9..b5c32cd 100644
--- a/src/Action/Obiettivi/ListObiettivoAction.php
+++ b/src/Action/Obiettivi/ListObjectiveAction.php
@@ -5,7 +5,7 @@
namespace App\Action\Obiettivi;
-use App\Domain\Obiettivi\Repository\ObiettiviRepository;
+use App\Domain\Obiettivi\Repository\ObjectiveRepository;
use App\Responder\Responder;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
@@ -13,9 +13,9 @@
/**
* Action.
*/
-final class ListObiettivoAction
+final class ListObjectiveAction
{
- private ObiettiviRepository $obiettiviRepository;
+ private ObjectiveRepository $obiettiviRepository;
/**
* The constructor.
@@ -23,9 +23,9 @@ final class ListObiettivoAction
* @param CitiesList $citiesList The user index list viewer
* @param Responder $responder The responder
*/
- public function __construct(ObiettiviRepository $obiettiviRepository, Responder $responder)
+ public function __construct(ObjectiveRepository $objectiveRepository, Responder $responder)
{
- $this->obiettiviRepository = $obiettiviRepository;
+ $this->obiettiviRepository = $objectiveRepository;
$this->responder = $responder;
}
diff --git a/src/Action/Obiettivi/UpdateObiettivoAction.php b/src/Action/Obiettivi/UpdateObjectiveAction.php
similarity index 74%
rename from src/Action/Obiettivi/UpdateObiettivoAction.php
rename to src/Action/Obiettivi/UpdateObjectiveAction.php
index b0cc9c1..1ae89f3 100644
--- a/src/Action/Obiettivi/UpdateObiettivoAction.php
+++ b/src/Action/Obiettivi/UpdateObjectiveAction.php
@@ -5,7 +5,7 @@
namespace App\Action\Obiettivi;
-use App\Domain\Obiettivi\Repository\ObiettiviRepository;
+use App\Domain\Obiettivi\Repository\ObjectiveRepository;
use App\Responder\Responder;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
@@ -13,21 +13,21 @@
/**
* Action.
*/
-final class UpdateObiettivoAction
+final class UpdateObjectiveAction
{
- private ObiettiviRepository $obiettiviRepository;
+ private ObjectiveRepository $obiettiviRepository;
private Responder $responder;
/**
* The constructor.
*
- * @param CitiesList $citiesList The user index list viewer
+ * @param CitiesList $citiesList The cities list viewer
* @param Responder $responder The responder
*/
- public function __construct(ObiettiviRepository $obiettiviRepository, Responder $responder)
+ public function __construct(ObjectiveRepository $objectiveRepository, Responder $responder)
{
- $this->obiettiviRepository = $obiettiviRepository;
+ $this->obiettiviRepository = $objectiveRepository;
$this->responder = $responder;
}
@@ -44,7 +44,7 @@ public function __invoke(ServerRequestInterface $request, ResponseInterface $res
$uid = $request->getAttribute('uid');
$data = $request->getParsedBody();
// Optional: Pass parameters from the request to the findUsers method
- $gh = $this->obiettiviRepository->updateObjective($data['ob_id'], $data['obiettivo'], $uid);
+ $gh = $this->obiettiviRepository->updateObjective($data['ob_id'], $data['objective'], $uid);
return $this->responder->withJson($response, $gh);
}
diff --git a/src/Action/Pages/ConsultoPageAction.php b/src/Action/Pages/ConsultoPageAction.php
index 379eb13..70757fc 100644
--- a/src/Action/Pages/ConsultoPageAction.php
+++ b/src/Action/Pages/ConsultoPageAction.php
@@ -2,7 +2,7 @@
namespace App\Action\Pages;
-use App\Domain\Consulti\Repository\ConsultiRepository;
+use App\Domain\Consulti\Repository\ConsultRepository;
use App\Domain\Patients\Repository\PatientsRepository;
use App\Domain\Reports\Repository\ReportRepository;
use App\Domain\Tests\Repository\TestsRepository;
@@ -20,7 +20,7 @@ final class ConsultoPageAction
private $reportRepository;
private $testRepository;
- public function __construct(PhpRenderer $renderer, PatientsRepository $repository, ConsultiRepository $consultiRepository, ReportRepository $reportRepository, TestsRepository $testsRepository)
+ public function __construct(PhpRenderer $renderer, PatientsRepository $repository, ConsultRepository $consultiRepository, ReportRepository $reportRepository, TestsRepository $testsRepository)
{
$this->renderer = $renderer;
$this->repository = $repository;
@@ -36,7 +36,7 @@ public function __invoke(ServerRequestInterface $request, ResponseInterface $res
return $this->renderer->render($response, 'errors/not_found.php');
}
- $this->renderer->setLayout('layout/consulto.php');
+ $this->renderer->setLayout('layout/consult.php');
$this->renderer->addAttribute('css', [
'/app-assets/vendors/css/forms/select/select2.min.css',
@@ -78,7 +78,7 @@ public function __invoke(ServerRequestInterface $request, ResponseInterface $res
'/app-assets/js/scripts/pages/patient-detail.js',
'/app-assets/js/scripts/components/components-popovers.js',
'/app-assets/js/scripts/components/mutation.js',
- '/app-assets/js/scripts/pages/consulto.js',
+ '/app-assets/js/scripts/pages/consult.js',
]);
@@ -199,7 +199,7 @@ public function __invoke(ServerRequestInterface $request, ResponseInterface $res
$li .= $this->convertResultPhq($val['result']) . "
";
}
- $comportamentiImpulsivi = $this->testRepository->listComportamentoTest($uid);
+ $comportamentiImpulsivi = $this->testRepository->listBehaviourTest($uid);
$cmp = "";
foreach ($comportamentiImpulsivi as $key => $val) {
foreach ($val as $a => $b) {
@@ -210,7 +210,7 @@ public function __invoke(ServerRequestInterface $request, ResponseInterface $res
$cmp .= "
- - + +
Accessi Recenti
+Last Access
NON AUTORIZZATO
+WHOOPS!
Non sei autorizzato! 🔐
+Not sure why you are here 🔐
- Non sappiamo che stai cercando di fare, ma sicuramente logghiamo tutto ed investigheremo + We have no idea, but we'll investigate!
0
- +0
- +0 €
- +0
- +--
+
-
-
-
+
+
@@ -83,7 +75,7 @@-
-
+
@@ -93,11 +85,11 @@
- Profilo
+ Profile
- Impostazioni
- Prezzi
+ Settings
+ Prices
FAQ
Logout
@@ -129,22 +121,22 @@
- Apps & Pages
- -
+
-
-
@@ -165,7 +157,7 @@
diff --git a/templates/login/login_doctor.php b/templates/login/login_doctor.php
index 924ed16..dc70c4d 100644
--- a/templates/login/login_doctor.php
+++ b/templates/login/login_doctor.php
@@ -41,15 +41,6 @@
-
-
-
@@ -78,8 +69,8 @@ function gtag(){dataLayer.push(arguments);}
-
@@ -88,14 +79,14 @@ function gtag(){dataLayer.push(arguments);}
- -
+ -
@@ -147,13 +138,13 @@ function do_login(){
role: 'doctor'
}, function(resp){
if ( resp.status == 'success' ){
- $(".login-box-msg").html("");
+ $(".login-box-msg").html("");
window.location = "/pages/home_doctor";
} else {
- $(".login-box-msg").html("");
+ $(".login-box-msg").html("");
}
}).fail(function(){
- $(".login-box-msg").html("");
+ $(".login-box-msg").html("");
});
}
diff --git a/templates/patients/add.php b/templates/patients/add.php
index d48717f..68f0ca9 100644
--- a/templates/patients/add.php
+++ b/templates/patients/add.php
@@ -17,9 +17,9 @@
- Home
- -
+
-
- -
+
-
--
+
-
-
- -
+
-
-
-- Impostazioni");?>
+
- Settings");?>
👋
- +👋
+- +
@@ -261,33 +261,33 @@
@@ -203,7 +203,7 @@ class="fw-bold">
- +
-
-
-
+
+
+
+
Relazione su Paziente
+Relation on Patient
- +
@@ -349,7 +349,7 @@ class="fw-bold">- +
- +
- +
+
- +
Mental Space
-🚀
- +🚀
+- + - +