package com.cfdeployer.model;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.UUID;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class CfDeployResponse {

    private Boolean success;
    private String message;
    private String deploymentId;
    private String output;
    private String error;

    public static CfDeployResponse success(String output) {
        return CfDeployResponse.builder()
                .success(true)
                .message("Application deployed successfully")
                .deploymentId(UUID.randomUUID().toString())
                .output(output)
                .build();
    }

    public static CfDeployResponse failure(String error, String output) {
        return CfDeployResponse.builder()
                .success(false)
                .message("Application deployment failed")
                .deploymentId(UUID.randomUUID().toString())
                .error(error)
                .output(output)
                .build();
    }
}
