package com.xindazhou.platform.controller.admin.service.maintenance.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.time.LocalDateTime;

import static com.xindazhou.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;

@Schema(description = "管理后台 - 维保订单保存 Request VO")
@Data
public class MaintenanceOrderSaveReqVO {

    @Schema(description = "订单ID", example = "1")
    private Long id;

    @Schema(description = "车辆ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @NotNull(message = "车辆ID不能为空")
    private Long vehicleId;

    @Schema(description = "用户ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @NotNull(message = "用户ID不能为空")
    private Long userId;

    @Schema(description = "维保类型：maintenance-保养，repair-维修，inspection-检测", requiredMode = Schema.RequiredMode.REQUIRED, example = "maintenance")
    @NotBlank(message = "维保类型不能为空")
    private String maintenanceType;

    @Schema(description = "维保内容", requiredMode = Schema.RequiredMode.REQUIRED, example = "更换机油")
    @NotBlank(message = "维保内容不能为空")
    private String content;

    @Schema(description = "维保费用", requiredMode = Schema.RequiredMode.REQUIRED, example = "299.00")
    @NotNull(message = "维保费用不能为空")
    private BigDecimal cost;

    @Schema(description = "维保时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2022-07-01 00:00:00")
    @NotNull(message = "维保时间不能为空")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime maintenanceTime;

    @Schema(description = "维保门店ID", example = "1")
    private Long shopId;

    @Schema(description = "维保门店名称", example = "XX维修店")
    private String shopName;

    @Schema(description = "维保门店地址", example = "XX市XX区XX路")
    private String shopAddress;

    @Schema(description = "维保人员ID", example = "1")
    private Long handlerId;

    @Schema(description = "维保人员名称", example = "张师傅")
    private String handlerName;

    @Schema(description = "备注", example = "备注信息")
    private String remark;

}

