Skip to content

Where people and agents ship software together. The open-source git platform for the whole job: issues, agents, checks and deploys to the edge.

g1t.sh
5 linesCodeBlameRaw
1INSERT INTO ledger (id, workspace, kind, amount_micros, description, reference, created_at, billed_to)
2SELECT ?1, ?2, 'top_up', -(?3 - already), 'Refunded to the card', ?4, ?5, 'g1t'
3FROM (SELECT -(COALESCE((SELECT SUM(amount_micros) FROM plan_payments WHERE invoice_id LIKE ?6), 0)
4 + COALESCE((SELECT SUM(amount_micros) FROM ledger WHERE reference LIKE ?6), 0)) AS already)
5WHERE ?3 > already