package com.friday.tooldriver.dto.uipath.request;

import com.alibaba.fastjson.annotation.JSONField;
import com.friday.operation.api.tooldriver.dto.rpa.GroupDto;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class FolderDto implements Serializable {
    @JSONField(name="DisplayName")
    private String displayName;
    @JSONField(name="Description")
    private String description;
    @JSONField(name="FullyQualifiedName")
    private String fullyQualifiedName;
    @JSONField(name="FeedType")
    private String feedType;
    @JSONField(name="PermissionModel")
    private String permissionModel;
    @JSONField(name="ProvisionType")
    private String provisionType;
    @JSONField(name="ParentId")
    private Integer parentId;
    @JSONField(name="Id")
    private Integer id;

    public GroupDto transferToGroupDto(){
        return GroupDto.builder()
                .key(String.valueOf(id))
                .name(displayName)
                .parentKey(String.valueOf(parentId))
                .description(description)
                .build();
    }
}
