package com.friday.tooldriver.dto.infodator.response;

import com.friday.operation.api.tooldriver.dto.rpa.RobotDto;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class Robot implements Serializable {
    private RpaRobot rpaRobot;
    private LiveStatus liveStatus;
    private int errorCount;

    public RobotDto createInfodatorRobotDto(){
        return RobotDto.builder()
                .key(String.valueOf(this.rpaRobot.getId()))
                .name(this.rpaRobot.getRobotName())
                .state(String.valueOf(this.rpaRobot.transferToJobState()))
                .build();
    }
}
