{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/floodbase/json-schema/floodbase-submission-batch-with-details-schema.json",
  "title": "SubmissionBatchWithDetails",
  "x-generated": "2026-12-02",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/floodbase-openapi.json#/components/schemas/SubmissionBatchWithDetails",
  "properties": {
    "creator_id": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Creator Id"
    },
    "time_created": {
      "type": "string",
      "format": "date-time",
      "title": "Time Created"
    },
    "time_updated": {
      "type": "string",
      "format": "date-time",
      "title": "Time Updated"
    },
    "date_submitted": {
      "type": "string",
      "format": "date-time",
      "title": "Date Submitted"
    },
    "coverage": {
      "$ref": "#/$defs/CoverageType"
    },
    "desired_flood_limit_usd": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Desired Flood Limit Usd"
    },
    "desired_start_date": {
      "anyOf": [
        {
          "type": "string",
          "format": "date"
        },
        {
          "type": "null"
        }
      ],
      "title": "Desired Start Date"
    },
    "desired_end_date": {
      "anyOf": [
        {
          "type": "string",
          "format": "date"
        },
        {
          "type": "null"
        }
      ],
      "title": "Desired End Date"
    },
    "additional_information": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Additional Information"
    },
    "country": {
      "type": "string",
      "maxLength": 2,
      "minLength": 2,
      "pattern": "^[A-Z]{2}$",
      "title": "Country"
    },
    "submission_batch_metadata": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Submission Batch Metadata"
    },
    "id": {
      "type": "integer",
      "title": "Id"
    },
    "organization_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Organization Name"
    },
    "submitted_by": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Submitted By"
    },
    "submissions": {
      "items": {
        "$ref": "#/$defs/Submission"
      },
      "type": "array",
      "title": "Submissions",
      "default": []
    },
    "uploads": {
      "items": {
        "$ref": "#/$defs/UploadInfo"
      },
      "type": "array",
      "title": "Uploads",
      "default": []
    },
    "instant_submission_ids": {
      "items": {
        "type": "integer"
      },
      "type": "array",
      "title": "Instant Submission Ids",
      "default": []
    },
    "instant_workflow_run_id": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Instant Workflow Run Id"
    },
    "cached_submission_ids": {
      "items": {
        "type": "integer"
      },
      "type": "array",
      "title": "Cached Submission Ids",
      "default": []
    },
    "standard_submission_ids": {
      "items": {
        "type": "integer"
      },
      "type": "array",
      "title": "Standard Submission Ids",
      "default": []
    },
    "standard_workflow_run_ids": {
      "anyOf": [
        {
          "items": {
            "type": "integer"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Standard Workflow Run Ids"
    },
    "manual_submission_ids": {
      "items": {
        "type": "integer"
      },
      "type": "array",
      "title": "Manual Submission Ids",
      "default": []
    }
  },
  "type": "object",
  "required": [
    "time_created",
    "time_updated",
    "date_submitted",
    "coverage",
    "country",
    "id"
  ],
  "$defs": {
    "CoverageType": {
      "type": "string",
      "enum": [
        "inland",
        "surge"
      ],
      "title": "CoverageType"
    },
    "GeojsonPointGeometry": {
      "properties": {
        "type": {
          "type": "string",
          "title": "Type"
        },
        "coordinates": {
          "items": {
            "type": "number"
          },
          "type": "array",
          "title": "Coordinates"
        }
      },
      "type": "object",
      "required": [
        "type",
        "coordinates"
      ],
      "title": "GeojsonPointGeometry"
    },
    "Submission": {
      "properties": {
        "creator_id": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Creator Id",
          "x-c2s-associated-resource": "User"
        },
        "time_created": {
          "type": "string",
          "format": "date-time",
          "title": "Time Created"
        },
        "time_updated": {
          "type": "string",
          "format": "date-time",
          "title": "Time Updated"
        },
        "address": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Address"
        },
        "location_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Location Name"
        },
        "location_type": {
          "anyOf": [
            {
              "$ref": "#/$defs/SubmissionLocationType"
            },
            {
              "type": "null"
            }
          ]
        },
        "lat_long": {
          "anyOf": [
            {
              "$ref": "#/$defs/GeojsonPointGeometry"
            },
            {
              "type": "null"
            }
          ]
        },
        "radius_in_miles": {
          "anyOf": [
            {
              "type": "number",
              "maximum": 10.0,
              "minimum": 2.0
            },
            {
              "type": "null"
            }
          ],
          "title": "Radius In Miles"
        },
        "additional_information": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Additional Information"
        },
        "submission_metadata": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Submission Metadata"
        },
        "submission_batch_id": {
          "type": "integer",
          "title": "Submission Batch Id",
          "x-c2s-associated-resource": "SubmissionBatch"
        },
        "id": {
          "type": "integer",
          "title": "Id"
        },
        "submitted_roi_id": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Submitted Roi Id"
        },
        "candidate_roi_ids": {
          "items": {
            "type": "integer"
          },
          "type": "array",
          "title": "Candidate Roi Ids",
          "default": []
        },
        "has_published_proposals": {
          "type": "boolean",
          "title": "Has Published Proposals",
          "default": false
        },
        "has_activation_request": {
          "type": "boolean",
          "title": "Has Activation Request",
          "default": false
        },
        "has_active_policy": {
          "type": "boolean",
          "title": "Has Active Policy",
          "default": false
        },
        "date_ready_by": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Date Ready By"
        }
      },
      "type": "object",
      "required": [
        "time_created",
        "time_updated",
        "submission_batch_id",
        "id"
      ],
      "title": "Submission",
      "x-c2s-associating-resources": {
        "SubmissionProposalUpload": "submission_id",
        "SubmissionRoiAssociation": "submission_id"
      }
    },
    "SubmissionLocationType": {
      "type": "string",
      "enum": [
        "Lat/Long",
        "Address",
        "Predefined Boundary",
        "Other / Describe"
      ],
      "title": "SubmissionLocationType"
    },
    "UploadInfo": {
      "properties": {
        "blob_name": {
          "type": "string",
          "title": "Blob Name"
        },
        "file_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "File Name"
        },
        "content_type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Content Type"
        }
      },
      "type": "object",
      "required": [
        "blob_name"
      ],
      "title": "UploadInfo"
    }
  }
}