package in.techware.carrefour.util.menuUtils;

import in.techware.carrefour.R;
import in.techware.carrefour.model.MenuBean;
import in.techware.carrefour.model.MenuListBean;
import in.techware.carrefour.util.AppConstants;

/**
 * Created by Jemsheer K D on 14 July, 2018.
 * Package in.techware.carrefour.util.menuUtils
 * Project Carrefour
 */
public class ELIEMenuUtil {

    public static final String CODE_EXPIRY_CAPTURE = "1";
    public static final String CODE_EXPIRED_ACTION = "2";
    public static final String CODE_RESTORE = "3";
    public static final String CODE_EXIT = "4";

    public static MenuListBean getAllMenu() {
        return BaseMenuUtil.getAllMenu(R.array.menu_elie);
    }


    public static String getFileName(MenuBean menuBean, int type) {
        switch (menuBean.getCode()) {
            case ELIEMenuUtil.CODE_EXPIRY_CAPTURE:
                return AppConstants.addWorkFolderPrefix(AppConstants.FILE_PREFIX_ITEM_EXPIRY);
            case ELIEMenuUtil.CODE_EXPIRED_ACTION:
                return AppConstants.addWorkFolderPrefix(AppConstants.FILE_PREFIX_EXPIRED_ACTION);
            case ELIEMenuUtil.CODE_RESTORE:
                if (type == AppConstants.ELIE_RESTORE_TYPE_EXPIRY_CAPTURE) {
                    return AppConstants.addSentFolderPrefix(AppConstants.FILE_PREFIX_ITEM_EXPIRY);
                } else if (type == AppConstants.ELIE_RESTORE_TYPE_EXPIRED_ACTION) {
                    return AppConstants.addSentFolderPrefix(AppConstants.FILE_PREFIX_EXPIRED_ACTION);
                } else {
                    return "";
                }
            case ELIEMenuUtil.CODE_EXIT:
            default:
                return "";
        }
    }
}
