{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/blacksky/json-schema/blacksky-tasking-quotation-schema.json",
  "title": "TaskingQuotation",
  "description": "A response for a decided tasking quotation.",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/blacksky-tasking-api-openapi.yml#/components/schemas/TaskingQuotation",
  "required": [
    "createdAt",
    "createdBy",
    "decision",
    "decisionAt",
    "decisionById",
    "decisionByType",
    "id",
    "updatedAt",
    "updatedBy"
  ],
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "The quotation ID.",
      "format": "uuid"
    },
    "createdAt": {
      "type": "string",
      "description": "The time the quotation was created.",
      "format": "date-time"
    },
    "createdBy": {
      "$ref": "#/$defs/Auditor"
    },
    "updatedAt": {
      "type": "string",
      "description": "The last time the quotation data was changed.",
      "format": "date-time"
    },
    "updatedBy": {
      "$ref": "#/$defs/Auditor"
    },
    "decision": {
      "$ref": "#/$defs/TaskingQuotationDecision"
    },
    "decisionById": {
      "type": [
        "string",
        "null"
      ],
      "description": "The ID of the user that made a decision on this quotation.",
      "format": "uuid"
    },
    "decisionByType": {
      "type": [
        "string",
        "null"
      ],
      "description": "The type of user that made a decision on this quotation.",
      "enum": [
        "USER",
        "ADMIN",
        "API",
        "SYSTEM",
        null
      ]
    },
    "decisionAt": {
      "type": [
        "string",
        "null"
      ],
      "description": "The time the decision was made on this quotation.",
      "format": "date-time"
    }
  },
  "allOf": [
    {
      "$ref": "#/$defs/TaskingQuotationPreSave"
    }
  ],
  "$defs": {
    "AccountId": {
      "type": "string",
      "description": "The account ID.",
      "format": "uuid"
    },
    "Auditor": {
      "type": "object",
      "properties": {
        "id": {
          "oneOf": [
            {
              "type": "string",
              "description": "The ID of the user who performed the action.",
              "format": "uuid"
            },
            {
              "type": "string",
              "description": "A marker that indicates an action was performed automatically. The only allowed value is `system`.",
              "enum": [
                "system"
              ]
            }
          ]
        },
        "type": {
          "type": "string",
          "description": "The type of user who performed the action.",
          "enum": [
            "INTERNAL",
            "ADMIN",
            "API_KEY",
            "USER"
          ]
        }
      },
      "description": "The ID and type of the user who performed the action.\n"
    },
    "OrderId": {
      "type": "string",
      "description": "The order ID.",
      "format": "uuid"
    },
    "TaskingQuotationDecision": {
      "type": "string",
      "description": "The decision for this quotation.",
      "default": "NOT_DECIDED",
      "enum": [
        "NOT_DECIDED",
        "ACCEPTED",
        "REJECTED"
      ]
    },
    "TaskingQuotationPreSave": {
      "required": [
        "accountId",
        "creditsPrice",
        "orderId",
        "workspaceId"
      ],
      "type": "object",
      "properties": {
        "accountId": {
          "$ref": "#/$defs/AccountId"
        },
        "workspaceId": {
          "$ref": "#/$defs/WorkspaceId"
        },
        "orderId": {
          "$ref": "#/$defs/OrderId"
        },
        "creditsPrice": {
          "type": "integer",
          "description": "The amount of credits that will be charged.",
          "format": "int32"
        }
      },
      "description": "Tasking Quotation DTO before creation"
    },
    "WorkspaceId": {
      "type": "string",
      "description": "The workspace ID.",
      "format": "uuid"
    }
  }
}