### MomentInterval Archetype

Represents something that needs to be worked with and tracked for business or legal reasons that occurs at a moment in time, or over an interval of time. Either a moment or an interval of importance in the problem domain. A sale is made at a moment in time, the date and time of that sale. A rental happens over an interval of time, from checkout to check-in. A reservation occurs over an interval of time, from the time that it is made until the time it is used, canceled, or expires. A sale could even be an interval of time, if you track the duration of the sale for performance assessments. What's important is that it is one of these two, not which one of the two it is.

#### Typical Attributes

- number - unique identifying number used by external entities to reference a specific instance of the class
- dateOrDateTimeOrInterval - time of moment or duration of interval
- priority - e.g. high, normal, low
- total - cached result from a calcTotal method (for performance to prevent necessary iteration across MI's)
- status - e.g. for a LoanApplication one of New, Submitted, Approved, Rejected, etc

#### Typical Methods

- makeMomentInterval - supports the business process for making one, that is
- addDetail - adds details (parts)
- calcTotal - interacts with its parts to calculate its total
- recalcTotal - recalculates its total (forcing a recalculation, regardless of any internally buffered value)
- complete - complete the MomentInterval
- cancel - cancel the MomentInterval
- mi_generateNext - generate next (subsequent) MomentInterval
- mi_assessWRTPrior - assess with respect to prior moment-intervals
- mi_assessWRTSubsequent - assess with respect to subsequent moment-intervals
- mi_comparePlanVsActual - compare MI's representing the planned with MI's representing the actual
- listMomentIntervals - class/static method: list all of the moment-interval objects
- calcAvgMomentInterval - class/static method: calculate the average moment-interval (usually average amount, although it could be something like average weight or average fulfillment time).