Compare commits
40 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 674f7dd5f5 | |||
| f50333d223 | |||
| a7f73eb96a | |||
| 57b4791a4a | |||
| 7737b8b4d2 | |||
| 2f2388caab | |||
| ff0f873dd8 | |||
| 7bf15cce48 | |||
| 643c5cc695 | |||
| 8b2b31ef3f | |||
| 423383a2f8 | |||
| 00b946fc8d | |||
| 4e5f789671 | |||
| ee521aa378 | |||
| c106209130 | |||
| 4c6eed2e47 | |||
| 0f4223e873 | |||
| faca742f5f | |||
| 3823096f4c | |||
| c9a99faa54 | |||
| e8aeb4d3b7 | |||
| a457849977 | |||
| bd807b3b1d | |||
| 1872e23ec1 | |||
| 24d4ab7bd0 | |||
| f5db0a0179 | |||
| c36c9eb809 | |||
| ed3f089736 | |||
| d862a79c0f | |||
| d5ba285a0c | |||
| d8e83b8e75 | |||
| 4b75eccdcd | |||
| 74e9fd3f37 | |||
| 194cb5bbe6 | |||
| aa15b86efd | |||
| b52f1cd80d | |||
| abf0d6caf0 | |||
| 42f9ba2848 | |||
| 055ad59d12 | |||
| d66df080fe |
17
models/amendment.go
Normal file
17
models/amendment.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
type DBAmendment struct {
|
||||
Id int `gorm:"primaryKey;autoIncrement"`
|
||||
ConversationId string `gorm:"index"`
|
||||
AmendmentColumn string
|
||||
AmendmentValue string
|
||||
Requestor string
|
||||
RequestedAt time.Time
|
||||
Sequence string
|
||||
}
|
||||
|
||||
func (DBAmendment) TableName() string {
|
||||
return "gc_amendments"
|
||||
}
|
||||
30
models/base_call.go
Normal file
30
models/base_call.go
Normal file
@@ -0,0 +1,30 @@
|
||||
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
|
||||
}
|
||||
|
||||
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"
|
||||
}
|
||||
29
models/call_stat.go
Normal file
29
models/call_stat.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package models
|
||||
|
||||
/*
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
type CallStat struct {
|
||||
ClientConversationId string `gorm:"primaryKey;index"`
|
||||
CallType string `gorm:"index"`
|
||||
ClientId int `gorm:"index"`
|
||||
CustomerDnis string
|
||||
CustomerAni string
|
||||
P1ConnectTime time.Time `gorm:"index"`
|
||||
P1DisconnectTime time.Time `gorm:"index"`
|
||||
BookingRequestNumber *int `gorm:"index"`
|
||||
UtsQueue bool
|
||||
InterpreterCount int
|
||||
InterpreterConnected bool
|
||||
ClientDisconnected bool
|
||||
UtsDuration int
|
||||
UtsEntries int
|
||||
Status string
|
||||
}
|
||||
|
||||
func (CallStat) TableName() string {
|
||||
return "gc_call_stats"
|
||||
}
|
||||
*/
|
||||
47
models/crm_client.go
Normal file
47
models/crm_client.go
Normal file
@@ -0,0 +1,47 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
type CrmClient struct {
|
||||
ID int `gorm:"primaryKey;column:id" json:"id"`
|
||||
BillingGroupNumber *int `gorm:"column:billing_group_number" json:"billing_group_number"`
|
||||
DrawdownCurrentBalance *float64 `gorm:"column:drawdown_current_balance" json:"drawdown_current_balance"`
|
||||
DrawdownInitialBalance *float64 `gorm:"column:drawdown_initial_balance" json:"drawdown_initial_balance"`
|
||||
ContractExpiry *time.Time `gorm:"column:contract_expiry;type:date" json:"contract_expiry"`
|
||||
CreatedDate *time.Time `gorm:"column:created_date;type:date" json:"created_date"`
|
||||
MBIE *bool `gorm:"column:mbie" json:"mbie"`
|
||||
FundingAvailable *bool `gorm:"column:funding_available" json:"funding_available"`
|
||||
DrawdownClient *bool `gorm:"column:drawdown_client" json:"drawdown_client"`
|
||||
CostCentreRequired *bool `gorm:"column:cost_centre_required" json:"cost_centre_required"`
|
||||
CallsRecordings *bool `gorm:"column:calls_recordings" json:"calls_recordings"`
|
||||
ABNNZBMNumber *string `gorm:"column:abn_nzbm_number" json:"abn_nzbm_number"`
|
||||
AccountsPayableEmail *string `gorm:"column:accounts_payable_email" json:"accounts_payable_email"`
|
||||
BillingGroup *string `gorm:"column:billing_group" json:"billing_group"`
|
||||
BusinessAddress *string `gorm:"column:business_address" json:"business_address"`
|
||||
Name *string `gorm:"column:name" json:"name"`
|
||||
Notes *string `gorm:"column:notes" json:"notes"`
|
||||
Owner *string `gorm:"column:owner" json:"owner"`
|
||||
PhoneNumber *string `gorm:"column:phone_number" json:"phone_number"`
|
||||
ServicePhone *string `gorm:"column:service_phone" json:"service_phone"`
|
||||
Status *string `gorm:"column:status" json:"status"`
|
||||
ContactName *string `gorm:"column:contact_name" json:"contact_name"`
|
||||
ContractSigned *string `gorm:"column:contract_signed" json:"contract_signed"`
|
||||
CreatedBy *string `gorm:"column:created_by" json:"created_by"`
|
||||
DrawdownPONumber *string `gorm:"column:drawdown_po_number" json:"drawdown_po_number"`
|
||||
GenderPreference *string `gorm:"column:gender_preference" json:"gender_preference"`
|
||||
GSTNumber *string `gorm:"column:gst_number" json:"gst_number"`
|
||||
InvoiceConfig *string `gorm:"column:invoice_config" json:"invoice_config"`
|
||||
CustomerReference *string `gorm:"column:customer_reference" json:"customer_reference"`
|
||||
PartnerName *string `gorm:"column:partner_name" json:"partner_name"`
|
||||
POReference *string `gorm:"column:po_reference" json:"po_reference"`
|
||||
PostalAddress *string `gorm:"column:postal_address" json:"postal_address"`
|
||||
SearchPattern *string `gorm:"column:search_pattern" json:"search_pattern"`
|
||||
State *string `gorm:"column:state" json:"state"`
|
||||
ReportEmails *string `gorm:"column:report_emails" json:"report_emails"`
|
||||
}
|
||||
|
||||
func (CrmClient) TableName() string {
|
||||
return "live_clients"
|
||||
}
|
||||
66
models/crm_interpreter.go
Normal file
66
models/crm_interpreter.go
Normal file
@@ -0,0 +1,66 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
type CrmInterpreter struct {
|
||||
ID int `gorm:"primaryKey;column:id" json:"id"`
|
||||
ABN *string `gorm:"column:abn" json:"abn"`
|
||||
AccountNumber *string `gorm:"column:account_number" json:"account_number"`
|
||||
AccountStatus *string `gorm:"column:account_status" json:"account_status"`
|
||||
Address *string `gorm:"column:address" json:"address"`
|
||||
BankName *string `gorm:"column:bank_name" json:"bank_name"`
|
||||
BSB *string `gorm:"column:bsb" json:"bsb"`
|
||||
ContractStatus *string `gorm:"column:contract_status" json:"contract_status"`
|
||||
BirthCountry *string `gorm:"column:birth_country" json:"birth_country"`
|
||||
CreatedBy *string `gorm:"column:created_by" json:"created_by"`
|
||||
CurrentPhone *string `gorm:"column:current_phone" json:"current_phone"`
|
||||
DateOfBirth *string `gorm:"column:date_of_birth" json:"date_of_birth"`
|
||||
Email *string `gorm:"column:email" json:"email"`
|
||||
EmployedBy *string `gorm:"column:employed_by" json:"employed_by"`
|
||||
EnrolmentDate *string `gorm:"column:enrolment_date" json:"enrolment_date"`
|
||||
FinanceTasksCompleted *bool `gorm:"column:finance_tasks_completed" json:"finance_tasks_completed"`
|
||||
GST *bool `gorm:"column:gst" json:"gst"`
|
||||
NZGovApproved *bool `gorm:"column:nz_gov_approved" json:"nz_gov_approved"`
|
||||
NaatiListed *bool `gorm:"column:naati_listed" json:"naati_listed"`
|
||||
PersonalCV *bool `gorm:"column:personal_cv" json:"personal_cv"`
|
||||
PinViaSMS *bool `gorm:"column:pin_via_sms" json:"pin_via_sms"`
|
||||
VaxFluCheck *bool `gorm:"column:vax_flu_check" json:"vax_flu_check"`
|
||||
WorkingWithChildren *bool `gorm:"column:working_with_children" json:"working_with_children"`
|
||||
LastContactAttempt *time.Time `gorm:"column:last_contact_attempt" json:"last_contact_attempt"`
|
||||
MigrationYear *time.Time `gorm:"column:migration_year" json:"migration_year"`
|
||||
FirstName *string `gorm:"column:first_name" json:"first_name"`
|
||||
Gender *string `gorm:"column:gender" json:"gender"`
|
||||
FullName *string `gorm:"column:full_name" json:"full_name"`
|
||||
Owner *string `gorm:"column:owner" json:"owner"`
|
||||
TranslationType *string `gorm:"column:translation_type" json:"translation_type"`
|
||||
Status *string `gorm:"column:status" json:"status"`
|
||||
GSTNumber *string `gorm:"column:gst_number" json:"gst_number"`
|
||||
LastName *string `gorm:"column:last_name" json:"last_name"`
|
||||
Layout *string `gorm:"column:layout" json:"layout"`
|
||||
ModifiedBy *string `gorm:"column:modified_by" json:"modified_by"`
|
||||
NaatiCertification *string `gorm:"column:naati_certification" json:"naati_certification"`
|
||||
NaatiCertificationID *string `gorm:"column:naati_certification_id" json:"naati_certification_id"`
|
||||
Notes *string `gorm:"column:notes" json:"notes"`
|
||||
NZBN *string `gorm:"column:nzbn" json:"nzbn"`
|
||||
Password *string `gorm:"column:password" json:"password"`
|
||||
PaymentState *string `gorm:"column:payment_state" json:"payment_state"`
|
||||
PhotoID *string `gorm:"column:photo_id" json:"photo_id"`
|
||||
PhotoIDExpiry *string `gorm:"column:photo_id_expiry" json:"photo_id_expiry"`
|
||||
Pin *string `gorm:"column:pin" json:"pin"`
|
||||
PoliceCheck *string `gorm:"column:police_check" json:"police_check"`
|
||||
PoliceCheckExpiry *string `gorm:"column:police_check_expiry" json:"police_check_expiry"`
|
||||
Postcode *string `gorm:"column:postcode" json:"postcode"`
|
||||
Priority *string `gorm:"column:priority" json:"priority"`
|
||||
State *string `gorm:"column:state" json:"state"`
|
||||
Status2 *string `gorm:"column:status_2" json:"status_2"`
|
||||
Suburb *string `gorm:"column:suburb" json:"suburb"`
|
||||
Tag *string `gorm:"column:tag" json:"tag"`
|
||||
VaxCovidCheck *string `gorm:"column:vax_covid_check" json:"vax_covid_check"`
|
||||
CRMID *string `gorm:"column:crm_id" json:"crm_id"`
|
||||
}
|
||||
|
||||
func (CrmInterpreter) TableName() string {
|
||||
return "live_interpreters"
|
||||
}
|
||||
34
models/crm_invoice_config.go
Normal file
34
models/crm_invoice_config.go
Normal file
@@ -0,0 +1,34 @@
|
||||
package models
|
||||
|
||||
import ()
|
||||
|
||||
type CrmInvoiceConfig struct {
|
||||
ID string `gorm:"primaryKey;column:id" json:"id"`
|
||||
Name string `gorm:"column:name;not null" json:"name"`
|
||||
BHEndHour *int `gorm:"column:bh_end_hour" json:"bh_end_hour"`
|
||||
BHEndMinute *int `gorm:"column:bh_end_minute" json:"bh_end_minute"`
|
||||
BHStartHour *int `gorm:"column:bh_start_hour" json:"bh_start_hour"`
|
||||
BHStartMinute *int `gorm:"column:bh_start_minute" json:"bh_start_minute"`
|
||||
MaximumDuration *int `gorm:"column:maximum_duration" json:"maximum_duration"`
|
||||
MinimumDuration *int `gorm:"column:minimum_duration" json:"minimum_duration"`
|
||||
OnDemandAH *string `gorm:"column:on_demand_ah" json:"on_demand_ah"`
|
||||
OnDemandBH *string `gorm:"column:on_demand_bh" json:"on_demand_bh"`
|
||||
AudioBookingAH *string `gorm:"column:audio_booking_ah" json:"audio_booking_ah"`
|
||||
AudioBookingBH *string `gorm:"column:audio_booking_bh" json:"audio_booking_bh"`
|
||||
VideoBookingAH *string `gorm:"column:video_booking_ah" json:"video_booking_ah"`
|
||||
VideoBookingBH *string `gorm:"column:video_booking_bh" json:"video_booking_bh"`
|
||||
PartnerOnDemandAH *string `gorm:"column:partner_on_demand_ah" json:"partner_on_demand_ah"`
|
||||
PartnerOnDemandBH *string `gorm:"column:partner_on_demand_bh" json:"partner_on_demand_bh"`
|
||||
PartnerAudioBookingAH *string `gorm:"column:partner_audio_booking_ah" json:"partner_audio_booking_ah"`
|
||||
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"`
|
||||
SplitBookings *bool `gorm:"column:split_bookings" json:"split_bookings"`
|
||||
SplitOnDemand *bool `gorm:"column:split_on_demand" json:"split_on_demand"`
|
||||
}
|
||||
|
||||
func (CrmInvoiceConfig) TableName() string {
|
||||
return "live_invoice_configs"
|
||||
}
|
||||
12
models/crm_language.go
Normal file
12
models/crm_language.go
Normal file
@@ -0,0 +1,12 @@
|
||||
package models
|
||||
|
||||
type CrmLanguage struct {
|
||||
ID int `gorm:"primaryKey;column:id" json:"id"`
|
||||
Name *string `gorm:"column:name" json:"name"`
|
||||
Active *bool `gorm:"column:active" json:"active"`
|
||||
CRMID *string `gorm:"column:crm_id" json:"crm_id"`
|
||||
}
|
||||
|
||||
func (CrmLanguage) TableName() string {
|
||||
return "live_languages"
|
||||
}
|
||||
22
models/crm_language_lookup.go
Normal file
22
models/crm_language_lookup.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
type CrmLanguageLookup struct {
|
||||
ID string `gorm:"primaryKey;column:id" json:"id"`
|
||||
Language *string `gorm:"column:language" json:"language"`
|
||||
CustomRateFunction *string `gorm:"column:custom_rate_function" json:"custom_rate_function"`
|
||||
Interpreter *string `gorm:"column:interpreter" json:"interpreter"`
|
||||
NaatiDescription *string `gorm:"column:naati_description" json:"naati_description"`
|
||||
NaatiNumber *string `gorm:"column:naati_number" json:"naati_number"`
|
||||
NaatiExpiry *time.Time `gorm:"column:naati_expiry;type:date" json:"naati_expiry"`
|
||||
NaatiLevel *int `gorm:"column:naati_level" json:"naati_level"`
|
||||
Priority *int `gorm:"column:priority" json:"priority"`
|
||||
Searchable *bool `gorm:"column:searchable" json:"searchable"`
|
||||
WorkingTowardsNaati *bool `gorm:"column:working_towards_naati" json:"working_towards_naati"`
|
||||
PaymentConfiguration *string `gorm:"column:payment_configuration" json:"payment_configuration"`
|
||||
}
|
||||
|
||||
func (CrmLanguageLookup) TableName() string {
|
||||
return "live_language_lookups"
|
||||
}
|
||||
18
models/crm_payment_config.go
Normal file
18
models/crm_payment_config.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package models
|
||||
|
||||
type CrmPaymentConfig struct {
|
||||
ID string `gorm:"primaryKey;column:id" json:"id"`
|
||||
Name string `gorm:"column:name;not null" json:"name"`
|
||||
BHEndHour *int `gorm:"column:bh_end_hour" json:"bh_end_hour"`
|
||||
BHEndMinute *int `gorm:"column:bh_end_minute" json:"bh_end_minute"`
|
||||
BHStartHour *int `gorm:"column:bh_start_hour" json:"bh_start_hour"`
|
||||
BHStartMinute *int `gorm:"column:bh_start_minute" json:"bh_start_minute"`
|
||||
OnDemand *string `gorm:"column:on_demand" json:"on_demand"`
|
||||
AudioBooking *string `gorm:"column:audio_booking" json:"audio_booking"`
|
||||
VideoBooking *string `gorm:"column:video_booking" json:"video_booking"`
|
||||
TimeZone *string `gorm:"column:time_zone" json:"time_zone"`
|
||||
}
|
||||
|
||||
func (CrmPaymentConfig) TableName() string {
|
||||
return "live_payment_configs"
|
||||
}
|
||||
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"
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
type Conversation 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 []struct {
|
||||
Address *string
|
||||
Attributes *string `gorm:"type:json"`
|
||||
ConnectedTime *time.Time `gorm:"index"`
|
||||
ConversationId string `gorm:"foreignKey;index"`
|
||||
EndTime *time.Time `gorm:"index"`
|
||||
ExternalContactId *string
|
||||
ExternalContactInitialDivisionId *string
|
||||
Id string `gorm:"primaryKey;index"`
|
||||
MediaRoles *string `gorm:"type:json"`
|
||||
Name *string `gorm:"index"`
|
||||
Purpose *string `gorm:"index"`
|
||||
QueueId *string
|
||||
Wrapup *string `gorm:"type:json"`
|
||||
WrapupExpected *bool
|
||||
WrapupRequired *bool
|
||||
Sessions []struct {
|
||||
Ani string
|
||||
Direction string
|
||||
Dnis string
|
||||
EdgeId string
|
||||
Id string `gorm:"primaryKey;index"`
|
||||
MediaEndpointStats string `gorm:"type:json"`
|
||||
MediaType string
|
||||
Metrics string `gorm:"type:json"`
|
||||
ParticipantId string `gorm:"foreignKey;index"`
|
||||
ProtocolCallId string
|
||||
Provider string
|
||||
Recording bool
|
||||
RemoteNameDisplayable string
|
||||
SessionDnis string
|
||||
Segments []struct {
|
||||
Id string `gorm:"primaryKey;index"`
|
||||
Conference bool
|
||||
DisconnectType string
|
||||
Q850ResponseCodes string `gorm:"type:json"`
|
||||
SegmentEnd time.Time `gorm:"index"`
|
||||
SegmentStart time.Time `gorm:"index"`
|
||||
SegmentType string `gorm:"index"`
|
||||
SessionId string `gorm:"foreignKey"`
|
||||
WrapUpCode string
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
205
models/gencloud.go
Normal file
205
models/gencloud.go
Normal file
@@ -0,0 +1,205 @@
|
||||
package models
|
||||
|
||||
type AnalyticsConversationWithAttributesQuery struct {
|
||||
Conversations []AnalyticsConversationWithAttributes `json:"conversations"`
|
||||
Cursor *string `json:"cursor"`
|
||||
}
|
||||
|
||||
type AnalyticsConversationWithAttributes struct {
|
||||
ConversationEnd string `json:"conversationEnd"`
|
||||
ConversationId string `json:"conversationId"`
|
||||
ConversationStart string `json:"conversationStart"`
|
||||
DivisionIds []string `json:"divisionIds"`
|
||||
ExternalTag string `json:"externalTag"`
|
||||
MediaStatsMinConversationMos float32 `json:"mediaStatsMinConversationMos"`
|
||||
MediaStatsMinConversationRFactor float32 `json:"mediaStatsMinConversationRFactor"`
|
||||
OriginatingDirection string `json:"originatingDirection"`
|
||||
Participants []struct {
|
||||
ExternalContactId string `json:"externalContactId"`
|
||||
ParticipantId string `json:"id"`
|
||||
ParticipantName string `json:"participantName"`
|
||||
Purpose string `json:"purpose"`
|
||||
Sessions []struct {
|
||||
ANI string `json:"ani"`
|
||||
Direction string `json:"direction"`
|
||||
DNIS string `json:"dnis"`
|
||||
EdgeId string `json:"edgeId"`
|
||||
MediaType string `json:"mediaType"`
|
||||
ProtocolCallId string `json:"protocolCallId"`
|
||||
Provider string `json:"provider"`
|
||||
Recording bool `json:"recording"`
|
||||
RemoteNameDisplayable string `json:"remoteNameDisplayable"`
|
||||
SessionDnis string `json:"sessionDnis"`
|
||||
SessionId string `json:"sessionId"`
|
||||
MediaEndpointStats []struct {
|
||||
Codecs []string `json:"codecs"`
|
||||
EventTime string `json:"eventTime"`
|
||||
MaxLatencyMs int `json:"maxLatencyMs"`
|
||||
MinMos float32 `json:"minMos"`
|
||||
MinRFactor float32 `json:"minRFactor"`
|
||||
ReceivedPackets int `json:"receivedPackets"`
|
||||
} `json:"mediaEndpointStats"`
|
||||
Metrics []struct {
|
||||
EmitDate string `json:"emitDate"`
|
||||
Name string `json:"name"`
|
||||
Value int `json:"value"`
|
||||
} `json:"metrics"`
|
||||
Segments []struct {
|
||||
Conference bool `json:"conference"`
|
||||
DisconnectType string `json:"disconnectType"`
|
||||
Q850ResponseCodes []int `json:"q850ResponseCodes"`
|
||||
SegmentEnd string `json:"segmentEnd"`
|
||||
SegmentStart string `json:"segmentStart"`
|
||||
SegmentType string `json:"segmentType"`
|
||||
WrapUpCode string `json:"wrapUpCode"`
|
||||
} `json:"segments"`
|
||||
} `json:"sessions"`
|
||||
Attributes map[string]any `json:"attributes"`
|
||||
} `json:"participants"`
|
||||
}
|
||||
|
||||
type AnalyticsConversationWithoutAttributesQuery struct {
|
||||
Conversations []AnalyticsConversationWithoutAttributes `json:"conversations"`
|
||||
TotalHits int `json:"totalHits"`
|
||||
}
|
||||
type AnalyticsConversationWithoutAttributes struct {
|
||||
ConversationId string `json:"conversationId"`
|
||||
ConversationStart string `json:"conversationStart"`
|
||||
ConversationEnd string `json:"conversationEnd"`
|
||||
MediaStatsMinConversationMos float32 `json:"mediaStatsMinConversationMos"`
|
||||
MediaStatsMinConversationRFactor float32 `json:"mediaStatsMinConversationRFactor"`
|
||||
OriginatingDirection string `json:"originatingDirection"`
|
||||
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"`
|
||||
Sessions []struct {
|
||||
MediaType string `json:"mediaType"`
|
||||
SessionId string `json:"sessionId"`
|
||||
ANI string `json:"ani"`
|
||||
Direction string `json:"direction"`
|
||||
DNIS string `json:"dnis"`
|
||||
SessionDNIS string `json:"sessionDnis"`
|
||||
EdgeId string `json:"edgeId"`
|
||||
RemoteNameDisplayable string `json:"remoteNameDisplayable"`
|
||||
Segments []struct {
|
||||
SegmentStart string `json:"segmentStart"`
|
||||
SegmentEnd string `json:"segmentEnd"`
|
||||
WrapUpCode string `json:"wrapUpCode"`
|
||||
DisconnectType string `json:"disconnectType"`
|
||||
SegmentType string `json:"SegmentType"`
|
||||
Q850ResponseCodes []int `json:"q850ResponseCodes"`
|
||||
Conference bool `json:"conference"`
|
||||
} `json:"segments"`
|
||||
Flow struct {
|
||||
EndingLanguage string `json:"endingLanguage"`
|
||||
EntryReason string `json:"entryReason"`
|
||||
EntryType string `json:"entryType"`
|
||||
ExitReason string `json:"exitReason"`
|
||||
FlowId string `json:"flowId"`
|
||||
FlowName string `json:"flowName"`
|
||||
FlowType string `json:"flowType"`
|
||||
FlowVersion string `json:"flowVersion"`
|
||||
StartingLanguage string `json:"startingLanguage"`
|
||||
TransferTargetAddress string `json:"transferTargetAddress"`
|
||||
TransferTargetName string `json:"transferTargetName"`
|
||||
TransferType string `json:"transferType"`
|
||||
} `json:"flow"`
|
||||
Metrics []struct {
|
||||
Name string `json:"name"`
|
||||
Value int `json:"value"`
|
||||
EmitDate string `json:"emitDate"`
|
||||
} `json:"metrics"`
|
||||
MediaEndpointStats []struct {
|
||||
Codecs []string `json:"codecs"`
|
||||
MinMos float32 `json:"minMos"`
|
||||
MinRFactor float32 `json:"minRFactor"`
|
||||
MaxLatencyMs int `json:"maxLatencyMs"`
|
||||
ReceivedPackets int `json:"receivedPackets"`
|
||||
} `json:"mediaEndpointStats"`
|
||||
Recording bool `json:"recording"`
|
||||
ProtocolCallId string `json:"protocolCallId"`
|
||||
Provider string `json:"provider"`
|
||||
} `json:"sessions"`
|
||||
} `json:"participants"`
|
||||
}
|
||||
|
||||
type NotificationConversationWithAttributes struct {
|
||||
Address string `json:"address"`
|
||||
Divisions []struct {
|
||||
Division struct {
|
||||
Id string `json:"id"`
|
||||
SelfUri string `json:"selfUri"`
|
||||
} `json:"division"`
|
||||
Entities []struct {
|
||||
DateDivisionUpdated string `json:"dateDivisionUpdated"`
|
||||
Id string `json:"id"`
|
||||
SelfUri string `json:"selfUri"`
|
||||
} `json:"entities"`
|
||||
} `json:"divisions"`
|
||||
ExternalTag string `json:"externalTag"`
|
||||
Id string `json:"id"`
|
||||
Participants []struct {
|
||||
Address string `json:"address"`
|
||||
Attributes map[string]any `json:"attributes"`
|
||||
Calls []struct {
|
||||
AfterCallWorkRequired bool `json:"afterCallWorkRequired"`
|
||||
Confined bool `json:"confined"`
|
||||
ConnectedTime string `json:"connectedTime"`
|
||||
Direction string `json:"direction"`
|
||||
DisconnectReasons []struct{} `json:"disconnectReasons"`
|
||||
DisconnectType string `json:"disconnectType"`
|
||||
DisconnectedTime string `json:"disconnectedTime"`
|
||||
Held bool `json:"held"`
|
||||
Id string `json:"id"`
|
||||
InitialState string `json:"initialState"`
|
||||
Muted bool `json:"muted"`
|
||||
Other map[string]any `json:"other"`
|
||||
PeerId string `json:"peerId"`
|
||||
Provider string `json:"provider"`
|
||||
Recording bool `json:"recording"`
|
||||
RecordingState string `json:"recordingState"`
|
||||
SecurePause bool `json:"securePause"`
|
||||
Self map[string]any `json:"self"`
|
||||
State string `json:"state"`
|
||||
} `json:"calls"`
|
||||
ConnectedTime string `json:"connectedTime"`
|
||||
EndTime string `json:"endTime"`
|
||||
ExternalContactId string `json:"externalContactId"`
|
||||
ExternalContactInitialDivisionId string `json:"externalContactInitialDivisionId"`
|
||||
Id string `json:"id"`
|
||||
MediaRoles []string `json:"mediaRoles"`
|
||||
Name string `json:"name"`
|
||||
Purpose string `json:"purpose"`
|
||||
QueueId string `json:"queueId"`
|
||||
Wrapup map[string]any `json:"wrapup"`
|
||||
WrapupExpected bool `json:"wrapupExpected"`
|
||||
WrapupRequired bool `json:"wrapupRequired"`
|
||||
} `json:"participants"`
|
||||
RecentTransfers []map[string]any `json:"recentTransfers"`
|
||||
RecordingState string `json:"recordingState"`
|
||||
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"`
|
||||
}
|
||||
|
||||
func (GCUser) TableName() string {
|
||||
return "gc_users"
|
||||
}
|
||||
25
models/interpreter_attempt.go
Normal file
25
models/interpreter_attempt.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package models
|
||||
|
||||
/*
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
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"
|
||||
}
|
||||
*/
|
||||
24
models/interpreter_connection.go
Normal file
24
models/interpreter_connection.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package models
|
||||
|
||||
/*
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
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"
|
||||
}
|
||||
*/
|
||||
@@ -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;references:Id"`
|
||||
User *GCUser `gorm:"foreignKey:UserId;references:Id"`
|
||||
}
|
||||
|
||||
func (DBParticipant) TableName() string {
|
||||
|
||||
184
models/processed.go
Normal file
184
models/processed.go
Normal file
@@ -0,0 +1,184 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
type DBClientProcessed struct {
|
||||
|
||||
// CALL DETAILS
|
||||
// ---
|
||||
ClientConversationId string `gorm:"primaryKey"`
|
||||
CallType string
|
||||
GenderPreference string
|
||||
BookingReference *int
|
||||
IvrData *int
|
||||
BillableClient bool
|
||||
CallOutcome string
|
||||
|
||||
// FLAGS / METADATA:
|
||||
// ---
|
||||
BuggedCall bool
|
||||
Amended bool
|
||||
CreatedAt time.Time `gorm:"autoCreateTime"`
|
||||
ModifiedAt time.Time
|
||||
CustomData *string `gorm:"type:json"`
|
||||
InternalUse *string `gorm:"type:json"`
|
||||
|
||||
// LANGUAGE DETAILS:
|
||||
// ---
|
||||
LanguageId int
|
||||
LanguageCrmId string
|
||||
LanguageName string
|
||||
|
||||
// CLIENT DETAILS:
|
||||
// ---
|
||||
ClientId int
|
||||
CustomerDnis string
|
||||
CustomerAni string
|
||||
ClientName string
|
||||
ClientState string
|
||||
ClientFunding bool
|
||||
ClientGroupId int
|
||||
ClientGroupName string
|
||||
ClientPoReference string
|
||||
InvoiceConfigCrmId string
|
||||
InvoiceConfigName string
|
||||
InvoiceConfigUsed string
|
||||
ClientCallDuration int
|
||||
ClientTimeOfDay string
|
||||
ClientBill float64
|
||||
ClientRate float64
|
||||
ClientTaxStatus string
|
||||
|
||||
// PARTNER DETAILS:
|
||||
// ---
|
||||
PartnerBill float64
|
||||
PartnerRate float64
|
||||
|
||||
// TIMESTAMP DETAILS:
|
||||
// ---
|
||||
P1SearchStartTime *time.Time
|
||||
P1ConnectTime time.Time
|
||||
P1DisconnectTime time.Time
|
||||
P3ConnectTime *time.Time
|
||||
P3DisconnectTime *time.Time
|
||||
}
|
||||
|
||||
func (DBClientProcessed) TableName() string {
|
||||
return "gc_client_processed"
|
||||
}
|
||||
|
||||
type DBInterpreterProcessed struct {
|
||||
|
||||
// CALL DETAILS
|
||||
// ---
|
||||
ClientConversationId string
|
||||
InterpreterConversationId string `gorm:"primaryKey"`
|
||||
CallType string
|
||||
GenderPreference string
|
||||
BookingReference *int
|
||||
BillableInterpreter bool
|
||||
BillableTpa bool
|
||||
|
||||
// FLAGS / METADATA:
|
||||
// ---
|
||||
BuggedCall bool
|
||||
Amended bool
|
||||
CreatedAt time.Time `gorm:"autoCreateTime"`
|
||||
ModifiedAt time.Time
|
||||
CustomData *string `gorm:"type:json"`
|
||||
InternalUse *string `gorm:"type:json"`
|
||||
|
||||
// LANGUAGE DETAILS:
|
||||
// ---
|
||||
LanguageId int
|
||||
LanguageCrmId string
|
||||
LanguageName string
|
||||
|
||||
// CLIENT DETAILS:
|
||||
// ---
|
||||
ClientId int
|
||||
ClientName string
|
||||
ClientState string
|
||||
|
||||
// INTERPRETER DETAILS:
|
||||
// ---
|
||||
InterpreterId int
|
||||
InterpreterCrmId string
|
||||
InterpreterName string
|
||||
InterpreterPhone string
|
||||
InterpreterGst bool
|
||||
InterpreterNaatiId string
|
||||
InterpreterGender string
|
||||
InterpreterState string
|
||||
InterpreterPaymentState string
|
||||
InterpreterEmployer string
|
||||
InterpreterLanguagePriority int
|
||||
InterpreterLanguageNaatiLevel int
|
||||
InterpreterLanguageNaatiDescription string
|
||||
InterpreterLanguageWtn bool
|
||||
InterpreterCallDuration int
|
||||
InterpreterTimeOfDay string
|
||||
InterpreterPayment float64
|
||||
InterpreterRate float64
|
||||
PaymentConfigCrmId string
|
||||
PaymentConfigName string
|
||||
PaymentConfigUsed string
|
||||
|
||||
// TIMESTAMP DETAILS:
|
||||
// ---
|
||||
P1SearchStartTime *time.Time
|
||||
P1ConnectTime time.Time
|
||||
P1DisconnectTime time.Time
|
||||
P2SearchStartTime *time.Time
|
||||
P2AcceptanceTime time.Time
|
||||
P2ConferenceTime time.Time
|
||||
P2DisconnectTime time.Time
|
||||
}
|
||||
|
||||
func (DBInterpreterProcessed) TableName() string {
|
||||
return "gc_interpreter_processed"
|
||||
}
|
||||
|
||||
/*
|
||||
type Processed struct {
|
||||
ClientConversationId string `gorm:"index"`
|
||||
InterpreterConversationId string `gorm:"primaryKey;index"`
|
||||
CallType string `gorm:"index"`
|
||||
GenderPreference string
|
||||
LanguageId int
|
||||
ClientId int `gorm:"index"`
|
||||
CustomerDnis string
|
||||
CustomerAni string
|
||||
InterpreterId int
|
||||
SearchStartTime time.Time `gorm:"index"`
|
||||
ClientIndex int
|
||||
NesIndex int
|
||||
P2ConnectTimeUtc time.Time `gorm:"index"`
|
||||
P2DisconnectTimeUtc time.Time `gorm:"index"`
|
||||
P1ConnectTimeUtc time.Time `gorm:"index"`
|
||||
P1DisconnectTimeUtc time.Time `gorm:"index"`
|
||||
P3ConnectTimeUtc *time.Time
|
||||
P3DisconnectTimeUtc *time.Time
|
||||
BookingRequestNumber *int `gorm:"index"`
|
||||
IvrData *int
|
||||
UtsEntries int
|
||||
InterpreterCount int
|
||||
Flags *string `gorm:"type:json"`
|
||||
Metadata *string `gorm:"type:json"`
|
||||
// Client data
|
||||
ClientCrmData string `gorm:"type:json"`
|
||||
InvoiceConfigCrmData string `gorm:"type:json"`
|
||||
LanguageCrmData string `gorm:"type:json"`
|
||||
InterpreterCrmData string `gorm:"type:json"`
|
||||
LanguageLookupCrmData string `gorm:"type:json"`
|
||||
VicTimezoneData string `gorm:"type:json"`
|
||||
NzTimezoneData string `gorm:"type:json"`
|
||||
LocalTimezoneData string `gorm:"type:json"`
|
||||
}
|
||||
|
||||
func (Processed) TableName() string {
|
||||
return "gc_processed"
|
||||
}
|
||||
*/
|
||||
@@ -8,6 +8,7 @@ type DBQueueLog struct {
|
||||
Start time.Time `gorm:"index"`
|
||||
End time.Time `gorm:"index"`
|
||||
Duration float64
|
||||
NextQueue string
|
||||
Result string `gorm:"type:json"`
|
||||
}
|
||||
|
||||
|
||||
188
models/raw.go
188
models/raw.go
@@ -1,171 +1,27 @@
|
||||
package models
|
||||
|
||||
type AnalyticsConversationWithAttributesQuery struct {
|
||||
Conversations []AnalyticsConversationWithAttributes `json:"conversations"`
|
||||
Cursor *string `json:"cursor"`
|
||||
import "time"
|
||||
|
||||
type GCRaw struct {
|
||||
ClientConversationId string
|
||||
InterpreterConversationId string
|
||||
LanguageId int
|
||||
CallType string
|
||||
GenderPreference string
|
||||
ClientId int
|
||||
CustomerDnis string
|
||||
CustomerAni string
|
||||
ClientConnectTimeUtc *time.Time
|
||||
ClientDisconnectTimeUtc *time.Time
|
||||
NesConnectTimeUtc *time.Time
|
||||
NesDisconnectTimeUtc *time.Time
|
||||
BookingReference *int
|
||||
IvrData *int
|
||||
InterpreterId int
|
||||
InterpreterConnectTimeUtc time.Time
|
||||
InterpreterDisconnectTimeUtc time.Time
|
||||
}
|
||||
|
||||
type AnalyticsConversationWithAttributes struct {
|
||||
ConversationEnd string `json:"conversationEnd"`
|
||||
ConversationId string `json:"conversationId"`
|
||||
ConversationStart string `json:"conversationStart"`
|
||||
DivisionIds []string `json:"divisionIds"`
|
||||
ExternalTag string `json:"externalTag"`
|
||||
MediaStatsMinConversationMos float32 `json:"mediaStatsMinConversationMos"`
|
||||
MediaStatsMinConversationRFactor float32 `json:"mediaStatsMinConversationRFactor"`
|
||||
OriginatingDirection string `json:"originatingDirection"`
|
||||
Participants []struct {
|
||||
ExternalContactId string `json:"externalContactId"`
|
||||
ParticipantId string `json:"participantId"`
|
||||
ParticipantName string `json:"participantName"`
|
||||
Purpose string `json:"purpose"`
|
||||
Sessions []struct {
|
||||
ANI string `json:"ani"`
|
||||
Direction string `json:"direction"`
|
||||
DNIS string `json:"dnis"`
|
||||
EdgeId string `json:"edgeId"`
|
||||
MediaType string `json:"mediaType"`
|
||||
ProtocolCallId string `json:"protocolCallId"`
|
||||
Provider string `json:"provider"`
|
||||
Recording bool `json:"recording"`
|
||||
RemoteNameDisplayable string `json:"remoteNameDisplayable"`
|
||||
SessionDnis string `json:"sessionDnis"`
|
||||
SessionId string `json:"sessionId"`
|
||||
MediaEndpointStats []struct {
|
||||
Codecs []string `json:"codecs"`
|
||||
EventTime string `json:"eventTime"`
|
||||
MaxLatencyMs int `json:"maxLatencyMs"`
|
||||
MinMos float32 `json:"minMos"`
|
||||
MinRFactor float32 `json:"minRFactor"`
|
||||
ReceivedPackets int `json:"receivedPackets"`
|
||||
} `json:"mediaEndpointStats"`
|
||||
Metrics []struct {
|
||||
EmitDate string `json:"emitDate"`
|
||||
Name string `json:"name"`
|
||||
Value int `json:"value"`
|
||||
} `json:"metrics"`
|
||||
Segments []struct {
|
||||
Conference bool `json:"conference"`
|
||||
DisconnectType string `json:"disconnectType"`
|
||||
Q850ResponseCodes []int `json:"q850ResponseCodes"`
|
||||
SegmentEnd string `json:"segmentEnd"`
|
||||
SegmentStart string `json:"segmentStart"`
|
||||
SegmentType string `json:"segmentType"`
|
||||
WrapUpCode string `json:"wrapUpCode"`
|
||||
} `json:"segments"`
|
||||
} `json:"sessions"`
|
||||
Attributes map[string]any `json:"attributes"`
|
||||
} `json:"participants"`
|
||||
}
|
||||
|
||||
type AnalyticsConversationWithoutAttributesQuery struct {
|
||||
Conversations []AnalyticsConversationWithoutAttributes `json:"conversations"`
|
||||
TotalHits int `json:"totalHits"`
|
||||
}
|
||||
type AnalyticsConversationWithoutAttributes struct {
|
||||
ConversationId string `json:"conversationId"`
|
||||
ConversationStart string `json:"conversationStart"`
|
||||
ConversationEnd string `json:"conversationEnd"`
|
||||
MediaStatsMinConversationMos float32 `json:"mediaStatsMinConversationMos"`
|
||||
MediaStatsMinConversationRFactor float32 `json:"mediaStatsMinConversationRFactor"`
|
||||
OriginatingDirection string `json:"originatingDirection"`
|
||||
DivisionIds []string `json:"divisionIds"`
|
||||
Participants []struct {
|
||||
ParticipantId string `json:"participantId"`
|
||||
ParticipantName string `json:"participantName"`
|
||||
Purpose string `json:"purpose"`
|
||||
ExternalContactId string `json:"externalContactId"`
|
||||
Sessions []struct {
|
||||
MediaType string `json:"mediaType"`
|
||||
SessionId string `json:"sessionId"`
|
||||
ANI string `json:"ani"`
|
||||
Direction string `json:"direction"`
|
||||
DNIS string `json:"dnis"`
|
||||
SessionDNIS string `json:"sessionDnis"`
|
||||
EdgeId string `json:"edgeId"`
|
||||
RemoteNameDisplayable string `json:"remoteNameDisplayable"`
|
||||
Segments []struct {
|
||||
SegmentStart string `json:"segmentStart"`
|
||||
SegmentEnd string `json:"segmentEnd"`
|
||||
WrapUpCode string `json:"wrapUpCode"`
|
||||
DisconnectType string `json:"disconnectType"`
|
||||
SegmentType string `json:"SegmentType"`
|
||||
Q850ResponseCodes []int `json:"q850ResponseCodes"`
|
||||
Conference bool `json:"conference"`
|
||||
} `json:"segments"`
|
||||
Metrics []struct {
|
||||
Name string `json:"name"`
|
||||
Value int `json:"value"`
|
||||
EmitDate string `json:"emitDate"`
|
||||
} `json:"metrics"`
|
||||
MediaEndpointStats []struct {
|
||||
Codecs []string `json:"codecs"`
|
||||
MinMos float32 `json:"minMos"`
|
||||
MinRFactor float32 `json:"minRFactor"`
|
||||
MaxLatencyMs int `json:"maxLatencyMs"`
|
||||
ReceivedPackets int `json:"receivedPackets"`
|
||||
} `json:"mediaEndpointStats"`
|
||||
Recording bool `json:"recording"`
|
||||
ProtocolCallId string `json:"protocolCallId"`
|
||||
Provider string `json:"provider"`
|
||||
} `json:"sessions"`
|
||||
} `json:"participants"`
|
||||
}
|
||||
|
||||
type NotificationConversationWithAttributes struct {
|
||||
Address string `json:"address"`
|
||||
Divisions []struct {
|
||||
Division struct {
|
||||
Id string `json:"id"`
|
||||
SelfUri string `json:"selfUri"`
|
||||
} `json:"division"`
|
||||
Entities []struct {
|
||||
DateDivisionUpdated string `json:"dateDivisionUpdated"`
|
||||
Id string `json:"id"`
|
||||
SelfUri string `json:"selfUri"`
|
||||
} `json:"entities"`
|
||||
} `json:"divisions"`
|
||||
ExternalTag string `json:"externalTag"`
|
||||
Id string `json:"id"`
|
||||
Participants []struct {
|
||||
Address string `json:"address"`
|
||||
Attributes map[string]any `json:"attributes"`
|
||||
Calls []struct {
|
||||
AfterCallWorkRequired bool `json:"afterCallWorkRequired"`
|
||||
Confined bool `json:"confined"`
|
||||
ConnectedTime string `json:"connectedTime"`
|
||||
Direction string `json:"direction"`
|
||||
DisconnectReasons []struct{} `json:"disconnectReasons"`
|
||||
DisconnectType string `json:"disconnectType"`
|
||||
DisconnectedTime string `json:"disconnectedTime"`
|
||||
Held bool `json:"held"`
|
||||
Id string `json:"id"`
|
||||
InitialState string `json:"initialState"`
|
||||
Muted bool `json:"muted"`
|
||||
Other map[string]any `json:"other"`
|
||||
PeerId string `json:"peerId"`
|
||||
Provider string `json:"provider"`
|
||||
Recording bool `json:"recording"`
|
||||
RecordingState string `json:"recordingState"`
|
||||
SecurePause bool `json:"securePause"`
|
||||
Self map[string]any `json:"self"`
|
||||
State string `json:"state"`
|
||||
} `json:"calls"`
|
||||
ConnectedTime string `json:"connectedTime"`
|
||||
EndTime string `json:"endTime"`
|
||||
ExternalContactId string `json:"externalContactId"`
|
||||
ExternalContactInitialDivisionId string `json:"externalContactInitialDivisionId"`
|
||||
Id string `json:"id"`
|
||||
MediaRoles []string `json:"mediaRoles"`
|
||||
Name string `json:"name"`
|
||||
Purpose string `json:"purpose"`
|
||||
QueueId string `json:"queueId"`
|
||||
Wrapup map[string]any `json:"wrapup"`
|
||||
WrapupExpected bool `json:"wrapupExpected"`
|
||||
WrapupRequired bool `json:"wrapupRequired"`
|
||||
} `json:"participants"`
|
||||
RecentTransfers []map[string]any `json:"recentTransfers"`
|
||||
RecordingState string `json:"recordingState"`
|
||||
SecurePause bool `json:"securePause"`
|
||||
UtilizationLabelId string `json:"utilizationLabelId"`
|
||||
func (GCRaw) TableName() string {
|
||||
return "gc_raw"
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ type DBSegment struct {
|
||||
SegmentEnd time.Time `gorm:"index"`
|
||||
SegmentStart time.Time `gorm:"index"`
|
||||
SegmentType string `gorm:"index"`
|
||||
SessionId string `gorm:"foreignKey"`
|
||||
SessionId string `gorm:"index;foreignKey"`
|
||||
WrapUpCode string
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ type DBSession struct {
|
||||
Recording bool
|
||||
RemoteNameDisplayable string
|
||||
SessionDnis string
|
||||
Flow string `gorm:"type:json"`
|
||||
|
||||
Segments []DBSegment `gorm:"foreignKey:SessionId;references:Id"`
|
||||
}
|
||||
|
||||
134
models/ticket.go
Normal file
134
models/ticket.go
Normal file
@@ -0,0 +1,134 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
type DBTicket struct {
|
||||
AccountId int
|
||||
ApprovalCount int
|
||||
Assignee string `gorm:"type:json"`
|
||||
AssigneeId int
|
||||
AttachmentCount int
|
||||
Category string
|
||||
CF string `gorm:"type:json"`
|
||||
Channel string
|
||||
ChannelCode string
|
||||
ChannelRelatedInfo string
|
||||
Classification string
|
||||
ClosedTime *time.Time
|
||||
CommentCount int
|
||||
Contact string `gorm:"type:json"`
|
||||
ContactId int
|
||||
CreatedBy int
|
||||
CreatedTime time.Time
|
||||
CustomerResponseTime time.Time
|
||||
DepartmentId int
|
||||
DescAttachments string `gorm:"type:json"`
|
||||
Description string
|
||||
DueDate *time.Time
|
||||
Email string
|
||||
EntitySkills string `gorm:"type:json"`
|
||||
FirstThread string `gorm:"type:json"`
|
||||
FollowerCount int
|
||||
Id string `gorm:"primaryKey"`
|
||||
IsArchived bool
|
||||
IsDeleted bool
|
||||
IsEscalated bool
|
||||
IsOverdue bool
|
||||
IsResponseOverdue bool
|
||||
IsSpam bool
|
||||
IsTrashed bool
|
||||
Language string
|
||||
LayoutDetails string `gorm:"type:json"`
|
||||
LayoutId int
|
||||
ModifiedBy int
|
||||
ModifiedTime time.Time
|
||||
OnHoldTime *time.Time
|
||||
Phone string
|
||||
Priority string
|
||||
ProductId string
|
||||
Resolution string
|
||||
ResponseDueDate *time.Time
|
||||
SecondaryContacts string `gorm:"type:json"`
|
||||
Sentiment string
|
||||
SharedDepartments string `gorm:"type:json"`
|
||||
Source string `gorm:"type:json"`
|
||||
Status string
|
||||
StatusType string
|
||||
SubCategory string
|
||||
Subject string
|
||||
TagCount int
|
||||
TaskCount int
|
||||
TeamId int
|
||||
ThreadCount int
|
||||
TicketNumber int
|
||||
TimeEntryCount int
|
||||
WebUrl string
|
||||
}
|
||||
|
||||
func (DBTicket) TableName() string {
|
||||
return "zoho_live_tickets"
|
||||
}
|
||||
|
||||
type Ticket struct {
|
||||
TicketID string `gorm:"primaryKey;column:ticket_id" json:"ticket_id"`
|
||||
TicketReferenceID *string `gorm:"column:ticket_reference_id" json:"ticket_reference_id"`
|
||||
DepartmentID *string `gorm:"column:department_id" json:"department_id"`
|
||||
AccountID *string `gorm:"column:account_id" json:"account_id"`
|
||||
ContactID *string `gorm:"column:contact_id" json:"contact_id"`
|
||||
Email *string `gorm:"column:email" json:"email"`
|
||||
Phone *string `gorm:"column:phone" json:"phone"`
|
||||
Subject *string `gorm:"column:subject" json:"subject"`
|
||||
Description *string `gorm:"column:description" json:"description"`
|
||||
Status *string `gorm:"column:status" json:"status"`
|
||||
ProductID *string `gorm:"column:product_id" json:"product_id"`
|
||||
TicketOwnerID *string `gorm:"column:ticket_owner_id" json:"ticket_owner_id"`
|
||||
CreatedBy *string `gorm:"column:created_by" json:"created_by"`
|
||||
ModifiedBy *string `gorm:"column:modified_by" json:"modified_by"`
|
||||
CreatedTime *time.Time `gorm:"column:created_time" json:"created_time"`
|
||||
OnHoldTime *time.Time `gorm:"column:on_hold_time" json:"on_hold_time"`
|
||||
ClosedTime *time.Time `gorm:"column:closed_time" json:"closed_time"`
|
||||
ModifiedTime *time.Time `gorm:"column:modified_time" json:"modified_time"`
|
||||
TeamID *string `gorm:"column:team_id" json:"team_id"`
|
||||
DueDate *time.Time `gorm:"column:due_date" json:"due_date"`
|
||||
Tags *string `gorm:"column:tags" json:"tags"`
|
||||
Priority *string `gorm:"column:priority" json:"priority"`
|
||||
IsOverdue *bool `gorm:"column:is_overdue" json:"is_overdue"`
|
||||
IsEscalated *bool `gorm:"column:is_escalated" json:"is_escalated"`
|
||||
Classification *string `gorm:"column:classification" json:"classification"`
|
||||
Resolution *string `gorm:"column:resolution" json:"resolution"`
|
||||
TimeToRespond *int `gorm:"column:time_to_respond" json:"time_to_respond"`
|
||||
Category *string `gorm:"column:category" json:"category"`
|
||||
Subcategory *string `gorm:"column:subcategory" json:"subcategory"`
|
||||
Subclassification *string `gorm:"column:subclassification" json:"subclassification"`
|
||||
BookingNumber *int `gorm:"column:booking_number" json:"booking_number"`
|
||||
CostCode *string `gorm:"column:cost_code" json:"cost_code"`
|
||||
LanguageRequired *string `gorm:"column:language_required" json:"language_required"`
|
||||
TimeZone *string `gorm:"column:time_zone" json:"time_zone"`
|
||||
DeliveryMethod *string `gorm:"column:delivery_method" json:"delivery_method"`
|
||||
DurationInMinutes *int `gorm:"column:duration_in_minutes" json:"duration_in_minutes"`
|
||||
InterpreterID *int `gorm:"column:interpreter_id" json:"interpreter_id"`
|
||||
InterpreterEmail *string `gorm:"column:interpreter_email" json:"interpreter_email"`
|
||||
InterpreterName *string `gorm:"column:interpreter_name" json:"interpreter_name"`
|
||||
ClientID *int `gorm:"column:client_id" json:"client_id"`
|
||||
ClientName *string `gorm:"column:client_name" json:"client_name"`
|
||||
InterpreterNaati *int `gorm:"column:interpreter_naati" json:"interpreter_naati"`
|
||||
SecondaryInterpreterID *int `gorm:"column:secondary_interpreter_id" json:"secondary_interpreter_id"`
|
||||
PayCycle *int `gorm:"column:pay_cycle" json:"pay_cycle"`
|
||||
BookingTime *time.Time `gorm:"column:booking_time" json:"booking_time"`
|
||||
BillingGroup *string `gorm:"column:billing_group" json:"billing_group"`
|
||||
VideoLink *string `gorm:"column:video_link" json:"video_link"`
|
||||
ConversationID *string `gorm:"column:conversation_id" json:"conversation_id"`
|
||||
DNIS *string `gorm:"column:dnis" json:"dnis"`
|
||||
ClientAgentName *string `gorm:"column:client_agent_name" json:"client_agent_name"`
|
||||
ClientAgentPhone *string `gorm:"column:client_agent_phone" json:"client_agent_phone"`
|
||||
ClientAgentEmail *string `gorm:"column:client_agent_email" json:"client_agent_email"`
|
||||
BillingCode *string `gorm:"column:billing_code" json:"billing_code"`
|
||||
MBIEFeedback *string `gorm:"column:mbie_feedback" json:"mbie_feedback"`
|
||||
BookingComments *string `gorm:"column:booking_comments" json:"booking_comments"`
|
||||
AdditionalPrebookingInformation *string `gorm:"column:additional_prebooking_information" json:"additional_prebooking_information"`
|
||||
ForceUpdate *bool `gorm:"column:force_update" json:"force_update"`
|
||||
}
|
||||
|
||||
func (Ticket) TableName() string {
|
||||
return "live_tickets"
|
||||
}
|
||||
263
util/extract.go
263
util/extract.go
@@ -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,
|
||||
ConversationId: base.ConversationId,
|
||||
EndTime: nil,
|
||||
// ConnectedTime: nil,
|
||||
ConversationId: base.ConversationId,
|
||||
// EndTime: nil,
|
||||
ExternalContactId: &p.ExternalContactId,
|
||||
Id: p.ParticipantId,
|
||||
Name: &p.ParticipantName,
|
||||
Purpose: &p.Purpose,
|
||||
UserId: &p.UserId,
|
||||
}
|
||||
participants = append(participants, participant)
|
||||
|
||||
@@ -70,6 +71,11 @@ func ExtractWithoutAttributes(base models.AnalyticsConversationWithoutAttributes
|
||||
metricsBytes = nil
|
||||
}
|
||||
|
||||
flowBytes, err := json.Marshal(sess.Flow)
|
||||
if err != nil {
|
||||
flowBytes = nil
|
||||
}
|
||||
|
||||
session := models.DBSession{
|
||||
Ani: sess.ANI,
|
||||
Direction: sess.Direction,
|
||||
@@ -85,6 +91,7 @@ func ExtractWithoutAttributes(base models.AnalyticsConversationWithoutAttributes
|
||||
Recording: sess.Recording,
|
||||
RemoteNameDisplayable: sess.RemoteNameDisplayable,
|
||||
SessionDnis: sess.SessionDNIS,
|
||||
Flow: string(flowBytes),
|
||||
}
|
||||
sessions = append(sessions, session)
|
||||
|
||||
@@ -113,7 +120,7 @@ func ExtractWithoutAttributes(base models.AnalyticsConversationWithoutAttributes
|
||||
SegmentEnd: segmentEnd,
|
||||
SegmentStart: segmentStart,
|
||||
SegmentType: seg.SegmentType,
|
||||
SessionId: sess.SessionId,
|
||||
SessionId: session.Id,
|
||||
WrapUpCode: seg.WrapUpCode,
|
||||
}
|
||||
|
||||
@@ -255,125 +262,125 @@ func ExtractLive(base models.NotificationConversationWithAttributes) (models.DBC
|
||||
|
||||
}
|
||||
|
||||
func ExtractWithAttributes(base models.AnalyticsConversationWithAttributes) (models.DBConversation, []models.DBParticipant, []models.DBSession, []models.DBSegment) {
|
||||
|
||||
var startTime *time.Time
|
||||
parsedStartTime, err := time.Parse(time.RFC3339, base.ConversationStart)
|
||||
if err != nil {
|
||||
startTime = nil
|
||||
} else {
|
||||
startTime = &parsedStartTime
|
||||
}
|
||||
|
||||
var endTime *time.Time
|
||||
parsedEndTime, err := time.Parse(time.RFC3339, base.ConversationEnd)
|
||||
if err != nil {
|
||||
endTime = nil
|
||||
} else {
|
||||
endTime = &parsedEndTime
|
||||
}
|
||||
|
||||
divisionIdsBytes, err := json.Marshal(base.DivisionIds)
|
||||
if err != nil {
|
||||
divisionIdsBytes = nil
|
||||
}
|
||||
divisionIdsBytesStr := string(divisionIdsBytes)
|
||||
|
||||
conversation := models.DBConversation{
|
||||
DivisionIds: &divisionIdsBytesStr,
|
||||
End: endTime,
|
||||
Id: base.ConversationId,
|
||||
MinMos: &base.MediaStatsMinConversationMos,
|
||||
MinRFactor: &base.MediaStatsMinConversationRFactor,
|
||||
OriginatingDirection: &base.OriginatingDirection,
|
||||
Start: startTime,
|
||||
}
|
||||
var participants []models.DBParticipant
|
||||
var sessions []models.DBSession
|
||||
var segments []models.DBSegment
|
||||
|
||||
for _, p := range base.Participants {
|
||||
|
||||
attributesBytes, err := json.Marshal(p.Attributes)
|
||||
if err != nil {
|
||||
attributesBytes = nil
|
||||
}
|
||||
attributesBytesStr := string(attributesBytes)
|
||||
|
||||
participant := models.DBParticipant{
|
||||
ConnectedTime: nil,
|
||||
ConversationId: base.ConversationId,
|
||||
EndTime: nil,
|
||||
ExternalContactId: &p.ExternalContactId,
|
||||
Id: p.ParticipantId,
|
||||
Name: &p.ParticipantName,
|
||||
Purpose: &p.Purpose,
|
||||
Attributes: &attributesBytesStr,
|
||||
}
|
||||
participants = append(participants, participant)
|
||||
|
||||
for _, sess := range p.Sessions {
|
||||
mediaEndpointStatsBytes, err := json.Marshal(sess.MediaEndpointStats)
|
||||
if err != nil {
|
||||
mediaEndpointStatsBytes = nil
|
||||
}
|
||||
|
||||
metricsBytes, err := json.Marshal(sess.Metrics)
|
||||
if err != nil {
|
||||
metricsBytes = nil
|
||||
}
|
||||
|
||||
session := models.DBSession{
|
||||
Ani: sess.ANI,
|
||||
Direction: sess.Direction,
|
||||
Dnis: sess.DNIS,
|
||||
EdgeId: sess.EdgeId,
|
||||
Id: fmt.Sprintf("%s_%s", p.ParticipantId, sess.SessionId),
|
||||
MediaEndpointStats: string(mediaEndpointStatsBytes),
|
||||
MediaType: sess.MediaType,
|
||||
Metrics: string(metricsBytes),
|
||||
ParticipantId: p.ParticipantId,
|
||||
ProtocolCallId: sess.ProtocolCallId,
|
||||
Provider: sess.Provider,
|
||||
Recording: sess.Recording,
|
||||
RemoteNameDisplayable: sess.RemoteNameDisplayable,
|
||||
SessionDnis: sess.SessionDnis,
|
||||
}
|
||||
sessions = append(sessions, session)
|
||||
|
||||
for _, seg := range sess.Segments {
|
||||
|
||||
segmentStart, err := time.Parse(time.RFC3339, seg.SegmentStart)
|
||||
if err != nil {
|
||||
segmentStart = time.Now()
|
||||
}
|
||||
|
||||
segmentEnd, err := time.Parse(time.RFC3339, seg.SegmentEnd)
|
||||
if err != nil {
|
||||
segmentEnd = time.Now()
|
||||
}
|
||||
|
||||
q850ResponseCodesBytes, err := json.Marshal(seg.Q850ResponseCodes)
|
||||
if err != nil {
|
||||
q850ResponseCodesBytes = nil
|
||||
}
|
||||
|
||||
segment := models.DBSegment{
|
||||
Id: fmt.Sprintf("%s_%s", session.Id, seg.SegmentType),
|
||||
Conference: seg.Conference,
|
||||
DisconnectType: seg.DisconnectType,
|
||||
Q850ResponseCodes: string(q850ResponseCodesBytes),
|
||||
SegmentEnd: segmentEnd,
|
||||
SegmentStart: segmentStart,
|
||||
SegmentType: seg.SegmentType,
|
||||
SessionId: sess.SessionId,
|
||||
WrapUpCode: seg.WrapUpCode,
|
||||
}
|
||||
|
||||
segments = append(segments, segment)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return conversation, participants, sessions, segments
|
||||
}
|
||||
//func ExtractWithAttributes(base models.AnalyticsConversationWithAttributes) (models.DBConversation, []models.DBParticipant, []models.DBSession, []models.DBSegment) {
|
||||
//
|
||||
// var startTime *time.Time
|
||||
// parsedStartTime, err := time.Parse(time.RFC3339, base.ConversationStart)
|
||||
// if err != nil {
|
||||
// startTime = nil
|
||||
// } else {
|
||||
// startTime = &parsedStartTime
|
||||
// }
|
||||
//
|
||||
// var endTime *time.Time
|
||||
// parsedEndTime, err := time.Parse(time.RFC3339, base.ConversationEnd)
|
||||
// if err != nil {
|
||||
// endTime = nil
|
||||
// } else {
|
||||
// endTime = &parsedEndTime
|
||||
// }
|
||||
//
|
||||
// divisionIdsBytes, err := json.Marshal(base.DivisionIds)
|
||||
// if err != nil {
|
||||
// divisionIdsBytes = nil
|
||||
// }
|
||||
// divisionIdsBytesStr := string(divisionIdsBytes)
|
||||
//
|
||||
// conversation := models.DBConversation{
|
||||
// DivisionIds: &divisionIdsBytesStr,
|
||||
// End: endTime,
|
||||
// Id: base.ConversationId,
|
||||
// MinMos: &base.MediaStatsMinConversationMos,
|
||||
// MinRFactor: &base.MediaStatsMinConversationRFactor,
|
||||
// OriginatingDirection: &base.OriginatingDirection,
|
||||
// Start: startTime,
|
||||
// }
|
||||
// var participants []models.DBParticipant
|
||||
// var sessions []models.DBSession
|
||||
// var segments []models.DBSegment
|
||||
//
|
||||
// for _, p := range base.Participants {
|
||||
//
|
||||
// attributesBytes, err := json.Marshal(p.Attributes)
|
||||
// if err != nil {
|
||||
// attributesBytes = nil
|
||||
// }
|
||||
// attributesBytesStr := string(attributesBytes)
|
||||
//
|
||||
// participant := models.DBParticipant{
|
||||
// ConnectedTime: nil,
|
||||
// ConversationId: base.ConversationId,
|
||||
// EndTime: nil,
|
||||
// ExternalContactId: &p.ExternalContactId,
|
||||
// Id: p.ParticipantId,
|
||||
// Name: &p.ParticipantName,
|
||||
// Purpose: &p.Purpose,
|
||||
// Attributes: &attributesBytesStr,
|
||||
// }
|
||||
// participants = append(participants, participant)
|
||||
//
|
||||
// for _, sess := range p.Sessions {
|
||||
// mediaEndpointStatsBytes, err := json.Marshal(sess.MediaEndpointStats)
|
||||
// if err != nil {
|
||||
// mediaEndpointStatsBytes = nil
|
||||
// }
|
||||
//
|
||||
// metricsBytes, err := json.Marshal(sess.Metrics)
|
||||
// if err != nil {
|
||||
// metricsBytes = nil
|
||||
// }
|
||||
//
|
||||
// session := models.DBSession{
|
||||
// Ani: sess.ANI,
|
||||
// Direction: sess.Direction,
|
||||
// Dnis: sess.DNIS,
|
||||
// EdgeId: sess.EdgeId,
|
||||
// Id: fmt.Sprintf("%s_%s", p.ParticipantId, sess.SessionId),
|
||||
// MediaEndpointStats: string(mediaEndpointStatsBytes),
|
||||
// MediaType: sess.MediaType,
|
||||
// Metrics: string(metricsBytes),
|
||||
// ParticipantId: p.ParticipantId,
|
||||
// ProtocolCallId: sess.ProtocolCallId,
|
||||
// Provider: sess.Provider,
|
||||
// Recording: sess.Recording,
|
||||
// RemoteNameDisplayable: sess.RemoteNameDisplayable,
|
||||
// SessionDnis: sess.SessionDnis,
|
||||
// }
|
||||
// sessions = append(sessions, session)
|
||||
//
|
||||
// for _, seg := range sess.Segments {
|
||||
//
|
||||
// segmentStart, err := time.Parse(time.RFC3339, seg.SegmentStart)
|
||||
// if err != nil {
|
||||
// segmentStart = time.Now()
|
||||
// }
|
||||
//
|
||||
// segmentEnd, err := time.Parse(time.RFC3339, seg.SegmentEnd)
|
||||
// if err != nil {
|
||||
// segmentEnd = time.Now()
|
||||
// }
|
||||
//
|
||||
// q850ResponseCodesBytes, err := json.Marshal(seg.Q850ResponseCodes)
|
||||
// if err != nil {
|
||||
// q850ResponseCodesBytes = nil
|
||||
// }
|
||||
//
|
||||
// segment := models.DBSegment{
|
||||
// Id: fmt.Sprintf("%s_%s", session.Id, seg.SegmentType),
|
||||
// Conference: seg.Conference,
|
||||
// DisconnectType: seg.DisconnectType,
|
||||
// Q850ResponseCodes: string(q850ResponseCodesBytes),
|
||||
// SegmentEnd: segmentEnd,
|
||||
// SegmentStart: segmentStart,
|
||||
// SegmentType: seg.SegmentType,
|
||||
// SessionId: sess.SessionId,
|
||||
// WrapUpCode: seg.WrapUpCode,
|
||||
// }
|
||||
//
|
||||
// segments = append(segments, segment)
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return conversation, participants, sessions, segments
|
||||
//}
|
||||
|
||||
Reference in New Issue
Block a user