package com.agileboot.domain.collaboration.record.command;

import com.fasterxml.jackson.annotation.JsonFormat;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.validation.Valid;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.PositiveOrZero;
import javax.validation.constraints.Size;
import lombok.Data;

/**
 * @author codex
 */
@Data
public class AddCollaborationRecordCommand {

    @NotBlank(message = "品牌不能为空")
    @Size(max = 100, message = "品牌长度不能超过100个字符")
    protected String brand;

    @NotBlank(message = "物品不能为空")
    @Size(max = 100, message = "物品长度不能超过100个字符")
    protected String goods;

    @Size(max = 50, message = "合作平台长度不能超过50个字符")
    protected String cooperationPlatform;

    @NotNull(message = "返图数量不能为空")
    @Min(value = 1, message = "返图数量至少为1")
    protected Integer imageReturnNum;

    @Size(max = 30, message = "留存方式长度不能超过30个字符")
    protected String retainedMethod;

    @Size(max = 30, message = "合作方式长度不能超过30个字符")
    protected String cooperatedMethod;

    @Size(max = 30, message = "购入方式长度不能超过30个字符")
    protected String purchaseMethod;

    @PositiveOrZero(message = "购入金额不能小于0")
    protected BigDecimal purchasePrice;

    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    protected Date purchaseDate;

    @Size(max = 30, message = "购入平台长度不能超过30个字符")
    protected String purchasePlatform;

    @NotNull(message = "预完成日期不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    protected Date deadline;

    @PositiveOrZero(message = "稿费不能小于0")
    protected BigDecimal remuneration;

    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    protected Date completeDate;

    @Size(max = 1000, message = "拍摄要求长度不能超过1000个字符")
    protected String requirements;

    @Size(max = 1000, message = "备注长度不能超过1000个字符")
    protected String remark;

    @Valid
    protected List<CollaborationTaskCommand> tasks = new ArrayList<>();

    @Valid
    protected List<CollaborationExpenditureCommand> expenditures = new ArrayList<>();

    @Valid
    protected List<CollaborationSettlementCommand> settlements = new ArrayList<>();

    @Valid
    protected List<CollaborationFileCommand> files = new ArrayList<>();

}
