import json

import xhiveframework


def execute():
	"""Handle introduction of UI tours"""
	completed = {}
	for tour in xhiveframework.get_all("Form Tour", {"ui_tour": 1}, pluck="name"):
		completed[tour] = {"is_complete": True}

	User = xhiveframework.qb.DocType("User")
	xhiveframework.qb.update(User).set("onboarding_status", json.dumps(completed)).run()
