-- name: GetAllCompaniesBranch :many
SELECT id, name, wallet_id, admin_id 
FROM companies;

-- name: GetBranchesByCompanyID :many
SELECT 
    id, 
    name, 
    location, 
    wallet_id, 
    branch_manager_id, 
    company_id, 
    is_self_owned
FROM branches
WHERE company_id = $1;

-- name: CountThresholdNotifications :one
SELECT COUNT(*) 
FROM wallet_threshold_notifications
WHERE company_id = $1 AND threshold = $2;

-- name: CreateThresholdNotification :exec
INSERT INTO wallet_threshold_notifications (company_id, threshold)
VALUES ($1, $2);