import { AXPCommonMenuKeys } from '@acorex/modules/common';
import { AXPEntityService } from '@acorex/platform/layout/entity';
import { inject } from '@angular/core';
import { RootConfig, AXMOrderManagementPermissionKeys, AXMOrderManagementMenuKeys } from './acorex-modules-order-management.mjs';

//#region ----   Imports   ----
//#endregion
//#region ----   Menu Provider   ----
class AXMOrderManagementMenuProvider {
    constructor() {
        this.entityService = inject(AXPEntityService);
    }
    async provide(context) {
        const module = RootConfig.module;
        const moduleName = module.name;
        const i18n = RootConfig.config.i18n;
        context.find(AXPCommonMenuKeys.Commerce).addItems([
            {
                name: AXMOrderManagementMenuKeys.BulkBuyOrders,
                priority: 3,
                text: `@${i18n}:bulk-buy-orders.menus.bulk-buy-orders.title`,
                description: `@${i18n}:bulk-buy-orders.menus.bulk-buy-orders.description`,
                icon: RootConfig.entities.bulkBuyOrder.icon,
                path: this.entityService.createPath(moduleName, RootConfig.entities.bulkBuyOrder.name),
                policy: {
                    features: [moduleName],
                    permissions: [AXMOrderManagementPermissionKeys.BulkBuyOrders.Management],
                },
            },
            {
                name: AXMOrderManagementMenuKeys.AvailableOrders,
                priority: 4,
                text: `@${i18n}:bulk-buy-orders.menus.available-orders.title`,
                description: `@${i18n}:bulk-buy-orders.menus.available-orders.description`,
                icon: RootConfig.entities.bulkBuyOrder.icon,
                path: this.entityService.createPath(moduleName, RootConfig.entities.bulkBuyOrder.name, 'available'),
                policy: {
                    features: [moduleName],
                    permissions: [AXMOrderManagementPermissionKeys.BulkBuyOrders.Member],
                },
            },
            {
                name: AXMOrderManagementMenuKeys.MyOrders,
                priority: 5,
                text: `@${i18n}:bulk-buy-orders.menus.my-orders.title`,
                description: `@${i18n}:bulk-buy-orders.menus.my-orders.description`,
                icon: RootConfig.entities.memberOrder.icon,
                path: this.entityService.createPath(moduleName, RootConfig.entities.memberOrder.name, 'my'),
                policy: {
                    features: [moduleName],
                    permissions: [AXMOrderManagementPermissionKeys.BulkBuyOrders.Member],
                },
            },
            { name: `${AXMOrderManagementMenuKeys.Root}:divider`, text: '', type: 'break', priority: 6 },
        ]);
    }
}
//#endregion

export { AXMOrderManagementMenuProvider };
//# sourceMappingURL=acorex-modules-order-management-menu.provider-DeMKkRZa.mjs.map
