refactor platform domain states and permissions
This commit is contained in:
@@ -227,7 +227,7 @@ func RechargeWalletBasic(ctx *gin.Context) {
|
||||
}
|
||||
now := time.Now()
|
||||
record = models.WalletRecord{
|
||||
Entity: models.Entity{Identity: models.NewIdentity(), Status: common.StatusPosted},
|
||||
Entity: models.Entity{Identity: models.NewIdentity(), Status: common.StatusEnable},
|
||||
WalletBasicID: wallet.ID, RecordNo: models.NewIdentity(), RequestNo: request.RequestNo,
|
||||
Direction: "income", TradeType: "recharge", Amount: request.Amount,
|
||||
BalanceAfter: wallet.Balance, WithdrawalBalanceAfter: wallet.WithdrawalBalance,
|
||||
@@ -285,10 +285,10 @@ func reviewWalletApplyCash(ctx *gin.Context, targetStatus int) {
|
||||
Where("identity = ?", ctx.Param("identity")).First(&application).Error; err != nil {
|
||||
return err
|
||||
}
|
||||
if application.Status == targetStatus {
|
||||
if application.ApplyStatus == targetStatus {
|
||||
return nil
|
||||
}
|
||||
if application.Status != common.StatusPending {
|
||||
if application.ApplyStatus != common.StatusPending {
|
||||
return errors.New("cash application is not pending")
|
||||
}
|
||||
now := time.Now()
|
||||
@@ -304,7 +304,7 @@ func reviewWalletApplyCash(ctx *gin.Context, targetStatus int) {
|
||||
}
|
||||
}
|
||||
return tx.Model(&application).Updates(map[string]any{
|
||||
"status": targetStatus, "reviewer_identity": operatorIdentity, "reviewer_name": operatorName,
|
||||
"apply_status": targetStatus, "reviewer_identity": operatorIdentity, "reviewer_name": operatorName,
|
||||
"reviewed_at": &now, "review_reason": request.Reason,
|
||||
}).Error
|
||||
})
|
||||
@@ -312,7 +312,7 @@ func reviewWalletApplyCash(ctx *gin.Context, targetStatus int) {
|
||||
common.RespondRecordError(ctx, err)
|
||||
return
|
||||
}
|
||||
infra.Response.Success(ctx, gin.H{"updated": true, "status": targetStatus})
|
||||
infra.Response.Success(ctx, gin.H{"updated": true, "apply_status": targetStatus})
|
||||
}
|
||||
|
||||
func dateNumber(value time.Time, layout string) int32 {
|
||||
|
||||
Reference in New Issue
Block a user