package com.yuchen.saas.park.service.service.door.communication.domain;

import lombok.Data;

import javax.annotation.Nullable;
import javax.validation.constraints.NotBlank;

@Data(staticConstructor = "of")
public class CallResult {
    private final boolean successful;
    @Nullable
    private final String failureDetails;

    public static CallResult successful() {
        return CallResult.of(true, null);
    }

    public static CallResult error(@NotBlank String failureDetails) {
        return CallResult.of(false, failureDetails);
    }
}
