package com.yiqi.core.domain.vo.wx;

import cn.binarywang.wx.miniapp.json.WxMaGsonBuilder;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;

/**
 * @author xiaohei
 * @date 2024/2/15
 */
@Data
public class IntracityExpressOrderInfoResult extends IntracityExpressBaseResult{

    @ApiModelProperty("订单状态")
    @JsonProperty("order_status")
    private Integer order_status;

    @ApiModelProperty("收件用户openid")
    @JsonProperty("user_openid")
    private String user_openid;

    @ApiModelProperty("运力ID")
    @JsonProperty("service_trans_id")
    private String service_trans_id;

    @ApiModelProperty("运力订单号")
    @JsonProperty("delivery_no")
    private String delivery_no;

    @ApiModelProperty("配送距离")
    @JsonProperty("distance")
    private BigDecimal distance;

    @ApiModelProperty("实际支付费用")
    private Integer actualfee;

    @ApiModelProperty("违约金")
    private Integer deductfee;

    @ApiModelProperty("发单时间")
    @JsonProperty("create_time")
    private Integer create_time;

    @ApiModelProperty("配送员接单时间")
    @JsonProperty("accept_time")
    private Integer accept_time;

    @ApiModelProperty("配送员取货时间")
    @JsonProperty("fetch_time")
    private Integer fetch_time;

    @ApiModelProperty("配送员送达时间")
    @JsonProperty("finish_time")
    private Integer finish_time;

    @ApiModelProperty("取消时间")
    @JsonProperty("cancel_time")
    private Integer cancel_time;

    @ApiModelProperty("预期送达时间")
    @JsonProperty("expected_finish_time")
    private Integer expected_finish_time;

    @JsonProperty("transporter_info")
    @ApiModelProperty("配送员信息")
    private TranspoterInfo transporter_info;

    @JsonProperty("store_info")
    @ApiModelProperty("门店信息")
    private StoreInfo store_info;

    @JsonProperty("receiver_info")
    @ApiModelProperty("收获人信息")
    private ReceiverInfo receiver_info;



    @Data
    public static class TranspoterInfo{
        @JsonProperty("transporter_name")
        @ApiModelProperty("配送员姓名")
        private String transporter_name;

        @JsonProperty("transporter_phone")
        @ApiModelProperty("配送员电话")
        private String transporter_phone;
    }

    @Data
    public static class StoreInfo{

        @JsonProperty("store_name")
        @ApiModelProperty("门店名称")
        private String store_name;

        @ApiModelProperty("门店详细地址")
        private String address;

        @JsonProperty("phone_num")
        @ApiModelProperty("门店电话")
        private String phone_num;
    }

    @Data
    public static class ReceiverInfo{
        @JsonProperty("receiver_name")
        @ApiModelProperty("收件人姓名")
        private String receiver_name;

        @ApiModelProperty("门店详细地址")
        private String address;

        @JsonProperty("phone_num")
        @ApiModelProperty("门店电话")
        private String phone_num;

    }

    public static IntracityExpressOrderInfoResult fromJson(String json) {
        return WxMaGsonBuilder.create().fromJson(json, IntracityExpressOrderInfoResult.class);
    }
}
