import 'package:rasadyar_chicken/presentation/pages/common/auth/logic.dart';
import 'package:rasadyar_chicken/presentation/pages/common/auth/view.dart';
import 'package:rasadyar_chicken/presentation/pages/common/role/logic.dart';
import 'package:rasadyar_chicken/presentation/pages/common/role/view.dart';
import 'package:rasadyar_chicken/presentation/pages/poultry_science/active_hatching/logic.dart';
import 'package:rasadyar_chicken/presentation/pages/poultry_science/active_hatching/view.dart';
import 'package:rasadyar_chicken/presentation/pages/poultry_science/farm/logic.dart';
import 'package:rasadyar_chicken/presentation/pages/poultry_science/farm/view.dart';
import 'package:rasadyar_chicken/presentation/pages/poultry_science/genocide/logic.dart';
import 'package:rasadyar_chicken/presentation/pages/poultry_science/genocide/view.dart';
import 'package:rasadyar_chicken/presentation/pages/poultry_science/home/logic.dart';
import 'package:rasadyar_chicken/presentation/pages/poultry_science/inspection/logic.dart';
import 'package:rasadyar_chicken/presentation/pages/poultry_science/inspection/view.dart';
import 'package:rasadyar_chicken/presentation/pages/poultry_science/killing_registration/logic.dart';
import 'package:rasadyar_chicken/presentation/pages/poultry_science/killing_registration/view.dart';
import 'package:rasadyar_chicken/presentation/pages/poultry_science/poultry_action/logic.dart';
import 'package:rasadyar_chicken/presentation/pages/poultry_science/poultry_action/view.dart';
import 'package:rasadyar_chicken/presentation/pages/poultry_science/root/logic.dart';
import 'package:rasadyar_chicken/presentation/pages/poultry_science/root/view.dart';
import 'package:rasadyar_chicken/presentation/pages/steward/steward.dart';
import 'package:rasadyar_chicken/presentation/routes/global_binding.dart';
import 'package:rasadyar_chicken/presentation/routes/routes.dart';
import 'package:rasadyar_chicken/presentation/widget/captcha/logic.dart';
import 'package:rasadyar_core/core.dart';

sealed class ChickenPages {
  ChickenPages._();

