-- name: GetCashiersByBranch :many
SELECT users.*
FROM branch_cashiers
    JOIN users ON branch_cashiers.user_id = users.id
    JOIN branches ON branches.id = branch_id
WHERE branch_cashiers.branch_id = $1;
-- name: GetAllCashiers :many
SELECT users.*,
    branch_id,
    branches.name AS branch_name,
    branches.wallet_id AS branch_wallet,
    branches.location As branch_location
FROM branch_cashiers
    JOIN users ON branch_cashiers.user_id = users.id
    JOIN branches ON branches.id = branch_id;
-- name: GetCashierByID :one
SELECT users.*,
    branch_id,
    branches.name AS branch_name,
    branches.wallet_id AS branch_wallet,
    branches.location As branch_location
FROM branch_cashiers
    JOIN users ON branch_cashiers.user_id = users.id
    JOIN branches ON branches.id = branch_id
WHERE users.id = $1;