Reporting business logic

time to read 2 min | 299 words

Here is an interesting problem. I didn't give it any though whatsoever yet, I am just presenting the problem.

A bit about the model:

 This is a temporal model, meaning that objects change over time. Validity is a date range object, which define in what range the object is valid. AppointmentSpec is very similar to an outlook recurring meeting. The actual infromation about the meeting is in the AppointmentSpecSnapshot. The scheduling of the appointment is in the ScheduleSpecSnapshot. As you can imagine, both of those can change independently. Appointment is a meeting that took place, and it is always assoicated with an AppointmentSpec.

 (Image from clipboard).png

My task is to generate a report about all the meetings that differ from their AppointmentSpec. Finding out what is the expected start/end hours for an appointment involves quite a bit of business logic. It is basically spanning the spec on a calendar, taking into account all sorts of interesting cases (holidays, vacations, etc).

Usually reports are done from data in the database, often assembled together in creative ways, but there is no way to do that, because the information simply do not exists there.

Just to give an idea about the complexity, on January 10 - 25, the appointment took place on Wendsday every other week 10:00 - 11:00 AM, from Febuary 26 - March 18, the appointment took place every week, Monday 09:00 - 09:30 AM. Note that there is nothing from the Jan 25 to Deb 26.

An appointment should be reported if it has different start/end hours, if it occurs when the AppointmentSpec says it should occur, etc.

Any thoughts?