<?php
//
$defaultHooks = [
  // 订单创建
  'classes_order_create_before' => [       // 订单创建前
      'app\\common\\listener\\classesorder\\OrderHook'
  ],
  'classes_order_create_after' => [        // 订单创建后
      'app\\common\\listener\\classesorder\\OrderHook'
  ],
  'classes_order_payed_after' => [        // 订单支付成功
      'app\\common\\listener\\classesorder\\OrderHook'
  ],
   'classes_order_cancel_after' => [         // 订单取消后
    'app\\common\\listener\\classesorder\\OrderHook'
  ],

  'classes_order_finish_after' => [        // 订单完成后
     'app\\common\\listener\\classesorder\\OrderHook'
  ],

    'classes_order_evaluate_after'=> [        // 订单评价后
        'app\\common\\listener\\classesorder\\OrderHook'
    ],

    'classes_order_evaluate_update_after'=> [        // 订单评价修改后
        'app\\common\\listener\\classesorder\\OrderHook'
    ],

];


//课时订单事件钩子
$hourHooks = [
    // 订单创建
    'classeshour_order_create_before' => [       // 订单创建前
        'app\\common\\listener\\classeshourorder\\OrderHook'
    ],
    'classeshour_order_create_after' => [        // 订单创建后
        'app\\common\\listener\\classeshourorder\\OrderHook'
    ],
    'classeshour_order_update_after' => [        // 订单变更课时后
        'app\\common\\listener\\classeshourorder\\OrderHook'
    ],
    'classeshour_order_auth_success_after' => [        // 订单审核通过后
        'app\\common\\listener\\classeshourorder\\OrderHook'
    ],
    'classeshour_order_auth_fail_after' => [        // 订单审核失败后
        'app\\common\\listener\\classeshourorder\\OrderHook'
    ],
    'classeshour_order_finish_after' => [        // 订单核销完成后
        'app\\common\\listener\\classeshourorder\\OrderHook'
    ],
    'classeshour_order_cancel_after' => [         // 订单取消后
        'app\\common\\listener\\classeshourorder\\OrderHook'
    ],
];



//机构审核事件钩子
$manystoreHooks = [
    // 订单创建
    'shop_create_after' => [        // 机构账号创建成功后（审核之前）
        'app\\common\\listener\\manystore\\ShopHook'
    ],
    'shop_apply_after' => [        // 机构账号提交审核申请后
        'app\\common\\listener\\manystore\\ShopHook'
    ],
    'shop_auth_success_after' => [        // 机构审核通过后
        'app\\common\\listener\\manystore\\ShopHook'
    ],
    'shop_auth_fail_after' => [        // 机构审核失败后
        'app\\common\\listener\\manystore\\ShopHook'
    ],
    'shop_update_after' => [        // 机构数据变更
        'app\\common\\listener\\manystore\\ShopHook'
    ],
];



//课程审核事件钩子
$classesHooks = [
    // 订单创建
    'classes_auth_need_after' => [        // 课程审核提交
        'app\\common\\listener\\classes\\ClassesHook'
    ],
    'classes_auth_success_after' => [        // 课程审核通过后
        'app\\common\\listener\\classes\\ClassesHook'
    ],
    'classes_auth_fail_after' => [        // 课程审核失败后
        'app\\common\\listener\\classes\\ClassesHook'
    ],
    'classes_view_after' => [        // 课程触发浏览后
        'app\\common\\listener\\classes\\ClassesHook'
    ],
    'classes_collect_success_after' => [        // 课程收藏后
        'app\\common\\listener\\classes\\ClassesHook'
    ],
    'classes_collect_cancel_after' => [        // 课程取消收藏后
        'app\\common\\listener\\classes\\ClassesHook'
    ],


];



//用户事件钩子
$userHooks = [
    'user_auth_need_after' => [           // 发起用户授权
        'app\\common\\listener\\user\\UserHook'
    ],
    'user_auth_success_after' => [        // 用户授权机构通过
        'app\\common\\listener\\user\\UserHook'
    ],
    'user_auth_fail_after' => [        // 用户授权机构不通过
        'app\\common\\listener\\user\\UserHook'
    ],
    'user_update_after' => [           // 用户信息更新后
        'app\\common\\listener\\user\\UserHook'
    ],
];


