-- name: CreateTrackStatus :one
INSERT INTO trackstatus (
    instructions,
    comment,
    user_id,
    exportcompany_id
 ) VALUES (
    $1, 
    $2,
    $3,
    $4
 ) RETURNING *;


-- name: CreateInterceptionNotice :one
INSERT INTO interceptionnotice (
    consignment_no,
    instructions,
    notes,
    user_id,
    exportcompany_id
 ) VALUES (
    $1, 
    $2,
    $3,
    $4, 
    $5
 ) RETURNING *;

-- name: CreateDestructionNotice :one
INSERT INTO destructionnotice (
    consignment_no,
    instructions,
    notes,
    boarder_inspector,
    nppo_inspector,
    company_rep,
    user_id,
    exportcompany_id
 ) VALUES (
    $1, 
    $2,
    $3,
    $4, 
    $5, 
    $6, 
    $7, 
    $8
 ) RETURNING *;


-- name: CreateConsignmentStatusTracker :one
INSERT INTO consignmentstatustracker (
     consignment_no,
     consignment_status,
     reasons,
     notes
 ) VALUES (
    $1, 
    $2,
    $3,
    $4
 ) RETURNING *;

-- name: FetchDestructionNotice :many
SELECT * from destructionnotice 
WHERE consignment_no = $1;