package com.red.circle.order.inner.asserts;

import com.red.circle.framework.dto.IResponseErrorCode;
import com.red.circle.framework.dto.ResErrorCode;

/**
 * 订单相关， 范围：5900 ~ 6000.
 *
 * @author pengliang on 2023/8/16
 */
@ResErrorCode(describe = "订单相关", minCode = 5900, maxCode = 6000)
public enum OrderErrorCode implements IResponseErrorCode {

  /**
   * 订单已创建.
   */
  ORDER_EXISTS_CREATED(5900, "Order created"),

  /**
   * 验证订单失败.
   */
  VALIDATION_ORDER_FAILED(5901, "Validation order failed"),

  /**
   * 未找到购买记录.
   */
  NO_PURCHASE_RECORD_FOUND(5902, "No purchase record found"),

  /**
   * 单据已过期.
   */
  RECEIPT_EXPIRED(5903, "Receipt expired"),

  /**
   * 锁定状态.
   */
  LOCK_STATUS(5904, "Lock status"),
  /**
   * 创建订单失败.
   */
  CREATE_ORDER_ERROR(5905, "Failed to create order"),

  /**
   * 订单等待处理.
   */
  ORDER_WAITING_FOR_PROCESSING(5906, "Order waiting for processing");

  private final Integer code;
  private final String message;

  OrderErrorCode(Integer code, String message) {
    this.code = code;
    this.message = message;
  }

  @Override
  public Integer getCode() {
    return this.code;
  }

  @Override
  public String getMessage() {
    return message;
  }

  @Override
  public String getErrorCodeName() {
    return this.name();
  }

}
