naise_pos/db/query/purchase_order.sql

24 lines
397 B
SQL

-- name: CreatePurchaseOrder :one
INSERT INTO purchase_order (
merchant_id,
supplier_id,
code,
is_paid,
total,
paid_nominal,
note,
created_by
) VALUES (
$1, $2, $3, $4, $5, $6, $7, $8
)
RETURNING *;
-- name: GetPurchaseOrderById :one
SELECT *
FROM purchase_order
WHERE id = $1;
-- name: ListPurchaseOrderByMerchantId :many
SELECT *
FROM purchase_order
WHERE merchant_id = $1;