# -*- coding: utf-8 -*-

import json

import sysactions

from api.boss import get_boss_service


@sysactions.action
def get_user_list(pos_id, *args):
    boss_service = get_boss_service()
    user_xml_str = boss_service.get_users_list()
    user_data = "<UserInfo>"
    for user in user_xml_str:
        user_data += user.get_info_response()
    user_data += "</UserInfo>"

    return json.dumps(user_data)
