/**
 * Printedparts plugin frontend routes (ADR-013 Phase 4: self-contained plugin
 * frontend). Views live beside this file under views/; core imports use the
 * @/ alias. The stage-frontend step copies this whole frontend/ dir into the
 * Vite tree and aggregates these routes, so a per-site build that omits
 * printedparts carries none of this code.
 *
 * `default` = AppLayout child routes; `toplevel` = full-screen routes.
 */
export default [
  {
    path: 'printedparts',
    name: 'printedparts',
    component: () => import('./views/PrintedItemsList.vue'),
    meta: { requiresAuth: true, plugin: 'printedparts' }
  },
  {
    path: 'printedparts/new',
    name: 'printedparts-new',
    component: () => import('./views/PrintedItemForm.vue'),
    meta: { requiresAuth: true, plugin: 'printedparts' }
  },
  {
    path: 'printedparts/:id',
    name: 'printedparts-detail',
    component: () => import('./views/PrintedItemDetail.vue'),
    meta: { requiresAuth: true, plugin: 'printedparts' }
  },
  {
    path: 'printedparts/:id/edit',
    name: 'printedparts-edit',
    component: () => import('./views/PrintedItemForm.vue'),
    meta: { requiresAuth: true, plugin: 'printedparts' }
  },
  {
    path: 'settings/printedparts',
    name: 'settings-printedparts',
    component: () => import('./views/PrintedPartsSettings.vue'),
    meta: { requiresAuth: true, requiresAdmin: true, plugin: 'printedparts' }
  }
]

export const toplevel = [
  {
    // Touch kiosk for taking 3D-printed parts: scan bin, scan badge, keypad.
    path: '/parts-kiosk',
    name: 'parts-kiosk',
    component: () => import('./views/PartsKiosk.vue'),
    meta: { plugin: 'printedparts' }
  },
  {
    // Requires login: lists the whole catalog, printedparts.view-gated at the API.
    path: '/print/printedparts-labels',
    name: 'print-printedparts-labels',
    component: () => import('./views/PrintedPartsLabels.vue'),
    meta: { requiresAuth: true, plugin: 'printedparts' }
  }
]
