{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/aurora-agile-meta-framework/versions/1.1.json",
  "title": "Aurora Agile Meta Framework",
  "description": "Make agile applications without technical debt",
  "x-lintel": {
    "source": "https://www.schemastore.org/aurora-1.1.json",
    "sourceSha256": "e802a55b4e7494f421193b8b49aac8ac8a2364665d9bae5685a5f22af2d753c2",
    "fileMatch": [
      "*.aurora.yaml",
      "*.aurora.yml"
    ],
    "parsers": [
      "yaml"
    ]
  },
  "type": "object",
  "properties": {
    "version": {
      "type": "string",
      "description": "Schema version",
      "default": "0.0.1",
      "minLength": 2
    },
    "boundedContextName": {
      "type": "string",
      "description": "The name of the package, singular in kebab-case",
      "minLength": 2
    },
    "moduleName": {
      "type": "string",
      "description": "The name of the module, singular in kebab-case",
      "minLength": 2
    },
    "moduleNames": {
      "type": "string",
      "description": "The name of the module, plural in kebab-case",
      "minLength": 2
    },
    "aggregateName": {
      "type": "string",
      "description": "The name of the aggregateName, singular in PascalCase",
      "minLength": 2
    },
    "hasOAuth": {
      "type": "boolean",
      "description": "Enabled authentication for this module",
      "default": false
    },
    "hasTenant": {
      "type": "boolean",
      "description": "Enabled tenant for this module",
      "default": false
    },
    "hasAuditing": {
      "type": "boolean",
      "description": "Enabled auditing for this module",
      "default": false
    },
    "front": {
      "$ref": "#/$defs/front"
    },
    "aggregateProperties": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/property"
      }
    },
    "additionalApis": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/apiDefinition"
      }
    },
    "excluded": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "required": [
    "boundedContextName",
    "moduleName",
    "moduleNames",
    "aggregateName"
  ],
  "additionalProperties": false,
  "$comment": "https://docs.aurorajs.dev/",
  "$defs": {
    "property": {
      "type": "object",
      "required": [
        "name",
        "type"
      ],
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of property, in camelCase",
          "minLength": 2
        },
        "type": {
          "type": "string",
          "description": "The type of property",
          "enum": [
            "array",
            "bigint",
            "blob.long",
            "blob.medium",
            "blob.tiny",
            "blob",
            "boolean",
            "char",
            "date",
            "decimal",
            "enum",
            "float",
            "id",
            "int",
            "json",
            "manyToMany",
            "password",
            "relationship",
            "smallint",
            "text",
            "timestamp",
            "varchar"
          ]
        },
        "arrayOptions": {
          "type": "object",
          "description": "Options to define array property",
          "required": [
            "type"
          ],
          "properties": {
            "type": {
              "type": "string",
              "description": "The type of property",
              "enum": [
                "char",
                "date",
                "decimal",
                "enum",
                "id",
                "int",
                "timestamp",
                "varchar"
              ]
            },
            "length": {
              "type": "number",
              "description": "Set max length to property",
              "minimum": 1
            },
            "maxLength": {
              "type": "number",
              "description": "Set max length to property",
              "minimum": 1
            },
            "enumOptions": {
              "type": "array",
              "description": "Values for enum type",
              "items": {
                "type": "string",
                "minLength": 1
              }
            }
          }
        },
        "length": {
          "type": "number",
          "description": "Set max length to property",
          "minimum": 1
        },
        "maxLength": {
          "type": "number",
          "description": "Set max length to property",
          "minimum": 1
        },
        "nullable": {
          "type": "boolean",
          "description": "Set property to nullable"
        },
        "unsigned": {
          "type": "boolean",
          "description": "Set property like unsigned"
        },
        "primaryKey": {
          "type": "boolean",
          "description": "Set property to primary key"
        },
        "index": {
          "type": "string",
          "description": "To define property like a index",
          "enum": [
            "index",
            "unique"
          ]
        },
        "indexName": {
          "type": "string",
          "description": "The name of index, if there are various indexes with the same name, they will be grouped",
          "minLength": 2
        },
        "isI18n": {
          "type": "boolean",
          "description": "Set property as i18n, this property will be used to translate the entity in the translation table"
        },
        "enumOptions": {
          "type": "array",
          "description": "Values for enum type",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "defaultValue": {
          "type": [
            "number",
            "string",
            "boolean"
          ],
          "description": "Default value for property"
        },
        "example": {
          "type": [
            "number",
            "string",
            "boolean",
            "array"
          ],
          "description": "Example value for property, this value will be used in swagger documentation"
        },
        "decimals": {
          "type": "array",
          "description": "Total digits of the number and length of the decimal places in the back of the number, example: [10, 2].",
          "items": {
            "type": "number",
            "minimum": 1
          }
        },
        "autoIncrement": {
          "type": "boolean",
          "description": "Set number property as auto increment"
        },
        "relationship": {
          "$ref": "#/$defs/relationship"
        },
        "webComponent": {
          "$ref": "#/$defs/webComponent"
        },
        "aggregateName": {
          "type": "string",
          "description": "The name of the aggregateName of pivot table property relationship, singular in PascalCase",
          "minLength": 2
        },
        "modulePath": {
          "type": "string",
          "description": "Path to the module that refers to this pivot table property relationship, example: library/author",
          "minLength": 2
        }
      },
      "additionalProperties": false
    },
    "apiDefinition": {
      "type": "object",
      "required": [
        "path",
        "resolverType",
        "httpMethod"
      ],
      "properties": {
        "path": {
          "type": "string",
          "description": "Path to access api",
          "minLength": 2
        },
        "resolverType": {
          "type": "string",
          "description": "Type of resolver, query or mutation",
          "enum": [
            "query",
            "mutation"
          ]
        },
        "httpMethod": {
          "type": "string",
          "description": "Verb of api rest",
          "enum": [
            "get",
            "post",
            "put",
            "delete",
            "patch"
          ]
        }
      }
    },
    "relationship": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "description": "The type of web component",
          "enum": [
            "many-to-many",
            "many-to-one",
            "none",
            "one-to-many",
            "one-to-one"
          ]
        },
        "singularName": {
          "type": "string",
          "description": "Singular name of the property referred to in the relationship, only for one-to-many and many-to-many relationship, example: book",
          "minLength": 2
        },
        "aggregateName": {
          "type": "string",
          "description": "Aggregate referring to this relationship, example: LibraryAuthor",
          "minLength": 2
        },
        "modulePath": {
          "type": "string",
          "description": "Path to the module that refers to this relationship, example: library/author",
          "minLength": 2
        },
        "key": {
          "type": "string",
          "description": "Property key that refers to this relationship, only for many-to-one relationship, example: id",
          "minLength": 2
        },
        "field": {
          "type": "string",
          "description": "Field to obtain the relationship data, example: author",
          "minLength": 2
        },
        "avoidConstraint": {
          "type": "boolean",
          "description": "Avoid constraint rules for this relationship"
        },
        "packageName": {
          "type": "string",
          "description": "Path to packageName where is the relationship, example: @aurora-ts/core",
          "minLength": 2
        },
        "isDenormalized": {
          "type": "boolean",
          "description": "Set many-to-many relationship as denormalized, creating a field to store the selected ids"
        },
        "pivot": {
          "$ref": "#/$defs/pivotTable"
        }
      },
      "description": "Relationship definition for this property",
      "additionalProperties": false
    },
    "webComponent": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "description": "The type of web component",
          "enum": [
            "grid-select-element",
            "grid-select-multiple-elements",
            "grid-elements-manager",
            "multiple-select",
            "select"
          ]
        }
      },
      "description": "Web Component that wil be rendered for this property",
      "additionalProperties": false
    },
    "front": {
      "type": "object",
      "properties": {
        "outlineFontSetIcon": {
          "type": "string",
          "description": "Font set outline icon to be used in the front application, example: material-symbols-outlined",
          "minLength": 2
        },
        "outlineIcon": {
          "type": "string",
          "description": "Outline icon to be used in the front application, example: heroicons_solid:tag",
          "minLength": 2
        },
        "solidFontSetIcon": {
          "type": "string",
          "description": "Font set solid icon to be used in the front application, example: material-symbols-outlined",
          "minLength": 2
        },
        "solidIcon": {
          "type": "string",
          "description": "Solid icon to be used in the front application, example: heroicons_solid:tag",
          "minLength": 2
        }
      },
      "description": "Appearance properties for front application",
      "additionalProperties": false
    },
    "pivotTable": {
      "type": "object",
      "properties": {
        "boundedContextName": {
          "type": "string",
          "description": "The name of the package, singular in kebab-case",
          "minLength": 2
        },
        "moduleName": {
          "type": "string",
          "description": "The name of the module, singular in kebab-case",
          "minLength": 2
        },
        "moduleNames": {
          "type": "string",
          "description": "The name of the module, plural in kebab-case",
          "minLength": 2
        },
        "aggregateName": {
          "type": "string",
          "description": "The name of the aggregateName, singular in PascalCase",
          "minLength": 2
        },
        "hasOAuth": {
          "type": "boolean",
          "description": "Enabled authentication for this pivot table",
          "default": false
        },
        "hasAuditing": {
          "type": "boolean",
          "description": "Enabled auditing for pivot table",
          "default": false
        },
        "aggregateProperties": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/property"
          }
        }
      },
      "description": "Relationship pivot table definition for this relationship",
      "additionalProperties": false
    }
  }
}
