package com.sckw.transport.model.vo;

import com.sckw.transport.model.enuma.WaybillTimelinePhaseEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.util.List;

/**
 * @author system
 * @description 运单节点轨迹VO
 * @date 2025-06-24
 */
@Data
@Schema(description = "运单节点轨迹响应对象")
public class WaybillOrderNodeVo implements Serializable {
    /**
     * 运单节点轨迹
     */
    @Schema(description = "运单节点轨迹")
    private List<WaybillOrderNode> waybillOrderNodes;
    /**
     * 时间线
     */
    @Schema(description = "时间线")
    private List<Timeline> timelines;
    @Serial
    private static final long serialVersionUID = 1L;


    @Data
    public static class Timeline implements Serializable{
        @Serial
        private static final long serialVersionUID = -3995085472087958354L;
        /**
         * 节点ID
         */
        @Schema(description = "节点ID")
        private Long id;

        /**
         * 时间
         */
        @Schema(description = "操作时间，格式：yyyy-MM-dd HH:mm:ss")
        private String createTime;

        /**
         * 运单状态
         */
        @Schema(description = "运单状态码")
        private Integer orderStatus;
        /**
         * 状态码描述
         */
        @Schema(description = "状态码描述")
        private String orderStatusName;

        /**
         * 备注
         */
        @Schema(description = "备注")
        private String remark;

        /**
         * 车牌号
         */
        @Schema(description = "车牌号")
        private String truckNo;

        /**
         * 司机名称
         */
        @Schema(description = "司机名称")
        private String driverName;

        /**
         * 地磅名称
         */
        @Schema(description = "地磅名称")
        private String weighbridgeName;

        /**
         * 地址
         */
        @Schema(description = "地址，如：四川省成都市新都区新都大道")
        private String address;

        /**
         * 经度
         */
        @Schema(description = "经度")
        private String lng;

        /**
         * 纬度
         */
        @Schema(description = "纬度")
        private String lat;

        /**
         * 是否过磅
         */
        @Schema(description = "是否过磅")
        private Boolean hasWeighbridge;

        /**
         * 图片路径
         */
        @Schema(description = "过磅图片路径")
        private String imageUrl;
        /**
         * 卸货凭证
         */
        @Schema(description = "卸货凭证")
        private String credential;

    }
    @Data
    public static class WaybillOrderNode implements Serializable{
        @Serial
        private static final long serialVersionUID = 4006243555652895243L;
        /**
         * 节点ID
         */
        @Schema(description = "节点ID")
        private Long id;

        /**
         * 时间
         */
        @Schema(description = "操作时间，格式：yyyy-MM-dd HH:mm:ss")
        private String createTime;

        /**
         * 状态序号：接口返回前会按 {@link WaybillTimelinePhaseEnum} 映射为前端五步序号 1~5；无法映射时仍为原始运单状态码
         */
        @Schema(description = "状态序号：1已接单 2到达装货点 3已装货 4已离场 5已卸货（无法映射时为原始运单状态码）")
        private Integer orderStatus;
        /**
         * 状态名称：映射后为前端五步文案；无法映射时仍为运单状态原始描述
         */
        @Schema(description = "状态名称（映射后与 orderStatus 对应五步文案）")
        private String orderStatusName;
    }
}
