package com.bonus.material.repair.domain.vo;

import com.bonus.material.repair.domain.RepairPart;
import com.bonus.material.repair.domain.RepairTask;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.ArrayList;
import java.util.List;

/**
 * @author : 阮世耀
 * @version : 1.0
 * @PackagePath: com.bonus.material.repair.domain.vo
 * @CreateTime: 2024-11-20  09:43
 * @Description: 维修任务单VO
 */
@Data
@Api(value = "维修任务单")
@Accessors(chain = true)
public class RepairTicketVo {

    @ApiModelProperty(value = "维修任务信息")
    private RepairTask repairTaskInfo;

    @ApiModelProperty(value = "维修物资列表")
    private List<RepairDeviceSummaryVo> repairDeviceSummaryList;

    @ApiModelProperty(value = "维修内容集合")
    private List<RepairPart> repairPartArray;

    // 覆盖默认get方法，防止空指针异常
    public List<RepairDeviceSummaryVo> getRepairDeviceSummaryList() {
        if (this.repairDeviceSummaryList == null) {return new ArrayList<>();}
        return this.repairDeviceSummaryList;
    }

}
