package com.erp.warehouse.dto;

import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;
import lombok.Builder;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 入库单DTO
 */
public class InboundOrderDTO {

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @Builder
    public static class CreateRequest {
        private String inboundType; // purchase / return / transfer
        private Long warehouseId;
        private String relatedNo;
        private Long supplierId;
        private String supplierName;
        private String remark;
        private LocalDateTime expectedTime;
        private List<ItemRequest> items;
    }

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @Builder
    public static class ItemRequest {
        private String skuCode;
        private String skuName;
        private Integer planQuantity;
    }

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @Builder
    public static class ConfirmRequest {
        private List<ConfirmItem> items;
        private String remark;
    }

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @Builder
    public static class ConfirmItem {
        private String skuCode;
        private Integer acceptedQuantity;
        private Integer defectiveQuantity;
    }

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @Builder
    public static class InboundOrderVO {
        private Long id;
        private String inboundNo;
        private String inboundType;
        private String inboundTypeLabel;
        private Long warehouseId;
        private String warehouseName;
        private String relatedNo;
        private Long supplierId;
        private String supplierName;
        private String status;
        private String statusLabel;
        private String remark;
        private LocalDateTime expectedTime;
        private LocalDateTime inboundTime;
        private LocalDateTime createTime;
    }
}
