{
 "openapi": "3.1.0",
 "info": {
  "title": "Results Analysis (Accounting)",
  "version": "20261030b",
  "description": "Percentage of completion, the revenue it entitles the company to, and what has to be accrued or deferred so the profit lands in the right month rather than all at the end."
 },
 "servers": [
  {
   "url": "https://{tenant}.tranxact.ai",
   "variables": {
    "tenant": {
     "default": "demo"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "schemas": {
   "results-analysis": {
    "type": "object",
    "required": [],
    "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
     },
     "project_id": {
      "type": "string",
      "format": "uuid",
      "description": "Project id",
      "readOnly": true
     },
     "contract_id": {
      "type": "string",
      "format": "uuid",
      "description": "Contract id",
      "readOnly": true
     },
     "wbs_element_id": {
      "type": "string",
      "format": "uuid",
      "description": "Wbs element id",
      "readOnly": true
     },
     "period_code": {
      "type": "string",
      "description": "Period code",
      "readOnly": true
     },
     "as_of_date": {
      "type": "string",
      "format": "date",
      "description": "As of date",
      "readOnly": true
     },
     "method": {
      "type": "string",
      "description": "Method",
      "readOnly": true
     },
     "contract_revenue": {
      "type": "string",
      "format": "decimal",
      "description": "Contract revenue",
      "readOnly": true
     },
     "cost_to_date": {
      "type": "string",
      "format": "decimal",
      "description": "Cost to date",
      "readOnly": true
     },
     "estimate_to_complete": {
      "type": "string",
      "format": "decimal",
      "description": "Estimate to complete",
      "readOnly": true
     },
     "estimate_at_completion": {
      "type": "string",
      "format": "decimal",
      "description": "Estimate at completion",
      "readOnly": true
     },
     "percent_complete": {
      "type": "string",
      "format": "decimal",
      "description": "Percent complete",
      "readOnly": true
     },
     "earned_revenue": {
      "type": "string",
      "format": "decimal",
      "description": "Earned revenue",
      "readOnly": true
     },
     "billed_revenue": {
      "type": "string",
      "format": "decimal",
      "description": "Billed revenue",
      "readOnly": true
     },
     "revenue_in_excess_of_billings": {
      "type": "string",
      "format": "decimal",
      "description": "Revenue in excess of billings",
      "readOnly": true
     },
     "billings_in_excess_of_revenue": {
      "type": "string",
      "format": "decimal",
      "description": "Billings in excess of revenue",
      "readOnly": true
     },
     "recognised_cost": {
      "type": "string",
      "format": "decimal",
      "description": "Recognised cost",
      "readOnly": true
     },
     "wip_amount": {
      "type": "string",
      "format": "decimal",
      "description": "Wip amount",
      "readOnly": true
     },
     "accrued_revenue": {
      "type": "string",
      "format": "decimal",
      "description": "Accrued revenue",
      "readOnly": true
     },
     "deferred_revenue": {
      "type": "string",
      "format": "decimal",
      "description": "Deferred revenue",
      "readOnly": true
     },
     "profit": {
      "type": "string",
      "format": "decimal",
      "description": "Profit",
      "readOnly": true
     },
     "margin_pct": {
      "type": "string",
      "format": "decimal",
      "description": "Margin pct",
      "readOnly": true
     },
     "expected_loss": {
      "type": "string",
      "format": "decimal",
      "description": "Expected loss",
      "readOnly": true
     },
     "loss_provision": {
      "type": "string",
      "format": "decimal",
      "description": "Loss provision",
      "readOnly": true
     },
     "is_loss_making": {
      "type": "boolean",
      "description": "Is loss making",
      "readOnly": true
     },
     "journal_id": {
      "type": "string",
      "format": "uuid",
      "description": "Journal id",
      "readOnly": true
     },
     "status": {
      "type": "string",
      "description": "Status",
      "readOnly": true
     },
     "calculated_at": {
      "type": "string",
      "format": "date-time",
      "description": "Calculated at",
      "readOnly": true
     },
     "notes": {
      "type": "string",
      "description": "Notes",
      "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_at": {
      "type": "string",
      "format": "date-time",
      "description": "Created at",
      "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/results-analysis": {
   "get": {
    "summary": "list results-analysis",
    "operationId": "list_results_analysis_0_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "create results-analysis",
    "operationId": "create_results_analysis_1_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/results-analysis/{id}": {
   "get": {
    "summary": "get results-analysis",
    "operationId": "get_results_analysis_0_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "put": {
    "summary": "change results-analysis",
    "operationId": "change_results_analysis_1_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "delete results-analysis",
    "operationId": "delete_results_analysis_2_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/results-analysis/{id}/copy": {
   "post": {
    "summary": "Copy",
    "operationId": "action_results_analysis_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"
     }
    }
   }
  },
  "/api/accounting/results-analysis/run": {
   "post": {
    "summary": "Run",
    "operationId": "action_results_analysis_0_5",
    "description": "Body keys: periodCode, contractId",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  }
 }
}