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 lombok.Data;
import org.springframework.lang.Nullable;

@Data
public class OrderRevocationContext {

    @NotBlank
    private String orderId;

    @Nullable
    private String operatorId;

    @Nullable
    private String operatorType;

    @Nullable
    private BigDecimal refundAmount;

    @Nullable
    private String refundReason;

    private boolean refundToCustomer;

    private boolean deductClerkEarnings;

    private OrderTriggerSource triggerSource = OrderTriggerSource.UNKNOWN;

    @Nullable
    private BigDecimal earningsAdjustAmount;

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