{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/oec-sh/json-schema/oec-sh-migration-response-schema.json",
  "title": "MigrationResponse",
  "description": "Full migration details response.",
  "x-generated": "2026-11-19",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/oec-sh-api-openapi.json#/components/schemas/MigrationResponse",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id",
      "description": "Migration ID"
    },
    "organization_id": {
      "type": "string",
      "format": "uuid",
      "title": "Organization Id",
      "description": "Organization ID"
    },
    "source_type": {
      "$ref": "#/$defs/MigrationSourceType",
      "description": "Source platform"
    },
    "odoosh_project_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Odoosh Project Name",
      "description": "Odoo.sh project name"
    },
    "odoosh_branch": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Odoosh Branch",
      "description": "Odoo.sh branch"
    },
    "git_repo_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Git Repo Url",
      "description": "Git repository URL"
    },
    "git_branch": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Git Branch",
      "description": "Git branch"
    },
    "status": {
      "$ref": "#/$defs/MigrationStatusType",
      "description": "Current status"
    },
    "progress_percent": {
      "type": "integer",
      "title": "Progress Percent",
      "description": "Progress percentage"
    },
    "current_step": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Current Step",
      "description": "Current step"
    },
    "upload_tier": {
      "anyOf": [
        {
          "$ref": "#/$defs/UploadTierType"
        },
        {
          "type": "null"
        }
      ],
      "description": "Upload tier used"
    },
    "file_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "File Name",
      "description": "Backup file name"
    },
    "file_size": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "File Size",
      "description": "File size in bytes"
    },
    "cloud_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Cloud Url",
      "description": "Cloud URL if imported"
    },
    "storage_config_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ],
      "title": "Storage Config Id",
      "description": "Organization storage config ID (if using org storage)"
    },
    "storage_key": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Storage Key",
      "description": "Storage key in organization's bucket"
    },
    "odoo_version_detected": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Odoo Version Detected",
      "description": "Detected Odoo version"
    },
    "analysis_partial": {
      "type": "boolean",
      "title": "Analysis Partial",
      "description": "Analysis completed but could not detect the Odoo version or modules (this backup format does not record them); the version must be chosen at the configure step.",
      "default": false
    },
    "pg_version_detected": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Pg Version Detected",
      "description": "PostgreSQL version from backup"
    },
    "database_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Database Name",
      "description": "Database name"
    },
    "company_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Company Name",
      "description": "Company name from backup"
    },
    "web_base_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Web Base Url",
      "description": "web.base.url from backup"
    },
    "database_size_bytes": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Database Size Bytes",
      "description": "Database size"
    },
    "filestore_size_bytes": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Filestore Size Bytes",
      "description": "Filestore size"
    },
    "modules_detected": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Modules Detected",
      "description": "All detected modules"
    },
    "modules_with_versions": {
      "anyOf": [
        {
          "additionalProperties": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Modules With Versions",
      "description": "Modules with their versions"
    },
    "custom_modules": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Custom Modules",
      "description": "Custom modules"
    },
    "partner_count": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Partner Count",
      "description": "Partner count"
    },
    "user_count": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "User Count",
      "description": "User count"
    },
    "recommended_cpu": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Recommended Cpu",
      "description": "Recommended CPU"
    },
    "recommended_ram_mb": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Recommended Ram Mb",
      "description": "Recommended RAM MB"
    },
    "target_vm_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ],
      "title": "Target Vm Id",
      "description": "Target VM ID"
    },
    "project_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Project Name",
      "description": "Project name"
    },
    "target_domain": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Target Domain",
      "description": "Target domain"
    },
    "neutralize": {
      "type": "boolean",
      "title": "Neutralize",
      "description": "Neutralize database after migration",
      "default": true
    },
    "project_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ],
      "title": "Project Id",
      "description": "Created project ID"
    },
    "environment_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ],
      "title": "Environment Id",
      "description": "Created environment ID"
    },
    "upload_started_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Upload Started At",
      "description": "Upload start"
    },
    "upload_completed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Upload Completed At",
      "description": "Upload complete"
    },
    "analysis_started_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Analysis Started At",
      "description": "Analysis start"
    },
    "analysis_completed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Analysis Completed At",
      "description": "Analysis complete"
    },
    "processing_started_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Processing Started At",
      "description": "Processing start"
    },
    "processing_completed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Processing Completed At",
      "description": "Processing complete"
    },
    "error_message": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Error Message",
      "description": "Error message if failed"
    },
    "error_step": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Error Step",
      "description": "Step where error occurred"
    },
    "retry_count": {
      "type": "integer",
      "title": "Retry Count",
      "description": "Number of retries",
      "default": 0
    },
    "restore_warnings": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Restore Warnings",
      "description": "Problems found after the restore, e.g. an empty filestore"
    },
    "estimated_monthly_cost": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Estimated Monthly Cost",
      "description": "Estimated monthly cost"
    },
    "odoosh_equivalent_cost": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Odoosh Equivalent Cost",
      "description": "Equivalent Odoo.sh cost"
    },
    "monthly_savings": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Monthly Savings",
      "description": "Monthly savings"
    },
    "created_by_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ],
      "title": "Created By Id",
      "description": "Created by user ID"
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At",
      "description": "Creation timestamp"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "title": "Updated At",
      "description": "Last update timestamp"
    }
  },
  "type": "object",
  "required": [
    "id",
    "organization_id",
    "source_type",
    "status",
    "progress_percent",
    "created_at",
    "updated_at"
  ],
  "$defs": {
    "MigrationSourceType": {
      "type": "string",
      "enum": [
        "odoosh",
        "on_premise",
        "odoo_online",
        "cloud_url",
        "other_paas"
      ],
      "title": "MigrationSourceType",
      "description": "Source platform for the migration."
    },
    "MigrationStatusType": {
      "type": "string",
      "enum": [
        "pending",
        "uploading",
        "uploaded",
        "analyzing",
        "analyzed",
        "configuring",
        "processing",
        "creating_project",
        "creating_environment",
        "deploying_containers",
        "downloading_backup",
        "extracting_backup",
        "restoring_database",
        "restoring_filestore",
        "cloning_repo",
        "configuring_traefik",
        "restarting_odoo",
        "verifying",
        "completed",
        "failed",
        "cancelled"
      ],
      "title": "MigrationStatusType",
      "description": "Status of the migration process."
    },
    "UploadTierType": {
      "type": "string",
      "enum": [
        "tier_1",
        "tier_2",
        "tier_3",
        "tier_4",
        "cloud_url"
      ],
      "title": "UploadTierType",
      "description": "Upload tier based on file size."
    }
  }
}