-- name: CreateConsignmentReasonRejection :one
INSERT INTO consignmentreasonrejections (
    crrcode,
    crrdescription
 ) VALUES (
    $1, $2
 ) RETURNING *;

-- name: GetConsignmentReasonRejection :one
SELECT * FROM consignmentreasonrejections
WHERE id = $1 LIMIT 1;

-- name: ListConsignmentReasonRejections :many
SELECT * FROM consignmentreasonrejections
ORDER BY id LIMIT $1
OFFSET $2;

-- name: UpdateConsignmentReasonRejection :one
UPDATE consignmentreasonrejections
  set 
    crrcode= $2,
    crrdescription = $3
WHERE id = $1
RETURNING *;

-- name: DeleteConsignmentReasonRejection :exec
DELETE FROM consignmentreasonrejections WHERE id= $1;