service = new QuitCheckinService(); } public function profile() { try { return Response::success($this->service->getProfile($this->getCurrentSmtUser())); } catch (\Throwable $e) { return Response::error($e->getMessage(), $e->getCode() ?: 500); } } public function saveProfile() { try { return Response::success($this->service->upsertProfile($this->getCurrentSmtUser(), $this->request->post())); } catch (\Throwable $e) { return Response::error($e->getMessage(), $e->getCode() ?: 500); } } public function home() { try { return Response::success($this->service->home($this->getCurrentSmtUserId())); } catch (\Throwable $e) { return Response::error($e->getMessage(), $e->getCode() ?: 500); } } public function checkin() { try { return Response::success($this->service->checkin($this->getCurrentSmtUserId(), $this->request->post())); } catch (\Throwable $e) { return Response::error($e->getMessage(), $e->getCode() ?: 500); } } public function dreamPresets() { try { return Response::success($this->service->listDreamPresets()); } catch (\Throwable $e) { return Response::error($e->getMessage(), $e->getCode() ?: 500); } } public function rewardGoals() { try { return Response::success($this->service->listRewardGoals($this->getCurrentSmtUserId(), (string) $this->request->get('status', 'all'))); } catch (\Throwable $e) { return Response::error($e->getMessage(), $e->getCode() ?: 500); } } public function createRewardGoal() { try { return Response::success($this->service->createRewardGoal($this->getCurrentSmtUserId(), $this->request->post())); } catch (\Throwable $e) { return Response::error($e->getMessage(), $e->getCode() ?: 500); } } public function updateRewardGoal(int $id) { try { return Response::success($this->service->updateRewardGoal($this->getCurrentSmtUserId(), $id, $this->request->post())); } catch (\Throwable $e) { return Response::error($e->getMessage(), $e->getCode() ?: 500); } } public function createSupervisorInvite() { try { return Response::success($this->service->createSupervisorInvite($this->getCurrentSmtUserId(), (int) $this->request->post('days', 7))); } catch (\Throwable $e) { return Response::error($e->getMessage(), $e->getCode() ?: 500); } } public function bindSupervisorInvite() { try { return Response::success($this->service->bindSupervisorInvite($this->getCurrentSmtUserId(), (string) $this->request->post('token', ''))); } catch (\Throwable $e) { return Response::error($e->getMessage(), $e->getCode() ?: 400); } } public function supervisorOverview() { try { return Response::success($this->service->supervisorOverview($this->getCurrentSmtUserId())); } catch (\Throwable $e) { return Response::error($e->getMessage(), $e->getCode() ?: 500); } } public function supervisorStatus() { try { return Response::success($this->service->supervisorStatus($this->getCurrentSmtUserId())); } catch (\Throwable $e) { return Response::error($e->getMessage(), $e->getCode() ?: 500); } } public function revokeSupervisorBinding() { try { return Response::success($this->service->revokeSupervisorBinding($this->getCurrentSmtUserId(), $this->request->post())); } catch (\Throwable $e) { return Response::error($e->getMessage(), $e->getCode() ?: 400); } } public function reminderSettings() { try { return Response::success($this->service->getReminderSettings($this->getCurrentSmtUserId())); } catch (\Throwable $e) { return Response::error($e->getMessage(), $e->getCode() ?: 500); } } public function updateReminderSettings() { try { return Response::success($this->service->updateReminderSettings($this->getCurrentSmtUserId(), $this->request->post())); } catch (\Throwable $e) { return Response::error($e->getMessage(), $e->getCode() ?: 400); } } public function runReminders() { try { return Response::success($this->service->runReminders($this->getCurrentSmtUserId())); } catch (\Throwable $e) { return Response::error($e->getMessage(), $e->getCode() ?: 500); } } }