import * as i0 from '@angular/core';
import { NgModule } from '@angular/core';
import { provideLazyProvider, AXP_MODULE_MANIFEST_PROVIDER, AXP_FEATURE_DEFINITION_PROVIDER } from '@acorex/platform/core';
import { AXP_ENTITY_DEFINITION_LOADER } from '@acorex/platform/layout/entity';
import { AXP_STATUS_PROVIDERS, AXP_SETTING_DEFINITION_PROVIDER, AXP_MENU_PROVIDER } from '@acorex/platform/common';
import { AXP_PERMISSION_DEFINITION_PROVIDER } from '@acorex/platform/auth';
import { AXP_IDENTIFIER_RULES } from '@acorex/modules/identifier-management';

//#region ----   Module Configuration   ----
const config = {
    i18n: 'order-management',
    module: 'OrderManagement',
};
const RootConfig = {
    config,
    module: {
        route: 'order-management',
        name: config.module,
        title: `@${config.i18n}:module.title`,
        icon: 'fa-light fa-file-invoice',
    },
    entities: {
        bulkBuyOrder: {
            name: 'BulkBuyOrder',
            source: `${config.module}.BulkBuyOrder`,
            title: '@order-management:bulk-buy-orders.entities.bulk-buy-order.title',
            titlePlural: '@order-management:bulk-buy-orders.entities.bulk-buy-order.plural',
            icon: 'fa-light fa-file-invoice',
        },
        bulkBuyOrderItem: {
            name: 'BulkBuyOrderItem',
            source: `${config.module}.BulkBuyOrderItem`,
            title: '@order-management:bulk-buy-orders.entities.bulk-buy-order-item.title',
            titlePlural: '@order-management:bulk-buy-orders.entities.bulk-buy-order-item.plural',
            icon: 'fa-light fa-list',
        },
        memberOrder: {
            name: 'MemberOrder',
            source: `${config.module}.MemberOrder`,
            title: '@order-management:bulk-buy-orders.entities.member-order.title',
            titlePlural: '@order-management:bulk-buy-orders.entities.member-order.plural',
            icon: 'fa-light fa-user-check',
        },
        memberOrderLine: {
            name: 'MemberOrderLine',
            source: `${config.module}.MemberOrderLine`,
            title: '@order-management:bulk-buy-orders.entities.member-order-line.title',
            titlePlural: '@order-management:bulk-buy-orders.entities.member-order-line.plural',
            icon: 'fa-light fa-list-check',
        },
    },
};
//#endregion

//#region ----   Imports   ----
//#endregion
//#region ----   Manifest Definition   ----
/**
 * Order Management Module Manifest.
 * Defines module metadata, features, and provider references.
 */
const OrderManagementManifest = {
    name: RootConfig.module.name,
    version: '1.0.0',
    title: RootConfig.module.title,
    icon: RootConfig.module.icon,
    i18n: RootConfig.config.i18n,
    // Module dependencies
    dependencies: [
        'FinancialCore',
        'ProductCatalog',
        'MeasurementCore',
        'PersonManagement',
        'SecurityManagement',
        'NotificationManagement',
    ],
};
//#endregion

//#region ----   Imports   ----
//#endregion
//#region ----   Bulk Buy Order Number Identifier Rule   ----
/**
 * Identifier rule for generating bulk buy order numbers.
 * Pattern: BBO-{YYYY}-{####}
 * Example: BBO-2024-0001
 * Scope: Yearly reset
 */
const AXM_BULK_BUY_ORDER_NUMBER_IDENTIFIER_RULE = {
    id: 'order-management.bulk-buy-order-number',
    title: 'Bulk Buy Order Number',
    entity: `${RootConfig.module.name}.BulkBuyOrder`,
    pattern: 'BBO-{date:YYYY}-{seq:4}',
    enabled: true,
    priority: 1,
    scopeConfig: {
        byTenant: false,
        period: 'yearly',
        minValue: 0,
        blockSize: 0,
    },
};
//#endregion

//#region ----   Imports   ----
//#endregion
//#region ----   Bulk Buy Order Feature Module   ----
/**
 * Feature module for Bulk Buy Order functionality.
 * Contains status providers and identifier rules for the bulk buy order feature.
 */
class AXMBulkBuyOrderModule {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: AXMBulkBuyOrderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.19", ngImport: i0, type: AXMBulkBuyOrderModule }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: AXMBulkBuyOrderModule, providers: [
            // Status Providers
            provideLazyProvider(AXP_STATUS_PROVIDERS, () => import('./acorex-modules-order-management-bulk-buy-order-status.provider-CT7kaIof.mjs').then(m => m.AXMBulkBuyOrderStatusProvider)),
            provideLazyProvider(AXP_STATUS_PROVIDERS, () => import('./acorex-modules-order-management-member-order-status.provider-Bkrzylqm.mjs').then(m => m.AXMMemberOrderStatusProvider)),
            // Identifier Rules
            {
                provide: AXP_IDENTIFIER_RULES,
                useValue: AXM_BULK_BUY_ORDER_NUMBER_IDENTIFIER_RULE,
                multi: true,
            },
        ] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: AXMBulkBuyOrderModule, decorators: [{
            type: NgModule,
            args: [{
                    imports: [],
                    providers: [
                        // Status Providers
                        provideLazyProvider(AXP_STATUS_PROVIDERS, () => import('./acorex-modules-order-management-bulk-buy-order-status.provider-CT7kaIof.mjs').then(m => m.AXMBulkBuyOrderStatusProvider)),
                        provideLazyProvider(AXP_STATUS_PROVIDERS, () => import('./acorex-modules-order-management-member-order-status.provider-Bkrzylqm.mjs').then(m => m.AXMMemberOrderStatusProvider)),
                        // Identifier Rules
                        {
                            provide: AXP_IDENTIFIER_RULES,
                            useValue: AXM_BULK_BUY_ORDER_NUMBER_IDENTIFIER_RULE,
                            multi: true,
                        },
                    ],
                }]
        }] });

