Newer
Older
from orchestrator.forms.validators import Choice
from gso.services.crm import all_customers
def customer_selector() -> Choice:
customers = {}
for customer in all_customers():
customers[customer["id"]] = customer["name"]
return Choice("Select a customer", zip(customers.keys(), customers.items())) # type: ignore