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

export type TConsumerSaleInvoicesRouteNames = 'saleInvoices' | 'saleInvoice';

export const consumerSaleInvoicesNamedRoutes: NamedRoutes<TConsumerSaleInvoicesRouteNames> = {
  saleInvoices: {
    path: 'sale_invoices',
    loadComponent: () =>
      import('../../views/list.component').then((m) => m.ConsumerSaleInvoicesComponent),
    meta: {
      title: 'فاکتورهای صادر شده',
      pagePath: () => `/consumer/sale_invoices`,
    },
  },
  saleInvoice: {
    path: 'sale_invoices/:invoiceId',
    loadComponent: () =>
      import('../../views/single.component').then((m) => m.ConsumerSaleInvoiceComponent),
    meta: {
      title: 'فاکتور صادر شده',
      pagePath: (saleInvoiceId: string) => `/consumer/sale_invoices/${saleInvoiceId}`,
    },
  },
};

export const CONSUMER_SALE_INVOICES_ROUTES: Routes = [
  consumerSaleInvoicesNamedRoutes.saleInvoices,
  consumerSaleInvoicesNamedRoutes.saleInvoice,
];
