package com.cool.store.request;

import com.cool.store.common.PageBasicInfo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Arrays;
import java.util.List;

/**
 * @Auther zx_szh
 * @Date 2026/4/10 16:37
 * @Version 1.0
 */
@Data
public class AdjustmentSpecialPageRequest extends PageBasicInfo {

    @ApiModelProperty("费用单据类型 费用单类型 1-费用单 2-调整单")
    private Integer expenseSheetType;

    @ApiModelProperty("单据状态")
    private Integer status;

    @ApiModelProperty("业务类型")
    private String businessTypeCode;

    private String storeId;

    public static AdjustmentOrderPageRequest convert(AdjustmentSpecialPageRequest request){
        AdjustmentOrderPageRequest adjustmentOrderPageRequest = new AdjustmentOrderPageRequest();
        adjustmentOrderPageRequest.setExpenseSheetType(request.getExpenseSheetType());
        adjustmentOrderPageRequest.setStoreId(request.getStoreId());
        if (request.getStatus()!=null){
            adjustmentOrderPageRequest.setStatusList(Arrays.asList(request.getStatus()));
        }
        adjustmentOrderPageRequest.setBusinessTypeCode(request.getBusinessTypeCode());
        return adjustmentOrderPageRequest;
    }

}
