Which is why you don't do things day by day but keep everything!
Naftoli Gugenheim
@nafg
Keep what?
Ichoran
@Ichoran
Everything should be a full DateTime
Use DateTime
Never use just Time
Naftoli Gugenheim
@nafg
You still aren't getting it
This is the schedule being generated from the scheduling rules
This has nothing to do with reservations
It's a function day => Seq[(LocalTime, SchedulingCapacities)]
Rob Williams
@robwilliams2018_twitter
is that signature supposed to tell us something?
Naftoli Gugenheim
@nafg
Schedule means, what is are the slot times, and what are their (initial) capacities
@robwilliams2018_twitter it's supposed to tell @Ichoran that "don't do things day by day" and "keep everything" make no sense
Rob Williams
@robwilliams2018_twitter
well, he's saying
by the TIME definition of a day :)
Naftoli Gugenheim
@nafg
What?
Rob Williams
@robwilliams2018_twitter
if you have the ability to go past midnight
Ichoran
@Ichoran
All you managed to tell me is that you have a broken API that says you're going to do things day by day, but then you ask it for things on the next day and surprise! it breaks.
Rob Williams
@robwilliams2018_twitter
in your definition of a day
that tells you you should work from your own abstraction
Naftoli Gugenheim
@nafg
@Ichoran it's not broken, it's exactly the business requirement
Ichoran
@Ichoran
So, don't use that API. It is conceptually flawed.
Rob Williams
@robwilliams2018_twitter
and make translations back into time when needed
Naftoli Gugenheim
@nafg
No it's not. Your assumptions about what reservation system means are.
Fabio Labella
@SystemFw
I think @Ichoran is just saying to have your model in term of slots, and layer time on top, rather than have it in terms of time, and fit slots in there
_
Naftoli Gugenheim
@nafg
@SystemFw that doesn't solve anything. And arguably it already is that way.
Ichoran
@Ichoran
Then your stop time is an index, which might be more than 24, and you are done.
Er, well, more than 96
Naftoli Gugenheim
@nafg
How can stop time be an index?
It's a business requirement that it can be a wall time
Ichoran
@Ichoran
Because you chop the day into 96 blocks (24*15 minutes)
And you convert back to time when anyone needs it.
Naftoli Gugenheim
@nafg
How is that better than using a Duration?
Ichoran
@Ichoran
Your business requirement is that you have a stop time, not a duration.
Naftoli Gugenheim
@nafg
Right, but I can convert it to a Duration relative to the date's start
Ichoran
@Ichoran
If you had a duration, you already wouldn't have the question you had.
Naftoli Gugenheim
@nafg
I can easily get a Duration from a LocalDate and a LocalTime
Rob Williams
@robwilliams2018_twitter
@nafg you realize that all the time api libraries are just fronts for LONGs right? that are then just offsets?
Naftoli Gugenheim
@nafg
The question that I was trying to ask, and kept getting interrupted with irrelevant questions, was what the most idiomatic type would be
Rob Williams
@robwilliams2018_twitter
haha
Ichoran
@Ichoran
case class Slot(time: Int) is my vote.
Naftoli Gugenheim
@nafg
It's really silly in the face of this whole debate about all the business decisions that I spent the last two months debating already
@Ichoran I have no idea what that means.
Rob Williams
@robwilliams2018_twitter
if you are getting the bends from the date rolling over, an 'idiomatic type' is not what you are in need of
Ichoran
@Ichoran
@nafg - Then you need to read and think about what I said previously, because I went over this more than once.
Naftoli Gugenheim
@nafg
@Ichoran I know what you mean but it doesn't add anything
Ichoran
@Ichoran
Good luck! I have to take care of other things.
Then maybe your problem doesn't have anything to do with types.