{
 "openapi": "3.1.0",
 "info": {
  "title": "Control Register (Accounting)",
  "version": "20261030b",
  "description": "Which controls we operate, who owns each, when it was last tested and what we are doing about the ones that failed. A different shape from an audit log, which records changes rather than assurance."
 },
 "servers": [
  {
   "url": "https://{tenant}.tranxact.ai",
   "variables": {
    "tenant": {
     "default": "demo"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "schemas": {
   "financial-controls": {
    "type": "object",
    "required": [
     "name"
    ],
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "description": "Id",
      "readOnly": true
     },
     "org_id": {
      "type": "string",
      "format": "uuid",
      "description": "Org id",
      "readOnly": true
     },
     "org_unit_id": {
      "type": "string",
      "format": "uuid",
      "description": "Org unit id",
      "readOnly": true
     },
     "control_no": {
      "type": "string",
      "description": "Control no",
      "readOnly": true
     },
     "name": {
      "type": "string",
      "description": "Name"
     },
     "framework_id": {
      "type": "string",
      "format": "uuid",
      "description": "Framework"
     },
     "framework_ref": {
      "type": "string",
      "description": "Framework reference"
     },
     "process": {
      "type": "string",
      "description": "Process"
     },
     "control_type": {
      "type": "string",
      "description": "Type"
     },
     "nature": {
      "type": "string",
      "description": "Nature",
      "enum": [
       "manual",
       "automated",
       "it_dependent",
       "hybrid"
      ]
     },
     "frequency": {
      "type": "string",
      "description": "Frequency",
      "enum": [
       "continuous",
       "daily",
       "weekly",
       "monthly",
       "quarterly",
       "annual",
       "event_driven",
       "ad_hoc"
      ]
     },
     "is_key": {
      "type": "boolean",
      "description": "Key control"
     },
     "risk_addressed": {
      "type": "string",
      "description": "Risk addressed"
     },
     "assertion": {
      "type": "string",
      "description": "Assertion"
     },
     "owner_employee_id": {
      "type": "string",
      "format": "uuid",
      "description": "Owner"
     },
     "performer_employee_id": {
      "type": "string",
      "format": "uuid",
      "description": "Performed by"
     },
     "reviewer_employee_id": {
      "type": "string",
      "format": "uuid",
      "description": "Reviewed by"
     },
     "owner_role": {
      "type": "string",
      "description": "Owner role"
     },
     "module": {
      "type": "string",
      "description": "Module"
     },
     "resource": {
      "type": "string",
      "description": "Screen"
     },
     "system_rule": {
      "type": "string",
      "description": "System rule"
     },
     "enforced_by": {
      "type": "string",
      "description": "Enforced in code by"
     },
     "design_description": {
      "type": "string",
      "description": "Design"
     },
     "operation_description": {
      "type": "string",
      "description": "How it operates"
     },
     "evidence_required": {
      "type": "string",
      "description": "Evidence required"
     },
     "effectiveness": {
      "type": "string",
      "description": "Effectiveness"
     },
     "last_tested_at": {
      "type": "string",
      "format": "date",
      "description": "Last tested at"
     },
     "next_test_due": {
      "type": "string",
      "format": "date",
      "description": "Next test due"
     },
     "status": {
      "type": "string",
      "description": "Status",
      "readOnly": true
     },
     "is_system": {
      "type": "boolean",
      "description": "Is system",
      "readOnly": true
     },
     "notes": {
      "type": "string",
      "description": "Notes"
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "Created at",
      "readOnly": true
     },
     "xf_text_1": {
      "type": "string",
      "description": "Xf text 1",
      "readOnly": true
     },
     "xf_text_2": {
      "type": "string",
      "description": "Xf text 2",
      "readOnly": true
     },
     "xf_text_3": {
      "type": "string",
      "description": "Xf text 3",
      "readOnly": true
     },
     "xf_text_4": {
      "type": "string",
      "description": "Xf text 4",
      "readOnly": true
     },
     "xf_text_5": {
      "type": "string",
      "description": "Xf text 5",
      "readOnly": true
     },
     "xf_num_1": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 1",
      "readOnly": true
     },
     "xf_num_2": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 2",
      "readOnly": true
     },
     "xf_num_3": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 3",
      "readOnly": true
     },
     "xf_date_1": {
      "type": "string",
      "format": "date",
      "description": "Xf date 1",
      "readOnly": true
     },
     "xf_date_2": {
      "type": "string",
      "format": "date",
      "description": "Xf date 2",
      "readOnly": true
     },
     "created_by": {
      "type": "string",
      "format": "uuid",
      "description": "Created by",
      "readOnly": true
     },
     "updated_at": {
      "type": "string",
      "format": "date-time",
      "description": "Updated at",
      "readOnly": true
     },
     "updated_by": {
      "type": "string",
      "format": "uuid",
      "description": "Updated by",
      "readOnly": true
     }
    }
   }
  }
 },
 "security": [
  {
   "bearer": []
  }
 ],
 "paths": {
  "/api/accounting/financial-controls": {
   "get": {
    "summary": "list financial-controls",
    "operationId": "list_financial_controls_0_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "create financial-controls",
    "operationId": "create_financial_controls_1_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/financial-controls/{id}": {
   "get": {
    "summary": "get financial-controls",
    "operationId": "get_financial_controls_0_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "put": {
    "summary": "change financial-controls",
    "operationId": "change_financial_controls_1_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "delete financial-controls",
    "operationId": "delete_financial_controls_2_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/financial-controls/{id}/copy": {
   "post": {
    "summary": "Copy",
    "operationId": "action_financial_controls_0_6",
    "description": "Body keys: overrides, preview, withLines",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  }
 }
}