package consts

type JDAccountStatus int32

const (
	JDAccountForbidden                  JDAccountStatus = iota // 账号禁用
	JDAccountNormal                                            // 账号正常
	JDAccountForbiddenByTooFast                                // 账号充值速度过快
	JDAccountForbiddenByMaxLimit                               // 账号禁用，最大充值金额
	JDAccountLimited                                           // 账号受到限制
	JDAccountForbiddenByLowRecharge                            // 由于低于50元以下充值导致
	JDAccountForbiddenBySafetyReason                           // 账号安全原因
	JDAccountTmpStoppedByTooManyRequest                        // 账号临时暂停兑换，10分钟后恢复
)

func (j JDAccountStatus) GetStatusText() string {
	switch j {
	case JDAccountForbidden:
		return "账号禁用"
	case JDAccountNormal:
		return "账号正常"
	case JDAccountForbiddenByTooFast:
		return "账号充值速度过快"
	case JDAccountForbiddenByMaxLimit:
		return "账号禁用，最大充值金额"
	case JDAccountLimited:
		return "账号受到限制"
	case JDAccountForbiddenByLowRecharge:
		return "由于低于50以下充值导致"
	case JDAccountForbiddenBySafetyReason:
		return "账号安全原因"
	case JDAccountTmpStoppedByTooManyRequest:
		return "账号临时暂停兑换，10分钟后恢复"
	default:
		return "未知错误"
	}
}

type JDAccountOperationStatus string

const (
	JDAccountOperationDeduct     JDAccountOperationStatus = "deduct" // 减款
	JDAccountOperationAdd        JDAccountOperationStatus = "add"    // 加款
	JDAccountOperationInitialize JDAccountOperationStatus = "initialize"
	JDAccountOperationReturn     JDAccountOperationStatus = "return" // 退款
)

// JDOrderStatus 充值编码
type JDOrderStatus int

const (
	JDOrderFail                       JDOrderStatus = 0  // 充值失败
	JDOrderSuccess                    JDOrderStatus = 1  // 充值成功
	JDOrderPending                    JDOrderStatus = 2  // 待处理
	JDOrderProcessing                 JDOrderStatus = 10 // 开始处理
	JDOrderRefundWithValidatedFail    JDOrderStatus = 3  // 验证失败
	JDOrderFailWithCKFail             JDOrderStatus = 4  // 账号失效
	JDOrderFailWithFrequent           JDOrderStatus = 5  // 账号频繁
	JDOrderFailWithCardUnknown        JDOrderStatus = 6  // 未知状态
	JDOrderForbiddenByMaxLimit        JDOrderStatus = 7  // 订单禁用，最大调用次数
	JDOrderSuccessWithDifferentAmount JDOrderStatus = 8  // 充值金额与订单金额不一致（已经充值）
	JDOrderFailWithWrongCardType      JDOrderStatus = 9  // 卡密类型错误
	JDOrderFailWithDifferentAmount    JDOrderStatus = 10 // 充值金额与订单金额不一致（没有充值）
)

type JDOrderOperationStatus int

const (
	JDOrderOperationFail                  JDOrderOperationStatus = 0  // 充值失败
	JDOrderOperationAdd                   JDOrderOperationStatus = 1  // 新增订单
	JDOrderOperationPending               JDOrderOperationStatus = 2  // 待处理
	JDOrderOperationSuccess               JDOrderOperationStatus = 3  // 充值成功
	JDOrderOperationCallback              JDOrderOperationStatus = 4  // 开始回调
	JDOrderOperationRefund                JDOrderOperationStatus = 5  // 订单退回
	JDOrderOperationFailWithCookie        JDOrderOperationStatus = 6  // 订单失败，账号问题
	JDOrderOperationPendingFail           JDOrderOperationStatus = 7  // 分配账号失败
	JDOrderOperationFailWithValidatedFail JDOrderOperationStatus = 8  // 验证失败
	JDOrderOperationCallbackStart         JDOrderOperationStatus = 9  // 开始回调
	JDOrderOperationCallbackSucceed       JDOrderOperationStatus = 10 // 回调成功
	JDOrderOperationCallbackFailed        JDOrderOperationStatus = 11 // 回调失败
)

type CardJDNotifyStatus int

const (
	CardJDNotifyStatusSuccess CardJDNotifyStatus = 1
	CardJDNotifyStatusFail    CardJDNotifyStatus = 2
)
