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

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

/**
 * 门店同城配送信息
 * @author xiaohei
 * @date 2024/1/31
 */
@Data
public class IntracityExpressCreateStoreRequest {

    @JsonProperty("out_store_id")
    @ApiModelProperty("自定义门店编号")
    private String out_store_id;

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

    @JsonProperty("order_pattern")
    @ApiModelProperty("运力偏好（1：价格优先，2：运力优先）默认价格优先")
    private String order_pattern;

    @JsonProperty("service_trans_prefer")
    @ApiModelProperty("优先使用的运力ID,order_pattern = 2时必填")
    private String service_trans_prefer;

    @JsonProperty("address_info")
    @ApiModelProperty("门店地址信息")
    private AddressInfo address_info;

    @Data
    public static class AddressInfo{

        @ApiModelProperty("省/自治区/直辖市")
        private String province;

        @ApiModelProperty("地级市")
        private String city;

        @ApiModelProperty("县/县级市/区")
        private String area;

        @ApiModelProperty("街道")
        private String street;

        @ApiModelProperty("具体门牌号或详细地址")
        private String house;

        @ApiModelProperty("门店所在地纬度")
        private Double lat;

        @ApiModelProperty("门店所在地经度")
        private Double lng;

        @ApiModelProperty("门店联系电话")
        private String phone;
    }

    public String toJson() {
        return WxMaGsonBuilder.create().toJson(this);
    }
}