//售后事件钩子
$serviceHooks = [
  // 订单创建
  'classes_serviceorder_create_after' => [       // 售后单创建后
      'app\\common\\listener\\serviceorder\\OrderHook'
  ],

   'classes_serviceorder_cancel_after' => [         // 订单取消后
    'app\\common\\listener\\serviceorder\\OrderHook'
  ],
    'classes_serviceorder_shop_confirm_after'=> [         // 课程订单售后机构处理后
    'app\\common\\listener\\serviceorder\\OrderHook'
  ],
  'classes_serviceorder_shop_reject_after'=> [         // 课程订单售后机构驳回后
    'app\\common\\listener\\serviceorder\\OrderHook'
  ],
  'classes_serviceorder_user_confirm_after'=> [         // 课程订单售后机构处理后
    'app\\common\\listener\\serviceorder\\OrderHook'
  ],
  'classes_serviceorder_user_reject_after'=> [         // 课程订单售后机构驳回后
    'app\\common\\listener\\serviceorder\\OrderHook'
  ],


  'classes_serviceorder_system_confirm_after'=> [         // 课程订单售后机构处理后
    'app\\common\\listener\\serviceorder\\OrderHook'
  ],

  'classes_serviceorder_system_reject_after'=> [         // 课程订单售后机构驳回后
    'app\\common\\listener\\serviceorder\\OrderHook'
  ],

];



//活动审核事件钩子
$activityHooks = [
    // 订单创建
    'activity_auth_need_after' => [        // 活动审核提交
        'app\\common\\listener\\classes\\ActivityHook'
    ],
    'activity_auth_success_after' => [        // 活动审核通过后
        'app\\common\\listener\\classes\\ActivityHook'
    ],
    'activity_auth_fail_after' => [        // 活动审核失败后
        'app\\common\\listener\\classes\\ActivityHook'
    ],
    'activity_view_after' => [        // 活动触发浏览后
        'app\\common\\listener\\classes\\ActivityHook'
    ],
    'activity_collect_success_after' => [        // 活动收藏后
        'app\\common\\listener\\classes\\ActivityHook'
    ],
    'activity_collect_cancel_after' => [        // 活动取消收藏后
        'app\\common\\listener\\classes\\ActivityHook'
    ],

];



$activityOrderHooks = [
    // 订单创建
    'classes_activity_order_create_before' => [       // 订单创建前
        'app\\common\\listener\\activityorder\\OrderHook'
    ],
    'classes_activity_order_create_after' => [        // 订单创建后
        'app\\common\\listener\\activityorder\\OrderHook'
    ],
    'classes_activity_order_payed_after' => [        // 订单支付成功
        'app\\common\\listener\\activityorder\\OrderHook'
    ],
    'classes_activity_order_cancel_after' => [         // 订单取消后
        'app\\common\\listener\\activityorder\\OrderHook'
    ],
    'classes_activity_order_auth_success_after' => [         // 订单审核通过后
        'app\\common\\listener\\activityorder\\OrderHook'
    ],
    'classes_activity_order_auth_fail_after' => [         // 订单审核失败后
        'app\\common\\listener\\activityorder\\OrderHook'
    ],

    'classes_activity_order_refund_success_after'=> [         // 订单审核失败后退款成功
        'app\\common\\listener\\activityorder\\OrderHook'
    ],
    'classes_activity_order_refund_fail_after'=> [         // 订单审核失败后退款成功
        'app\\common\\listener\\activityorder\\OrderHook'
    ],
    'classes_activity_order_finish_after' => [        // 订单完成后
        'app\\common\\listener\\activityorder\\OrderHook'
    ],

//
//    'classes_order_finish_after' => [        // 订单完成后
//        'app\\common\\listener\\classesorder\\OrderHook'
//    ],
//
//    'classes_order_evaluate_after'=> [        // 订单评价后
//        'app\\common\\listener\\classesorder\\OrderHook'
//    ],
//
//    'classes_order_evaluate_update_after'=> [        // 订单评价修改后
//        'app\\common\\listener\\classesorder\\OrderHook'
//    ],

];

//活动审核事件钩子
$helpHooks = [
    'help_article_view_after' => [        // 活动触发浏览后
        'app\\common\\listener\\help\\HelpHook'
    ],
];



//
//if (file_exists(ROOT_PATH . 'addons/shopro/listener/commission')) {
//  $defaultHooks = array_merge_recursive($defaultHooks, $commissionHooks);
//}
$defaultHooks = array_merge_recursive($defaultHooks, $hourHooks);
$defaultHooks = array_merge_recursive($defaultHooks, $manystoreHooks);
$defaultHooks = array_merge_recursive($defaultHooks, $classesHooks);
$defaultHooks = array_merge_recursive($defaultHooks, $userHooks);
$defaultHooks = array_merge_recursive($defaultHooks, $serviceHooks);

$defaultHooks = array_merge_recursive($defaultHooks, $activityHooks);
$defaultHooks = array_merge_recursive($defaultHooks, $activityOrderHooks);
$defaultHooks = array_merge_recursive($defaultHooks, $helpHooks);




return $defaultHooks;
