-- Create case_expenses table
CREATE TABLE IF NOT EXISTS case_expenses (
  id SERIAL PRIMARY KEY,
  case_id INTEGER NOT NULL,
  expense_date DATE DEFAULT NULL,
  amount DECIMAL(10,2) DEFAULT 0,
  description TEXT DEFAULT NULL,
  employee_id INTEGER DEFAULT NULL,
  document_id INTEGER DEFAULT NULL,
  isDeleted BOOLEAN NOT NULL DEFAULT FALSE,
  updatedAt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX IF NOT EXISTS case_expenses_case_idx ON case_expenses(case_id);
CREATE INDEX IF NOT EXISTS case_expenses_employee_idx ON case_expenses(employee_id);
CREATE INDEX IF NOT EXISTS case_expenses_document_idx ON case_expenses(document_id);
