Compare commits

...

7 Commits

8 changed files with 8 additions and 24 deletions

View File

@@ -2,12 +2,9 @@ package models
import (
"time"
"gorm.io/gorm"
)
type DBCall struct {
gorm.Model
AfterCallWorkRequired bool
Confined bool
ConnectedTime *time.Time `gorm:"index"`

View File

@@ -2,12 +2,9 @@ package models
import (
"time"
"gorm.io/gorm"
)
type DBConversation struct {
gorm.Model
Address *string
DivisionIds *string `gorm:"type:json"`
End *time.Time `gorm:"index"`
@@ -22,6 +19,7 @@ type DBConversation struct {
Start *time.Time `gorm:"index"`
UtilizationLabelId *string
LiveUpdate *time.Time
DetailsUpdate *time.Time
SemiLiveUpdate *time.Time
JobUpdate *time.Time
}

View File

@@ -2,12 +2,9 @@ package models
import (
"time"
"gorm.io/gorm"
)
type DBParticipant struct {
gorm.Model
Address *string
Attributes *string `gorm:"type:json"`
ConnectedTime *time.Time `gorm:"index"`

View File

@@ -7,7 +7,8 @@ type DBQueueLog struct {
ConversationId string `gorm:"primaryKey"`
Start time.Time `gorm:"index"`
End time.Time `gorm:"index"`
Result string `gorm:"type:json"`
Duration float64
Result string `gorm:"type:json"`
}
func (DBQueueLog) TableName() string {

View File

@@ -1,5 +1,10 @@
package models
type AnalyticsConversationWithAttributesQuery struct {
Conversations []AnalyticsConversationWithAttributes `json:"conversations"`
Cursor *string `json:"cursor"`
}
type AnalyticsConversationWithAttributes struct {
ConversationEnd string `json:"conversationEnd"`
ConversationId string `json:"conversationId"`

View File

@@ -2,12 +2,9 @@ package models
import (
"time"
"gorm.io/gorm"
)
type DBSegment struct {
gorm.Model
Id string `gorm:"primaryKey;index"`
Conference bool
DisconnectType string

View File

@@ -1,9 +1,6 @@
package models
import "gorm.io/gorm"
type DBSession struct {
gorm.Model
Ani string
Direction string
Dnis string

View File

@@ -33,8 +33,6 @@ func ExtractWithoutAttributes(base models.AnalyticsConversationWithoutAttributes
}
divisionIdsBytesStr := string(divisionIdsBytes)
currentTime := time.Now()
conversation := models.DBConversation{
DivisionIds: &divisionIdsBytesStr,
End: endTime,
@@ -43,7 +41,6 @@ func ExtractWithoutAttributes(base models.AnalyticsConversationWithoutAttributes
MinRFactor: &base.MediaStatsMinConversationRFactor,
OriginatingDirection: &base.OriginatingDirection,
Start: startTime,
SemiLiveUpdate: &currentTime,
}
var participants []models.DBParticipant
var sessions []models.DBSession
@@ -129,7 +126,6 @@ func ExtractWithoutAttributes(base models.AnalyticsConversationWithoutAttributes
}
func ExtractLive(base models.NotificationConversationWithAttributes) (models.DBConversation, []models.DBParticipant, []models.DBCall) {
currentTime := time.Now()
conversation := models.DBConversation{
Id: base.Id,
@@ -138,7 +134,6 @@ func ExtractLive(base models.NotificationConversationWithAttributes) (models.DBC
RecordingState: &base.RecordingState,
SecurePause: &base.SecurePause,
UtilizationLabelId: &base.UtilizationLabelId,
LiveUpdate: &currentTime,
}
var participants []models.DBParticipant
@@ -284,8 +279,6 @@ func ExtractWithAttributes(base models.AnalyticsConversationWithAttributes) (mod
}
divisionIdsBytesStr := string(divisionIdsBytes)
currentTime := time.Now()
conversation := models.DBConversation{
DivisionIds: &divisionIdsBytesStr,
End: endTime,
@@ -294,7 +287,6 @@ func ExtractWithAttributes(base models.AnalyticsConversationWithAttributes) (mod
MinRFactor: &base.MediaStatsMinConversationRFactor,
OriginatingDirection: &base.OriginatingDirection,
Start: startTime,
JobUpdate: &currentTime,
}
var participants []models.DBParticipant
var sessions []models.DBSession