  static final pages = [
    GetPage(
      name: ChickenRoutes.auth,
      page: () => AuthPage(),
      binding: BindingsBuilder(() {
        Get.lazyPut(() => AuthLogic());
        Get.lazyPut(() => CaptchaWidgetLogic());
        Get.lazyPut(() => BaseLogic(), fenix: true);
      }),
    ),

    GetPage(
      name: ChickenRoutes.role,
      page: () => RolePage(),
      binding: BindingsBuilder(() {
        Get.lazyPut(() => RoleLogic());
        Get.lazyPut(() => BaseLogic(), fenix: true);
      }),
    ),

    //region Steward Pages
    GetPage(
      name: ChickenRoutes.initSteward,
      page: () => StewardRootPage(),
      middlewares: [AuthMiddleware()],
      bindings: [
        GlobalBinding(),
        BindingsBuilder(() {
          Get.lazyPut(() => BaseLogic(), fenix: true);
          Get.lazyPut(() => StewardRootLogic());
          Get.lazyPut(() => HomeLogic());
          Get.lazyPut(() => BuyLogic());
          Get.lazyPut(() => SaleLogic());
          Get.lazyPut(() => SegmentationLogic());
        }),
      ],
    ),

    GetPage(
      name: ChickenRoutes.homeSteward,
      page: () => HomePage(),
      middlewares: [AuthMiddleware()],
      binding: BindingsBuilder(() {

        Get.put(HomeLogic());
        Get.lazyPut(() => BaseLogic());
      }),
    ),

    //sales
    GetPage(
      name: ChickenRoutes.saleSteward,
      page: () => SalePage(),
      middlewares: [AuthMiddleware()],
      binding: BindingsBuilder(() {
        Get.lazyPut(() => SaleLogic());
        Get.lazyPut(() => BaseLogic());
        Get.lazyPut(() => SalesOutOfProvinceLogic());
        Get.lazyPut(() => SalesOutOfProvinceBuyersLogic());
        Get.lazyPut(() => StewardRootLogic());
      }),
    ),
    GetPage(
      name: ChickenRoutes.salesOutOfProvinceSteward,
      page: () => SalesOutOfProvincePage(),
      middlewares: [AuthMiddleware()],
      binding: BindingsBuilder(() {
        Get.lazyPut(() => SalesOutOfProvinceLogic());
        Get.lazyPut(() => SalesOutOfProvinceBuyersLogic());
        Get.lazyPut(() => SalesOutOfProvinceSalesListLogic());
      }),
    ),
    GetPage(
      name: ChickenRoutes.salesOutOfProvinceBuyerSteward,
      page: () => SalesOutOfProvinceBuyersPage(),
      middlewares: [AuthMiddleware()],
      binding: BindingsBuilder(() {
        Get.lazyPut(() => SalesOutOfProvinceLogic());
        Get.lazyPut(() => SalesOutOfProvinceBuyersLogic());
        Get.lazyPut(() => SalesOutOfProvinceSalesListLogic());
      }),
    ),
    GetPage(
      name: ChickenRoutes.salesInProvinceSteward,
      page: () => SalesInProvincePage(),
      middlewares: [AuthMiddleware()],
      binding: BindingsBuilder(() {
        Get.lazyPut(() => BaseLogic());
        Get.lazyPut(() => SalesInProvinceLogic());
      }),
    ),

    //buy
    GetPage(
      name: ChickenRoutes.buySteward,
      page: () => BuyPage(),
      middlewares: [AuthMiddleware()],
      binding: BindingsBuilder(() {
        Get.lazyPut(() => BaseLogic());
        Get.lazyPut(() => BuyLogic());
      }),
    ),
    GetPage(
      name: ChickenRoutes.buysOutOfProvinceSteward,
      page: () => BuyOutOfProvincePage(),
      middlewares: [AuthMiddleware()],
      binding: BindingsBuilder(() {
        Get.lazyPut(() => BaseLogic());
        Get.lazyPut(() => BuyOutOfProvinceLogic());
      }),
    ),
    GetPage(
      name: ChickenRoutes.buysInProvinceSteward,
      page: () => BuyInProvincePage(),
      middlewares: [AuthMiddleware()],
      binding: BindingsBuilder(() {
        Get.lazyPut(() => BaseLogic());
        Get.lazyPut(() => BuyInProvinceLogic());
        Get.lazyPut(() => BuyInProvinceWaitingLogic());
        Get.lazyPut(() => BuyInProvinceAllLogic());
      }),
    ),

    //endregion

    //region Poultry science Pages
    GetPage(
      name: ChickenRoutes.initPoultryScience,
      page: () => PoultryScienceRootPage(),
      middlewares: [AuthMiddleware()],
      bindings: [
        GlobalBinding(),
        BindingsBuilder(() {
          Get.lazyPut(() => PoultryScienceRootLogic());
          Get.lazyPut(() => PoultryScienceHomeLogic());
          Get.lazyPut(() => PoultryActionLogic());
        }),
      ],
    ),

    GetPage(
      name: ChickenRoutes.inspectionPoultryScience,
      page: () => InspectionPoultrySciencePage(),
      middlewares: [AuthMiddleware()],
      binding: BindingsBuilder(() {
        Get.lazyPut(() => InspectionPoultryScienceLogic());
      }),
    ),
    GetPage(
      name: ChickenRoutes.actionPoultryScience,
      page: () => PoultryActionPage(),
      middlewares: [AuthMiddleware()],
      binding: BindingsBuilder(() {
        Get.lazyPut(() => PoultryActionLogic());
      }),
    ),

    GetPage(
      name: ChickenRoutes.farmPoultryScience,
      page: () => FarmPage(),
      middlewares: [AuthMiddleware()],
      binding: BindingsBuilder(() {
        Get.lazyPut(() => FarmLogic());
        Get.lazyPut(() => PoultryScienceHomeLogic());
        Get.lazyPut(() => PoultryScienceRootLogic());
      }),
    ),
    GetPage(
      name: ChickenRoutes.activeHatchingPoultryScience,
      page: () => ActiveHatchingPage(),
      middlewares: [AuthMiddleware()],
      binding: BindingsBuilder(() {
        Get.lazyPut(() => ActiveHatchingLogic());
        Get.lazyPut(() => PoultryScienceRootLogic());
      }),
    ),
    GetPage(
      name: ChickenRoutes.genocidePoultryScience,
      page: () => GenocidePage(),
      middlewares: [AuthMiddleware()],
      binding: BindingsBuilder(() {
        Get.lazyPut(() => GenocideLogic());
        Get.lazyPut(() => PoultryScienceRootLogic());
        Get.lazyPut(() => KillingRegistrationLogic(), fenix: true);
      }),
    ),
    GetPage(
      name: ChickenRoutes.killingRegistrationPoultryScience,
      page: () => KillingRegistrationPage(),
      middlewares: [AuthMiddleware()],
      binding: BindingsBuilder(() {
        Get.lazyPut(() => KillingRegistrationLogic());
        Get.lazyPut(() => GenocideLogic());
        Get.lazyPut(() => PoultryScienceRootLogic());
      }),
    ),
    //endregion
  ];
}
