package com.erp.waybill.dto;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 运单申请请求
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class WaybillApplyRequest {

    @NotNull(message = "订单ID不能为空")
    private Long orderId;

    @NotBlank(message = "快递编码不能为空")
    private String expressCode;

    /**
     * 收件人信息（优先使用，若不传则从订单获取）
     */
    private ReceiverInfo receiver;

    /**
     * 发件人信息（优先使用，若不传则从订单获取）
     */
    private SenderInfo sender;

    @Data
    public static class ReceiverInfo {
        private String name;
        private String phone;
        private String address;
    }

    @Data
    public static class SenderInfo {
        private String name;
        private String phone;
        private String address;
    }
}
