# Copyright (c) 2017, SolutionERP LLC and contributors
# For license information, please see license.txt


import xhiveframework
from xhiveframework.model.document import Document


class SupplierScorecardStanding(Document):
	pass


@xhiveframework.whitelist()
def get_scoring_standing(standing_name):
	standing = xhiveframework.get_doc("Supplier Scorecard Standing", standing_name)

	return standing


@xhiveframework.whitelist()
def get_standings_list():
	standings = xhiveframework.db.sql(
		"""
		SELECT
			scs.name
		FROM
			`tabSupplier Scorecard Standing` scs""",
		{},
		as_dict=1,
	)

	return standings
