import 'package:flutter/material.dart';

import '../config/app_config.dart';
import '../modules/feature_module.dart';
import '../screens/sales_dashboard_screen.dart';
import '../screens/sales_entries_screen.dart';

class SalesManagementModule extends FeatureModule {
  SalesManagementModule();

  @override
  String get key => 'sales_management';

  @override
  bool get isEnabled => AppConfig.enableSalesManagement;

  @override
  List<ModuleDashboardCard> get dashboardCards => [
        ModuleDashboardCard(
          id: 'sales_management_report',
          route: 'sales_management',
          title: '売上管理',
          description: '売上ダッシュボード（ランチャー）',
          iconName: 'analytics',
          onTap: (context) async {
            await Navigator.push(
              context,
              MaterialPageRoute(builder: (_) => const SalesDashboardScreen()),
            );
          },
        ),
        ModuleDashboardCard(
          id: 'sales_entries',
          route: 'sales_entries',
          title: '売上伝票入力',
          description: 'U1:売上伝票の入力・編集',
          iconName: 'receipt_long',
          onTap: (context) async {
            await Navigator.push(
              context,
              MaterialPageRoute(builder: (_) => SalesEntriesScreen()),
            );
          },
        ),
      ];
}
