package com.rj.dto;

import com.rj.entity.CustomerManagement;
import lombok.Getter;

/**
 * 客户阶段（stage）更新结果，供控制层映射 HTTP 状态与 JSON。
 */
@Getter
public class CustomerStageUpdateResult {

    private final int httpStatus;
    private final boolean success;
    private final String message;
    private final CustomerManagement customer;

    private CustomerStageUpdateResult(int httpStatus, boolean success, String message, CustomerManagement customer) {
        this.httpStatus = httpStatus;
        this.success = success;
        this.message = message;
        this.customer = customer;
    }

    public static CustomerStageUpdateResult ok(CustomerManagement customer) {
        return new CustomerStageUpdateResult(200, true, "阶段更新成功", customer);
    }

    public static CustomerStageUpdateResult badRequest(String message) {
        return new CustomerStageUpdateResult(400, false, message, null);
    }

    public static CustomerStageUpdateResult serverError(String message) {
        return new CustomerStageUpdateResult(500, false, message, null);
    }
}
