# Copyright (c) 2015, SolutionERP LLC and Contributors
# License: GNU General Public License v3. See license.txt

import xhiveframework

# test_records = xhiveframework.get_test_records('Designation')


def create_designation(**args):
	args = xhiveframework._dict(args)
	if xhiveframework.db.exists("Designation", args.designation_name or "_Test designation"):
		return xhiveframework.get_doc("Designation", args.designation_name or "_Test designation")

	designation = xhiveframework.get_doc(
		{
			"doctype": "Designation",
			"designation_name": args.designation_name or "_Test designation",
			"description": args.description or "_Test description",
		}
	)
	designation.save()
	return designation
