bottemplates/store-server.gbai/store-server.gbdialog/get-ncm.bas

14 lines
463 B
QBasic

PARAM product_id AS STRING
product = PRODUCT product_id
IF NOT product THEN
RETURN {error: "Product not found"}
END IF
IF product.tax_code THEN
RETURN {tax_code: product.tax_code, tax_class: product.tax_class}
END IF
info = LLM "Get NCM/tax classification for: " + product.name + " " + product.category + ". Return JSON {tax_code, tax_class, description}"
UPDATE "products", product_id, {tax_code: info.tax_code, tax_class: info.tax_class}
RETURN info