/*
 * Arrebol Consultancy copyright.
 * 
 * This code belongs to Arrebol Consultancy
 * its use, redistribution or modification are prohibited 
 * without written authorization from Arrebol Consultancy.
 */
package com.arrebol.taxiservicios.controller.stocktaking;

import com.arrebol.taxiservicios.model.catalog.Location;
import com.arrebol.taxiservicios.model.enums.StopNotificationType;
import com.arrebol.taxiservicios.model.stocktaking.ServiceOrder;
import com.arrebol.taxiservicios.model.stocktaking.ServiceOrderHasProduct;
import com.arrebol.taxiservicios.model.stocktaking.ServiceOrderNotification;
import com.arrebol.taxiservicios.model.stocktaking.ServiceOrderNotificationDeliveryTo;
import java.util.Date;
import java.util.List;

/**
 *
 * @author Carlos Janitzio Zavala Lopez <janitzio.zavala@arrebol.com.mx>
 */
public interface ServiceOrderService {

    /**
     *
     * @param operation 1 = Update service order<br/>2 = Approve service order 3
     * = Delete service order, 4 = Change status to PROGRESS, 5 = Change status
     * to FINISH
     * @param orderId
     * @param orderHasProducts
     * @param so
     * @param userId
     * @param taxiId
     * @param km
     * @param kmMaintenance
     * @param location
     * @return
     */
    public boolean workWithServiceOrder(int operation,
            String orderId, List<ServiceOrderHasProduct> orderHasProducts,
            ServiceOrder so, String userId, String taxiId, Float km, Float kmMaintenance, Location location);

    /**
     *
     * @param notification
     */
    public void saveServiceOrderNotification(ServiceOrderNotification notification);

    /**
     *
     * @param userId
     * @param permissionLst
     * @param stopNotificationType
     * @return
     */
    public List<String> findAllUsersByPermissionHowWillReciveNotification(String userId,
            List<String> permissionLst, StopNotificationType stopNotificationType);

    /**
     *
     * @param deliveryToLst
     */
    public void sendNotifications(List<ServiceOrderNotificationDeliveryTo> deliveryToLst);

    /**
     *
     * @param driverId
     * @param startDate
     * @param endDate
     * @return
     */
    public List<ServiceOrder> findRangeOfDateFromOrderByDriverIdBetweenStartAndEndDate(String driverId, Date startDate, Date endDate);

}
