{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "$id": "https://stride-tasks.github.io/stride/api/notification/repository.changed.schema.json",
    "title": "repository.changed",
    "description": "Emitted after a sync when at least one remote actor introduced changes.",
    "type": "object",
    "properties": {
        "method": {
            "type": "string",
            "const": "repository.changed"
        },
        "params": {
            "type": "object",
            "properties": {
                "repository-id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "UUID of the repository that was synced."
                },
                "changes": {
                    "type": "array",
                    "description": "One entry per task that was touched by a remote actor.",
                    "items": {
                        "$comment": "@name:TaskChange",
                        "type": "object",
                        "properties": {
                            "task-id": {
                                "type": "string",
                                "format": "uuid",
                                "description": "UUID of the affected task."
                            },
                            "title": {
                                "type": "string",
                                "description": "The title of the task before the change."
                            },
                            "fields": {
                                "type": "array",
                                "items": {
                                    "$comment": "@name:TaskFieldChange",
                                    "type": "object",
                                    "properties": {
                                        "type": {
                                            "type": "string"
                                        },
                                        "previous": {
                                            "type": "string"
                                        },
                                        "current": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "type"
                                    ]
                                }
                            }
                        },
                        "required": [
                            "task-id",
                            "title",
                            "fields"
                        ]
                    }
                }
            },
            "required": [
                "repository-id",
                "changes"
            ]
        }
    },
    "required": [
        "method",
        "params"
    ]
}