package com.heyu.api.data.service.impl.order;

import com.heyu.api.data.entity.vv.VvTradeOrderLineEntity;
import com.heyu.api.data.enums.ActionEnums;
import com.heyu.api.data.enums.OrderStatusEnums;
import com.heyu.api.data.service.impl.AbstractOrderAction;

public class CancelAction extends AbstractOrderAction {
    @Override
    public ActionEnums getAction(VvTradeOrderLineEntity vvTradeOrderLineEntity, boolean isApp) {
        if (
                OrderStatusEnums.wait_shipping.getStatus().equals(vvTradeOrderLineEntity.getStatus())
        ) {
            if (isApp) {
                return ActionEnums.App_Apply_Cancel;
            }

            return ActionEnums.Admin_Cancel;
        }
        return null;
    }
}
