{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/restivity-ai/json-schema/restivity-ai-work-session-move-result-schema.json",
  "title": "WorkSessionMoveResult",
  "x-generated": "2026-11-23",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/restivity-ai-openapi.json#/components/schemas/WorkSessionMoveResult",
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "enum": [
        "moved",
        "pending",
        "declined",
        "undone",
        "withdrawn"
      ]
    },
    "code": {
      "description": "On 202: the move waits for the owner/admins of the workspace the hours leave.",
      "type": "string",
      "const": "move_needs_approval"
    },
    "message": {
      "type": "string"
    },
    "request_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid",
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$"
        },
        {
          "type": "null"
        }
      ]
    },
    "origin_workspace_id": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$"
    },
    "destination_workspace_id": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$"
    },
    "approver_ids": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uuid",
        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$"
      }
    },
    "session_ids": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uuid",
        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$"
      }
    },
    "session_count": {
      "description": "On a withdraw (status `withdrawn`, AGF-487): how many sessions the withdrawn request named. Nothing moved.",
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "moved": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "session_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$"
          },
          "before": {
            "description": "The anchors and price before the move (an Undo, `POST /work-sessions/move/undo`, puts it back there). Money as the preview shows it: a rate or amount the caller may not read is null.",
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "after": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          }
        },
        "required": [
          "session_id",
          "before",
          "after"
        ],
        "additionalProperties": false
      }
    },
    "undone": {
      "description": "On an undo (status `undone`): per session the anchors and price before the undo (`before`, where the move had left it) and after (`after`, back where it was earned, priced again there). Money the caller may not read is null.",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "session_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$"
          },
          "before": {
            "description": "The anchors and price before the move (an Undo, `POST /work-sessions/move/undo`, puts it back there). Money as the preview shows it: a rate or amount the caller may not read is null.",
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "after": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          }
        },
        "required": [
          "session_id",
          "before",
          "after"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "status",
    "request_id"
  ],
  "additionalProperties": false
}