-- name: CreateConsignmentRejection :one
INSERT INTO consignmentrejections (
    cjcode,
    cjdescription
 ) VALUES (
    $1, $2
 ) RETURNING *;

-- name: GetConsignmentRejection :one
SELECT * FROM consignmentrejections
WHERE id = $1 LIMIT 1;

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

-- name: UpdateConsignmentRejection :one
UPDATE consignmentrejections
  set 
    cjcode= $2,
    cjdescription= $3
WHERE id = $1
RETURNING *;

-- name: DeleteConsignmentRejection :exec
DELETE FROM consignmentrejections WHERE id= $1;