from __future__ import annotations


class AccountRoutesMixin:
    def _handle_accounts_public_get(self, parsed) -> bool:
        if parsed.path == "/api/auth/me":
            self.auth_me()
            return True
        if parsed.path == "/api/auth/accounts":
            self.auth_accounts()
            return True
        return False

    def _handle_accounts_get(self, parsed) -> bool:
        if parsed.path == "/api/account/status":
            self.send_json({"ok": True, **self.application_service.status()})
            return True
        return False

    def _handle_accounts_delete(self, parsed) -> bool:
        if parsed.path == "/api/account/birth-profile":
            deleted = self.application_service.database.delete_user_birth_profile(self.application_service.current_user_id)
            self.send_json({"ok": True, "deleted": deleted})
            return True
        return False
