package org.ta.pddserver.model.api.request;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.List;

@Data
public class PackageCompleteRequest {

    @Schema(
            description = "集运单号",
            example = "P12345678",
            defaultValue = "",
            requiredMode = Schema.RequiredMode.REQUIRED // 必填
    )
    private String orderCode;

    @Schema(
            description = "订单信息列表",
            example = "",
            defaultValue = "",
            requiredMode = Schema.RequiredMode.REQUIRED // 必填
    )
    private List<OutPackage> outPackageList;

    /**
     * 包裹详情
     */
    @Data
    public static class OutBoundList {
        @Schema(
                description = "运单号",
                example = "P12345678",
                defaultValue = "",
                requiredMode = Schema.RequiredMode.REQUIRED // 必填
        )
        private String mailNo;


    }

    @Data
    public static class OutPackage {
        @Schema(
                description = "包裹长度，单位默认为厘米",
                example = "1",
                defaultValue = "",
                requiredMode = Schema.RequiredMode.REQUIRED // 必填
        )
        private Integer length;

        @Schema(
                description = "包裹宽度，单位默认为厘米",
                example = "1",
                defaultValue = "",
                requiredMode = Schema.RequiredMode.REQUIRED // 必填
        )
        private Integer width;

        @Schema(
                description = "包裹高度，单位默认为厘米",
                example = "1",
                defaultValue = "",
                requiredMode = Schema.RequiredMode.REQUIRED // 必填
        )
        private Integer height;

        @Schema(
                description = "实重重量，单位默认为克",
                example = "1",
                defaultValue = "",
                requiredMode = Schema.RequiredMode.REQUIRED // 必填
        )
        private Integer weight;

        @Schema(
                description = "包裹种类",
                example = "1",
                defaultValue = "",
                requiredMode = Schema.RequiredMode.REQUIRED // 必填
        )
        private String packageType;

        @Schema(
                description = "运单号",
                example = "P1234567",
                defaultValue = "",
                requiredMode = Schema.RequiredMode.REQUIRED // 必填
        )
        private String mailNo;

        @Schema(
                description = "包裹关联原快递包裹单号，多拆少时必填",
                example = "[\"SF000001\"]",
                defaultValue = "",
                requiredMode = Schema.RequiredMode.NOT_REQUIRED // 非必填
        )
        private List<String> outBound;

        private String orderType;
    }
}
