diff --git a/app/views/mailer/ticket_escalation_warning/de.html.erb b/app/views/mailer/ticket_escalation_warning/de.html.erb
index 9f1e64658..d78d8fe48 100644
--- a/app/views/mailer/ticket_escalation_warning/de.html.erb
+++ b/app/views/mailer/ticket_escalation_warning/de.html.erb
@@ -2,7 +2,7 @@ Ticket wird eskalieren (<%= d 'ticket.title' %>)
diff --git a/app/views/mailer/ticket_escalation_warning/en.html.erb b/app/views/mailer/ticket_escalation_warning/en.html.erb
index 6742ff422..0952efc91 100644
--- a/app/views/mailer/ticket_escalation_warning/en.html.erb
+++ b/app/views/mailer/ticket_escalation_warning/en.html.erb
@@ -2,7 +2,7 @@ Ticket will escalate (<%= d 'ticket.title' %>)
Hi <%= d 'recipient.firstname' %>,
-
A ticket (<%= d 'ticket.title' %>) from "<%= d 'ticket.customer.longname' %>" will escalate at "<%= d 'ticket.escalation_time' %>"!
+
A ticket (<%= d 'ticket.title' %>) from "<%= d 'ticket.customer.longname' %>" will escalate at "<%= d 'ticket.escalation_at' %>"!
<% if @objects[:article] %>
diff --git a/app/views/slack/ticket_escalation/en.md.erb b/app/views/slack/ticket_escalation/en.md.erb
index e4853da66..e9d232544 100644
--- a/app/views/slack/ticket_escalation/en.md.erb
+++ b/app/views/slack/ticket_escalation/en.md.erb
@@ -1,6 +1,6 @@
# <%= d 'ticket.title' %>
-_<<%= c 'http_type' %>://<%= c 'fqdn' %>/#ticket/zoom/<%= d 'ticket.id' %>|Ticket#<%= d 'ticket.number' %>>: Escalated at <%= d 'ticket.escalation_time' %>_
-A ticket (<%= d 'ticket.title' %>) from "<%= d 'ticket.customer.longname' %>" is escalated since "<%= d 'ticket.escalation_time' %>"!
+_<<%= c 'http_type' %>://<%= c 'fqdn' %>/#ticket/zoom/<%= d 'ticket.id' %>|Ticket#<%= d 'ticket.number' %>>: Escalated at <%= d 'ticket.escalation_at' %>_
+A ticket (<%= d 'ticket.title' %>) from "<%= d 'ticket.customer.longname' %>" is escalated since "<%= d 'ticket.escalation_at' %>"!
<% if @objects[:article] %>
<%= a_text 'article' %>
diff --git a/app/views/slack/ticket_escalation_warning/en.md.erb b/app/views/slack/ticket_escalation_warning/en.md.erb
index 806c49fba..15068b0fb 100644
--- a/app/views/slack/ticket_escalation_warning/en.md.erb
+++ b/app/views/slack/ticket_escalation_warning/en.md.erb
@@ -1,6 +1,6 @@
# <%= d 'ticket.title' %>
-_<<%= c 'http_type' %>://<%= c 'fqdn' %>/#ticket/zoom/<%= d 'ticket.id' %>|Ticket#<%= d 'ticket.number' %>>: Will escalate at <%= d 'ticket.escalation_time' %>_
-A ticket (<%= d 'ticket.title' %>) from "<%= d 'ticket.customer.longname' %>" will escalate at "<%= d 'ticket.escalation_time' %>"!
+_<<%= c 'http_type' %>://<%= c 'fqdn' %>/#ticket/zoom/<%= d 'ticket.id' %>|Ticket#<%= d 'ticket.number' %>>: Will escalate at <%= d 'ticket.escalation_at' %>_
+A ticket (<%= d 'ticket.title' %>) from "<%= d 'ticket.customer.longname' %>" will escalate at "<%= d 'ticket.escalation_at' %>"!
<% if @objects[:article] %>
<%= a_text 'article' %>
diff --git a/db/migrate/20120101000010_create_ticket.rb b/db/migrate/20120101000010_create_ticket.rb
index 4a2acc4fa..40dcc06a5 100644
--- a/db/migrate/20120101000010_create_ticket.rb
+++ b/db/migrate/20120101000010_create_ticket.rb
@@ -41,27 +41,24 @@ class CreateTicket < ActiveRecord::Migration
t.column :owner_id, :integer, null: false
t.column :customer_id, :integer, null: false
t.column :note, :string, limit: 250, null: true
- t.column :first_response, :timestamp, limit: 3, null: true
- t.column :first_response_escal_date, :timestamp, limit: 3, null: true
- t.column :first_response_sla_time, :timestamp, limit: 3, null: true
+ t.column :first_response_at, :timestamp, limit: 3, null: true
+ t.column :first_response_escalation_at, :timestamp, limit: 3, null: true
t.column :first_response_in_min, :integer, null: true
t.column :first_response_diff_in_min, :integer, null: true
- t.column :close_time, :timestamp, limit: 3, null: true
- t.column :close_time_escal_date, :timestamp, limit: 3, null: true
- t.column :close_time_sla_time, :timestamp, limit: 3, null: true
- t.column :close_time_in_min, :integer, null: true
- t.column :close_time_diff_in_min, :integer, null: true
- t.column :update_time_escal_date, :timestamp, limit: 3, null: true
- t.column :update_time_sla_time, :timestamp, limit: 3, null: true
- t.column :update_time_in_min, :integer, null: true
- t.column :update_time_diff_in_min, :integer, null: true
- t.column :last_contact, :timestamp, limit: 3, null: true
- t.column :last_contact_agent, :timestamp, limit: 3, null: true
- t.column :last_contact_customer, :timestamp, limit: 3, null: true
+ t.column :close_at, :timestamp, limit: 3, null: true
+ t.column :close_escalation_at, :timestamp, limit: 3, null: true
+ t.column :close_in_min, :integer, null: true
+ t.column :close_diff_in_min, :integer, null: true
+ t.column :update_escalation_at, :timestamp, limit: 3, null: true
+ t.column :update_in_min, :integer, null: true
+ t.column :update_diff_in_min, :integer, null: true
+ t.column :last_contact_at, :timestamp, limit: 3, null: true
+ t.column :last_contact_agent_at, :timestamp, limit: 3, null: true
+ t.column :last_contact_customer_at, :timestamp, limit: 3, null: true
t.column :create_article_type_id, :integer, null: true
t.column :create_article_sender_id, :integer, null: true
t.column :article_count, :integer, null: true
- t.column :escalation_time, :timestamp, limit: 3, null: true
+ t.column :escalation_at, :timestamp, limit: 3, null: true
t.column :pending_time, :timestamp, limit: 3, null: true
t.column :type, :string, limit: 100, null: true
t.column :preferences, :text, limit: 500.kilobytes + 1, null: true
@@ -77,20 +74,20 @@ class CreateTicket < ActiveRecord::Migration
add_index :tickets, [:number], unique: true
add_index :tickets, [:title]
add_index :tickets, [:created_at]
- add_index :tickets, [:first_response]
- add_index :tickets, [:first_response_escal_date]
+ add_index :tickets, [:first_response_at]
+ add_index :tickets, [:first_response_escalation_at]
add_index :tickets, [:first_response_in_min]
add_index :tickets, [:first_response_diff_in_min]
- add_index :tickets, [:close_time]
- add_index :tickets, [:close_time_escal_date]
- add_index :tickets, [:close_time_in_min]
- add_index :tickets, [:close_time_diff_in_min]
- add_index :tickets, [:escalation_time]
- add_index :tickets, [:update_time_in_min]
- add_index :tickets, [:update_time_diff_in_min]
- add_index :tickets, [:last_contact]
- add_index :tickets, [:last_contact_agent]
- add_index :tickets, [:last_contact_customer]
+ add_index :tickets, [:close_at]
+ add_index :tickets, [:close_escalation_at]
+ add_index :tickets, [:close_in_min]
+ add_index :tickets, [:close_diff_in_min]
+ add_index :tickets, [:escalation_at]
+ add_index :tickets, [:update_in_min]
+ add_index :tickets, [:update_diff_in_min]
+ add_index :tickets, [:last_contact_at]
+ add_index :tickets, [:last_contact_agent_at]
+ add_index :tickets, [:last_contact_customer_at]
add_index :tickets, [:create_article_type_id]
add_index :tickets, [:create_article_sender_id]
add_index :tickets, [:created_by_id]
diff --git a/db/migrate/20160913000002_ticket_rename.rb b/db/migrate/20160913000002_ticket_rename.rb
new file mode 100644
index 000000000..836d7f3eb
--- /dev/null
+++ b/db/migrate/20160913000002_ticket_rename.rb
@@ -0,0 +1,54 @@
+class TicketRename < ActiveRecord::Migration
+ def up
+ # return if it's a new setup
+ return if !Setting.find_by(name: 'system_init_done')
+
+ rename_column :tickets, :first_response, :first_response_at
+ rename_column :tickets, :first_response_escal_date, :first_response_escalation_at
+
+ rename_column :tickets, :close_time, :close_at
+ rename_column :tickets, :close_time_escal_date, :close_escalation_at
+ rename_column :tickets, :close_time_in_min, :close_in_min
+ rename_column :tickets, :close_time_diff_in_min, :close_diff_in_min
+
+ rename_column :tickets, :update_time_escal_date, :update_escalation_at
+ rename_column :tickets, :update_time_in_min, :update_in_min
+ rename_column :tickets, :update_time_diff_in_min, :update_diff_in_min
+
+ rename_column :tickets, :escalation_time, :escalation_at
+
+ rename_column :tickets, :last_contact, :last_contact_at
+ rename_column :tickets, :last_contact_agent, :last_contact_agent_at
+ rename_column :tickets, :last_contact_customer, :last_contact_customer_at
+
+ remove_column :tickets, :first_response_sla_time
+ remove_column :tickets, :close_time_sla_time
+ remove_column :tickets, :update_time_sla_time
+
+ overview_role = Role.find_by(name: 'Agent')
+ Overview.create_or_update(
+ name: 'Escalated',
+ link: 'all_escalated',
+ prio: 1050,
+ role_id: overview_role.id,
+ condition: {
+ 'ticket.escalation_at' => {
+ operator: 'within next (relative)',
+ value: '10',
+ range: 'minute',
+ },
+ },
+ order: {
+ by: 'escalation_at',
+ direction: 'ASC',
+ },
+ view: {
+ d: %w(title customer group owner escalation_at),
+ s: %w(title customer group owner escalation_at),
+ m: %w(number title customer group owner escalation_at),
+ view_mode_default: 's',
+ },
+ )
+
+ end
+end
diff --git a/db/seeds.rb b/db/seeds.rb
index 8f9fb8e95..0e6521110 100644
--- a/db/seeds.rb
+++ b/db/seeds.rb
@@ -3219,20 +3219,20 @@ Overview.create_if_not_exists(
prio: 1050,
role_id: overview_role.id,
condition: {
- 'ticket.escalation_time' => {
+ 'ticket.escalation_at' => {
operator: 'within next (relative)',
value: '10',
range: 'minute',
},
},
order: {
- by: 'escalation_time',
+ by: 'escalation_at',
direction: 'ASC',
},
view: {
- d: %w(title customer group owner escalation_time),
- s: %w(title customer group owner escalation_time),
- m: %w(number title customer group owner escalation_time),
+ d: %w(title customer group owner escalation_at),
+ s: %w(title customer group owner escalation_at),
+ m: %w(number title customer group owner escalation_at),
view_mode_default: 's',
},
)
diff --git a/lib/calendar_subscriptions/tickets.rb b/lib/calendar_subscriptions/tickets.rb
index c300f7b2d..2a5151c8e 100644
--- a/lib/calendar_subscriptions/tickets.rb
+++ b/lib/calendar_subscriptions/tickets.rb
@@ -172,7 +172,7 @@ class CalendarSubscriptions::Tickets
operator: 'is',
value: owner_ids,
},
- 'ticket.escalation_time' => {
+ 'ticket.escalation_at' => {
operator: 'is not',
value: nil,
}
@@ -189,17 +189,17 @@ class CalendarSubscriptions::Tickets
tickets.each do |ticket|
- next if !ticket.escalation_time
+ next if !ticket.escalation_at
event_data = {}
- escalation_time = ticket.escalation_time
- if escalation_time < Time.zone.today
- escalation_time = Time.zone.today
+ escalation_at = ticket.escalation_at
+ if escalation_at < Time.zone.today
+ escalation_at = Time.zone.today
end
- event_data[:dtstart] = Icalendar::Values::DateTime.new(escalation_time, 'tzid' => @tzid)
- event_data[:dtend] = Icalendar::Values::DateTime.new(escalation_time, 'tzid' => @tzid)
+ event_data[:dtstart] = Icalendar::Values::DateTime.new(escalation_at, 'tzid' => @tzid)
+ event_data[:dtend] = Icalendar::Values::DateTime.new(escalation_at, 'tzid' => @tzid)
event_data[:summary] = "#{translated_ticket_escalation}: '#{ticket.title}' #{customer}: #{ticket.customer.longname}"
event_data[:description] = "T##{ticket.number}"
if alarm?
diff --git a/lib/import/otrs.rb b/lib/import/otrs.rb
index eaf1e7eb9..49ad0d0f5 100644
--- a/lib/import/otrs.rb
+++ b/lib/import/otrs.rb
@@ -561,14 +561,14 @@ module Import::OTRS
CustomerUserID: :customer,
Title: :title,
TicketID: :id,
- FirstResponse: :first_response,
- #FirstResponseTimeDestinationDate: :first_response_escal_date,
+ FirstResponse: :first_response_at,
+ #FirstResponseTimeDestinationDate: :first_response_escalation_at,
#FirstResponseInMin: :first_response_in_min,
#FirstResponseDiffInMin: :first_response_diff_in_min,
- Closed: :close_time,
- #SoltutionTimeDestinationDate: :close_time_escal_date,
- #CloseTimeInMin: :close_time_in_min,
- #CloseTimeDiffInMin: :close_time_diff_in_min,
+ Closed: :close_at,
+ #SoltutionTimeDestinationDate: :close_escalation_at,
+ #CloseTimeInMin: :close_in_min,
+ #CloseTimeDiffInMin: :close_diff_in_min,
},
Article: {
SenderType: :sender,
diff --git a/lib/report/ticket_backlog.rb b/lib/report/ticket_backlog.rb
index 345119364..5948ae0a3 100644
--- a/lib/report/ticket_backlog.rb
+++ b/lib/report/ticket_backlog.rb
@@ -23,7 +23,7 @@ returns
local_params[:params][:field] = 'created_at'
created = Report::TicketGenericTime.aggs(local_params)
- local_params[:params][:field] = 'close_time'
+ local_params[:params][:field] = 'close_at'
closed = Report::TicketGenericTime.aggs(local_params)
result = []
diff --git a/lib/report/ticket_first_solution.rb b/lib/report/ticket_first_solution.rb
index ee8b1924a..f54f41125 100644
--- a/lib/report/ticket_first_solution.rb
+++ b/lib/report/ticket_first_solution.rb
@@ -51,14 +51,14 @@ returns
stop = start + 1.minute
end
query, bind_params, tables = Ticket.selector2sql(params[:selector])
- ticket_list = Ticket.select('tickets.id, tickets.close_time, tickets.created_at').where(
- 'tickets.close_time IS NOT NULL AND tickets.close_time >= ? AND tickets.close_time < ?',
+ ticket_list = Ticket.select('tickets.id, tickets.close_at, tickets.created_at').where(
+ 'tickets.close_at IS NOT NULL AND tickets.close_at >= ? AND tickets.close_at < ?',
start,
stop,
).where(query, *bind_params).joins(tables)
count = 0
ticket_list.each { |ticket|
- closed_at = ticket.close_time
+ closed_at = ticket.close_at
created_at = ticket.created_at
if (closed_at - (60 * 15) ) < created_at
count += 1
@@ -90,8 +90,8 @@ returns
def self.items(params)
query, bind_params, tables = Ticket.selector2sql(params[:selector])
- ticket_list = Ticket.select('tickets.id, tickets.close_time, tickets.created_at').where(
- 'tickets.close_time IS NOT NULL AND tickets.close_time >= ? AND tickets.close_time < ?',
+ ticket_list = Ticket.select('tickets.id, tickets.close_at, tickets.created_at').where(
+ 'tickets.close_at IS NOT NULL AND tickets.close_at >= ? AND tickets.close_at < ?',
params[:range_start],
params[:range_end],
).where(query, *bind_params).joins(tables)
@@ -99,7 +99,7 @@ returns
assets = {}
ticket_ids = []
ticket_list.each { |ticket|
- closed_at = ticket.close_time
+ closed_at = ticket.close_at
created_at = ticket.created_at
if (closed_at - (60 * 15) ) < created_at
count += 1
diff --git a/lib/stats/ticket_escalation.rb b/lib/stats/ticket_escalation.rb
index 1cc2a25b5..0562eedc6 100644
--- a/lib/stats/ticket_escalation.rb
+++ b/lib/stats/ticket_escalation.rb
@@ -11,12 +11,12 @@ class Stats::TicketEscalation
# owned tickets
own_escalated = Ticket.where(
- 'owner_id = ? AND group_id IN (?) AND state_id IN (?) AND escalation_time < ?', user.id, group_ids, open_state_ids, Time.zone.now
+ 'owner_id = ? AND group_id IN (?) AND state_id IN (?) AND escalation_at < ?', user.id, group_ids, open_state_ids, Time.zone.now
).count
# all tickets
all_escalated = Ticket.where(
- 'group_id IN (?) AND state_id IN (?) AND escalation_time < ?', group_ids, open_state_ids, Time.zone.now
+ 'group_id IN (?) AND state_id IN (?) AND escalation_at < ?', group_ids, open_state_ids, Time.zone.now
).count
average = '-'
diff --git a/lib/stats/ticket_in_process.rb b/lib/stats/ticket_in_process.rb
index c76678d19..97ef92788 100644
--- a/lib/stats/ticket_in_process.rb
+++ b/lib/stats/ticket_in_process.rb
@@ -15,7 +15,7 @@ class Stats::TicketInProcess
# get all tickets where I worked on today (owner & closed today)
closed_state_ids = Ticket::State.by_category('closed').map(&:id)
closed_ticket_ids = Ticket.select('id').where(
- 'owner_id = ? AND state_id IN (?) AND close_time > ?',
+ 'owner_id = ? AND state_id IN (?) AND close_at > ?',
user.id, closed_state_ids, Time.zone.now - 1.day
).limit(100).map(&:id)
diff --git a/lib/stats/ticket_reopen.rb b/lib/stats/ticket_reopen.rb
index 4107cd770..b73dab3db 100644
--- a/lib/stats/ticket_reopen.rb
+++ b/lib/stats/ticket_reopen.rb
@@ -6,7 +6,7 @@ class Stats::TicketReopen
# get my closed tickets
total = Ticket.select('id').where(
- 'owner_id = ? AND close_time > ?',
+ 'owner_id = ? AND close_at > ?',
user.id, Time.zone.now - 7.days
).count
@@ -67,8 +67,8 @@ class Stats::TicketReopen
return if object != 'Ticket'
ticket = Ticket.lookup(id: o_id)
- # check if close_time is already set / if not, ticket is not reopend
- return if !ticket.close_time
+ # check if close_at is already set / if not, ticket is not reopend
+ return if !ticket.close_at
# only if state id has changed
return if !changes['state_id']
diff --git a/lib/stats/ticket_response_time.rb b/lib/stats/ticket_response_time.rb
index a896b0269..bf458cf93 100644
--- a/lib/stats/ticket_response_time.rb
+++ b/lib/stats/ticket_response_time.rb
@@ -13,10 +13,10 @@ class Stats::TicketResponseTime
return if ticket.owner_id != 1 && ticket.owner_id != article_created_by_id
# return if customer send at least
- return if ticket.last_contact_customer > ticket.last_contact_agent
+ return if ticket.last_contact_customer_at > ticket.last_contact_agent_at
# TODO: only business hours
- response_time_taken = ticket.last_contact_agent - ticket.last_contact_customer
+ response_time_taken = ticket.last_contact_agent_at - ticket.last_contact_customer_at
(response_time_taken / 60).round
end
diff --git a/test/integration/otrs_import_test.rb b/test/integration/otrs_import_test.rb
index da1fa9ba5..194e402f1 100644
--- a/test/integration/otrs_import_test.rb
+++ b/test/integration/otrs_import_test.rb
@@ -185,7 +185,7 @@ class OtrsImportTest < ActiveSupport::TestCase
assert_equal( 'partner', ticket.customer.login )
assert_equal( 'Partner der betreut', ticket.organization.name )
assert_equal( Time.zone.parse('2014-11-20 22:33:41 +0000').gmtime.to_s, ticket.created_at.to_s )
- assert_equal( nil, ticket.close_time )
+ assert_equal( nil, ticket.close_at )
# check history
# - create entry
@@ -200,7 +200,7 @@ class OtrsImportTest < ActiveSupport::TestCase
assert_equal( 'jn2', ticket.customer.login )
assert_equal( 'Znuny GmbH', ticket.organization.name )
assert_equal( Time.zone.parse('2014-11-20 23:24:20 +0000').gmtime.to_s, ticket.created_at.to_s )
- assert_equal( Time.zone.parse('2014-11-20 23:24:20 +0000').gmtime.to_s, ticket.close_time.to_s )
+ assert_equal( Time.zone.parse('2014-11-20 23:24:20 +0000').gmtime.to_s, ticket.close_at.to_s )
# check history
# - create entry
@@ -215,7 +215,7 @@ class OtrsImportTest < ActiveSupport::TestCase
assert_equal( 'betreuterkunde2', ticket.customer.login )
assert_equal( 'Noch ein betreuter Kunde', ticket.organization.name )
assert_equal( Time.zone.parse('2014-11-21 00:17:40 +0000').gmtime.to_s, ticket.created_at.to_s )
- assert_equal( Time.zone.parse('2014-11-21 00:21:08 +0000').gmtime.to_s, ticket.close_time.to_s )
+ assert_equal( Time.zone.parse('2014-11-21 00:21:08 +0000').gmtime.to_s, ticket.close_at.to_s )
# ticket dynamic fields
ticket = Ticket.find(591)
diff --git a/test/integration/report_test.rb b/test/integration/report_test.rb
index 9709ab6fe..344150b10 100644
--- a/test/integration/report_test.rb
+++ b/test/integration/report_test.rb
@@ -139,7 +139,7 @@ class ReportTest < ActiveSupport::TestCase
customer_id: 2,
state: Ticket::State.lookup(name: 'closed'),
priority: Ticket::Priority.lookup(name: '2 normal'),
- close_time: '2015-10-28 11:30:00 UTC',
+ close_at: '2015-10-28 11:30:00 UTC',
created_at: '2015-10-28 10:30:00 UTC',
updated_at: '2015-10-28 10:30:00 UTC',
updated_by_id: 1,
@@ -167,7 +167,7 @@ class ReportTest < ActiveSupport::TestCase
customer_id: 2,
state: Ticket::State.lookup(name: 'closed'),
priority: Ticket::Priority.lookup(name: '3 high'),
- close_time: '2015-10-28 11:40:00 UTC',
+ close_at: '2015-10-28 11:40:00 UTC',
created_at: '2015-10-28 11:30:00 UTC',
updated_at: '2015-10-28 11:30:00 UTC',
updated_by_id: 1,
@@ -199,7 +199,7 @@ class ReportTest < ActiveSupport::TestCase
customer_id: 2,
state: Ticket::State.lookup(name: 'closed'),
priority: Ticket::Priority.lookup(name: '2 normal'),
- close_time: '2015-10-31 12:35:00 UTC',
+ close_at: '2015-10-31 12:35:00 UTC',
created_at: '2015-10-31 12:30:00 UTC',
updated_at: '2015-10-31 12:30:00 UTC',
updated_by_id: 1,
@@ -227,7 +227,7 @@ class ReportTest < ActiveSupport::TestCase
customer_id: 2,
state: Ticket::State.lookup(name: 'closed'),
priority: Ticket::Priority.lookup(name: '2 normal'),
- close_time: '2015-11-01 12:30:00 UTC',
+ close_at: '2015-11-01 12:30:00 UTC',
created_at: '2015-11-01 12:30:00 UTC',
updated_at: '2015-11-01 12:30:00 UTC',
updated_by_id: 1,
diff --git a/test/integration/zendesk_import_test.rb b/test/integration/zendesk_import_test.rb
index 1aafb5676..5b1c87082 100644
--- a/test/integration/zendesk_import_test.rb
+++ b/test/integration/zendesk_import_test.rb
@@ -437,27 +437,24 @@ If you\'re reading this message in your email, click the ticket number link that
owner_id
customer_id
note
- first_response
- first_response_escal_date
- first_response_sla_time
+ first_response_at
+ first_response_escalation_at
first_response_in_min
first_response_diff_in_min
- close_time
- close_time_escal_date
- close_time_sla_time
- close_time_in_min
- close_time_diff_in_min
- update_time_escal_date
- update_time_sla_time
- update_time_in_min
- update_time_diff_in_min
- last_contact
- last_contact_agent
- last_contact_customer
+ close_at
+ close_escalation_at
+ close_in_min
+ close_diff_in_min
+ update_escalation_at
+ update_in_min
+ update_diff_in_min
+ last_contact_at
+ last_contact_agent_at
+ last_contact_customer_at
create_article_type_id
create_article_sender_id
article_count
- escalation_time
+ escalation_at
pending_time
type
preferences
diff --git a/test/unit/calendar_subscription_test.rb b/test/unit/calendar_subscription_test.rb
index 580dc6abf..3e31dbab1 100644
--- a/test/unit/calendar_subscription_test.rb
+++ b/test/unit/calendar_subscription_test.rb
@@ -134,7 +134,7 @@ class CalendarSubscriptionTest < ActiveSupport::TestCase
updated_by_id: 1,
created_by_id: 1,
)
- ticket5.update_columns(escalation_time: '2016-02-07 17:39:00')
+ ticket5.update_columns(escalation_at: '2016-02-07 17:39:00')
ticket6 = Ticket.create!(
title: 'some title1 - escalation - group_default',
@@ -147,7 +147,7 @@ class CalendarSubscriptionTest < ActiveSupport::TestCase
updated_by_id: 1,
created_by_id: 1,
)
- ticket6.update_columns(escalation_time: '2016-02-07 16:37:00')
+ ticket6.update_columns(escalation_at: '2016-02-07 16:37:00')
ticket7 = Ticket.create!(
title: 'some title2 - new - group_calendar',
@@ -206,7 +206,7 @@ class CalendarSubscriptionTest < ActiveSupport::TestCase
updated_by_id: 1,
created_by_id: 1,
)
- ticket11.update_columns(escalation_time: '2016-02-08 18:37:00')
+ ticket11.update_columns(escalation_at: '2016-02-08 18:37:00')
ticket12 = Ticket.create!(
title: 'some title2 - escalation - group_default',
@@ -219,8 +219,8 @@ class CalendarSubscriptionTest < ActiveSupport::TestCase
updated_by_id: 1,
created_by_id: 1,
)
- ticket12.update_columns(escalation_time: '2016-02-08 18:38:00')
- Cache.clear # set escalation_time manually, to clear cache to have correct content later
+ ticket12.update_columns(escalation_at: '2016-02-08 18:38:00')
+ Cache.clear # set escalation_at manually, to clear cache to have correct content later
# check agent 1
calendar_subscriptions = CalendarSubscriptions.new(agent1)
diff --git a/test/unit/ticket_selector_test.rb b/test/unit/ticket_selector_test.rb
index 2d602b7f2..2d7039d12 100644
--- a/test/unit/ticket_selector_test.rb
+++ b/test/unit/ticket_selector_test.rb
@@ -129,7 +129,7 @@ class TicketSelectorTest < ActiveSupport::TestCase
updated_by_id: 1,
created_by_id: 1,
)
- ticket3.update_columns(escalation_time: '2015-02-06 10:00:00')
+ ticket3.update_columns(escalation_at: '2015-02-06 10:00:00')
assert(ticket3, 'ticket created')
assert_equal(ticket3.customer.id, customer2.id)
assert_equal(ticket3.organization_id, nil)
@@ -287,7 +287,7 @@ class TicketSelectorTest < ActiveSupport::TestCase
assert_equal(ticket_count, 1)
condition = {
- 'ticket.escalation_time' => {
+ 'ticket.escalation_at' => {
operator: 'is not',
value: nil,
}
diff --git a/test/unit/ticket_sla_test.rb b/test/unit/ticket_sla_test.rb
index d81318700..5e6a27e3c 100644
--- a/test/unit/ticket_sla_test.rb
+++ b/test/unit/ticket_sla_test.rb
@@ -23,7 +23,7 @@ class TicketSlaTest < ActiveSupport::TestCase
created_by_id: 1,
)
assert(ticket, 'ticket created')
- assert_equal(ticket.escalation_time, nil, 'ticket.escalation_time verify')
+ assert_equal(ticket.escalation_at, nil, 'ticket.escalation_at verify')
calendar1 = Calendar.create_or_update(
name: 'EU 1',
@@ -76,10 +76,10 @@ class TicketSlaTest < ActiveSupport::TestCase
)
Scheduler.worker(true)
ticket = Ticket.find(ticket.id)
- assert_equal(ticket.escalation_time.gmtime.to_s, '2013-03-21 10:30:00 UTC', 'ticket.escalation_time verify 1')
- assert_equal(ticket.first_response_escal_date.gmtime.to_s, '2013-03-21 10:30:00 UTC', 'ticket.first_response_escal_date verify 1')
- assert_equal(ticket.update_time_escal_date.gmtime.to_s, '2013-03-21 12:30:00 UTC', 'ticket.update_time_escal_date verify 1')
- assert_equal(ticket.close_time_escal_date.gmtime.to_s, '2013-03-21 13:30:00 UTC', 'ticket.close_time_escal_date verify 1')
+ assert_equal(ticket.escalation_at.gmtime.to_s, '2013-03-21 10:30:00 UTC', 'ticket.escalation_at verify 1')
+ assert_equal(ticket.first_response_escalation_at.gmtime.to_s, '2013-03-21 10:30:00 UTC', 'ticket.first_response_escalation_at verify 1')
+ assert_equal(ticket.update_escalation_at.gmtime.to_s, '2013-03-21 12:30:00 UTC', 'ticket.update_escalation_at verify 1')
+ assert_equal(ticket.close_escalation_at.gmtime.to_s, '2013-03-21 13:30:00 UTC', 'ticket.close_escalation_at verify 1')
sla = Sla.create_or_update(
name: 'test sla 1',
@@ -93,10 +93,10 @@ class TicketSlaTest < ActiveSupport::TestCase
)
Scheduler.worker(true)
ticket = Ticket.find(ticket.id)
- assert_equal(ticket.escalation_time.gmtime.to_s, '2013-03-21 11:30:00 UTC', 'ticket.escalation_time verify 1')
- assert_equal(ticket.first_response_escal_date.gmtime.to_s, '2013-03-21 11:30:00 UTC', 'ticket.first_response_escal_date verify 1')
- assert_equal(ticket.update_time_escal_date.gmtime.to_s, '2013-03-21 12:30:00 UTC', 'ticket.update_time_escal_date verify 1')
- assert_equal(ticket.close_time_escal_date.gmtime.to_s, '2013-03-21 13:30:00 UTC', 'ticket.close_time_escal_date verify 1')
+ assert_equal(ticket.escalation_at.gmtime.to_s, '2013-03-21 11:30:00 UTC', 'ticket.escalation_at verify 1')
+ assert_equal(ticket.first_response_escalation_at.gmtime.to_s, '2013-03-21 11:30:00 UTC', 'ticket.first_response_escalation_at verify 1')
+ assert_equal(ticket.update_escalation_at.gmtime.to_s, '2013-03-21 12:30:00 UTC', 'ticket.update_escalation_at verify 1')
+ assert_equal(ticket.close_escalation_at.gmtime.to_s, '2013-03-21 13:30:00 UTC', 'ticket.close_escalation_at verify 1')
delete = sla.destroy
assert(delete, 'sla destroy 1')
@@ -155,190 +155,190 @@ class TicketSlaTest < ActiveSupport::TestCase
)
Scheduler.worker(true)
ticket = Ticket.find(ticket.id)
- assert_equal(ticket.escalation_time.gmtime.to_s, '2013-03-21 10:30:00 UTC', 'ticket.escalation_time verify 2')
- assert_equal(ticket.first_response_escal_date.gmtime.to_s, '2013-03-21 10:30:00 UTC', 'ticket.first_response_escal_date verify 2')
- assert_equal(ticket.first_response, nil, 'ticket.first_response verify 2')
+ assert_equal(ticket.escalation_at.gmtime.to_s, '2013-03-21 10:30:00 UTC', 'ticket.escalation_at verify 2')
+ assert_equal(ticket.first_response_escalation_at.gmtime.to_s, '2013-03-21 10:30:00 UTC', 'ticket.first_response_escalation_at verify 2')
+ assert_equal(ticket.first_response_at, nil, 'ticket.first_response_at verify 2')
assert_equal(ticket.first_response_in_min, nil, 'ticket.first_response_in_min verify 2')
assert_equal(ticket.first_response_diff_in_min, nil, 'ticket.first_response_diff_in_min verify 2')
- assert_equal(ticket.update_time_escal_date.gmtime.to_s, '2013-03-21 11:30:00 UTC', 'ticket.update_time_escal_date verify 2')
- assert_equal(ticket.update_time_in_min, nil, 'ticket.update_time_in_min verify 2')
- assert_equal(ticket.update_time_diff_in_min, nil, 'ticket.update_time_diff_in_min verify 2')
+ assert_equal(ticket.update_escalation_at.gmtime.to_s, '2013-03-21 11:30:00 UTC', 'ticket.update_escalation_at verify 2')
+ assert_equal(ticket.update_in_min, nil, 'ticket.update_in_min verify 2')
+ assert_equal(ticket.update_diff_in_min, nil, 'ticket.update_diff_in_min verify 2')
- assert_equal(ticket.close_time_escal_date.gmtime.to_s, '2013-03-21 12:30:00 UTC', 'ticket.close_time_escal_date verify 2')
- assert_equal(ticket.close_time_in_min, nil, 'ticket.close_time_in_min verify 2')
- assert_equal(ticket.close_time_diff_in_min, nil, 'ticket.close_time_diff_in_min verify 2')
+ assert_equal(ticket.close_escalation_at.gmtime.to_s, '2013-03-21 12:30:00 UTC', 'ticket.close_escalation_at verify 2')
+ assert_equal(ticket.close_in_min, nil, 'ticket.close_in_min verify 2')
+ assert_equal(ticket.close_diff_in_min, nil, 'ticket.close_diff_in_min verify 2')
# set first response in time
ticket.update_attributes(
- first_response: '2013-03-21 10:00:00 UTC',
+ first_response_at: '2013-03-21 10:00:00 UTC',
)
- assert_equal(ticket.escalation_time.gmtime.to_s, '2013-03-21 11:30:00 UTC', 'ticket.escalation_time verify 3')
- assert_equal(ticket.first_response_escal_date.gmtime.to_s, '2013-03-21 10:30:00 UTC', 'ticket.first_response_escal_date verify 3')
- assert_equal(ticket.first_response.gmtime.to_s, '2013-03-21 10:00:00 UTC', 'ticket.first_response verify 3')
+ assert_equal(ticket.escalation_at.gmtime.to_s, '2013-03-21 11:30:00 UTC', 'ticket.escalation_at verify 3')
+ assert_equal(ticket.first_response_escalation_at.gmtime.to_s, '2013-03-21 10:30:00 UTC', 'ticket.first_response_escalation_at verify 3')
+ assert_equal(ticket.first_response_at.gmtime.to_s, '2013-03-21 10:00:00 UTC', 'ticket.first_response_at verify 3')
assert_equal(ticket.first_response_in_min, 30, 'ticket.first_response_in_min verify 3')
assert_equal(ticket.first_response_diff_in_min, 30, 'ticket.first_response_diff_in_min verify 3')
- assert_equal(ticket.update_time_escal_date.gmtime.to_s, '2013-03-21 11:30:00 UTC', 'ticket.update_time_escal_date verify 3')
- assert_equal(ticket.update_time_in_min, nil, 'ticket.update_time_in_min verify 3')
- assert_equal(ticket.update_time_diff_in_min, nil, 'ticket.update_time_diff_in_min verify 3')
+ assert_equal(ticket.update_escalation_at.gmtime.to_s, '2013-03-21 11:30:00 UTC', 'ticket.update_escalation_at verify 3')
+ assert_equal(ticket.update_in_min, nil, 'ticket.update_in_min verify 3')
+ assert_equal(ticket.update_diff_in_min, nil, 'ticket.update_diff_in_min verify 3')
- assert_equal(ticket.close_time_escal_date.gmtime.to_s, '2013-03-21 12:30:00 UTC', 'ticket.close_time_escal_date verify 3')
- assert_equal(ticket.close_time_in_min, nil, 'ticket.close_time_in_min verify 3')
- assert_equal(ticket.close_time_diff_in_min, nil, 'ticket.close_time_diff_in_min verify 3')
+ assert_equal(ticket.close_escalation_at.gmtime.to_s, '2013-03-21 12:30:00 UTC', 'ticket.close_escalation_at verify 3')
+ assert_equal(ticket.close_in_min, nil, 'ticket.close_in_min verify 3')
+ assert_equal(ticket.close_diff_in_min, nil, 'ticket.close_diff_in_min verify 3')
# set first reponse over time
ticket.update_attributes(
- first_response: '2013-03-21 14:00:00 UTC',
+ first_response_at: '2013-03-21 14:00:00 UTC',
)
- assert_equal(ticket.escalation_time.gmtime.to_s, '2013-03-21 11:30:00 UTC', 'ticket.escalation_time verify 4')
- assert_equal(ticket.first_response_escal_date.gmtime.to_s, '2013-03-21 10:30:00 UTC', 'ticket.first_response_escal_date verify 4')
- assert_equal(ticket.first_response.gmtime.to_s, '2013-03-21 14:00:00 UTC', 'ticket.first_response verify 4')
+ assert_equal(ticket.escalation_at.gmtime.to_s, '2013-03-21 11:30:00 UTC', 'ticket.escalation_at verify 4')
+ assert_equal(ticket.first_response_escalation_at.gmtime.to_s, '2013-03-21 10:30:00 UTC', 'ticket.first_response_escalation_at verify 4')
+ assert_equal(ticket.first_response_at.gmtime.to_s, '2013-03-21 14:00:00 UTC', 'ticket.first_response_at verify 4')
assert_equal(ticket.first_response_in_min, 270, 'ticket.first_response_in_min verify 4')
assert_equal(ticket.first_response_diff_in_min, -210, 'ticket.first_response_diff_in_min verify 4')
- assert_equal(ticket.update_time_escal_date.gmtime.to_s, '2013-03-21 11:30:00 UTC', 'ticket.update_time_escal_date verify 4')
- assert_equal(ticket.update_time_in_min, nil, 'ticket.update_time_in_min verify 4')
- assert_equal(ticket.update_time_diff_in_min, nil, 'ticket.update_time_diff_in_min verify 4')
+ assert_equal(ticket.update_escalation_at.gmtime.to_s, '2013-03-21 11:30:00 UTC', 'ticket.update_escalation_at verify 4')
+ assert_equal(ticket.update_in_min, nil, 'ticket.update_in_min verify 4')
+ assert_equal(ticket.update_diff_in_min, nil, 'ticket.update_diff_in_min verify 4')
- assert_equal(ticket.close_time_escal_date.gmtime.to_s, '2013-03-21 12:30:00 UTC', 'ticket.close_time_escal_date verify 4')
- assert_equal(ticket.close_time_in_min, nil, 'ticket.close_time_in_min verify 4')
- assert_equal(ticket.close_time_diff_in_min, nil, 'ticket.close_time_diff_in_min verify 4')
+ assert_equal(ticket.close_escalation_at.gmtime.to_s, '2013-03-21 12:30:00 UTC', 'ticket.close_escalation_at verify 4')
+ assert_equal(ticket.close_in_min, nil, 'ticket.close_in_min verify 4')
+ assert_equal(ticket.close_diff_in_min, nil, 'ticket.close_diff_in_min verify 4')
# set update time in time
ticket.update_attributes(
- last_contact_agent: '2013-03-21 11:00:00 UTC',
+ last_contact_agent_at: '2013-03-21 11:00:00 UTC',
)
- assert_equal(ticket.escalation_time.gmtime.to_s, '2013-03-21 12:30:00 UTC', 'ticket.escalation_time verify 5')
+ assert_equal(ticket.escalation_at.gmtime.to_s, '2013-03-21 12:30:00 UTC', 'ticket.escalation_at verify 5')
- assert_equal(ticket.first_response_escal_date.gmtime.to_s, '2013-03-21 10:30:00 UTC', 'ticket.first_response_escal_date verify 5')
- assert_equal(ticket.first_response.gmtime.to_s, '2013-03-21 14:00:00 UTC', 'ticket.first_response verify 5')
+ assert_equal(ticket.first_response_escalation_at.gmtime.to_s, '2013-03-21 10:30:00 UTC', 'ticket.first_response_escalation_at verify 5')
+ assert_equal(ticket.first_response_at.gmtime.to_s, '2013-03-21 14:00:00 UTC', 'ticket.first_response_at verify 5')
assert_equal(ticket.first_response_in_min, 270, 'ticket.first_response_in_min verify 5')
assert_equal(ticket.first_response_diff_in_min, -210, 'ticket.first_response_diff_in_min verify 5')
- assert_equal(ticket.update_time_escal_date.gmtime.to_s, '2013-03-21 13:00:00 UTC', 'ticket.update_time_escal_date verify 5')
- assert_equal(ticket.update_time_in_min, 90, 'ticket.update_time_in_min verify 5')
- assert_equal(ticket.update_time_diff_in_min, 30, 'ticket.update_time_diff_in_min verify 5')
+ assert_equal(ticket.update_escalation_at.gmtime.to_s, '2013-03-21 13:00:00 UTC', 'ticket.update_escalation_at verify 5')
+ assert_equal(ticket.update_in_min, 90, 'ticket.update_in_min verify 5')
+ assert_equal(ticket.update_diff_in_min, 30, 'ticket.update_diff_in_min verify 5')
- assert_equal(ticket.close_time_escal_date.gmtime.to_s, '2013-03-21 12:30:00 UTC', 'ticket.close_time_escal_date verify 5')
- assert_equal(ticket.close_time_in_min, nil, 'ticket.close_time_in_min verify 5')
- assert_equal(ticket.close_time_diff_in_min, nil, 'ticket.close_time_diff_in_min verify 5')
+ assert_equal(ticket.close_escalation_at.gmtime.to_s, '2013-03-21 12:30:00 UTC', 'ticket.close_escalation_at verify 5')
+ assert_equal(ticket.close_in_min, nil, 'ticket.close_in_min verify 5')
+ assert_equal(ticket.close_diff_in_min, nil, 'ticket.close_diff_in_min verify 5')
# set update time over time
ticket.update_attributes(
- last_contact_agent: '2013-03-21 12:00:00 UTC',
+ last_contact_agent_at: '2013-03-21 12:00:00 UTC',
)
- assert_equal(ticket.escalation_time.gmtime.to_s, '2013-03-21 12:30:00 UTC', 'ticket.escalation_time verify 6')
+ assert_equal(ticket.escalation_at.gmtime.to_s, '2013-03-21 12:30:00 UTC', 'ticket.escalation_at verify 6')
- assert_equal(ticket.first_response_escal_date.gmtime.to_s, '2013-03-21 10:30:00 UTC', 'ticket.first_response_escal_date verify 6')
- assert_equal(ticket.first_response.gmtime.to_s, '2013-03-21 14:00:00 UTC', 'ticket.first_response verify 6')
+ assert_equal(ticket.first_response_escalation_at.gmtime.to_s, '2013-03-21 10:30:00 UTC', 'ticket.first_response_escalation_at verify 6')
+ assert_equal(ticket.first_response_at.gmtime.to_s, '2013-03-21 14:00:00 UTC', 'ticket.first_response_at verify 6')
assert_equal(ticket.first_response_in_min, 270, 'ticket.first_response_in_min verify 6')
assert_equal(ticket.first_response_diff_in_min, -210, 'ticket.first_response_diff_in_min verify 6')
- assert_equal(ticket.update_time_escal_date.gmtime.to_s, '2013-03-21 14:00:00 UTC', 'ticket.update_time_escal_date verify 6')
- assert_equal(ticket.update_time_in_min, 150, 'ticket.update_time_in_min verify 6')
- assert_equal(ticket.update_time_diff_in_min, -30, 'ticket.update_time_diff_in_min verify 6')
+ assert_equal(ticket.update_escalation_at.gmtime.to_s, '2013-03-21 14:00:00 UTC', 'ticket.update_escalation_at verify 6')
+ assert_equal(ticket.update_in_min, 150, 'ticket.update_in_min verify 6')
+ assert_equal(ticket.update_diff_in_min, -30, 'ticket.update_diff_in_min verify 6')
- assert_equal(ticket.close_time_escal_date.gmtime.to_s, '2013-03-21 12:30:00 UTC', 'ticket.close_time_escal_date verify 6')
- assert_equal(ticket.close_time_in_min, nil, 'ticket.close_time_in_min verify 6')
- assert_equal(ticket.close_time_diff_in_min, nil, 'ticket.close_time_diff_in_min verify 6')
+ assert_equal(ticket.close_escalation_at.gmtime.to_s, '2013-03-21 12:30:00 UTC', 'ticket.close_escalation_at verify 6')
+ assert_equal(ticket.close_in_min, nil, 'ticket.close_in_min verify 6')
+ assert_equal(ticket.close_diff_in_min, nil, 'ticket.close_diff_in_min verify 6')
# set update time over time
ticket.update_attributes(
- last_contact_customer: '2013-03-21 12:05:00 UTC',
+ last_contact_customer_at: '2013-03-21 12:05:00 UTC',
)
- assert_equal(ticket.escalation_time.gmtime.to_s, '2013-03-21 12:30:00 UTC', 'ticket.escalation_time verify 6')
+ assert_equal(ticket.escalation_at.gmtime.to_s, '2013-03-21 12:30:00 UTC', 'ticket.escalation_at verify 6')
- assert_equal(ticket.first_response_escal_date.gmtime.to_s, '2013-03-21 10:30:00 UTC', 'ticket.first_response_escal_date verify 6')
- assert_equal(ticket.first_response.gmtime.to_s, '2013-03-21 14:00:00 UTC', 'ticket.first_response verify 6')
+ assert_equal(ticket.first_response_escalation_at.gmtime.to_s, '2013-03-21 10:30:00 UTC', 'ticket.first_response_escalation_at verify 6')
+ assert_equal(ticket.first_response_at.gmtime.to_s, '2013-03-21 14:00:00 UTC', 'ticket.first_response_at verify 6')
assert_equal(ticket.first_response_in_min, 270, 'ticket.first_response_in_min verify 6')
assert_equal(ticket.first_response_diff_in_min, -210, 'ticket.first_response_diff_in_min verify 6')
- assert_equal(ticket.update_time_escal_date.gmtime.to_s, '2013-03-21 14:05:00 UTC', 'ticket.update_time_escal_date verify 6')
- assert_equal(ticket.update_time_in_min, 155, 'ticket.update_time_in_min verify 6')
- assert_equal(ticket.update_time_diff_in_min, -35, 'ticket.update_time_diff_in_min verify 6')
+ assert_equal(ticket.update_escalation_at.gmtime.to_s, '2013-03-21 14:05:00 UTC', 'ticket.update_escalation_at verify 6')
+ assert_equal(ticket.update_in_min, 155, 'ticket.update_in_min verify 6')
+ assert_equal(ticket.update_diff_in_min, -35, 'ticket.update_diff_in_min verify 6')
- assert_equal(ticket.close_time_escal_date.gmtime.to_s, '2013-03-21 12:30:00 UTC', 'ticket.close_time_escal_date verify 6')
- assert_equal(ticket.close_time_in_min, nil, 'ticket.close_time_in_min verify 6')
- assert_equal(ticket.close_time_diff_in_min, nil, 'ticket.close_time_diff_in_min verify 6')
+ assert_equal(ticket.close_escalation_at.gmtime.to_s, '2013-03-21 12:30:00 UTC', 'ticket.close_escalation_at verify 6')
+ assert_equal(ticket.close_in_min, nil, 'ticket.close_in_min verify 6')
+ assert_equal(ticket.close_diff_in_min, nil, 'ticket.close_diff_in_min verify 6')
# set update time over time
ticket.update_attributes(
- last_contact_agent: '2013-03-21 12:10:00 UTC',
+ last_contact_agent_at: '2013-03-21 12:10:00 UTC',
)
- assert_equal(ticket.escalation_time.gmtime.to_s, '2013-03-21 12:30:00 UTC', 'ticket.escalation_time verify 6')
+ assert_equal(ticket.escalation_at.gmtime.to_s, '2013-03-21 12:30:00 UTC', 'ticket.escalation_at verify 6')
- assert_equal(ticket.first_response_escal_date.gmtime.to_s, '2013-03-21 10:30:00 UTC', 'ticket.first_response_escal_date verify 6')
- assert_equal(ticket.first_response.gmtime.to_s, '2013-03-21 14:00:00 UTC', 'ticket.first_response verify 6')
+ assert_equal(ticket.first_response_escalation_at.gmtime.to_s, '2013-03-21 10:30:00 UTC', 'ticket.first_response_escalation_at verify 6')
+ assert_equal(ticket.first_response_at.gmtime.to_s, '2013-03-21 14:00:00 UTC', 'ticket.first_response_at verify 6')
assert_equal(ticket.first_response_in_min, 270, 'ticket.first_response_in_min verify 6')
assert_equal(ticket.first_response_diff_in_min, -210, 'ticket.first_response_diff_in_min verify 6')
- assert_equal(ticket.update_time_escal_date.gmtime.to_s, '2013-03-21 14:10:00 UTC', 'ticket.update_time_escal_date verify 6')
- assert_equal(ticket.update_time_in_min, 160, 'ticket.update_time_in_min verify 6')
- assert_equal(ticket.update_time_diff_in_min, -40, 'ticket.update_time_diff_in_min verify 6')
+ assert_equal(ticket.update_escalation_at.gmtime.to_s, '2013-03-21 14:10:00 UTC', 'ticket.update_escalation_at verify 6')
+ assert_equal(ticket.update_in_min, 160, 'ticket.update_in_min verify 6')
+ assert_equal(ticket.update_diff_in_min, -40, 'ticket.update_diff_in_min verify 6')
- assert_equal(ticket.close_time_escal_date.gmtime.to_s, '2013-03-21 12:30:00 UTC', 'ticket.close_time_escal_date verify 6')
- assert_equal(ticket.close_time_in_min, nil, 'ticket.close_time_in_min verify 6')
- assert_equal(ticket.close_time_diff_in_min, nil, 'ticket.close_time_diff_in_min verify 6')
+ assert_equal(ticket.close_escalation_at.gmtime.to_s, '2013-03-21 12:30:00 UTC', 'ticket.close_escalation_at verify 6')
+ assert_equal(ticket.close_in_min, nil, 'ticket.close_in_min verify 6')
+ assert_equal(ticket.close_diff_in_min, nil, 'ticket.close_diff_in_min verify 6')
# set close time in time
ticket.update_attributes(
- close_time: '2013-03-21 11:30:00 UTC',
+ close_at: '2013-03-21 11:30:00 UTC',
)
- assert_equal(ticket.escalation_time.gmtime.to_s, '2013-03-21 14:10:00 UTC', 'ticket.escalation_time verify 7')
+ assert_equal(ticket.escalation_at.gmtime.to_s, '2013-03-21 14:10:00 UTC', 'ticket.escalation_at verify 7')
- assert_equal(ticket.first_response_escal_date.gmtime.to_s, '2013-03-21 10:30:00 UTC', 'ticket.first_response_escal_date verify 7')
- assert_equal(ticket.first_response.gmtime.to_s, '2013-03-21 14:00:00 UTC', 'ticket.first_response verify 7')
+ assert_equal(ticket.first_response_escalation_at.gmtime.to_s, '2013-03-21 10:30:00 UTC', 'ticket.first_response_escalation_at verify 7')
+ assert_equal(ticket.first_response_at.gmtime.to_s, '2013-03-21 14:00:00 UTC', 'ticket.first_response_at verify 7')
assert_equal(ticket.first_response_in_min, 270, 'ticket.first_response_in_min verify 7')
assert_equal(ticket.first_response_diff_in_min, -210, 'ticket.first_response_diff_in_min verify 7')
- assert_equal(ticket.update_time_escal_date.gmtime.to_s, '2013-03-21 14:10:00 UTC', 'ticket.update_time_escal_date verify 7')
- assert_equal(ticket.update_time_in_min, 160, 'ticket.update_time_in_min verify 7')
- assert_equal(ticket.update_time_diff_in_min, -40, 'ticket.update_time_diff_in_min verify 7')
+ assert_equal(ticket.update_escalation_at.gmtime.to_s, '2013-03-21 14:10:00 UTC', 'ticket.update_escalation_at verify 7')
+ assert_equal(ticket.update_in_min, 160, 'ticket.update_in_min verify 7')
+ assert_equal(ticket.update_diff_in_min, -40, 'ticket.update_diff_in_min verify 7')
- assert_equal(ticket.close_time_escal_date.gmtime.to_s, '2013-03-21 12:30:00 UTC', 'ticket.close_time_escal_date verify 7')
- assert_equal(ticket.close_time_in_min, 120, 'ticket.close_time_in_min verify 7')
- assert_equal(ticket.close_time_diff_in_min, 60, 'ticket.close_time_diff_in_min verify 7')
+ assert_equal(ticket.close_escalation_at.gmtime.to_s, '2013-03-21 12:30:00 UTC', 'ticket.close_escalation_at verify 7')
+ assert_equal(ticket.close_in_min, 120, 'ticket.close_in_min verify 7')
+ assert_equal(ticket.close_diff_in_min, 60, 'ticket.close_diff_in_min verify 7')
# set close time over time
ticket.update_attributes(
- close_time: '2013-03-21 13:00:00 UTC',
+ close_at: '2013-03-21 13:00:00 UTC',
)
- assert_equal(ticket.escalation_time.gmtime.to_s, '2013-03-21 14:10:00 UTC', 'ticket.escalation_time verify 8')
+ assert_equal(ticket.escalation_at.gmtime.to_s, '2013-03-21 14:10:00 UTC', 'ticket.escalation_at verify 8')
- assert_equal(ticket.first_response_escal_date.gmtime.to_s, '2013-03-21 10:30:00 UTC', 'ticket.first_response_escal_date verify 8')
- assert_equal(ticket.first_response.gmtime.to_s, '2013-03-21 14:00:00 UTC', 'ticket.first_response verify 8')
+ assert_equal(ticket.first_response_escalation_at.gmtime.to_s, '2013-03-21 10:30:00 UTC', 'ticket.first_response_escalation_at verify 8')
+ assert_equal(ticket.first_response_at.gmtime.to_s, '2013-03-21 14:00:00 UTC', 'ticket.first_response_at verify 8')
assert_equal(ticket.first_response_in_min, 270, 'ticket.first_response_in_min verify 8')
assert_equal(ticket.first_response_diff_in_min, -210, 'ticket.first_response_diff_in_min verify 8')
- assert_equal(ticket.update_time_escal_date.gmtime.to_s, '2013-03-21 14:10:00 UTC', 'ticket.update_time_escal_date verify 8')
- assert_equal(ticket.update_time_in_min, 160, 'ticket.update_time_in_min verify 8')
- assert_equal(ticket.update_time_diff_in_min, -40, 'ticket.update_time_diff_in_min verify 8')
+ assert_equal(ticket.update_escalation_at.gmtime.to_s, '2013-03-21 14:10:00 UTC', 'ticket.update_escalation_at verify 8')
+ assert_equal(ticket.update_in_min, 160, 'ticket.update_in_min verify 8')
+ assert_equal(ticket.update_diff_in_min, -40, 'ticket.update_diff_in_min verify 8')
- assert_equal(ticket.close_time_escal_date.gmtime.to_s, '2013-03-21 12:30:00 UTC', 'ticket.close_time_escal_date verify 8')
- assert_equal(ticket.close_time_in_min, 210, 'ticket.close_time_in_min verify 8')
- assert_equal(ticket.close_time_diff_in_min, -30, 'ticket.close_time_diff_in_min verify 8')
+ assert_equal(ticket.close_escalation_at.gmtime.to_s, '2013-03-21 12:30:00 UTC', 'ticket.close_escalation_at verify 8')
+ assert_equal(ticket.close_in_min, 210, 'ticket.close_in_min verify 8')
+ assert_equal(ticket.close_diff_in_min, -30, 'ticket.close_diff_in_min verify 8')
# set close time over time
ticket.update_attributes(
state: Ticket::State.lookup(name: 'closed')
)
- assert_equal(ticket.escalation_time, nil, 'ticket.escalation_time verify 9')
+ assert_equal(ticket.escalation_at, nil, 'ticket.escalation_at verify 9')
- assert_equal(ticket.first_response_escal_date.gmtime.to_s, '2013-03-21 10:30:00 UTC', 'ticket.first_response_escal_date verify 9')
- assert_equal(ticket.first_response.gmtime.to_s, '2013-03-21 14:00:00 UTC', 'ticket.first_response verify 9')
+ assert_equal(ticket.first_response_escalation_at.gmtime.to_s, '2013-03-21 10:30:00 UTC', 'ticket.first_response_escalation_at verify 9')
+ assert_equal(ticket.first_response_at.gmtime.to_s, '2013-03-21 14:00:00 UTC', 'ticket.first_response_at verify 9')
assert_equal(ticket.first_response_in_min, 270, 'ticket.first_response_in_min verify 9')
assert_equal(ticket.first_response_diff_in_min, -210, 'ticket.first_response_diff_in_min verify 9')
- assert_equal(ticket.update_time_escal_date.gmtime.to_s, '2013-03-21 14:10:00 UTC', 'ticket.update_time_escal_date verify 9')
- assert_equal(ticket.update_time_in_min, 160, 'ticket.update_time_in_min verify 9')
- assert_equal(ticket.update_time_diff_in_min, -40, 'ticket.update_time_diff_in_min verify 9')
+ assert_equal(ticket.update_escalation_at.gmtime.to_s, '2013-03-21 14:10:00 UTC', 'ticket.update_escalation_at verify 9')
+ assert_equal(ticket.update_in_min, 160, 'ticket.update_in_min verify 9')
+ assert_equal(ticket.update_diff_in_min, -40, 'ticket.update_diff_in_min verify 9')
- assert_equal(ticket.close_time_escal_date.gmtime.to_s, '2013-03-21 12:30:00 UTC', 'ticket.close_time_escal_date verify 9')
- assert_equal(ticket.close_time_in_min, 210, 'ticket.close_time_in_min verify 9')
- assert_equal(ticket.close_time_diff_in_min, -30, 'ticket.close_time_diff_in_min verify 9')
+ assert_equal(ticket.close_escalation_at.gmtime.to_s, '2013-03-21 12:30:00 UTC', 'ticket.close_escalation_at verify 9')
+ assert_equal(ticket.close_in_min, 210, 'ticket.close_in_min verify 9')
+ assert_equal(ticket.close_diff_in_min, -30, 'ticket.close_diff_in_min verify 9')
delete = ticket.destroy
assert(delete, 'ticket destroy')
@@ -378,11 +378,11 @@ class TicketSlaTest < ActiveSupport::TestCase
)
ticket = Ticket.find(ticket.id)
assert_equal(ticket.article_count, 1, 'ticket.article_count verify - inbound')
- assert_equal(ticket.last_contact.to_s, article_inbound.created_at.to_s, 'ticket.last_contact verify - inbound')
- assert_equal(ticket.last_contact_customer.to_s, article_inbound.created_at.to_s, 'ticket.last_contact_customer verify - inbound')
- assert_equal(ticket.last_contact_agent, nil, 'ticket.last_contact_agent verify - inbound')
- assert_equal(ticket.first_response, nil, 'ticket.first_response verify - inbound')
- assert_equal(ticket.close_time, nil, 'ticket.close_time verify - inbound')
+ assert_equal(ticket.last_contact_at.to_s, article_inbound.created_at.to_s, 'ticket.last_contact_at verify - inbound')
+ assert_equal(ticket.last_contact_customer_at.to_s, article_inbound.created_at.to_s, 'ticket.last_contact_customer_at verify - inbound')
+ assert_equal(ticket.last_contact_agent_at, nil, 'ticket.last_contact_agent_at verify - inbound')
+ assert_equal(ticket.first_response_at, nil, 'ticket.first_response_at verify - inbound')
+ assert_equal(ticket.close_at, nil, 'ticket.close_at verify - inbound')
# create outbound article
article_outbound = Ticket::Article.create!(
@@ -403,13 +403,13 @@ class TicketSlaTest < ActiveSupport::TestCase
ticket = Ticket.find(ticket.id)
assert_equal(ticket.article_count, 2, 'ticket.article_count verify - outbound')
- assert_equal(ticket.last_contact.to_s, article_outbound.created_at.to_s, 'ticket.last_contact verify - outbound')
- assert_equal(ticket.last_contact_customer.to_s, article_inbound.created_at.to_s, 'ticket.last_contact_customer verify - outbound')
- assert_equal(ticket.last_contact_agent.to_s, article_outbound.created_at.to_s, 'ticket.last_contact_agent verify - outbound')
- assert_equal(ticket.first_response.to_s, article_outbound.created_at.to_s, 'ticket.first_response verify - outbound')
+ assert_equal(ticket.last_contact_at.to_s, article_outbound.created_at.to_s, 'ticket.last_contact_at verify - outbound')
+ assert_equal(ticket.last_contact_customer_at.to_s, article_inbound.created_at.to_s, 'ticket.last_contact_customer_at verify - outbound')
+ assert_equal(ticket.last_contact_agent_at.to_s, article_outbound.created_at.to_s, 'ticket.last_contact_agent_at verify - outbound')
+ assert_equal(ticket.first_response_at.to_s, article_outbound.created_at.to_s, 'ticket.first_response_at verify - outbound')
assert_equal(ticket.first_response_in_min, 0, 'ticket.first_response_in_min verify - outbound')
assert_equal(ticket.first_response_diff_in_min, 60, 'ticket.first_response_diff_in_min verify - outbound')
- assert_equal(ticket.close_time, nil, 'ticket.close_time verify - outbound')
+ assert_equal(ticket.close_at, nil, 'ticket.close_at verify - outbound')
delete = ticket.destroy
assert(delete, 'ticket destroy')
@@ -448,11 +448,11 @@ class TicketSlaTest < ActiveSupport::TestCase
)
ticket = Ticket.find(ticket.id)
assert_equal(ticket.article_count, 1, 'ticket.article_count verify - inbound')
- assert_equal(ticket.last_contact.to_s, article_inbound.created_at.to_s, 'ticket.last_contact verify - inbound')
- assert_equal(ticket.last_contact_customer.to_s, article_inbound.created_at.to_s, 'ticket.last_contact_customer verify - inbound')
- assert_equal(ticket.last_contact_agent, nil, 'ticket.last_contact_agent verify - inbound')
- assert_equal(ticket.first_response, nil, 'ticket.first_response verify - inbound')
- assert_equal(ticket.close_time, nil, 'ticket.close_time verify - inbound')
+ assert_equal(ticket.last_contact_at.to_s, article_inbound.created_at.to_s, 'ticket.last_contact_at verify - inbound')
+ assert_equal(ticket.last_contact_customer_at.to_s, article_inbound.created_at.to_s, 'ticket.last_contact_customer_at verify - inbound')
+ assert_equal(ticket.last_contact_agent_at, nil, 'ticket.last_contact_agent_at verify - inbound')
+ assert_equal(ticket.first_response_at, nil, 'ticket.first_response_at verify - inbound')
+ assert_equal(ticket.close_at, nil, 'ticket.close_at verify - inbound')
# create note article
article_note = Ticket::Article.create!(
@@ -471,11 +471,11 @@ class TicketSlaTest < ActiveSupport::TestCase
)
ticket = Ticket.find(ticket.id)
assert_equal(ticket.article_count, 2, 'ticket.article_count verify - inbound')
- assert_equal(ticket.last_contact.to_s, article_inbound.created_at.to_s, 'ticket.last_contact verify - inbound')
- assert_equal(ticket.last_contact_customer.to_s, article_inbound.created_at.to_s, 'ticket.last_contact_customer verify - inbound')
- assert_equal(ticket.last_contact_agent, nil, 'ticket.last_contact_agent verify - inbound')
- assert_equal(ticket.first_response, nil, 'ticket.first_response verify - inbound')
- assert_equal(ticket.close_time, nil, 'ticket.close_time verify - inbound')
+ assert_equal(ticket.last_contact_at.to_s, article_inbound.created_at.to_s, 'ticket.last_contact_at verify - inbound')
+ assert_equal(ticket.last_contact_customer_at.to_s, article_inbound.created_at.to_s, 'ticket.last_contact_customer_at verify - inbound')
+ assert_equal(ticket.last_contact_agent_at, nil, 'ticket.last_contact_agent_at verify - inbound')
+ assert_equal(ticket.first_response_at, nil, 'ticket.first_response_at verify - inbound')
+ assert_equal(ticket.close_at, nil, 'ticket.close_at verify - inbound')
# create outbound article
article_outbound = Ticket::Article.create!(
@@ -494,11 +494,11 @@ class TicketSlaTest < ActiveSupport::TestCase
)
ticket = Ticket.find(ticket.id)
assert_equal(ticket.article_count, 3, 'ticket.article_count verify - inbound')
- assert_equal(ticket.last_contact.to_s, article_outbound.created_at.to_s, 'ticket.last_contact verify - inbound')
- assert_equal(ticket.last_contact_customer.to_s, article_inbound.created_at.to_s, 'ticket.last_contact_customer verify - inbound')
- assert_equal(ticket.last_contact_agent.to_s, article_outbound.created_at.to_s, 'ticket.last_contact_agent verify - inbound')
- assert_equal(ticket.first_response.to_s, article_outbound.created_at.to_s, 'ticket.first_response verify - inbound')
- assert_equal(ticket.close_time, nil, 'ticket.close_time verify - inbound')
+ assert_equal(ticket.last_contact_at.to_s, article_outbound.created_at.to_s, 'ticket.last_contact_at verify - inbound')
+ assert_equal(ticket.last_contact_customer_at.to_s, article_inbound.created_at.to_s, 'ticket.last_contact_customer_at verify - inbound')
+ assert_equal(ticket.last_contact_agent_at.to_s, article_outbound.created_at.to_s, 'ticket.last_contact_agent_at verify - inbound')
+ assert_equal(ticket.first_response_at.to_s, article_outbound.created_at.to_s, 'ticket.first_response_at verify - inbound')
+ assert_equal(ticket.close_at, nil, 'ticket.close_at verify - inbound')
delete = sla.destroy
assert(delete, 'sla destroy')
@@ -527,7 +527,7 @@ class TicketSlaTest < ActiveSupport::TestCase
created_by_id: 1,
)
assert(ticket, 'ticket created')
- assert_equal(ticket.escalation_time, nil, 'ticket.escalation_time verify')
+ assert_equal(ticket.escalation_at, nil, 'ticket.escalation_at verify')
# set sla's for timezone "Europe/Berlin" wintertime (+1), so UTC times are 7:00-16:00
calendar = Calendar.create_or_update(
@@ -600,10 +600,10 @@ class TicketSlaTest < ActiveSupport::TestCase
)
Scheduler.worker(true)
ticket = Ticket.find(ticket.id)
- assert_equal(ticket.escalation_time.gmtime.to_s, '2013-03-21 11:30:00 UTC', 'ticket.escalation_time verify 1')
- assert_equal(ticket.first_response_escal_date.gmtime.to_s, '2013-03-21 11:30:00 UTC', 'ticket.first_response_escal_date verify 1')
- assert_equal(ticket.update_time_escal_date.gmtime.to_s, '2013-03-21 12:30:00 UTC', 'ticket.update_time_escal_date verify 1')
- assert_equal(ticket.close_time_escal_date.gmtime.to_s, '2013-03-21 13:30:00 UTC', 'ticket.close_time_escal_date verify 1')
+ assert_equal(ticket.escalation_at.gmtime.to_s, '2013-03-21 11:30:00 UTC', 'ticket.escalation_at verify 1')
+ assert_equal(ticket.first_response_escalation_at.gmtime.to_s, '2013-03-21 11:30:00 UTC', 'ticket.first_response_escalation_at verify 1')
+ assert_equal(ticket.update_escalation_at.gmtime.to_s, '2013-03-21 12:30:00 UTC', 'ticket.update_escalation_at verify 1')
+ assert_equal(ticket.close_escalation_at.gmtime.to_s, '2013-03-21 13:30:00 UTC', 'ticket.close_escalation_at verify 1')
delete = sla.destroy
assert(delete, 'sla destroy')
@@ -622,7 +622,7 @@ class TicketSlaTest < ActiveSupport::TestCase
created_by_id: 1,
)
assert(ticket, 'ticket created')
- assert_equal(ticket.escalation_time, nil, 'ticket.escalation_time verify')
+ assert_equal(ticket.escalation_at, nil, 'ticket.escalation_at verify')
# set sla's for timezone "Europe/Berlin" summertime (+2), so UTC times are 6:00-15:00
calendar = Calendar.create_or_update(
@@ -689,10 +689,10 @@ class TicketSlaTest < ActiveSupport::TestCase
)
Scheduler.worker(true)
ticket = Ticket.find(ticket.id)
- assert_equal(ticket.escalation_time.gmtime.to_s, '2013-10-21 11:30:00 UTC', 'ticket.escalation_time verify 1')
- assert_equal(ticket.first_response_escal_date.gmtime.to_s, '2013-10-21 11:30:00 UTC', 'ticket.first_response_escal_date verify 1')
- assert_equal(ticket.update_time_escal_date.gmtime.to_s, '2013-10-21 12:30:00 UTC', 'ticket.update_time_escal_date verify 1')
- assert_equal(ticket.close_time_escal_date.gmtime.to_s, '2013-10-21 13:30:00 UTC', 'ticket.close_time_escal_date verify 1')
+ assert_equal(ticket.escalation_at.gmtime.to_s, '2013-10-21 11:30:00 UTC', 'ticket.escalation_at verify 1')
+ assert_equal(ticket.first_response_escalation_at.gmtime.to_s, '2013-10-21 11:30:00 UTC', 'ticket.first_response_escalation_at verify 1')
+ assert_equal(ticket.update_escalation_at.gmtime.to_s, '2013-10-21 12:30:00 UTC', 'ticket.update_escalation_at verify 1')
+ assert_equal(ticket.close_escalation_at.gmtime.to_s, '2013-10-21 13:30:00 UTC', 'ticket.close_escalation_at verify 1')
delete = ticket.destroy
assert(delete, 'ticket destroy')
@@ -712,7 +712,7 @@ class TicketSlaTest < ActiveSupport::TestCase
created_by_id: 1,
)
assert(ticket, 'ticket created')
- assert_equal(ticket.escalation_time, nil, 'ticket.escalation_time verify')
+ assert_equal(ticket.escalation_at, nil, 'ticket.escalation_at verify')
# set sla's for timezone "Europe/Berlin" summertime (+2), so UTC times are 6:00-15:00
sla = Sla.create_or_update(
@@ -727,10 +727,10 @@ class TicketSlaTest < ActiveSupport::TestCase
)
Scheduler.worker(true)
ticket = Ticket.find(ticket.id)
- assert_equal(ticket.escalation_time.gmtime.to_s, '2013-10-21 08:00:00 UTC', 'ticket.escalation_time verify 1')
- assert_equal(ticket.first_response_escal_date.gmtime.to_s, '2013-10-21 08:00:00 UTC', 'ticket.first_response_escal_date verify 1')
- assert_equal(ticket.update_time_escal_date.gmtime.to_s, '2013-10-21 09:00:00 UTC', 'ticket.update_time_escal_date verify 1')
- assert_equal(ticket.close_time_escal_date.gmtime.to_s, '2013-10-21 10:00:00 UTC', 'ticket.close_time_escal_date verify 1')
+ assert_equal(ticket.escalation_at.gmtime.to_s, '2013-10-21 08:00:00 UTC', 'ticket.escalation_at verify 1')
+ assert_equal(ticket.first_response_escalation_at.gmtime.to_s, '2013-10-21 08:00:00 UTC', 'ticket.first_response_escalation_at verify 1')
+ assert_equal(ticket.update_escalation_at.gmtime.to_s, '2013-10-21 09:00:00 UTC', 'ticket.update_escalation_at verify 1')
+ assert_equal(ticket.close_escalation_at.gmtime.to_s, '2013-10-21 10:00:00 UTC', 'ticket.close_escalation_at verify 1')
ticket = Ticket.create!(
title: 'some title holiday test',
@@ -744,10 +744,10 @@ class TicketSlaTest < ActiveSupport::TestCase
created_by_id: 1,
)
ticket = Ticket.find(ticket.id)
- assert_equal(ticket.escalation_time.gmtime.to_s, '2015-09-23 07:30:00 UTC', 'ticket.escalation_time verify 1')
- assert_equal(ticket.first_response_escal_date.gmtime.to_s, '2015-09-23 07:30:00 UTC', 'ticket.first_response_escal_date verify 1')
- assert_equal(ticket.update_time_escal_date.gmtime.to_s, '2015-09-23 08:30:00 UTC', 'ticket.update_time_escal_date verify 1')
- assert_equal(ticket.close_time_escal_date.gmtime.to_s, '2015-09-23 09:30:00 UTC', 'ticket.close_time_escal_date verify 1')
+ assert_equal(ticket.escalation_at.gmtime.to_s, '2015-09-23 07:30:00 UTC', 'ticket.escalation_at verify 1')
+ assert_equal(ticket.first_response_escalation_at.gmtime.to_s, '2015-09-23 07:30:00 UTC', 'ticket.first_response_escalation_at verify 1')
+ assert_equal(ticket.update_escalation_at.gmtime.to_s, '2015-09-23 08:30:00 UTC', 'ticket.update_escalation_at verify 1')
+ assert_equal(ticket.close_escalation_at.gmtime.to_s, '2015-09-23 09:30:00 UTC', 'ticket.close_escalation_at verify 1')
delete = sla.destroy
assert(delete, 'sla destroy')
@@ -889,8 +889,8 @@ class TicketSlaTest < ActiveSupport::TestCase
)
ticket1.escalation_calculation
ticket1 = Ticket.find(ticket1.id)
- assert_equal(ticket1.escalation_time.gmtime.to_s, '2013-06-04 11:45:00 UTC', 'ticket1.escalation_time verify 1')
- assert_equal(ticket1.first_response_escal_date.gmtime.to_s, '2013-06-04 11:45:00 UTC', 'ticket1.first_response_escal_date verify 1')
+ assert_equal(ticket1.escalation_at.gmtime.to_s, '2013-06-04 11:45:00 UTC', 'ticket1.escalation_at verify 1')
+ assert_equal(ticket1.first_response_escalation_at.gmtime.to_s, '2013-06-04 11:45:00 UTC', 'ticket1.first_response_escalation_at verify 1')
assert_equal(ticket1.first_response_in_min, nil, 'ticket1.first_response_in_min verify 3')
assert_equal(ticket1.first_response_diff_in_min, nil, 'ticket1.first_response_diff_in_min verify 3')
@@ -938,8 +938,8 @@ class TicketSlaTest < ActiveSupport::TestCase
)
ticket2.escalation_calculation(true)
ticket2 = Ticket.find(ticket2.id)
- assert_equal(ticket2.escalation_time.gmtime.to_s, '2013-06-04 16:00:00 UTC', 'ticket2.escalation_time verify 1')
- assert_equal(ticket2.first_response_escal_date.gmtime.to_s, '2013-06-04 16:00:00 UTC', 'ticket2.first_response_escal_date verify 1')
+ assert_equal(ticket2.escalation_at.gmtime.to_s, '2013-06-04 16:00:00 UTC', 'ticket2.escalation_at verify 1')
+ assert_equal(ticket2.first_response_escalation_at.gmtime.to_s, '2013-06-04 16:00:00 UTC', 'ticket2.first_response_escalation_at verify 1')
assert_equal(ticket2.first_response_in_min, nil, 'ticket2.first_response_in_min verify 3')
assert_equal(ticket2.first_response_diff_in_min, nil, 'ticket2.first_response_diff_in_min verify 3')
@@ -998,12 +998,12 @@ class TicketSlaTest < ActiveSupport::TestCase
# set update time
ticket.update_attributes(
- last_contact_agent: '2013-06-04 10:15:00 UTC',
+ last_contact_agent_at: '2013-06-04 10:15:00 UTC',
)
# set first response time
ticket.update_attributes(
- first_response: '2013-06-04 10:45:00 UTC',
+ first_response_at: '2013-06-04 10:45:00 UTC',
)
# set ticket from 11:30 to closed
@@ -1022,7 +1022,7 @@ class TicketSlaTest < ActiveSupport::TestCase
)
ticket.update_attributes(
- close_time: '2013-06-04 12:00:00 UTC',
+ close_at: '2013-06-04 12:00:00 UTC',
)
# set sla's for timezone "Europe/Berlin" summertime (+2), so UTC times are 7:00-16:00
@@ -1076,14 +1076,14 @@ class TicketSlaTest < ActiveSupport::TestCase
)
Scheduler.worker(true)
ticket = Ticket.find(ticket.id)
- assert_equal(ticket.escalation_time.gmtime.to_s, '2013-06-04 13:30:00 UTC', 'ticket.escalation_time verify 1')
- assert_equal(ticket.first_response_escal_date.gmtime.to_s, '2013-06-04 11:30:00 UTC', 'ticket.first_response_escal_date verify 1')
+ assert_equal(ticket.escalation_at.gmtime.to_s, '2013-06-04 13:30:00 UTC', 'ticket.escalation_at verify 1')
+ assert_equal(ticket.first_response_escalation_at.gmtime.to_s, '2013-06-04 11:30:00 UTC', 'ticket.first_response_escalation_at verify 1')
assert_equal(ticket.first_response_in_min, 75, 'ticket.first_response_in_min verify 3')
assert_equal(ticket.first_response_diff_in_min, 45, 'ticket.first_response_diff_in_min verify 3')
- assert_equal(ticket.update_time_escal_date.gmtime.to_s, '2013-06-04 13:30:00 UTC', 'ticket.update_time_escal_date verify 1')
- assert_equal(ticket.close_time_escal_date.gmtime.to_s, '2013-06-04 13:40:00 UTC', 'ticket.close_time_escal_date verify 1')
- assert_equal(ticket.close_time_in_min, 150, 'ticket.close_time_in_min verify 3')
- assert_equal(ticket.close_time_diff_in_min, 100, 'ticket.close_time_diff_in_min# verify 3')
+ assert_equal(ticket.update_escalation_at.gmtime.to_s, '2013-06-04 13:30:00 UTC', 'ticket.update_escalation_at verify 1')
+ assert_equal(ticket.close_escalation_at.gmtime.to_s, '2013-06-04 13:40:00 UTC', 'ticket.close_escalation_at verify 1')
+ assert_equal(ticket.close_in_min, 150, 'ticket.close_in_min verify 3')
+ assert_equal(ticket.close_diff_in_min, 100, 'ticket.close_diff_in_min# verify 3')
delete = sla.destroy
assert(delete, 'sla destroy')
@@ -1119,7 +1119,7 @@ class TicketSlaTest < ActiveSupport::TestCase
updated_at: '2013-06-04 12:00:00 UTC',
)
ticket.update_attributes(
- close_time: '2013-06-04 12:00:00 UTC',
+ close_at: '2013-06-04 12:00:00 UTC',
)
ticket.escalation_calculation(true)
@@ -1173,14 +1173,14 @@ class TicketSlaTest < ActiveSupport::TestCase
)
Scheduler.worker(true)
ticket = Ticket.find(ticket.id)
- assert_equal(ticket.escalation_time, nil, 'ticket.escalation_time verify 1')
- assert_equal(ticket.first_response_escal_date.gmtime.to_s, '2013-06-04 14:00:00 UTC', 'ticket.first_response_escal_date verify 1')
+ assert_equal(ticket.escalation_at, nil, 'ticket.escalation_at verify 1')
+ assert_equal(ticket.first_response_escalation_at.gmtime.to_s, '2013-06-04 14:00:00 UTC', 'ticket.first_response_escalation_at verify 1')
assert_equal(ticket.first_response_in_min, nil, 'ticket.first_response_in_min verify 3')
assert_equal(ticket.first_response_diff_in_min, nil, 'ticket.first_response_diff_in_min verify 3')
- assert_equal(ticket.update_time_escal_date.gmtime.to_s, '2013-06-04 15:00:00 UTC', 'ticket.update_time_escal_date verify 1')
- assert_equal(ticket.close_time_escal_date.gmtime.to_s, '2013-06-04 16:00:00 UTC', 'ticket.close_time_escal_date verify 1')
- assert_equal(ticket.close_time_in_min, 0, 'ticket.close_time_in_min verify 3')
- assert_equal(ticket.close_time_diff_in_min, 240, 'ticket.close_time_diff_in_min# verify 3')
+ assert_equal(ticket.update_escalation_at.gmtime.to_s, '2013-06-04 15:00:00 UTC', 'ticket.update_escalation_at verify 1')
+ assert_equal(ticket.close_escalation_at.gmtime.to_s, '2013-06-04 16:00:00 UTC', 'ticket.close_escalation_at verify 1')
+ assert_equal(ticket.close_in_min, 0, 'ticket.close_in_min verify 3')
+ assert_equal(ticket.close_diff_in_min, 240, 'ticket.close_diff_in_min# verify 3')
delete = sla.destroy
assert(delete, 'sla destroy')
@@ -1247,7 +1247,7 @@ class TicketSlaTest < ActiveSupport::TestCase
updated_at: '2013-06-04 12:00:00 UTC',
)
ticket.update_attributes(
- close_time: '2013-06-04 12:00:00 UTC',
+ close_at: '2013-06-04 12:00:00 UTC',
)
calendar = Calendar.create_or_update(
@@ -1300,14 +1300,14 @@ class TicketSlaTest < ActiveSupport::TestCase
)
Scheduler.worker(true)
ticket = Ticket.find(ticket.id)
- assert_equal(ticket.escalation_time, nil, 'ticket.escalation_time verify 1')
- assert_equal(ticket.first_response_escal_date.gmtime.to_s, '2013-06-04 13:30:00 UTC', 'ticket.first_response_escal_date verify 1')
+ assert_equal(ticket.escalation_at, nil, 'ticket.escalation_at verify 1')
+ assert_equal(ticket.first_response_escalation_at.gmtime.to_s, '2013-06-04 13:30:00 UTC', 'ticket.first_response_escalation_at verify 1')
assert_equal(ticket.first_response_in_min, nil, 'ticket.first_response_in_min verify 3')
assert_equal(ticket.first_response_diff_in_min, nil, 'ticket.first_response_diff_in_min verify 3')
- assert_equal(ticket.update_time_escal_date.gmtime.to_s, '2013-06-04 14:30:00 UTC', 'ticket.update_time_escal_date verify 1')
- assert_equal(ticket.close_time_escal_date.gmtime.to_s, '2013-06-04 15:30:00 UTC', 'ticket.close_time_escal_date verify 1')
- assert_equal(ticket.close_time_in_min, 30, 'ticket.close_time_in_min verify 3')
- assert_equal(ticket.close_time_diff_in_min, 210, 'ticket.close_time_diff_in_min# verify 3')
+ assert_equal(ticket.update_escalation_at.gmtime.to_s, '2013-06-04 14:30:00 UTC', 'ticket.update_escalation_at verify 1')
+ assert_equal(ticket.close_escalation_at.gmtime.to_s, '2013-06-04 15:30:00 UTC', 'ticket.close_escalation_at verify 1')
+ assert_equal(ticket.close_in_min, 30, 'ticket.close_in_min verify 3')
+ assert_equal(ticket.close_diff_in_min, 210, 'ticket.close_diff_in_min# verify 3')
delete = sla.destroy
assert(delete, 'sla destroy')
@@ -1390,7 +1390,7 @@ class TicketSlaTest < ActiveSupport::TestCase
updated_at: '2013-06-04 12:00:00 UTC',
)
ticket.update_attributes(
- close_time: '2013-06-04 12:00:00 UTC',
+ close_at: '2013-06-04 12:00:00 UTC',
)
calendar = Calendar.create_or_update(
@@ -1443,14 +1443,14 @@ class TicketSlaTest < ActiveSupport::TestCase
)
Scheduler.worker(true)
ticket = Ticket.find(ticket.id)
- assert_equal(ticket.escalation_time, nil, 'ticket.escalation_time verify 1')
- assert_equal(ticket.first_response_escal_date.gmtime.to_s, '2013-06-04 13:00:00 UTC', 'ticket.first_response_escal_date verify 1')
+ assert_equal(ticket.escalation_at, nil, 'ticket.escalation_at verify 1')
+ assert_equal(ticket.first_response_escalation_at.gmtime.to_s, '2013-06-04 13:00:00 UTC', 'ticket.first_response_escalation_at verify 1')
assert_equal(ticket.first_response_in_min, nil, 'ticket.first_response_in_min verify 3')
assert_equal(ticket.first_response_diff_in_min, nil, 'ticket.first_response_diff_in_min verify 3')
- assert_equal(ticket.update_time_escal_date.gmtime.to_s, '2013-06-04 14:00:00 UTC', 'ticket.update_time_escal_date verify 1')
- assert_equal(ticket.close_time_escal_date.gmtime.to_s, '2013-06-04 15:00:00 UTC', 'ticket.close_time_escal_date verify 1')
- assert_equal(ticket.close_time_in_min, 60, 'ticket.close_time_in_min verify 3')
- assert_equal(ticket.close_time_diff_in_min, 180, 'ticket.close_time_diff_in_min# verify 3')
+ assert_equal(ticket.update_escalation_at.gmtime.to_s, '2013-06-04 14:00:00 UTC', 'ticket.update_escalation_at verify 1')
+ assert_equal(ticket.close_escalation_at.gmtime.to_s, '2013-06-04 15:00:00 UTC', 'ticket.close_escalation_at verify 1')
+ assert_equal(ticket.close_in_min, 60, 'ticket.close_in_min verify 3')
+ assert_equal(ticket.close_diff_in_min, 180, 'ticket.close_diff_in_min# verify 3')
delete = sla.destroy
assert(delete, 'sla destroy')
diff --git a/test/unit/ticket_test.rb b/test/unit/ticket_test.rb
index 27247b253..f9012db71 100644
--- a/test/unit/ticket_test.rb
+++ b/test/unit/ticket_test.rb
@@ -36,11 +36,11 @@ class TicketTest < ActiveSupport::TestCase
ticket = Ticket.find(ticket.id)
assert_equal(ticket.article_count, 1, 'ticket.article_count verify - inbound')
- assert_equal(ticket.last_contact.to_s, article_inbound1.created_at.to_s, 'ticket.last_contact verify - inbound')
- assert_equal(ticket.last_contact_customer.to_s, article_inbound1.created_at.to_s, 'ticket.last_contact_customer verify - inbound')
- assert_equal(ticket.last_contact_agent, nil, 'ticket.last_contact_agent verify - inbound')
- assert_equal(ticket.first_response, nil, 'ticket.first_response verify - inbound')
- assert_equal(ticket.close_time, nil, 'ticket.close_time verify - inbound')
+ assert_equal(ticket.last_contact_at.to_s, article_inbound1.created_at.to_s, 'ticket.last_contact verify - inbound')
+ assert_equal(ticket.last_contact_customer_at.to_s, article_inbound1.created_at.to_s, 'ticket.last_contact_customer_at verify - inbound')
+ assert_equal(ticket.last_contact_agent_at, nil, 'ticket.last_contact_agent_at verify - inbound')
+ assert_equal(ticket.first_response_at, nil, 'ticket.first_response_at verify - inbound')
+ assert_equal(ticket.close_at, nil, 'ticket.close_at verify - inbound')
# create inbound article #2
sleep 2
@@ -61,11 +61,11 @@ class TicketTest < ActiveSupport::TestCase
ticket = Ticket.find(ticket.id)
assert_equal(ticket.article_count, 2, 'ticket.article_count verify - inbound')
- assert_equal(ticket.last_contact.to_s, article_inbound1.created_at.to_s, 'ticket.last_contact verify - inbound')
- assert_equal(ticket.last_contact_customer.to_s, article_inbound1.created_at.to_s, 'ticket.last_contact_customer verify - inbound')
- assert_equal(ticket.last_contact_agent, nil, 'ticket.last_contact_agent verify - inbound')
- assert_equal(ticket.first_response, nil, 'ticket.first_response verify - inbound')
- assert_equal(ticket.close_time, nil, 'ticket.close_time verify - inbound')
+ assert_equal(ticket.last_contact_at.to_s, article_inbound1.created_at.to_s, 'ticket.last_contact verify - inbound')
+ assert_equal(ticket.last_contact_customer_at.to_s, article_inbound1.created_at.to_s, 'ticket.last_contact_customer_at verify - inbound')
+ assert_equal(ticket.last_contact_agent_at, nil, 'ticket.last_contact_agent_at verify - inbound')
+ assert_equal(ticket.first_response_at, nil, 'ticket.first_response_at verify - inbound')
+ assert_equal(ticket.close_at, nil, 'ticket.close_at verify - inbound')
# create note article
article_note = Ticket::Article.create(
@@ -84,11 +84,11 @@ class TicketTest < ActiveSupport::TestCase
ticket = Ticket.find(ticket.id)
assert_equal(ticket.article_count, 3, 'ticket.article_count verify - note')
- assert_equal(ticket.last_contact.to_s, article_inbound1.created_at.to_s, 'ticket.last_contact verify - note')
- assert_equal(ticket.last_contact_customer.to_s, article_inbound1.created_at.to_s, 'ticket.last_contact_customer verify - note')
- assert_equal(ticket.last_contact_agent, nil, 'ticket.last_contact_agent verify - note')
- assert_equal(ticket.first_response, nil, 'ticket.first_response verify - note')
- assert_equal(ticket.close_time, nil, 'ticket.close_time verify - note')
+ assert_equal(ticket.last_contact_at.to_s, article_inbound1.created_at.to_s, 'ticket.last_contact verify - note')
+ assert_equal(ticket.last_contact_customer_at.to_s, article_inbound1.created_at.to_s, 'ticket.last_contact_customer_at verify - note')
+ assert_equal(ticket.last_contact_agent_at, nil, 'ticket.last_contact_agent_at verify - note')
+ assert_equal(ticket.first_response_at, nil, 'ticket.first_response_at verify - note')
+ assert_equal(ticket.close_at, nil, 'ticket.close_at verify - note')
# create outbound article
sleep 2
@@ -108,11 +108,11 @@ class TicketTest < ActiveSupport::TestCase
ticket = Ticket.find(ticket.id)
assert_equal(ticket.article_count, 4, 'ticket.article_count verify - outbound')
- assert_equal(ticket.last_contact.to_s, article_outbound.created_at.to_s, 'ticket.last_contact verify - outbound')
- assert_equal(ticket.last_contact_customer.to_s, article_inbound1.created_at.to_s, 'ticket.last_contact_customer verify - outbound')
- assert_equal(ticket.last_contact_agent.to_s, article_outbound.created_at.to_s, 'ticket.last_contact_agent verify - outbound')
- assert_equal(ticket.first_response.to_s, article_outbound.created_at.to_s, 'ticket.first_response verify - outbound')
- assert_equal(ticket.close_time, nil, 'ticket.close_time verify - outbound')
+ assert_equal(ticket.last_contact_at.to_s, article_outbound.created_at.to_s, 'ticket.last_contact verify - outbound')
+ assert_equal(ticket.last_contact_customer_at.to_s, article_inbound1.created_at.to_s, 'ticket.last_contact_customer_at verify - outbound')
+ assert_equal(ticket.last_contact_agent_at.to_s, article_outbound.created_at.to_s, 'ticket.last_contact_agent_at verify - outbound')
+ assert_equal(ticket.first_response_at.to_s, article_outbound.created_at.to_s, 'ticket.first_response_at verify - outbound')
+ assert_equal(ticket.close_at, nil, 'ticket.close_at verify - outbound')
# create inbound article #3
article_inbound3 = Ticket::Article.create(
@@ -132,11 +132,11 @@ class TicketTest < ActiveSupport::TestCase
ticket = Ticket.find(ticket.id)
assert_equal(ticket.article_count, 5, 'ticket.article_count verify - inbound')
- assert_equal(ticket.last_contact.to_s, article_inbound3.created_at.to_s, 'ticket.last_contact verify - inbound')
- assert_equal(ticket.last_contact_customer.to_s, article_inbound3.created_at.to_s, 'ticket.last_contact_customer verify - inbound')
- assert_equal(ticket.last_contact_agent.to_s, article_outbound.created_at.to_s, 'ticket.last_contact_agent verify - outbound')
- assert_equal(ticket.first_response.to_s, article_outbound.created_at.to_s, 'ticket.first_response verify - outbound')
- assert_equal(ticket.close_time, nil, 'ticket.close_time verify - outbound')
+ assert_equal(ticket.last_contact_at.to_s, article_inbound3.created_at.to_s, 'ticket.last_contact verify - inbound')
+ assert_equal(ticket.last_contact_customer_at.to_s, article_inbound3.created_at.to_s, 'ticket.last_contact_customer_at verify - inbound')
+ assert_equal(ticket.last_contact_agent_at.to_s, article_outbound.created_at.to_s, 'ticket.last_contact_agent_at verify - outbound')
+ assert_equal(ticket.first_response_at.to_s, article_outbound.created_at.to_s, 'ticket.first_response_at verify - outbound')
+ assert_equal(ticket.close_at, nil, 'ticket.close_at verify - outbound')
# create inbound article #4
sleep 2
@@ -157,22 +157,22 @@ class TicketTest < ActiveSupport::TestCase
ticket = Ticket.find(ticket.id)
assert_equal(ticket.article_count, 6, 'ticket.article_count verify - inbound')
- assert_equal(ticket.last_contact.to_s, article_inbound3.created_at.to_s, 'ticket.last_contact verify - inbound')
- assert_equal(ticket.last_contact_customer.to_s, article_inbound3.created_at.to_s, 'ticket.last_contact_customer verify - inbound')
- assert_equal(ticket.last_contact_agent.to_s, article_outbound.created_at.to_s, 'ticket.last_contact_agent verify - outbound')
- assert_equal(ticket.first_response.to_s, article_outbound.created_at.to_s, 'ticket.first_response verify - outbound')
- assert_equal(ticket.close_time, nil, 'ticket.close_time verify - outbound')
+ assert_equal(ticket.last_contact_at.to_s, article_inbound3.created_at.to_s, 'ticket.last_contact verify - inbound')
+ assert_equal(ticket.last_contact_customer_at.to_s, article_inbound3.created_at.to_s, 'ticket.last_contact_customer_at verify - inbound')
+ assert_equal(ticket.last_contact_agent_at.to_s, article_outbound.created_at.to_s, 'ticket.last_contact_agent_at verify - outbound')
+ assert_equal(ticket.first_response_at.to_s, article_outbound.created_at.to_s, 'ticket.first_response_at verify - outbound')
+ assert_equal(ticket.close_at, nil, 'ticket.close_at verify - outbound')
ticket.state_id = Ticket::State.where(name: 'closed').first.id
ticket.save
ticket = Ticket.find(ticket.id)
assert_equal(ticket.article_count, 6, 'ticket.article_count verify - state update')
- assert_equal(ticket.last_contact.to_s, article_inbound3.created_at.to_s, 'ticket.last_contact verify - state update')
- assert_equal(ticket.last_contact_customer.to_s, article_inbound3.created_at.to_s, 'ticket.last_contact_customer verify - state update')
- assert_equal(ticket.last_contact_agent.to_s, article_outbound.created_at.to_s, 'ticket.last_contact_agent verify - state update')
- assert_equal(ticket.first_response.to_s, article_outbound.created_at.to_s, 'ticket.first_response verify - state update')
- assert(ticket.close_time, 'ticket.close_time verify - state update')
+ assert_equal(ticket.last_contact_at.to_s, article_inbound3.created_at.to_s, 'ticket.last_contact verify - state update')
+ assert_equal(ticket.last_contact_customer_at.to_s, article_inbound3.created_at.to_s, 'ticket.last_contact_customer_at verify - state update')
+ assert_equal(ticket.last_contact_agent_at.to_s, article_outbound.created_at.to_s, 'ticket.last_contact_agent_at verify - state update')
+ assert_equal(ticket.first_response_at.to_s, article_outbound.created_at.to_s, 'ticket.first_response_at verify - state update')
+ assert(ticket.close_at, 'ticket.close_at verify - state update')
# set pending time
ticket.state_id = Ticket::State.find_by(name: 'pending reminder').id