-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompatibility-modules.config.ts
More file actions
83 lines (77 loc) · 2.54 KB
/
Copy pathcompatibility-modules.config.ts
File metadata and controls
83 lines (77 loc) · 2.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
import { FormTab } from '../../features/catalog/models/product-workspace.model';
import { SubMenuItem } from '../models/menu-item';
export interface CompatibilityModuleConfig {
menuId: string;
workspaceTab: FormTab;
label: string;
route: string;
icon: string;
headerIcon: string;
headerIconClass: string;
description: string;
countKey:
'oemCodesCount' | 'productCodesCount' | 'equivalentProductsCount' | 'vehicleApplicationsCount';
}
/** Módulos de compatibilidade — fonte única alinhada ao menu do shell-state */
export const COMPATIBILITY_MODULES: CompatibilityModuleConfig[] = [
{
menuId: 'oem',
workspaceTab: 'oem',
label: 'OEM Codes',
route: '/compatibility/oem-codes',
icon: 'hash',
headerIcon: 'box',
headerIconClass: 'text-[#4F8A6B]',
description: 'Códigos originais de montadoras de referência cadastrados para esta peça',
countKey: 'oemCodesCount',
},
{
menuId: 'product-codes',
workspaceTab: 'codigos',
label: 'Product Codes',
route: '/compatibility/product-codes',
icon: 'barcode',
headerIcon: 'tag',
headerIconClass: 'text-[#5A8DEE]',
description: 'EAN, DUN, Código do fabricante, Código paralelo e Código interno auxiliar',
countKey: 'productCodesCount',
},
{
menuId: 'equivalents',
workspaceTab: 'equivalentes',
label: 'Produtos Equivalentes',
route: '/compatibility/equivalent-products',
icon: 'copy',
headerIcon: 'copy',
headerIconClass: 'text-purple-500',
description: 'Relacionamento entre produtos equivalentes e marcas cruzadas',
countKey: 'equivalentProductsCount',
},
{
menuId: 'applications',
workspaceTab: 'compatibilidade',
label: 'Aplicações',
route: '/compatibility/applications',
icon: 'layers',
headerIcon: 'car',
headerIconClass: 'text-amber-500',
description: 'Relacionamento entre o produto e suas aplicações veiculares',
countKey: 'vehicleApplicationsCount',
},
];
export function compatibilityMenuChildren(): SubMenuItem[] {
return COMPATIBILITY_MODULES.map(({ menuId, label, route }) => ({
id: menuId,
label,
route,
}));
}
export const COMPATIBILITY_WORKSPACE_TABS: FormTab[] = COMPATIBILITY_MODULES.map(
(module) => module.workspaceTab,
);
export function isCompatibilityWorkspaceTab(tab: FormTab): boolean {
return COMPATIBILITY_WORKSPACE_TABS.includes(tab);
}
export function getCompatibilityModuleByTab(tab: FormTab): CompatibilityModuleConfig | undefined {
return COMPATIBILITY_MODULES.find((module) => module.workspaceTab === tab);
}