-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
All raw times should have an absolute time #265
Comments
This isn't broken per se, but something in the chain is taking a perfectly good irb(main):012:0> versions.each { |version| pp version.attributes }; nil
# Step 1
{"id"=>290813,
"item_type"=>"RawTime",
"item_id"=>46667,
"event"=>"create",
"whodunnit"=>"701",
"object"=>nil,
"created_at"=>Sat, 15 Aug 2020 20:09:52 UTC +00:00,
"object_changes"=>
{"id"=>[nil, 46667],
"event_group_id"=>[nil, 295],
"split_name"=>[nil, "Towers 3"],
"bitkey"=>[nil, 1],
"bib_number"=>[nil, "611"],
"entered_time"=>[nil, "2020-08-15 14:09:17-6:00"],
"source"=>[nil, "ost-remote-1831D2F1-7A01-4A09-9A13-8CB78421F15D"],
"created_by"=>[nil, 701],
"updated_by"=>[nil, 701],
"created_at"=>[nil, "2020-08-15T20:09:52.876Z"],
"updated_at"=>[nil, "2020-08-15T20:09:52.876Z"],
"parameterized_split_name"=>[nil, "towers-3"],
"sortable_bib_number"=>[nil, 611],
"matchable_bib_number"=>[nil, 611]}}
# Step 2
{"id"=>290814,
"item_type"=>"RawTime",
"item_id"=>46667,
"event"=>"update",
"whodunnit"=>nil,
"object"=>
{"event_group_id"=>295,
"entered_lap"=>nil,
"lap"=>1,
"absolute_time"=>nil,
"entered_time"=>"2020-08-15 14:09:17-6:00",
"id"=>46667,
"created_by"=>701,
"split_name"=>"Towers 3",
"parameterized_split_name"=>"towers-3",
"bib_number"=>"611",
"sortable_bib_number"=>611,
"matchable_bib_number"=>611,
"data_status"=>nil,
"bitkey"=>1,
"source"=>"ost-remote-1831D2F1-7A01-4A09-9A13-8CB78421F15D",
"split_time_id"=>nil,
"with_pacer"=>false,
"stopped_here"=>false,
"pulled_by"=>nil,
"pulled_at"=>nil,
"updated_by"=>701,
"created_at"=>"2020-08-15T20:09:52.876Z",
"updated_at"=>"2020-08-15T20:09:52.876Z",
"remarks"=>nil,
"disassociated_from_effort"=>nil,
"effort_id"=>46925,
"effort_last_name"=>"Hanback",
"event_id"=>301,
"split_id"=>352,
"split_time_exists"=>nil},
"created_at"=>Sat, 15 Aug 2020 20:09:52 UTC +00:00,
"object_changes"=>
{"lap"=>[nil, 1],
"absolute_time"=>[nil, "2020-08-15T20:09:17.000Z"],
"updated_at"=>["2020-08-15T20:09:52.876Z", "2020-08-15T20:09:52.923Z"]}}
# Step 3
{"id"=>290815,
"item_type"=>"RawTime",
"item_id"=>46667,
"event"=>"update",
"whodunnit"=>nil,
"object"=>
{"split_time_id"=>nil,
"id"=>46667,
"event_group_id"=>295,
"split_name"=>"Towers 3",
"bitkey"=>1,
"bib_number"=>"611",
"absolute_time"=>"2020-08-15T20:09:17.000Z",
"entered_time"=>"2020-08-15 14:09:17-6:00",
"with_pacer"=>false,
"stopped_here"=>false,
"source"=>"ost-remote-1831D2F1-7A01-4A09-9A13-8CB78421F15D",
"pulled_by"=>nil,
"pulled_at"=>nil,
"created_by"=>701,
"updated_by"=>701,
"created_at"=>"2020-08-15T20:09:52.876Z",
"updated_at"=>"2020-08-15T20:09:52.923Z",
"parameterized_split_name"=>"towers-3",
"remarks"=>nil,
"sortable_bib_number"=>611,
"data_status"=>nil,
"matchable_bib_number"=>611,
"disassociated_from_effort"=>nil,
"entered_lap"=>nil,
"lap"=>1,
"split_time_exists"=>false,
"effort_id"=>46925,
"effort_last_name"=>"Hanback",
"event_id"=>301,
"split_id"=>352},
"created_at"=>Sat, 15 Aug 2020 20:09:52 UTC +00:00,
"object_changes"=>
{"entered_time"=>["2020-08-15 14:09:17-6:00", "14:09:17"],
"updated_at"=>["2020-08-15T20:09:52.923Z", "2020-08-15T20:09:52.995Z"],
"data_status"=>[nil, "good"],
"lap"=>[nil, 1],
"split_time_exists"=>[nil, false]}}
# Step 4
{"id"=>290817,
"item_type"=>"RawTime",
"item_id"=>46667,
"event"=>"update",
"whodunnit"=>nil,
"object"=>
{"split_time_id"=>nil,
"id"=>46667,
"event_group_id"=>295,
"split_name"=>"Towers 3",
"bitkey"=>1,
"bib_number"=>"611",
"absolute_time"=>"2020-08-15T20:09:17.000Z",
"entered_time"=>"14:09:17",
"with_pacer"=>false,
"stopped_here"=>false,
"source"=>"ost-remote-1831D2F1-7A01-4A09-9A13-8CB78421F15D",
"pulled_by"=>nil,
"pulled_at"=>nil,
"created_by"=>701,
"updated_by"=>701,
"created_at"=>"2020-08-15T20:09:52.876Z",
"updated_at"=>"2020-08-15T20:09:52.995Z",
"parameterized_split_name"=>"towers-3",
"remarks"=>nil,
"sortable_bib_number"=>611,
"data_status"=>"good",
"matchable_bib_number"=>611,
"disassociated_from_effort"=>nil,
"entered_lap"=>nil,
"lap"=>1,
"split_time_exists"=>false,
"effort_id"=>46925,
"effort_last_name"=>"Hanback",
"event_id"=>301,
"split_id"=>352},
"created_at"=>Sat, 15 Aug 2020 20:09:53 UTC +00:00,
"object_changes"=>
{"split_time_id"=>[nil, 338875],
"updated_at"=>["2020-08-15T20:09:52.995Z", "2020-08-15T20:09:53.030Z"]}} Tracking this separately in #401 |
This is done. |
Lack of an absolute time on some raw times is causing a number of minor problems throughout the app. Currently, raw times coming in from OST Remote are coming in as
absolute_time
with full date and time (with zone) information. Raw times coming from the Live Entry screen have just anentered_time
which is military time without date information.Every raw time should have an absolute time. But we should preserve what is coming in from various clients, so we need to make a few changes.
entered_time
(string) instead ofabsolute_time
(datetime)entered_time
should become a required field.entered_time
toabsolute_time
, usinglap
to help if necessary. In a multi-lap event, if we have only a military time and nolap
, we should still try to compute an absolute time.entered_lap
field, which will contain the data submitted by a client. Thenlap
will be a purely computed field.Other required fields stay as is:
event_group_id
,split_name
,bitkey
,bib_number
, andsource
.This will be a major rewrite in some respects. We need to sketch out existing logic and proposed new logic for all this.
The text was updated successfully, but these errors were encountered: