// @ts-nocheck
import React from 'react';
import { FormattedMessage as T } from '@/components';
import { Features } from '@/constants/features';
import {
ISidebarMenuItemType,
ISidebarMenuOverlayIds,
} from '@/containers/Dashboard/Sidebar/interfaces';
import {
ReportsAction,
AbilitySubject,
ItemAction,
InventoryAdjustmentAction,
SaleEstimateAction,
SaleInvoiceAction,
SaleReceiptAction,
PaymentReceiveAction,
BillAction,
PaymentMadeAction,
CustomerAction,
VendorAction,
AccountAction,
ManualJournalAction,
ExpenseAction,
CashflowAction,
PreferencesAbility,
} from '@/constants/abilityOption';
import { DialogsName } from './dialogs';
export const SidebarMenu = [
// ---------------
// # Homepage
// ---------------
{
text: ,
type: ISidebarMenuItemType.Link,
disabled: false,
href: '/',
matchExact: true,
},
// ---------------
// # Sales & Inventory
// ---------------
{
text: ,
type: ISidebarMenuItemType.Group,
children: [
{
text: ,
type: ISidebarMenuItemType.Overlay,
overlayId: ISidebarMenuOverlayIds.Items,
children: [
{
text: ,
type: ISidebarMenuItemType.Group,
children: [
{
text: ,
href: '/items',
type: ISidebarMenuItemType.Link,
permission: {
subject: AbilitySubject.Item,
ability: ItemAction.View,
},
},
{
text: ,
href: '/inventory-adjustments',
type: ISidebarMenuItemType.Link,
permission: {
subject: AbilitySubject.InventoryAdjustment,
ability: InventoryAdjustmentAction.View,
},
},
{
text: ,
href: '/items/categories',
type: ISidebarMenuItemType.Link,
permission: {
subject: AbilitySubject.Item,
ability: ItemAction.View,
},
},
{
text: ,
href: '/warehouses-transfers',
type: ISidebarMenuItemType.Link,
feature: Features.Warehouses,
},
],
},
{
text: ,
type: ISidebarMenuItemType.Group,
children: [
{
text: ,
href: '/items/new',
type: ISidebarMenuItemType.Link,
permission: {
subject: AbilitySubject.Item,
ability: ItemAction.Create,
},
},
{
text: ,
href: '/items/new',
type: ISidebarMenuItemType.Link,
permission: {
subject: AbilitySubject.Item,
ability: ItemAction.Create,
},
},
{
text: ,
href: '/items/categories/new',
type: ISidebarMenuItemType.Dialog,
dialogName: DialogsName.ItemCategoryForm,
permission: {
subject: AbilitySubject.Item,
ability: ItemAction.Create,
},
},
{
text: ,
href: '/warehouses-transfers/new',
type: ISidebarMenuItemType.Link,
feature: Features.Warehouses,
},
],
},
],
},
],
},
// ---------------
// # Sales
// ---------------
{
text: ,
type: ISidebarMenuItemType.Overlay,
overlayId: ISidebarMenuOverlayIds.Sales,
children: [
{
text: ,
type: ISidebarMenuItemType.Group,
children: [
{
text: ,
href: '/estimates',
type: ISidebarMenuItemType.Link,
permission: {
subject: AbilitySubject.Estimate,
ability: SaleEstimateAction.View,
},
},
{
text: ,
href: '/invoices',
type: ISidebarMenuItemType.Link,
permission: {
subject: AbilitySubject.Invoice,
ability: SaleInvoiceAction.View,
},
},
{
text: ,
href: '/receipts',
type: ISidebarMenuItemType.Link,
permission: {
subject: AbilitySubject.Receipt,
ability: SaleReceiptAction.View,
},
},
{
text: ,
href: '/credit-notes',
type: ISidebarMenuItemType.Link,
},
{
text: ,
href: '/payment-receives',
type: ISidebarMenuItemType.Link,
permission: {
subject: AbilitySubject.PaymentReceive,
ability: PaymentReceiveAction.View,
},
},
],
},
{
text: ,
type: ISidebarMenuItemType.Group,
children: [
{
text: ,
href: '/estimates/new',
type: ISidebarMenuItemType.Link,
permission: {
subject: AbilitySubject.Estimate,
ability: SaleEstimateAction.Create,
},
},
{
text: ,
href: '/invoices/new',
type: ISidebarMenuItemType.Link,
permission: {
subject: AbilitySubject.Invoice,
ability: SaleInvoiceAction.Create,
},
},
{
text: ,
href: '/receipts/new',
type: ISidebarMenuItemType.Link,
permission: {
subject: AbilitySubject.Receipt,
ability: SaleReceiptAction.Create,
},
},
{
text: ,
href: '/credit-notes/new',
type: ISidebarMenuItemType.Link,
},
{
text: ,
href: '/payment-receives/new',
type: ISidebarMenuItemType.Link,
permission: {
subject: AbilitySubject.PaymentReceive,
ability: PaymentReceiveAction.Create,
},
},
],
},
],
},
// ---------------
// # Purchases
// ---------------
{
text: ,
type: ISidebarMenuItemType.Overlay,
overlayId: ISidebarMenuOverlayIds.Purchases,
children: [
{
text: ,
type: ISidebarMenuItemType.Group,
children: [
{
text: ,
href: '/bills',
type: ISidebarMenuItemType.Link,
permission: {
subject: AbilitySubject.Bill,
ability: BillAction.View,
},
},
{
text: ,
href: '/vendor-credits',
type: ISidebarMenuItemType.Link,
},
{
text: ,
href: '/payment-mades',
type: ISidebarMenuItemType.Link,
permission: {
subject: AbilitySubject.PaymentMade,
ability: PaymentMadeAction.View,
},
},
],
},
{
text: ,
type: ISidebarMenuItemType.Group,
children: [
{
text: ,
href: '/bills/new',
type: ISidebarMenuItemType.Link,
permission: {
subject: AbilitySubject.Bill,
ability: BillAction.Create,
},
},
{
text: ,
href: '/vendor-credits/new',
type: ISidebarMenuItemType.Link,
permission: {
subject: AbilitySubject.Bill,
ability: BillAction.Create,
},
},
{
text: ,
href: '/payment-mades/new',
type: ISidebarMenuItemType.Link,
permission: {
subject: AbilitySubject.PaymentMade,
ability: PaymentMadeAction.Create,
},
},
],
},
],
},
// ---------------
// # Contacts
// ---------------
{
text: ,
type: ISidebarMenuItemType.Overlay,
overlayId: ISidebarMenuOverlayIds.Contacts,
children: [
{
text: ,
type: ISidebarMenuItemType.Group,
children: [
{
text: ,
href: '/customers',
type: ISidebarMenuItemType.Link,
permission: {
subject: AbilitySubject.Customer,
ability: CustomerAction.View,
},
},
{
text: ,
href: '/vendors',
type: ISidebarMenuItemType.Link,
permission: {
subject: AbilitySubject.Vendor,
ability: VendorAction.Create,
},
},
],
},
{
text: ,
type: ISidebarMenuItemType.Group,
children: [
{
text: ,
href: '/customers/new',
type: ISidebarMenuItemType.Link,
permission: {
subject: AbilitySubject.Customer,
ability: CustomerAction.View,
},
},
{
text: ,
href: '/vendors/new',
type: ISidebarMenuItemType.Link,
permission: {
subject: AbilitySubject.Vendor,
ability: VendorAction.View,
},
},
],
},
],
},
// ---------------
// # Accounting
// ---------------
{
text: ,
type: ISidebarMenuItemType.Group,
children: [
{
text: ,
type: ISidebarMenuItemType.Overlay,
overlayId: ISidebarMenuOverlayIds.Financial,
children: [
{
text: ,
type: ISidebarMenuItemType.Group,
children: [
{
text: ,
href: '/accounts',
type: ISidebarMenuItemType.Link,
permission: {
subject: AbilitySubject.Account,
ability: AccountAction.View,
},
},
{
text: ,
href: '/manual-journals',
type: ISidebarMenuItemType.Link,
permission: {
subject: AbilitySubject.ManualJournal,
ability: ManualJournalAction.View,
},
},
{
text: ,
href: '/transactions-locking',
type: ISidebarMenuItemType.Link,
},
],
},
{
text: ,
type: ISidebarMenuItemType.Group,
children: [
{
text: ,
href: '/make-journal-entry',
type: ISidebarMenuItemType.Link,
permission: {
subject: AbilitySubject.ManualJournal,
ability: ManualJournalAction.Create,
},
},
],
},
],
},
],
},
// ---------------
// # Cashflow
// ---------------
{
text: ,
type: ISidebarMenuItemType.Overlay,
overlayId: ISidebarMenuOverlayIds.Cashflow,
children: [
{
text: ,
type: ISidebarMenuItemType.Group,
children: [
{
text: ,
href: '/cashflow-accounts',
type: ISidebarMenuItemType.Link,
permission: {
subject: AbilitySubject.Cashflow,
ability: CashflowAction.View,
},
},
],
},
{
text: ,
type: ISidebarMenuItemType.Group,
divider: true,
children: [
{
text: ,
href: '/cashflow-accounts',
type: ISidebarMenuItemType.Dialog,
dialogName: DialogsName.MoneyInForm,
permission: {
subject: AbilitySubject.Cashflow,
ability: CashflowAction.Create,
},
},
{
text: ,
href: '/cashflow-accounts',
type: ISidebarMenuItemType.Dialog,
dialogName: DialogsName.MoneyOutForm,
permission: {
subject: AbilitySubject.Cashflow,
ability: CashflowAction.Create,
},
},
{
text: ,
href: '/cashflow-accounts',
type: ISidebarMenuItemType.Dialog,
dialogName: DialogsName.AccountForm,
permission: {
subject: AbilitySubject.Cashflow,
ability: CashflowAction.Create,
},
},
{
text: ,
href: '/cashflow-accounts',
type: ISidebarMenuItemType.Dialog,
dialogName: DialogsName.AccountForm,
permission: {
subject: AbilitySubject.Cashflow,
ability: CashflowAction.Create,
},
},
],
},
],
},
// ---------------
// # Expenses
// ---------------
{
text: ,
type: ISidebarMenuItemType.Overlay,
overlayId: ISidebarMenuOverlayIds.Expenses,
children: [
{
text: ,
type: ISidebarMenuItemType.Group,
children: [
{
text: ,
href: '/expenses',
type: ISidebarMenuItemType.Link,
permission: {
subject: AbilitySubject.Expense,
ability: ExpenseAction.View,
},
},
],
},
{
text: ,
type: ISidebarMenuItemType.Group,
children: [
{
text: ,
href: '/expenses/new',
type: ISidebarMenuItemType.Link,
permission: {
subject: AbilitySubject.Expense,
ability: ExpenseAction.Create,
},
},
],
},
],
},
// ---------------------
// # Projects Management
// ---------------------
// {
// text: ,
// type: ISidebarMenuItemType.Overlay,
// overlayId: ISidebarMenuOverlayIds.Projects,
// children: [
// {
// text: ,
// type: ISidebarMenuItemType.Group,
// children: [
// {
// text: ,
// href: '/projects',
// type: ISidebarMenuItemType.Link,
// permission: {
// subject: AbilitySubject.Project,
// ability: ProjectAction.View,
// },
// },
// ],
// },
// {
// text: ,
// type: ISidebarMenuItemType.Group,
// children: [
// {
// text: ,
// type: ISidebarMenuItemType.Dialog,
// dialogName: 'project-form',
// permission: {
// subject: AbilitySubject.Project,
// ability: ProjectAction.Create,
// },
// },
// {
// text: ,
// type: ISidebarMenuItemType.Dialog,
// dialogName: 'project-time-entry-form',
// },
// ],
// },
// {
// text: ,
// type: ISidebarMenuItemType.Group,
// children: [
// {
// text: ,
// href: '/financial-reports/project-profitability-summary',
// type: ISidebarMenuItemType.Link,
// },
// ],
// },
// ],
// },
// ---------------
// # Reports
// ---------------
{
text: ,
type: ISidebarMenuItemType.Overlay,
overlayId: ISidebarMenuOverlayIds.Reports,
children: [
{
text: ,
type: ISidebarMenuItemType.Group,
children: [
{
text: ,
href: '/financial-reports/balance-sheet',
type: ISidebarMenuItemType.Link,
permission: {
subject: AbilitySubject.Report,
ability: ReportsAction.READ_BALANCE_SHEET,
},
},
{
text: ,
href: '/financial-reports/trial-balance-sheet',
type: ISidebarMenuItemType.Link,
permission: {
subject: AbilitySubject.Report,
ability: ReportsAction.READ_TRIAL_BALANCE_SHEET,
},
},
{
text: ,
href: '/financial-reports/journal-sheet',
type: ISidebarMenuItemType.Link,
permission: {
subject: AbilitySubject.Report,
ability: ReportsAction.READ_JOURNAL,
},
},
{
text: ,
href: '/financial-reports/general-ledger',
type: ISidebarMenuItemType.Link,
permission: {
subject: AbilitySubject.Report,
ability: ReportsAction.READ_GENERAL_LEDGET,
},
},
{
text: ,
href: '/financial-reports/profit-loss-sheet',
type: ISidebarMenuItemType.Link,
permission: {
subject: AbilitySubject.Report,
ability: ReportsAction.READ_PROFIT_LOSS,
},
},
{
text: ,
href: '/financial-reports/cash-flow',
type: ISidebarMenuItemType.Link,
permission: {
subject: AbilitySubject.Report,
ability: ReportsAction.READ_CASHFLOW_ACCOUNT_TRANSACTION,
},
},
{
text: ,
href: '/financial-reports/receivable-aging-summary',
type: ISidebarMenuItemType.Link,
permission: {
subject: AbilitySubject.Report,
ability: ReportsAction.READ_AR_AGING_SUMMARY,
},
},
{
text: ,
href: '/financial-reports/payable-aging-summary',
type: ISidebarMenuItemType.Link,
permission: {
subject: AbilitySubject.Report,
ability: ReportsAction.READ_AP_AGING_SUMMARY,
},
},
],
},
{
text: ,
type: ISidebarMenuItemType.Group,
children: [
{
text: ,
type: ISidebarMenuItemType.Link,
href: '/financial-reports/purchases-by-items',
permission: {
subject: AbilitySubject.Report,
ability: ReportsAction.READ_PURCHASES_BY_ITEMS,
},
},
{
text: ,
href: '/financial-reports/sales-by-items',
type: ISidebarMenuItemType.Link,
permission: {
subject: AbilitySubject.Report,
ability: ReportsAction.READ_SALES_BY_ITEMS,
},
},
{
text: ,
href: '/financial-reports/transactions-by-customers',
type: ISidebarMenuItemType.Link,
permission: {
subject: AbilitySubject.Report,
ability: ReportsAction.READ_CUSTOMERS_TRANSACTIONS,
},
},
{
text: ,
href: '/financial-reports/transactions-by-vendors',
type: ISidebarMenuItemType.Link,
permission: {
subject: AbilitySubject.Report,
ability: ReportsAction.READ_VENDORS_TRANSACTIONS,
},
},
{
text: ,
href: '/financial-reports/customers-balance-summary',
type: ISidebarMenuItemType.Link,
permission: {
subject: AbilitySubject.Report,
ability: ReportsAction.READ_CUSTOMERS_SUMMARY_BALANCE,
},
},
{
text: ,
href: '/financial-reports/vendors-balance-summary',
type: ISidebarMenuItemType.Link,
permission: {
subject: AbilitySubject.Report,
ability: ReportsAction.READ_VENDORS_SUMMARY_BALANCE,
},
},
],
},
{
text: ,
type: ISidebarMenuItemType.Group,
children: [
{
text: ,
href: '/financial-reports/inventory-item-details',
type: ISidebarMenuItemType.Link,
permission: {
subject: AbilitySubject.Report,
ability: ReportsAction.READ_INVENTORY_ITEM_DETAILS,
},
},
{
text: ,
href: '/financial-reports/inventory-valuation',
type: ISidebarMenuItemType.Link,
permission: {
subject: AbilitySubject.Report,
ability: ReportsAction.READ_INVENTORY_VALUATION_SUMMARY,
},
},
],
},
],
},
{
text: ,
type: ISidebarMenuItemType.Group,
children: [
{
text: ,
href: '/preferences',
type: ISidebarMenuItemType.Link,
permission: {
subject: AbilitySubject.Preferences,
ability: PreferencesAbility.Mutate,
},
},
],
},
];