//#region ----   Imports   ----
//#endregion
//#region ----   Order Management Module   ----
class AXMOrderManagementModule {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: AXMOrderManagementModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.19", ngImport: i0, type: AXMOrderManagementModule, imports: [
            // Feature Modules
            AXMBulkBuyOrderModule] }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: AXMOrderManagementModule, providers: [
            // Settings Provider (lazy loaded)
            provideLazyProvider(AXP_SETTING_DEFINITION_PROVIDER, () => import('./acorex-modules-order-management-settings.provider-BzNJIZCu.mjs').then(m => m.AXMOrderManagementSettingProvider)),
            // Module Manifest Provider
            {
                provide: AXP_MODULE_MANIFEST_PROVIDER,
                useValue: OrderManagementManifest,
                multi: true,
            },
            // Provider references (lazy loaded)
            provideLazyProvider(AXP_PERMISSION_DEFINITION_PROVIDER, () => import('./acorex-modules-order-management-permission-definition.provider-BHAiUDxR.mjs').then(m => m.AXMOrderManagementPermissionDefinitionProvider)),
            provideLazyProvider(AXP_MENU_PROVIDER, () => import('./acorex-modules-order-management-menu.provider-DeMKkRZa.mjs').then(m => m.AXMOrderManagementMenuProvider)),
            provideLazyProvider(AXP_ENTITY_DEFINITION_LOADER, () => import('./acorex-modules-order-management-entity.provider-D3ArjXN3.mjs').then(m => m.AXMOrderManagementEntityProvider)),
            provideLazyProvider(AXP_FEATURE_DEFINITION_PROVIDER, () => import('./acorex-modules-order-management-feature-definition.provider-BgrmTQ_L.mjs').then(m => m.AXMOrderManagementFeatureDefinitionProvider)),
        ], imports: [
            // Feature Modules
            AXMBulkBuyOrderModule] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: AXMOrderManagementModule, decorators: [{
            type: NgModule,
            args: [{
                    imports: [
                        // Feature Modules
                        AXMBulkBuyOrderModule,
                    ],
                    providers: [
                        // Settings Provider (lazy loaded)
                        provideLazyProvider(AXP_SETTING_DEFINITION_PROVIDER, () => import('./acorex-modules-order-management-settings.provider-BzNJIZCu.mjs').then(m => m.AXMOrderManagementSettingProvider)),
                        // Module Manifest Provider
                        {
                            provide: AXP_MODULE_MANIFEST_PROVIDER,
                            useValue: OrderManagementManifest,
                            multi: true,
                        },
                        // Provider references (lazy loaded)
                        provideLazyProvider(AXP_PERMISSION_DEFINITION_PROVIDER, () => import('./acorex-modules-order-management-permission-definition.provider-BHAiUDxR.mjs').then(m => m.AXMOrderManagementPermissionDefinitionProvider)),
                        provideLazyProvider(AXP_MENU_PROVIDER, () => import('./acorex-modules-order-management-menu.provider-DeMKkRZa.mjs').then(m => m.AXMOrderManagementMenuProvider)),
                        provideLazyProvider(AXP_ENTITY_DEFINITION_LOADER, () => import('./acorex-modules-order-management-entity.provider-D3ArjXN3.mjs').then(m => m.AXMOrderManagementEntityProvider)),
                        provideLazyProvider(AXP_FEATURE_DEFINITION_PROVIDER, () => import('./acorex-modules-order-management-feature-definition.provider-BgrmTQ_L.mjs').then(m => m.AXMOrderManagementFeatureDefinitionProvider)),
                    ],
                }]
        }] });

const AXMOrderManagementMenuKeys = {
    Root: 'OrderManagement:Menu',
    BulkBuyOrders: 'OrderManagement:Menu:BulkBuyOrders',
    AvailableOrders: 'OrderManagement:Menu:AvailableOrders',
    MyOrders: 'OrderManagement:Menu:MyOrders',
};

// Management feature removed - module name is used directly as feature key
const AXMOrderManagementFeatureKeys = {};

//#region ----   Permission Keys   ----
const AXMOrderManagementPermissionKeys = {
    Orders: {
        Management: 'OrderManagement:Permission:Orders.Management',
        View: 'OrderManagement:Permission:Orders.View',
        Create: 'OrderManagement:Permission:Orders.Create',
        Edit: 'OrderManagement:Permission:Orders.Edit',
        Delete: 'OrderManagement:Permission:Orders.Delete',
    },
    GroupOrders: {
        Management: 'OrderManagement:Permission:GroupOrders.Management',
        View: 'OrderManagement:Permission:GroupOrders.View',
        Create: 'OrderManagement:Permission:GroupOrders.Create',
        Edit: 'OrderManagement:Permission:GroupOrders.Edit',
        Delete: 'OrderManagement:Permission:GroupOrders.Delete',
        MemberView: 'OrderManagement:Permission:GroupOrders.MemberView',
    },
    BulkBuyOrders: {
        Management: 'OrderManagement:Permission:BulkBuyOrders.Management',
        Member: 'OrderManagement:Permission:BulkBuyOrders.Member',
    },
};
//#endregion

/**
 * Generated bundle index. Do not edit.
 */

export { AXMOrderManagementFeatureKeys, AXMOrderManagementMenuKeys, AXMOrderManagementModule, AXMOrderManagementPermissionKeys, RootConfig };
//# sourceMappingURL=acorex-modules-order-management.mjs.map
