-- Update Case Detail modal to add Post action
UPDATE ui_modals

SET config = '{"title":"Case Detail","body":[{"type":"tabs","tabs":[{"label":"Hours","elements":[{"type":"button","label":"Add Hour","onClick":"openCaseHourForm"},{"type":"table","id":"caseHoursTbl","options":{"tableName":"case_hours","addButton":false,"editFormId":38,"showGlobalSearch":false,"apiRowActions":[{"buttonText":"Post","apiUrl":"../api/case_hours/{id}","method":"PUT","body":{"posted":true}}],"rowFormatter":"formatCaseHourRow"}}]},{"label":"Documents","elements":[{"type":"button","label":"Upload Document","onClick":"uploadCaseDocument"},{"type":"table","id":"caseDocsTbl","options":{"tableName":"documents","addButton":false,"showGlobalSearch":false}}]},{"label":"Invoices","elements":[{"type":"button","label":"Create Invoice","onClick":"openCaseInvoiceForm"},{"type":"table","id":"caseInvoicesTbl","options":{"tableName":"invoices","addButton":false,"showGlobalSearch":false}}]},{"label":"Payments","elements":[{"type":"button","label":"Record Payment","onClick":"openCasePaymentForm"},{"type":"table","id":"casePaymentsTbl","options":{"tableName":"payments","addButton":false,"showGlobalSearch":false}}]}]}],"footer":[{"type":"button","label":"Close","onClick":"closeModal"}]}'

WHERE name = 'Case Detail';
