{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/aurora-agile-meta-framework/versions/1.3.json",
  "title": "Aurora Agile Meta Framework",
  "description": "Make agile applications without technical debt",
  "x-lintel": {
    "source": "https://www.schemastore.org/aurora-1.3.json",
    "sourceSha256": "1a06ba554780d9e0befb2d1a0d9949c1ebdd7fa296408aca79dce8d099454b99",
    "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",
      "examples": [
        "iam",
        "queue-manager"
      ],
      "minLength": 2
    },
    "moduleName": {
      "type": "string",
      "description": "The name of the module, singular in kebab case",
      "examples": [
        "account",
        "job-registry"
      ],
      "minLength": 2
    },
    "moduleNames": {
      "type": "string",
      "description": "The name of the module, plural in kebab case",
      "examples": [
        "accounts",
        "jobs-registry"
      ],
      "minLength": 2
    },
    "aggregateName": {
      "type": "string",
      "description": "The name of the aggregateName, singular in pascal case, is composed of the boundedContextName plus the moduleName",
      "examples": [
        "IamAccount",
        "QueueManagerJobRegistry"
      ],
      "minLength": 2
    },
    "hasOAuth": {
      "type": "boolean",
      "description": "Enabled authentication for this module",
      "examples": [
        false
      ],
      "default": false
    },
    "hasTenant": {
      "type": "boolean",
      "description": "Enabled tenant for this module",
      "examples": [
        false
      ],
      "default": false
    },
    "hasAuditing": {
      "type": "boolean",
      "description": "Enabled auditing for this module",
      "examples": [
        false
      ],
      "default": false
    },
    "front": {
      "$ref": "#/$defs/frontDefinition"
    },
    "aggregateProperties": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/propertyDefinition"
      }
    },
    "additionalApis": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/additionalApisDefinition"
      }
    },
    "excludedFiles": {
      "type": "array",
      "description": "Files to be excluded from the module",
      "examples": [
        "src/@api/iam/account/resolvers/iam-create-accounts.resolver.ts",
        "src/@api/iam/account/resolvers/iam-create-accounts.resolver.spec.ts"
      ],
      "items": {
        "type": "string"
      }
    },
    "excludedOperations": {
      "$ref": "#/$defs/excludedOperationDefinition"
    }
  },
  "required": [
    "boundedContextName",
    "moduleName",
    "moduleNames",
    "aggregateName"
  ],
  "additionalProperties": false,
  "$comment": "https://docs.aurorajs.dev/",
  "$defs": {
    "propertyDefinition": {
      "type": "object",
      "required": [
        "name",
        "type"
      ],
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of property, in camelCase",
          "minLength": 2
        },
        "description": {
          "type": "string",
          "description": "The description of the property",
          "minLength": 2
        },
        "type": {
          "type": "string",
          "description": "The type of property",
          "examples": [
            "varchar"
          ],
          "enum": [
            "array",
            "bigint",
            "blob.long",
            "blob.medium",
            "blob.tiny",
            "blob",
            "boolean",
            "char",
            "date",
            "decimal",
            "encrypted",
            "enum",
            "float",
            "id",
            "int",
            "json",
            "jsonb",
            "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"
          ]
        },
        "indexFields": {
          "type": "array",
          "description": "Fields to do composite unique index",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "indexName": {
          "type": "string",
          "description": "The name of index, if there are various indexes with the same name, they will be grouped",
          "minLength": 2
        },
        "indexUsing": {
          "type": "string",
          "description": "To define property like a index",
          "enum": [
            "Btree",
            "GIN",
            "HASH",
            "spgist",
            "GiST",
            "BRIN"
          ]
        },
        "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": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "number"
            },
            {
              "type": "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"
        },
        "applyTimezone": {
          "type": "boolean",
          "description": "Apply timezone to date property, by default is true"
        },
        "relationship": {
          "$ref": "#/$defs/relationshipDefinition"
        },
        "webComponent": {
          "$ref": "#/$defs/webComponentDefinition"
        }
      },
      "additionalProperties": false
    },
    "additionalApisDefinition": {
      "type": "object",
      "required": [
        "path",
        "resolverType",
        "httpMethod"
      ],
      "properties": {
        "path": {
          "type": "string",
          "description": "Path to access api",
          "minLength": 2,
          "examples": [
            "auditing/side-effect/rollback",
            "iam/account/check-unique-username"
          ]
        },
        "resolverType": {
          "type": "string",
          "description": "Type of resolver, query or mutation",
          "enum": [
            "query",
            "mutation"
          ],
          "examples": [
            "query"
          ]
        },
        "httpMethod": {
          "type": "string",
          "description": "Verb of api rest",
          "enum": [
            "get",
            "post",
            "put",
            "delete",
            "patch"
          ],
          "examples": [
            "post"
          ]
        }
      }
    },
    "relationshipDefinition": {
      "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
        },
        "description": {
          "type": "string",
          "description": "The description of the relationship field",
          "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/pivotTableDefinition"
        }
      },
      "description": "Relationship definition for this property",
      "additionalProperties": false
    },
    "webComponentDefinition": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "description": "The type of web component",
          "enum": [
            "async-search-multiple-select",
            "async-search-select",
            "grid-elements-manager",
            "grid-select-element",
            "grid-select-multiple-elements",
            "multiple-select",
            "search-multiple-select",
            "search-select",
            "select"
          ]
        },
        "className": {
          "type": "string",
          "description": "CSS class for web component",
          "minLength": 2
        },
        "detailSort": {
          "type": "number",
          "description": "Web component order on detail view",
          "minimum": 1
        },
        "isDetailHidden": {
          "type": "boolean",
          "description": "Set hidden web component on detail view"
        },
        "listSort": {
          "type": "number",
          "description": "Web component order on list view",
          "minimum": 1
        },
        "isListHidden": {
          "type": "boolean",
          "description": "Set hidden web component on list view"
        }
      },
      "description": "Web Component that wil be rendered for this property",
      "additionalProperties": false
    },
    "excludedOperationDefinition": {
      "type": "array",
      "description": "Operations to be excluded from the module",
      "examples": [
        [
          "create",
          "update",
          "delete"
        ],
        [
          "create",
          "update",
          "delete",
          "findById"
        ]
      ],
      "items": {
        "enum": [
          "count",
          "create",
          "createBatch",
          "deleteById",
          "delete",
          "findById",
          "find",
          "get",
          "max",
          "min",
          "paginate",
          "rawSql",
          "getRaw",
          "sum",
          "updateAndIncrement",
          "updateById",
          "update",
          "upsert"
        ]
      }
    },
    "frontDefinition": {
      "type": "object",
      "properties": {
        "outlineFontSetIcon": {
          "type": "string",
          "description": "Font set outline icon to be used in the front application",
          "minLength": 2,
          "examples": [
            "material-symbols-outlined"
          ]
        },
        "outlineIcon": {
          "type": "string",
          "description": "Outline icon to be used in the front application",
          "minLength": 2,
          "examples": [
            "heroicons_solid:tag",
            "photo_auto_merge"
          ]
        },
        "solidFontSetIcon": {
          "type": "string",
          "description": "Font set solid icon to be used in the front application",
          "minLength": 2,
          "examples": [
            "material-symbols-outlined"
          ]
        },
        "solidIcon": {
          "type": "string",
          "description": "Solid icon to be used in the front application",
          "minLength": 2,
          "examples": [
            "heroicons_solid:tag",
            "photo_auto_merge"
          ]
        }
      },
      "description": "Appearance properties for front application",
      "additionalProperties": false
    },
    "pivotTableDefinition": {
      "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/propertyDefinition"
          }
        },
        "excludedFiles": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "excludedOperations": {
          "$ref": "#/$defs/excludedOperationDefinition"
        }
      },
      "description": "Relationship pivot table definition for this relationship",
      "additionalProperties": false
    }
  }
}
