{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "$id": "dolittle.io/schemas/Runtime/Applications.Configuration/bounded-context.json",
    "title": "Bounded Context Configuration",
    "description": "The bounded context configuration",
    "type": "object",
    "properties": {
        "application": {
            "description": "The application id that represents the application that this bounded context is a part of",
            "type": "string"
        },
        "boundedContext": {
            "description": "The bounded context id that represents this bounded context",
            "type": "string"
        },
        "boundedContextName": {
            "description": "The bounded context name that represents the name of this bounded context",
            "type": "string"
        },
        "core": {
            "$ref": "#/definitions/coreConfiguration"
        },
        "interaction": {
            "description": "A list of configurations for the interaction layers that this bounded context exposes",
            "type": "array",
            "items": {
                "$ref": "#/definitions/interactionLayerConfiguration"
            }
        },
        "resources": {
            "description": "A map of describing the resource type implementation mapping of resource types",
            "type": "object",
            "properties": {
                "readModels": {
                    "$ref": "#/definitions/resourceTypeImplementationConfiguration"
                },
                "eventStore": {
                    "$ref": "#/definitions/resourceTypeImplementationConfiguration"
                }
            },
            "required": [
                "readModels",
                "eventStore"
            ]
        }
    },
    "required": [
        "application",
        "boundedContext",
        "boundedContextName",
        "core",
        "interaction",
        "resources"
    ],
    "definitions": {
        "coreConfiguration": {
            "description": "A configuration describing the Core of this bounded context",
            "type": "object",
            "properties": {
                "language": {
                    "$comment": "This schema definition allows only a set of core languages by hard coding it here in the enum property. Can probably be done better",
                    "description": "Describes which programming language the Core is written in",
                    "type": "string",
                    "enum": [
                        "csharp"
                    ]
                },
                "entryPoint": {
                    "$comment": "This property is optional. The default value is \"Core\"",
                    "description": "The entry point of the bounded context's Core.  A relative path to the folder",
                    "type": "string",
                    "format": "uri-reference"
                }
            },
            "required": [
                "language"
            ]
        },
        "interactionLayerConfiguration": {
            "description": "The configuration of an interaction layer",
            "type": "object",
            "properties": {
                "type": {
                    "$comment": "This schema definition allows only a set of types by hard coding it here in the enum property. Can probably be done better",
                    "description": "The type of the interaction layer",
                    "type": "string",
                    "enum": [
                        "web"
                    ]
                },
                "language": {
                    "description": "The programming language of the interaction layer",
                    "type": "string"
                },
                "entryPoint": {
                    "description": "The entry point of the interaction layer. A relative path to the folder",
                    "type": "string",
                    "format": "uri-reference"
                },
                "framework": {
                    "$comment": "This schema definition allows only a set of frameworks by hard coding it here in the enum property. Can probably be done better",
                    "description": "The framework of the interaction layer",
                    "type": "string",
                    "enum": [
                        "react",
                        "aurelia"
                    ]
                }
            },
            "required": [
                "type",
                "language",
                "entryPoint"
            ]
        },
        "resourceTypeImplementationConfiguration": {
            "description": "Resource type implementation configuration",
            "type": "object",
            "properties": {
                "production": {
                    "type": "string"
                },
                "development": {
                    "type": "string"
                }
            },
            "required": [
                "production",
                "development"
            ]
        }
    }
}