42 lines
1.3 KiB
Go
42 lines
1.3 KiB
Go
package models
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
// DBConversation is a model that stores raw 'conversation' payloads from GenesysCloud websockets and API requests.
|
|
//
|
|
// - The ExtractLive function handles the conversion from JSON data (map) into formatted JSON string for websocket payloads.
|
|
// - The ExtractWithoutAttributes function handles the conversion from JSON data (map) into formatted JSON string for gcq-details requests.
|
|
//
|
|
// Table Schema:
|
|
//
|
|
// Primary Key: Id
|
|
// Indexes: End, Id, Start
|
|
// JSON Fields: DivisionIds, RecentTransfers
|
|
type DBConversation struct {
|
|
Address *string
|
|
DivisionIds *string `gorm:"type:json"`
|
|
End *time.Time `gorm:"index"`
|
|
ExternalTag *string
|
|
Id string `gorm:"primaryKey;index"`
|
|
MinMos *float32
|
|
MinRFactor *float32
|
|
OriginatingDirection *string
|
|
RecentTransfers *string `gorm:"type:json"`
|
|
RecordingState *string
|
|
SecurePause *bool
|
|
Start *time.Time `gorm:"index"`
|
|
UtilizationLabelId *string
|
|
LiveUpdate *time.Time
|
|
DetailsUpdate *time.Time
|
|
SemiLiveUpdate *time.Time
|
|
JobUpdate *time.Time
|
|
|
|
Participants []DBParticipant `gorm:"foreignKey:ConversationId;references:Id"`
|
|
}
|
|
|
|
func (DBConversation) TableName() string {
|
|
return "gc_conversations"
|
|
}
|