import { NamedRoutes } from '@/core';
import { Routes } from '@angular/router';

export type TAccountsRouteNames = 'accounts' | 'account';

export const partnerConsumerAccountsNamedRoutes: NamedRoutes<TAccountsRouteNames> = {
  accounts: {
    path: 'accounts',
    loadComponent: () =>
      import('../../views/accounts/list.component').then((m) => m.ConsumerAccountsComponent),
    // @ts-ignore
    meta: {
      title: 'حساب‌های کاربری',
      pagePath: (consumerId: string) => `/partner/consumers/${consumerId}/accounts`,
    },
  },
  account: {
    path: 'accounts/:accountId',
    meta: {
      title: 'حساب‌ کاربری',
      pagePath: (consumerId: string, accountId: string) =>
        `/partner/consumers/${consumerId}/accounts/${accountId}`,
    },
  },
};

export const PARTNER_CONSUMER_ACCOUNTS_ROUTES: Routes = [
  partnerConsumerAccountsNamedRoutes.accounts,
];
