/**
 * @aurora-catalyst-generated
 * @source cliter/<%= it.fmt.toKebabCase(it.schema.boundedContextName) %>
 */
import type { Routes } from '@angular/router';

import {
  accountDetailResolver,
  accountListResolver,
  accountNewResolver,
} from './account/data-access/account.resolvers';
import {
  boundedContextDetailResolver,
  boundedContextListResolver,
  boundedContextNewResolver,
} from './bounded-context/data-access/bounded-context.resolvers';
import { permissionListResolver } from './permission/data-access/permission.resolvers';
import {
  roleDetailResolver,
  roleListResolver,
  roleNewResolver,
} from './role/data-access/role.resolvers';
import { tagListResolver } from './tag/data-access/tag.resolvers';
import { tenantListResolver } from './tenant/data-access/tenant.resolvers';
// iam/user UI standalone retired — see `openspec/specs/iam-account-management-ui/spec.md`.
// The user lifecycle is now managed via the combined account+user form in `iam/account`.
// The aggregate's backend APIs remain intact for programmatic use.

export const iamRoutes: Routes = [
  {
    path: 'tag',
    loadComponent: () => import('./tag/features/tag-list.component'),
    resolve: { pagination: tagListResolver },
  },
  {
    path: 'permission',
    loadComponent: () => import('./permission/features/permission-list.component'),
    resolve: { pagination: permissionListResolver },
  },
  {
    path: 'bounded-context',
    loadComponent: () => import('./bounded-context/features/bounded-context-list.component'),
    resolve: { pagination: boundedContextListResolver },
  },
  {
    path: 'bounded-context/new',
    loadComponent: () => import('./bounded-context/features/bounded-context-detail.component'),
    data: { mode: 'new' },
    resolve: { init: boundedContextNewResolver },
  },
  {
    path: 'bounded-context/edit/:id',
    loadComponent: () => import('./bounded-context/features/bounded-context-detail.component'),
    data: { mode: 'edit' },
    resolve: { item: boundedContextDetailResolver },
  },
  {
    path: 'tenant',
    loadComponent: () => import('./tenant/features/tenant-list.component'),
    resolve: { pagination: tenantListResolver },
  },
  {
    path: 'role',
    loadComponent: () => import('./role/features/role-list.component'),
    resolve: { pagination: roleListResolver },
  },
  {
    path: 'role/new',
    loadComponent: () => import('./role/features/role-detail.component'),
    data: { mode: 'new' },
    resolve: { init: roleNewResolver },
  },
  {
    path: 'role/edit/:id',
    loadComponent: () => import('./role/features/role-detail.component'),
    data: { mode: 'edit' },
    resolve: { item: roleDetailResolver },
  },
  {
    path: 'account',
    loadComponent: () => import('./account/features/account-list.component'),
    resolve: { pagination: accountListResolver },
  },
  {
    path: 'account/new',
    loadComponent: () => import('./account/features/account-detail.component'),
    data: { mode: 'new' },
    resolve: { init: accountNewResolver },
  },
  {
    path: 'account/edit/:id',
    loadComponent: () => import('./account/features/account-detail.component'),
    data: { mode: 'edit' },
    resolve: { item: accountDetailResolver },
  },
  // iam/user UI routes retired in favor of the combined form at /iam/account.
  // Any external link to /iam/user falls through to the parent app's 404 handler.
];
