<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="sales_order_save_after">
        <observer name="simplyin_order_status_change" instance="Simplyin\Payment\Observer\OrderStatusChange" />
    </event>
    
    <!-- Sync tracking info when shipment track is added -->
    <event name="sales_order_shipment_track_save_after">
        <observer name="simplyin_shipment_track_save" instance="Simplyin\Payment\Observer\ShipmentTrackSaveAfter" />
    </event>
    
    <!-- Create Simply.IN account and order for SimplyIN payment method -->
    <event name="checkout_onepage_controller_success_action">
        <observer name="simplyin_create_account_on_order" instance="Simplyin\Payment\Observer\CreateSimplyinAccountOnOrder" />
    </event>
    
    <!-- Create Simply.IN account for any payment method when user opts in -->
    <event name="checkout_submit_all_after">
        <observer name="simplyin_create_account_on_any_order" instance="Simplyin\Payment\Observer\CreateSimplyinAccountOnAnyOrder" />
    </event>
    
    <!-- Copy pickup point extension attributes from Quote to Order -->
    <event name="sales_model_service_quote_submit_before">
        <observer name="simplyin_copy_pickup_point_to_order" instance="Simplyin\Payment\Observer\CopyPickupPointToOrder" />
    </event>
</config>
