Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1bb7661f94 | |||
| 79bea9002e | |||
| 0e72fa1355 | |||
| db89056468 | |||
| 567470372f | |||
| 674f7dd5f5 | |||
| f50333d223 | |||
| a7f73eb96a | |||
| 57b4791a4a | |||
| 7737b8b4d2 | |||
| 2f2388caab | |||
| ff0f873dd8 | |||
| 7bf15cce48 | |||
| 643c5cc695 | |||
| 8b2b31ef3f | |||
| 423383a2f8 | |||
| 00b946fc8d |
@@ -8,7 +8,7 @@ type DBAmendment struct {
|
||||
AmendmentColumn string
|
||||
AmendmentValue string
|
||||
Requestor string
|
||||
RequestedAt time.Time
|
||||
RequestedAt time.Time `gorm:"index"`
|
||||
Sequence string
|
||||
}
|
||||
|
||||
|
||||
@@ -23,8 +23,8 @@ type CrmInvoiceConfig struct {
|
||||
PartnerAudioBookingBH *string `gorm:"column:partner_audio_booking_bh" json:"partner_audio_booking_bh"`
|
||||
PartnerVideoBookingAH *string `gorm:"column:partner_video_booking_ah" json:"partner_video_booking_ah"`
|
||||
PartnerVideoBookingBH *string `gorm:"column:partner_video_booking_bh" json:"partner_video_booking_bh"`
|
||||
RoundingFunction *string `gorm:"column:rounding_function" json:"rounding_function"`
|
||||
RoundBookings *bool `gorm:"column:round_bookings" json:"round_bookings"`
|
||||
RoundingFunction *bool `gorm:"column:rounding_function" json:"rounding_function"`
|
||||
SplitBookings *bool `gorm:"column:split_bookings" json:"split_bookings"`
|
||||
SplitOnDemand *bool `gorm:"column:split_on_demand" json:"split_on_demand"`
|
||||
}
|
||||
|
||||
@@ -78,8 +78,6 @@ type CallStat struct {
|
||||
InterpreterAccepted bool
|
||||
InterpreterConnectedCount int
|
||||
InterpreterConnected bool
|
||||
// InterpreterCount int
|
||||
// InterpreterConnected bool
|
||||
ClientDisconnected bool
|
||||
UtsDuration int
|
||||
UtsEntries int
|
||||
@@ -93,3 +91,40 @@ type CallStat struct {
|
||||
func (CallStat) TableName() string {
|
||||
return "gc_call_stats"
|
||||
}
|
||||
|
||||
type Breakdown struct {
|
||||
ClientConversationId string `gorm:"primaryKey;index"`
|
||||
InterpreterConversationId string `gorm:"index"`
|
||||
Timestamp time.Time `gorm:"primaryKey;index"`
|
||||
Task string `gorm:"primaryKey"`
|
||||
Duration int
|
||||
Message string
|
||||
Metadata *string `gorm:"type:json"`
|
||||
}
|
||||
|
||||
func (Breakdown) TableName() string {
|
||||
return "gc_call_breakdown"
|
||||
}
|
||||
|
||||
type CallMetrics struct {
|
||||
ClientConversationId string `gorm:"primaryKey;index"`
|
||||
//
|
||||
TotalDuration int
|
||||
TotalClientResponseDuration int
|
||||
TotalSystemDuration int
|
||||
TotalTalkDuration int
|
||||
//
|
||||
AgentAlertDuration int
|
||||
AgentHoldDuration int
|
||||
AgentTalkDuration int
|
||||
//
|
||||
SearchingDuration int
|
||||
ConfigurationDuration int
|
||||
QueueDuration int
|
||||
//
|
||||
Metadata *string `gorm:"type:json"`
|
||||
}
|
||||
|
||||
func (CallMetrics) TableName() string {
|
||||
return "gc_call_metrics"
|
||||
}
|
||||
|
||||
@@ -72,6 +72,7 @@ type AnalyticsConversationWithoutAttributes struct {
|
||||
DivisionIds []string `json:"divisionIds"`
|
||||
Participants []struct {
|
||||
ParticipantId string `json:"participantId"`
|
||||
UserId string `json:"userId"`
|
||||
ParticipantName string `json:"participantName"`
|
||||
Purpose string `json:"purpose"`
|
||||
ExternalContactId string `json:"externalContactId"`
|
||||
@@ -183,3 +184,22 @@ type NotificationConversationWithAttributes struct {
|
||||
SecurePause bool `json:"securePause"`
|
||||
UtilizationLabelId string `json:"utilizationLabelId"`
|
||||
}
|
||||
|
||||
type UsersQuery struct {
|
||||
Entities []GCUser `json:"entities"`
|
||||
PageSize int `json:"pageSize"`
|
||||
Total int `json:"total"`
|
||||
}
|
||||
|
||||
type GCUser struct {
|
||||
Id string `json:"id" gorm:"primaryKey"`
|
||||
Name string `json:"name"`
|
||||
Email string `json:"email"`
|
||||
State string `json:"state"`
|
||||
Username string `json:"username"`
|
||||
AcdAutoAnswer bool `json:"acdAutoAnswer"`
|
||||
}
|
||||
|
||||
func (GCUser) TableName() string {
|
||||
return "gc_users"
|
||||
}
|
||||
|
||||
@@ -2,6 +2,8 @@ package models
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type DBParticipant struct {
|
||||
@@ -17,13 +19,24 @@ type DBParticipant struct {
|
||||
Name *string `gorm:"index"`
|
||||
Purpose *string `gorm:"index"`
|
||||
QueueId *string
|
||||
UserId *string
|
||||
Wrapup *string `gorm:"type:json"`
|
||||
WrapupExpected *bool
|
||||
WrapupRequired *bool
|
||||
|
||||
Sessions []DBSession `gorm:"foreignKey:ParticipantId;references:Id"`
|
||||
Calls []DBCall `gorm:"foreignKey:ParticipantId;references:Id"`
|
||||
User *GCUser `gorm:"foreignKey:UserId;references:Id"`
|
||||
}
|
||||
|
||||
func (DBParticipant) TableName() string {
|
||||
return "gc_participants"
|
||||
}
|
||||
|
||||
func (p *DBParticipant) BeforeSave(tx *gorm.DB) error {
|
||||
// Convert empty string to nil
|
||||
if p.UserId != nil && *p.UserId == "" {
|
||||
p.UserId = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -22,9 +22,9 @@ func ExtractWithoutAttributes(base models.AnalyticsConversationWithoutAttributes
|
||||
var endTime *time.Time
|
||||
parsedEndTime, err := time.Parse(time.RFC3339, base.ConversationEnd)
|
||||
if err != nil {
|
||||
startTime = nil
|
||||
endTime = nil
|
||||
} else {
|
||||
startTime = &parsedEndTime
|
||||
endTime = &parsedEndTime
|
||||
}
|
||||
|
||||
divisionIdsBytes, err := json.Marshal(base.DivisionIds)
|
||||
@@ -49,13 +49,14 @@ func ExtractWithoutAttributes(base models.AnalyticsConversationWithoutAttributes
|
||||
for _, p := range base.Participants {
|
||||
|
||||
participant := models.DBParticipant{
|
||||
ConnectedTime: nil,
|
||||
// ConnectedTime: nil,
|
||||
ConversationId: base.ConversationId,
|
||||
EndTime: nil,
|
||||
// EndTime: nil,
|
||||
ExternalContactId: &p.ExternalContactId,
|
||||
Id: p.ParticipantId,
|
||||
Name: &p.ParticipantName,
|
||||
Purpose: &p.Purpose,
|
||||
UserId: &p.UserId,
|
||||
}
|
||||
participants = append(participants, participant)
|
||||
|
||||
@@ -94,7 +95,7 @@ func ExtractWithoutAttributes(base models.AnalyticsConversationWithoutAttributes
|
||||
}
|
||||
sessions = append(sessions, session)
|
||||
|
||||
for _, seg := range sess.Segments {
|
||||
for idx, seg := range sess.Segments {
|
||||
|
||||
segmentStart, err := time.Parse(time.RFC3339, seg.SegmentStart)
|
||||
if err != nil {
|
||||
@@ -112,7 +113,7 @@ func ExtractWithoutAttributes(base models.AnalyticsConversationWithoutAttributes
|
||||
}
|
||||
|
||||
segment := models.DBSegment{
|
||||
Id: fmt.Sprintf("%s_%s", session.Id, seg.SegmentType),
|
||||
Id: fmt.Sprintf("%s_%s_%d", session.Id, seg.SegmentType, idx),
|
||||
Conference: seg.Conference,
|
||||
DisconnectType: seg.DisconnectType,
|
||||
Q850ResponseCodes: string(q850ResponseCodesBytes),
|
||||
|
||||
Reference in New Issue
Block a user