P5-4394 add framed-prints price formulas

This commit is contained in:
Martin
2019-10-31 14:16:22 +01:00
parent 0dd8d619b4
commit 95a264af99
5 changed files with 132 additions and 0 deletions
+34
View File
@@ -11,6 +11,7 @@ from api.lib.prices import (
canvas_frame_price,
poster_price,
poster_hanger_price,
framed_print_price,
m2_price,
inquiry_price,
)
@@ -239,6 +240,39 @@ def poster_hanger():
return jsonify(data=data)
@mod.route("/framed-print", methods=["GET"])
@validate_territory("territory")
def framed_print():
sku = request.args.get("sku", type=str)
market = market_model.from_territory(request.args.get("territory"))
reseller = get_reseller()
designer = get_designer()
data = [
{
"sku": sku,
"price": framed_print_price(
sku,
market,
designer=designer,
reseller=reseller,
rounded=False,
inc_vat=True,
),
"price_excl_vat": framed_print_price(
sku,
market,
designer=designer,
reseller=reseller,
rounded=False,
inc_vat=False,
),
}
]
return jsonify(data=data)
def get_inquiry_measurements(inquiry):
""" this function returns width and height to be used in the price calculations """