package com.erp.waybill.dto;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**
 * 运单响应DTO
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@JsonInclude(JsonInclude.Include.NON_NULL)
public class WaybillResponse {

    private Long id;
    private Long orderId;
    private String expressCode;
    private String waybillNo;
    private String printContent;
    private String status;
    private String statusLabel;
    private LocalDateTime usedAt;
    private LocalDateTime cancelledAt;
    private String cancelReason;
    private LocalDateTime voidedAt;
    private String voidReason;
    private Long tenantId;
    private LocalDateTime createdAt;
    private LocalDateTime updatedAt;

    // 运单状态跟踪信息
    private WaybillStatusResponse tracking;

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    @JsonInclude(JsonInclude.Include.NON_NULL)
    public static class WaybillStatusResponse {
        private String status;
        private String statusLabel;
        private String location;
        private String description;
        private LocalDateTime lastTraceTime;
        private LocalDateTime signedTime;
        private String receiverName;
        private String receiverPhone;
    }
}
