fix(chat-room): 입장/전송 next 계산 보완 및 채팅 가능 시 next=null 처리
enter: roomPaid==0 && roomFree>0 && global<=0 → 글로벌 next roomPaid==0 && roomFree==0 → (global<=0) ? max(roomNext, globalNext) : roomNext 채팅 가능(totalRemaining>0)인 경우 next=null 반환(유료>0 포함) send: totalRemaining==0 && global<=0 → max(roomNext, globalNext) 채팅 가능(totalRemaining>0)인 경우 next=null 반환
This commit is contained in:
		| @@ -428,8 +428,10 @@ class ChatRoomService( | |||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|  |  | ||||||
|         // 권고안에 따른 next 계산 |         // 권고안 + 이슈 보정: 채팅 가능(totalRemaining>0)인 경우 next=null | ||||||
|         val nextForEnter: Long? = when { |         val nextForEnter: Long? = when { | ||||||
|  |             // 채팅 가능: 유료>0 또는 무료 동시 사용 가능 → next는 표시하지 않음 | ||||||
|  |             roomStatus.totalRemaining > 0 -> null | ||||||
|             // roomPaid==0 && roomFree>0 && global<=0 → 글로벌 next |             // roomPaid==0 && roomFree>0 && global<=0 → 글로벌 next | ||||||
|             roomStatus.remainingPaid == 0 && roomStatus.remainingFree > 0 && globalStatus.totalRemaining <= 0 -> |             roomStatus.remainingPaid == 0 && roomStatus.remainingFree > 0 && globalStatus.totalRemaining <= 0 -> | ||||||
|                 globalStatus.nextRechargeAtEpochMillis |                 globalStatus.nextRechargeAtEpochMillis | ||||||
| @@ -443,10 +445,7 @@ class ChatRoomService( | |||||||
|                     } else if (globalNext == null) { |                     } else if (globalNext == null) { | ||||||
|                         roomNext |                         roomNext | ||||||
|                     } else { |                     } else { | ||||||
|                         maxOf( |                         maxOf(roomNext, globalNext) | ||||||
|                             roomNext, |  | ||||||
|                             globalNext |  | ||||||
|                         ) |  | ||||||
|                     } |                     } | ||||||
|                 } else { |                 } else { | ||||||
|                     roomNext |                     roomNext | ||||||
| @@ -693,6 +692,8 @@ class ChatRoomService( | |||||||
|         val statusTotalRemaining = roomQuotaAfterConsume.totalRemaining |         val statusTotalRemaining = roomQuotaAfterConsume.totalRemaining | ||||||
|         val globalAfter = chatQuotaService.getStatus(member.id!!) |         val globalAfter = chatQuotaService.getStatus(member.id!!) | ||||||
|         val statusNextRechargeAt: Long? = when { |         val statusNextRechargeAt: Long? = when { | ||||||
|  |             // 채팅 가능: totalRemaining>0 → next 표시하지 않음 | ||||||
|  |             statusTotalRemaining > 0 -> null | ||||||
|             // totalRemaining==0이고 (global<=0) → max(roomNext, globalNext) |             // totalRemaining==0이고 (global<=0) → max(roomNext, globalNext) | ||||||
|             statusTotalRemaining == 0 && globalAfter.totalRemaining <= 0 -> { |             statusTotalRemaining == 0 && globalAfter.totalRemaining <= 0 -> { | ||||||
|                 val roomNext = roomQuotaAfterConsume.nextRechargeAtEpochMillis |                 val roomNext = roomQuotaAfterConsume.nextRechargeAtEpochMillis | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user