package com.starry.admin.modules.order.module.dto;

import com.starry.admin.modules.order.module.constant.OrderConstant.OrderTriggerSource;
import java.math.BigDecimal;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import lombok.Data;
import org.springframework.lang.Nullable;

@Data
public class OrderRefundContext {

    @NotBlank
    private String orderId;

    @NotNull
    private BigDecimal refundAmount;

    @Nullable
    private String refundReason;

    @Nullable
    private String operatorType;

    @Nullable
    private String operatorId;

    private OrderTriggerSource triggerSource = OrderTriggerSource.UNKNOWN;

    private boolean fullRefund;

    @Nullable
    private String comment;

    public OrderRefundContext withTriggerSource(OrderTriggerSource triggerSource) {
        this.triggerSource = triggerSource;
        return this;
    }

    public OrderRefundContext withComment(@Nullable String comment) {
        this.comment = comment;
        return this;
    }
}
