// Path: app/src/main/java/com/tryouts/courierapplication/fragments/PreviousOrdersFragment.java
// public class PreviousOrdersFragment extends Fragment {
// 
//     private ListView mListView;
//     private PreviousOrderPresenter mPresenter;
// 
//     @Override
//     public void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//     }
// 
//     @Override
//     public View onCreateView(LayoutInflater inflater, ViewGroup container,
//                              Bundle savedInstanceState) {
//         return inflater.inflate(R.layout.fragment_previous_orders, container, false);
//     }
// 
//     @Override
//     public void onViewCreated(View view, Bundle savedInstanceState) {
//         mListView = (ListView) view.findViewById(R.id.previous_orders_listview);
// 
//         mPresenter = new PreviousOrderPresenter(this);
//         mPresenter.initialize();
//     }
// 
//     public Context getFragmentContext() {
//         return getContext();
//     }
// 
//     public void setListViewWithAdapter(OrdersAdapter ordersAdapter) {
//         mListView.setAdapter(ordersAdapter);
//     }
// 
//     @Override
//     public void onDestroy() {
//         super.onDestroy();
//         mPresenter.detachView();
//     }
// }
// 
// Path: app/src/main/java/com/tryouts/courierapplication/interactors/PreviousOrderInteractor.java
// public class PreviousOrderInteractor {
// 
//     private PreviousOrderPresenter mPresenter;
//     private Context context;
//     private OrdersAdapter mOrdersAdapter;
// 
//     public PreviousOrderInteractor(PreviousOrderPresenter presenter) {
//         this.mPresenter = presenter;
//     }
// 
//     public void fetchPreviousOrdersData() {
//         FirebaseOpsHelper fbHelper = new FirebaseOpsHelper();
//         fbHelper.onPreviousOrdersCall(this);
//     }
// 
//     public void onReceivedPreviousOrdersData(ArrayList<OrderReceived> orderList) {
//         mPresenter.sendContext();
//         mOrdersAdapter = new OrdersAdapter(orderList, context);
//         mPresenter.onAdapterReady();
//     }
// 
//     public void setInteractorContext(Context context) {
//         this.context = context;
//     }
// 
//     public OrdersAdapter sendOrdersAdapter() {
//         return mOrdersAdapter;
//     }
// 
// }


import com.tryouts.courierapplication.fragments.PreviousOrdersFragment;
import com.tryouts.courierapplication.interactors.PreviousOrderInteractor;
package com.tryouts.courierapplication.presenters;



public class PreviousOrderPresenter {

    private PreviousOrdersFragment mView;
    private PreviousOrderInteractor mInteractor;

    public PreviousOrderPresenter(PreviousOrdersFragment fragment) {
        this.mView = fragment;
        this.mInteractor = new PreviousOrderInteractor(this);
    }

    public void initialize() {
        mInteractor.fetchPreviousOrdersData();
    }

// Path: app/src/main/java/com/tryouts/courierapplication/fragments/PreviousOrdersFragment.java
// public class PreviousOrdersFragment extends Fragment {
// 
//     private ListView mListView;
//     private PreviousOrderPresenter mPresenter;
// 
//     @Override
//     public void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//     }
// 
//     @Override
//     public View onCreateView(LayoutInflater inflater, ViewGroup container,
//                              Bundle savedInstanceState) {
//         return inflater.inflate(R.layout.fragment_previous_orders, container, false);
//     }
// 
//     @Override
//     public void onViewCreated(View view, Bundle savedInstanceState) {
//         mListView = (ListView) view.findViewById(R.id.previous_orders_listview);
// 
//         mPresenter = new PreviousOrderPresenter(this);
//         mPresenter.initialize();
//     }
// 
//     public Context getFragmentContext() {
//         return getContext();
//     }
// 
//     public void setListViewWithAdapter(OrdersAdapter ordersAdapter) {
//         mListView.setAdapter(ordersAdapter);
//     }
// 
//     @Override
//     public void onDestroy() {
//         super.onDestroy();
//         mPresenter.detachView();
//     }
// }
// 
// Path: app/src/main/java/com/tryouts/courierapplication/interactors/PreviousOrderInteractor.java
// public class PreviousOrderInteractor {
// 
//     private PreviousOrderPresenter mPresenter;
//     private Context context;
//     private OrdersAdapter mOrdersAdapter;
// 
//     public PreviousOrderInteractor(PreviousOrderPresenter presenter) {
//         this.mPresenter = presenter;
//     }
// 
//     public void fetchPreviousOrdersData() {
//         FirebaseOpsHelper fbHelper = new FirebaseOpsHelper();
//         fbHelper.onPreviousOrdersCall(this);
//     }
// 
//     public void onReceivedPreviousOrdersData(ArrayList<OrderReceived> orderList) {
//         mPresenter.sendContext();
//         mOrdersAdapter = new OrdersAdapter(orderList, context);
//         mPresenter.onAdapterReady();
//     }
// 
//     public void setInteractorContext(Context context) {
//         this.context = context;
//     }
// 
//     public OrdersAdapter sendOrdersAdapter() {
//         return mOrdersAdapter;
//     }
// 
// }


// Path: app/src/main/java/com/tryouts/courierapplication/presenters/PreviousOrderPresenter.java
import com.tryouts.courierapplication.fragments.PreviousOrdersFragment;
import com.tryouts.courierapplication.interactors.PreviousOrderInteractor;

package com.tryouts.courierapplication.presenters;



public class PreviousOrderPresenter {

    private PreviousOrdersFragment mView;
    private PreviousOrderInteractor mInteractor;

    public PreviousOrderPresenter(PreviousOrdersFragment fragment) {
        this.mView = fragment;
        this.mInteractor = new PreviousOrderInteractor(this);
    }

    public void initialize() {
        mInteractor.fetchPreviousOrdersData();
    }

    public void sendContext() {