{
  "$schema": "http://json-schema.org/schema",
  "id": "NxAdspVueAdminCrud",
  "title": "Vue Admin CRUD (List + Edit)",
  "description": "Generates a simple admin CRUD screen pair (a WorkspaceTable list view with a Create action and per-row Edit, plus a create/update Edit view) into an existing vue-app project. Suited to small lookup-table style admin screens, not large paginated workspaces -- see vue-workspace-view for that.",
  "type": "object",
  "properties": {
    "project": {
      "type": "string",
      "description": "The vue-app project to add the views to.",
      "$default": {
        "$source": "argv",
        "index": 0
      },
      "x-prompt": "Which project should the admin CRUD screens be added to?"
    },
    "name": {
      "type": "string",
      "description": "View name, e.g. 'regions' generates src/views/RegionsListView.vue and src/views/RegionsEditView.vue.",
      "$default": {
        "$source": "argv",
        "index": 1
      },
      "x-prompt": "What should the views be called?"
    },
    "resource": {
      "type": "string",
      "description": "API resource path segment -- fetches /api/v1/<resource> (list), /api/v1/<resource>/:id (load one), POST /api/v1/<resource> (create), PUT /api/v1/<resource>/:id (update)."
    },
    "route": {
      "type": "string",
      "description": "List route path added to router/index.ts, e.g. /regions. The edit/create route is added as `${route}/:id` (visiting `${route}/new` creates)."
    },
    "fields": {
      "type": "string",
      "description": "JSON array of fields, in display/form order -- e.g. '[{\"key\":\"name\",\"label\":\"Name\"},{\"key\":\"quota\",\"label\":\"Quota\",\"type\":\"number\"},{\"key\":\"region\",\"label\":\"Region\",\"type\":\"select\",\"options\":[{\"value\":\"north\",\"label\":\"North\"}]}]'. Each item: { key, label, type?: \"text\"|\"textarea\"|\"number\"|\"date\"|\"select\"|\"checkbox\" (default \"text\"), options?: [{value,label}] (select only), required?: boolean }. A number field is submitted as a number and a date as YYYY-MM-DD built from local calendar parts. A plain array is also accepted when invoked programmatically. Nx's CLI option coercion only supports comma-separated primitive lists for array-typed schema properties, not JSON -- a JSON string is the only CLI syntax that survives Nx's own arg parsing."
    },
    "heading": {
      "type": "string",
      "description": "List page heading. Defaults to the view name, title-cased."
    },
    "singularLabel": {
      "type": "string",
      "description": "Singular label used in \"Create <label>\"/\"Edit <label>\" headings and buttons. Defaults to --heading (override for irregular plurals, e.g. --heading=Regions --singularLabel=Region)."
    },
    "icon": {
      "type": "string",
      "description": "Ionicon name for the generated side-menu entry, e.g. `settings`. goa-work-side-menu-item renders a blank item without one.",
      "default": "settings"
    },
    "requiresAuth": {
      "type": "boolean",
      "description": "Whether the generated routes require authentication.",
      "default": true
    }
  },
  "required": ["project", "name", "resource", "route", "fields"],
  "additionalProperties": false
}
