package com.rthoni.camotion.business;

import com.luticate.utils.business.LuBusinessManager;
import com.luticate.utils.business.LuPromise;
import com.luticate.utils.dbo.LuDataAccessConfigDbo;
import com.luticate.utils.dbo.LuVoidDbo;
import com.rthoni.camotion.dataaccess.CommandsDataAccess;
import com.rthoni.camotion.dbo.CommandDbo;

/**
 * Created by robin on 12/3/15.
 */
public class CommandsBusiness extends LuBusinessManager {
    public static LuPromise<CommandDbo.MultipleCommandDbo> getAll(LuDataAccessConfigDbo config, int page, int perPage)
    {
        return CommandsDataAccess.getAll(config, page, perPage);
    }

    public static LuPromise<LuVoidDbo> exec(LuDataAccessConfigDbo config, int commandId)
    {
        return CommandsDataAccess.exec(config, commandId);
    }

    public static LuPromise<LuVoidDbo> exec(LuDataAccessConfigDbo config, CommandDbo command)
    {
        return exec(config, command.getId());
    }
}
