package com.ningdatech.pmapi.projectdeclared.model.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @Classname Purchase
 * @Description
 * @Date 2023/5/29 10:00
 * @Author PoffyZhang
 */
@Data
@ApiModel(value = "采购对象", description = "采购对象")
@AllArgsConstructor
public class PurchaseSaveDTO {

    @ApiModelProperty("项目ID")
    @NotNull(message = "请传项目ID")
    private Long projectId;

    @NotEmpty(message = "标段信息不能为空")
    private List<TenderDTO> tenders;

    @Data
    public static class TenderDTO {

        @ApiModelProperty("标段ID")
        private Long id;

        @ApiModelProperty("供应商")
        private String supplier;

        @ApiModelProperty("供应商联系人")
        private String supplierContact;

        @ApiModelProperty("供应商联系方式")
        private String supplierContactInfo;

        @ApiModelProperty("采购方式 1公开招标 2自行采购")
        private Integer purchaseMethod;

        @ApiModelProperty("成交金额")
        private BigDecimal transactionAmount;

        @ApiModelProperty("成交时间")
        @JsonFormat(pattern = "yyyy-MM-dd")
        private LocalDateTime transactionTime;

        @ApiModelProperty("代理机构")
        private String agency;

        @ApiModelProperty("投标文件")
        private String biddingDoc;

        @ApiModelProperty("招标文件")
        private String bidDoc;

        @ApiModelProperty("中标通知书")
        private String acceptanceLetter;

        @ApiModelProperty("应用编码")
        private String appCode;

    }
}
