import 'package:rasadyar_chicken/presentation/pages/auth/logic.dart';
import 'package:rasadyar_chicken/presentation/pages/auth/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/poultry_action/logic.dart';
import 'package:rasadyar_chicken/presentation/pages/poultry_science/poultry_action/view.dart';
import 'package:rasadyar_chicken/presentation/pages/poultry_science/profile/logic.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/role/logic.dart';
import 'package:rasadyar_chicken/presentation/pages/role/view.dart';
import 'package:rasadyar_chicken/presentation/pages/steward/steward.dart';
import 'package:rasadyar_chicken/presentation/routes/routes.dart';
import 'package:rasadyar_chicken/presentation/widget/base_page/logic.dart';
import 'package:rasadyar_chicken/presentation/widget/captcha/logic.dart';
import 'package:rasadyar_chicken/presentation/widget/search/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());
      }),
    ),

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

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

    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(() => StewardRootLogic());
      }),
    ),
    GetPage(
      name: ChickenRoutes.salesOutOfProvinceSteward,
      page: () => SalesOutOfProvincePage(),
      middlewares: [AuthMiddleware()],
      binding: BindingsBuilder(() {
        Get.lazyPut(() => SearchLogic());
        Get.lazyPut(() => SalesOutOfProvinceLogic());
        Get.lazyPut(() => SalesOutOfProvinceBuyersLogic());
        Get.lazyPut(() => SalesOutOfProvinceSalesListLogic());
      }),
    ),
    GetPage(
      name: ChickenRoutes.salesOutOfProvinceBuyerSteward,
      page: () => SalesOutOfProvinceBuyersPage(),
      middlewares: [AuthMiddleware()],
      binding: BindingsBuilder(() {
        Get.lazyPut(() => SearchLogic());
        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());
        Get.lazyPut(() => SearchLogic());
      }),
    ),

    //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(() => SearchLogic());
        Get.lazyPut(() => BuyOutOfProvinceLogic());
      }),
    ),
    GetPage(
      name: ChickenRoutes.buysInProvinceSteward,
      page: () => BuyInProvincePage(),
      middlewares: [AuthMiddleware()],
      binding: BindingsBuilder(() {
        Get.lazyPut(() => BaseLogic());
        Get.lazyPut(() => SearchLogic());
        Get.lazyPut(() => BuyInProvinceLogic());
        Get.lazyPut(() => BuyInProvinceWaitingLogic());
        Get.lazyPut(() => BuyInProvinceAllLogic());
      }),
    ),

    //endregion

    //region Poultry science Pages
    GetPage(
      name: ChickenRoutes.initPoultryScience,
      page: () => PoultryScienceRootPage(),
      middlewares: [AuthMiddleware()],
      binding: BindingsBuilder(() {
        Get.lazyPut(() => BaseLogic());
        Get.lazyPut(() => SearchLogic());
        Get.lazyPut(() => PoultryScienceRootLogic());
        Get.lazyPut(() => PoultryScienceHomeLogic());
        Get.lazyPut(() => PoultryScienceProfileLogic());
        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());
      }),
    ),
    //endregion
  ];
}
