c775146b64
Implementation A partner, not just software HexDive Technologies' local team handles setup, data migration, training and ongoing support — in Sinhala, Tamil and English. [confirm] 1 Discovery Map your network, products and processes. 2 Configuration Set up depots, pricing, schemes, routes and users. 3 Migration & training Move your data and train every team. 4 Go-live & support Dedicated account manager and local support desk.
140 lines
2.5 KiB
TypeScript
140 lines
2.5 KiB
TypeScript
export interface PermissionCategory {
|
|
id: string
|
|
label: string
|
|
codes: string[]
|
|
}
|
|
|
|
export const PERMISSION_CATEGORIES: PermissionCategory[] = [
|
|
{
|
|
id: 'sales',
|
|
label: 'Sales & Orders',
|
|
codes: [
|
|
'orders.view',
|
|
'stores.view',
|
|
'store.view',
|
|
'store.manage',
|
|
'sales_visits.checkin',
|
|
'return.view',
|
|
'return.manage',
|
|
],
|
|
},
|
|
{
|
|
id: 'operations',
|
|
label: 'Operations',
|
|
codes: [
|
|
'rides.view',
|
|
'loading.view',
|
|
'loading-sheet.view',
|
|
'loading-sheet.manage',
|
|
'delivery-task.view',
|
|
'delivery-task.manage',
|
|
],
|
|
},
|
|
{
|
|
id: 'stock',
|
|
label: 'Stock & Inventory',
|
|
codes: [
|
|
'warehouses.view',
|
|
'stock.view',
|
|
'stock.manage',
|
|
'items.view',
|
|
'categories.view',
|
|
],
|
|
},
|
|
{
|
|
id: 'procurement',
|
|
label: 'Procurement',
|
|
codes: [
|
|
'purchase_orders.view',
|
|
'purchase-order.view',
|
|
'purchase-order.manage',
|
|
'purchase-return.manage',
|
|
'grn.view',
|
|
'grn.manage',
|
|
'suppliers.view',
|
|
'supplier-claim.view',
|
|
'supplier-claim.manage',
|
|
],
|
|
},
|
|
{
|
|
id: 'pricing',
|
|
label: 'Pricing',
|
|
codes: [
|
|
'pricelists.view',
|
|
'price-list.view',
|
|
'price-list.manage',
|
|
'schemes.view',
|
|
'scheme.view',
|
|
'scheme.manage',
|
|
],
|
|
},
|
|
{
|
|
id: 'claims',
|
|
label: 'Claims',
|
|
codes: [
|
|
'claim.view',
|
|
'claim.manage',
|
|
],
|
|
},
|
|
{
|
|
id: 'network',
|
|
label: 'Network & Routes',
|
|
codes: [
|
|
'regions.view',
|
|
'region.view',
|
|
'region.manage',
|
|
'routes.view',
|
|
'route.view',
|
|
'route.manage',
|
|
],
|
|
},
|
|
{
|
|
id: 'fleet',
|
|
label: 'Fleet & Drivers',
|
|
codes: [
|
|
'vehicles.view',
|
|
'driver_profiles.view',
|
|
'driver.view',
|
|
'driver.manage',
|
|
'compliance.manage',
|
|
],
|
|
},
|
|
{
|
|
id: 'expenses',
|
|
label: 'Expenses',
|
|
codes: [
|
|
'expense.view',
|
|
'expense.create',
|
|
'expense.post',
|
|
'expense.pay',
|
|
'expense.void',
|
|
'expense.manage_categories',
|
|
'expense.manage_recurring',
|
|
],
|
|
},
|
|
{
|
|
id: 'users',
|
|
label: 'User Management',
|
|
codes: [
|
|
'users.view',
|
|
'roles.view',
|
|
],
|
|
},
|
|
{
|
|
id: 'system',
|
|
label: 'System',
|
|
codes: [
|
|
'sys-config.view',
|
|
'sys-config.manage',
|
|
],
|
|
},
|
|
]
|
|
|
|
export const ALL_PERMISSION_CODES = new Set(
|
|
PERMISSION_CATEGORIES.flatMap((c) => c.codes),
|
|
)
|
|
|
|
export function getCategoryForCode(code: string): PermissionCategory | undefined {
|
|
return PERMISSION_CATEGORIES.find((c) => c.codes.includes(code))
|
|
}
|