{
  "$schema": "http://json-schema.org/schema",
  "$id": "service-generator",
  "type": "object",
  "examples": [
    {
      "command": "nx g @brainly-gene/tools:service myService",
      "description": "Generate libs/myService"
    }
  ],
  "properties": {
    "name": {
      "type": "string",
      "description": "Service name",
      "default": "post",
      "$default": {
        "$source": "argv",
        "index": 0
      },
      "x-prompt": "What is the service name? (the name should be an entity name in singular form - for example post, user, book, etc.)"
    },
    "directory": {
      "type": "string",
      "description": "A directory where the service is placed",
      "x-prompt": "What is the service directory?"
    },
    "tags": {
      "type": "string",
      "description": "Add tags to the library (used for linting)",
      "x-prompt": "What are the service tags?"
    },
    "serviceType": {
      "type": "string",
      "enum": ["react-query", "apollo"],
      "description": "Service type to create",
      "default": "react-query",
      "x-prompt": "What is the service type?"
    },
    "useDefaultCrudFunctions": {
      "type": "boolean",
      "description": "Use default CRUD options (only get/read function)",
      "default": false
    },
    "crudOperations": {
      "type": "array",
      "description": "Select CRUD operations to include",
      "items": {
        "type": "string",
        "enum": ["get", "create", "update", "delete"]
      }
    },
    "includeRead": {
      "type": "boolean",
      "description": "Include read/get single item function",
      "default": false
    },
    "includeCreate": {
      "type": "boolean",
      "description": "Include create function",
      "default": false
    },
    "includeUpdate": {
      "type": "boolean",
      "description": "Include update function",
      "default": false
    },
    "includeDelete": {
      "type": "boolean",
      "description": "Include delete function",
      "default": false
    }
  },
  "required": ["name"]
}
