pub async fn get_or_create_user_state_doc( state: &AppState, user_id: &str, ) -> Result<DocumentId, AppError>
Gets or creates the user state document for a given user.