Skip to content

Commit

Permalink
replace String with Status type for status
Browse files Browse the repository at this point in the history
  • Loading branch information
e.eschenko committed Feb 28, 2023
1 parent 1ef1117 commit 7771f4f
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ interface TelephonyBotRequest : JaicpNativeBotRequest {
/**
* Contains the status of the transfer of a customer to an operator.
*
* @property status agent transfer status. It returns a string: `SUCCESS` or `FAIL`.
* @property status agent transfer status. It returns an enum value of [Status.SUCCESS] or [Status.FAIL].
*
* @property hangup true means the customer has ended the conversation.
* false means the customer is still online and was re-directed to the bot (if continueCall: true in [TelephonySwitchReply]).
Expand All @@ -132,11 +132,16 @@ interface TelephonyBotRequest : JaicpNativeBotRequest {

@Serializable
data class TransferStatus(
val status: String,
val status: Status,
val hangup: Boolean,
val number: String
) {
val isSuccess = status == "SUCCESS"

enum class Status {
SUCCESS, FAIL
}

val isSuccess = status == Status.SUCCESS
}

@Serializable
Expand Down

0 comments on commit 7771f4f

Please sign in to comment.