smithfarm / dochazka-cli

Dochazka CLI client
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

INTERVAL FETCH does not return partial intervals #17

Closed smithfarm closed 8 years ago

smithfarm commented 8 years ago

Add an interval that straddles two days:

Dochazka(2016-01-03) active ACTIVE> interval 2016-01-02 23:00 - 2016-01-03 01:00 WORK Doze off
Interval IID 3
["2016-01-02 23:00:00+01","2016-01-03 01:00:00+01") WORK Doze off

It's not visible in either day:

Dochazka(2016-01-03) active ACTIVE> interval
Attendance intervals of active (EID 20)
in the range [ 2016-01-03 00:00, 2016-01-03 24:00 )

IID Begin            End              Code Description        
2   2016-01-03 08:00 2016-01-03 09:00 WORK Look out the window

Dochazka(2016-01-03) active ACTIVE> interval fetch 2016-01-02
No attendance intervals found in tsrange [ 2016-01-02 00:00, 2016-01-02 24:00 )

To see it, we have to specify a range that is larger than the interval (in both directions):

Dochazka(2016-01-03) active ACTIVE> interval fetch 2016-01-02 2016-01-03
Attendance intervals of active (EID 20)
in the range [ 2016-01-02 00:00, 2016-01-03 24:00 )

IID Begin            End              Code Description        
3   2016-01-02 23:00 2016-01-03 01:00 WORK Doze off           
2   2016-01-03 08:00 2016-01-03 09:00 WORK Look out the window

Instead of this behavior, the command should show the partial interval with an asterisk next to it to indicate that it's partial.

smithfarm commented 8 years ago

Since the INTERVAL FETCH command is a wrapper around the GET interval/eid/:eid/:tsrange REST operation, this bug cannot be fixed until that REST operation somehow starts returning partial intervals.

smithfarm commented 8 years ago

As of App::Dochazka::REST version 0.512 the partial intervals are there, but not marked yet.