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


import influxframework
from influxframework.model.document import Document


class SupplierScorecardStanding(Document):
	pass


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

	return standing


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

	return standings
