package cn.newfeifan.mall.module.trade.controller.admin.order.vo;

import cn.newfeifan.mall.framework.common.enums.TerminalEnum;
import cn.newfeifan.mall.framework.common.pojo.PageParam;
import cn.newfeifan.mall.framework.common.validation.InEnum;
import cn.newfeifan.mall.framework.common.validation.Mobile;
import cn.newfeifan.mall.module.trade.enums.order.TradeOrderStatusEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

import static cn.newfeifan.mall.framework.common.util.date.DateUtils.*;

@Schema(description = "管理后台 - 交易订单的分页 Request VO")
@Data
public class TradeOrderPageReqVO extends PageParam {

    @Schema(description = "订单号", example = "88888888")
    private String no;

    @Schema(description = "用户编号", example = "1024")
    private Long userId;

    @Schema(description = "用户昵称", example = "小王")
    private String userNickname;

    @Schema(description = "用户手机号", example = "小王")
    @Mobile
    private String userMobile;

    @Schema(description = "配送方式", example = "1")
    private Integer deliveryType;

    @Schema(description = "发货物流公司编号", example = "1")
    private Long logisticsId;

    @Schema(description = "自提门店编号", example = "[1,2]")
    private List<Long> pickUpStoreIds;

    @Schema(description = "自提核销码", example = "12345678")
    private String pickUpVerifyCode;

    @Schema(description = "订单类型", example = "1")
    private Integer type;

    @Schema(description = "订单状态", example = "1")
    @InEnum(value = TradeOrderStatusEnum.class, message = "订单状态必须是 {value}")
    private Integer status;

    @Schema(description = "支付渠道", example = "wx_lite")
    private String payChannelCode;

    @Schema(description = "创建时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime[] createTime;

    @Schema(description = "订单来源", example = "10")
    @InEnum(value = TerminalEnum.class, message = "订单来源 {value}")
    private Integer terminal;

    @Schema(description = "店铺id", example = "20588")
    private Long shopId;


    @Schema(description = "用户类型", example = "1")
    private Long categoryId;

    @Schema(description = "商户ID", example = "1")
    private Long  merchantId;

    @Schema(description = "店铺编号集")
    private List<Long> shopIds;
    @Schema(description = "支付积分")
    private Long payIntegral;

    @Schema(description = "用户获得积分")
    private Long increaseIntegral;

    @Schema(description = "退还的使用的积分")
    private Long refundIntegral;

    @Schema(description = "实付人民币，单位：分")
    private Integer payRmb;

    @Schema(description = "订阅物流信息，未订阅是0，已订阅是1", requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer subscriptionLogisticsInfo;

    @Schema(description = "物流签收时间")
    private LocalDateTime receivingTime;

    @Schema(description = "发货备注", example = "你猜")
    private String deliveryRemark;

    @Schema(description = "发货信息附件")
    private String attachment;

    @Schema(description = "订单账单日期")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
    private LocalDate orderCalcTime;

    @Schema(description = "支付状态")
    private Integer payStatus;

    @Schema(description = "店铺结算单ID")
    private Long shopSettlementId;

}
