2023-03-05 23:35:41 +07:00
|
|
|
-- name: CreatePurchaseOrderDetail :one
|
|
|
|
INSERT INTO purchase_order_detail (
|
|
|
|
purchase_order_id,
|
|
|
|
merchant_id,
|
|
|
|
product_id,
|
|
|
|
quantity,
|
|
|
|
sub_total,
|
|
|
|
product_price
|
|
|
|
) VALUES (
|
|
|
|
$1, $2, $3, $4, $5, $6
|
|
|
|
)
|
2023-03-16 16:55:45 +07:00
|
|
|
RETURNING *;
|
|
|
|
|
|
|
|
-- name: GetPurchaseOrderDetailsByPuchaseOrderId :one
|
|
|
|
SELECT *
|
|
|
|
FROM purchase_order_detail
|
|
|
|
WHERE purchase_order_id = $1;
|