Compare commits
18 Commits
v1.0.28
...
2f2388caab
| Author | SHA1 | Date | |
|---|---|---|---|
| 2f2388caab | |||
| ff0f873dd8 | |||
| 7bf15cce48 | |||
| 643c5cc695 | |||
| 8b2b31ef3f | |||
| 423383a2f8 | |||
| 00b946fc8d | |||
| 4e5f789671 | |||
| ee521aa378 | |||
| c106209130 | |||
| 4c6eed2e47 | |||
| 0f4223e873 | |||
| faca742f5f | |||
| 3823096f4c | |||
| c9a99faa54 | |||
| e8aeb4d3b7 | |||
| a457849977 | |||
| bd807b3b1d |
@@ -9,23 +9,9 @@ type DBAmendment struct {
|
||||
AmendmentValue string
|
||||
Requestor string
|
||||
RequestedAt time.Time
|
||||
Sequence string
|
||||
}
|
||||
|
||||
func (DBAmendment) TableName() string {
|
||||
return "gc_amendments"
|
||||
}
|
||||
|
||||
type DBAmendmentLog struct {
|
||||
Id int `gorm:"primaryKey;autoIncrement"`
|
||||
ConversationId string `gorm:"index"`
|
||||
AmendmentColumn string
|
||||
OldValue string
|
||||
NewValue string
|
||||
Requestor string
|
||||
RequestedAt time.Time
|
||||
AmendedAt time.Time
|
||||
}
|
||||
|
||||
func (DBAmendmentLog) TableName() string {
|
||||
return "gc_amendment_logs"
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package models
|
||||
|
||||
/*
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
@@ -26,3 +27,4 @@ type BaseCall struct {
|
||||
func (BaseCall) TableName() string {
|
||||
return "gc_base_calls"
|
||||
}
|
||||
*/
|
||||
|
||||
28
models/booking.go
Normal file
28
models/booking.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
type Booking struct {
|
||||
BookingReference int `gorm:"primaryKey;index"`
|
||||
BookingTime *time.Time `gorm:"index"`
|
||||
Timezone *string
|
||||
Language *string
|
||||
CustomData *string
|
||||
Method *string `gorm:"index"`
|
||||
Duration *int
|
||||
BookedDuration *int
|
||||
ConversationId *string `gorm:"index"`
|
||||
CancellationTime *time.Time
|
||||
InterpreterId *int `gorm:"index"`
|
||||
ClientId *int `gorm:"index"`
|
||||
AgentName *string
|
||||
AgentEmail *string
|
||||
AgentPhone *string
|
||||
Comments *string
|
||||
BillingCode *string
|
||||
TicketId string
|
||||
}
|
||||
|
||||
func (Booking) TableName() string {
|
||||
return "gc_bookings"
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package models
|
||||
|
||||
/*
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
@@ -25,3 +26,4 @@ type CallStat struct {
|
||||
func (CallStat) TableName() string {
|
||||
return "gc_call_stats"
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -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"`
|
||||
}
|
||||
|
||||
107
models/formatter.go
Normal file
107
models/formatter.go
Normal file
@@ -0,0 +1,107 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
type BaseCall struct {
|
||||
ClientConversationId string `gorm:"primaryKey;index"`
|
||||
CallType string `gorm:"index"`
|
||||
GenderPreference string
|
||||
ClientId int `gorm:"index"`
|
||||
LanguageId int
|
||||
CustomerDnis string
|
||||
CustomerAni string
|
||||
SearchStartTime *time.Time
|
||||
P1ConnectTime time.Time `gorm:"index"`
|
||||
P1DisconnectTime time.Time `gorm:"index"`
|
||||
P3ConnectTime *time.Time
|
||||
P3DisconnectTime *time.Time
|
||||
BookingRequestNumber *int `gorm:"index"`
|
||||
IvrData *int
|
||||
UtsEntries int
|
||||
InterpreterCount int
|
||||
Status string
|
||||
}
|
||||
|
||||
func (BaseCall) TableName() string {
|
||||
return "gc_base_calls"
|
||||
}
|
||||
|
||||
type InterpreterAttempt struct {
|
||||
InterpreterConversationId string `gorm:"primaryKey;index"`
|
||||
InterpreterResponseTime time.Time
|
||||
InterpreterAccepted bool
|
||||
InterpreterId int `gorm:"index"`
|
||||
CallType string
|
||||
CallConnected string
|
||||
ClientConversationId string `gorm:"index"`
|
||||
LanguageId int
|
||||
InterpreterPhone string
|
||||
ConversationStart time.Time
|
||||
ConversationEnd time.Time
|
||||
}
|
||||
|
||||
func (InterpreterAttempt) TableName() string {
|
||||
return "gc_interpreter_attempts"
|
||||
}
|
||||
|
||||
type InterpreterConnection struct {
|
||||
InterpreterConversationId string `gorm:"primaryKey;index"`
|
||||
InterpreterAccepted bool
|
||||
InterpreterId int `gorm:"index"`
|
||||
CallType string
|
||||
CallConnected string
|
||||
ClientConversationId string `gorm:"index"`
|
||||
LanguageId int
|
||||
InterpreterPhone string
|
||||
ConferenceStart time.Time
|
||||
ConferenceEnd time.Time
|
||||
}
|
||||
|
||||
func (InterpreterConnection) TableName() string {
|
||||
return "gc_interpreter_connections"
|
||||
}
|
||||
|
||||
type CallStat struct {
|
||||
ClientConversationId string `gorm:"primaryKey;index"`
|
||||
CallType string `gorm:"index"`
|
||||
ClientId int `gorm:"index"`
|
||||
CustomerDnis string
|
||||
CustomerAni string
|
||||
ConversationStart *time.Time `gorm:"index"`
|
||||
ConversationEnd *time.Time `gorm:"index"`
|
||||
SearchStartTime *time.Time
|
||||
P1ConnectTime time.Time `gorm:"index"`
|
||||
P1DisconnectTime time.Time `gorm:"index"`
|
||||
BookingRequestNumber *int `gorm:"index"`
|
||||
UtsQueue bool
|
||||
InterpreterAcceptedCount int
|
||||
InterpreterAccepted bool
|
||||
InterpreterConnectedCount int
|
||||
InterpreterConnected bool
|
||||
ClientDisconnected bool
|
||||
UtsDuration int
|
||||
UtsEntries int
|
||||
Status string
|
||||
SubStatus string
|
||||
FirstLanguageId int
|
||||
LastLanguageId int
|
||||
FirstInterpreter string
|
||||
}
|
||||
|
||||
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"
|
||||
}
|
||||
@@ -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,18 @@ 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;foreignKey"`
|
||||
Name string `json:"name"`
|
||||
Email string `json:"email"`
|
||||
State string `json:"state"`
|
||||
Username string `json:"username"`
|
||||
AcdAutoAnswer bool `json:"acdAutoAnswer"`
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package models
|
||||
|
||||
/*
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
@@ -21,3 +22,4 @@ type InterpreterAttempt struct {
|
||||
func (InterpreterAttempt) TableName() string {
|
||||
return "gc_interpreter_attempts"
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package models
|
||||
|
||||
/*
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
@@ -20,3 +21,4 @@ type InterpreterConnection struct {
|
||||
func (InterpreterConnection) TableName() string {
|
||||
return "gc_interpreter_connections"
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -17,11 +17,14 @@ 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;referencesId`
|
||||
User GCUser `gorm:"foreignKey:UserId;references:Id`
|
||||
}
|
||||
|
||||
func (DBParticipant) TableName() string {
|
||||
|
||||
@@ -20,7 +20,7 @@ type DBClientProcessed struct {
|
||||
// ---
|
||||
BuggedCall bool
|
||||
Amended bool
|
||||
CreatedAt time.Time
|
||||
CreatedAt time.Time `gorm:"autoCreateTime"`
|
||||
ModifiedAt time.Time
|
||||
CustomData *string `gorm:"type:json"`
|
||||
InternalUse *string `gorm:"type:json"`
|
||||
@@ -54,7 +54,7 @@ type DBClientProcessed struct {
|
||||
// PARTNER DETAILS:
|
||||
// ---
|
||||
PartnerBill float64
|
||||
ParnterRate float64
|
||||
PartnerRate float64
|
||||
|
||||
// TIMESTAMP DETAILS:
|
||||
// ---
|
||||
@@ -85,7 +85,7 @@ type DBInterpreterProcessed struct {
|
||||
// ---
|
||||
BuggedCall bool
|
||||
Amended bool
|
||||
CreatedAt time.Time
|
||||
CreatedAt time.Time `gorm:"autoCreateTime"`
|
||||
ModifiedAt time.Time
|
||||
CustomData *string `gorm:"type:json"`
|
||||
InternalUse *string `gorm:"type:json"`
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user