| | A simple example of FLEXIBLE, EXPLAINABLE BILLING using the Internet Business Logic system | ------------------------------------------------------------------------------------------ | on this-date customer this-cust-number made call this-call-number starting this-start-time and ending this-end-time =================================================================================================================== 20020902 001 1 8:47 8:57 20020903 001 2 10:50 10:55 20020917 001 3 17:10 17:55 20020920 001 4 20:11 21:15 customer this-cust-number is on the this-type plan effective this-date ====================================================================== 001 AAA 20020901 001 BBB 20020915 on the this-type plan the this-day/night rate is this-charge per minute ======================================================================= AAA day 0.98 AAA night 0.55 BBB day 2.99 BBB night 1.99 customer some-cust-number is on the some-type plan effective some-plan-start-date that-plan-start-date is less than or equal some-current-date not : customer that-cust-number has switched plans between that-plan-start-date and that-current-date ----------------------------------------------------------------------------------------------------- on that-current-date the plan in effect for customer that-cust-number is that-type customer some-cust-number is on the some-type1 plan effective some-plan-start-date1 customer that-cust-number is on the some-type2 plan effective some-plan-start-date2 that-plan-start-date1 is less than that-plan-start-date2 that-plan-start-date2 is less than or equal some-current-date ------------------------------------------------------------------------------------------------ customer that-cust-number has switched plans between that-plan-start-date1 and that-current-date on some-date customer some-cust-number made call some-call-number starting some-start-time and ending some-end-time a call starting that-start-time and ending that-end-time lasts for some-length minutes --------------------------------------------------------------------------------------------------------------------- on that-date customer that-cust-number made call that-call-number starting that-start-time lasting that-length minutes on some-date customer some-cust-number made call some-call-number starting some-start-time lasting some-length minutes on that-date the plan in effect for customer that-cust-number is some-type that-start-time is during the some-day/night for billing purposes on the that-type plan the that-day/night rate is some-charge per minute that-length * that-charge = an-amount ----------------------------------------------------------------------------------------------------- on that-date customer that-cust-number made call that-call-number costing $ that-amount some-hour followed by some-minute separated by a symbol : = some-time that-hour is between 7 and 17 --------------------------------------------------------------------- that-time is during the day for billing purposes some-hour followed by some-minute separated by a symbol : = some-time not : that-hour is between 8 and 17 --------------------------------------------------------------------- that-time is during the night for billing purposes some-hour is greater than or equal some-lower-limit that-hour is less than or equal some-upper-limit ---------------------------------------------------------- that-hour is between that-lower-limit and that-upper-limit customer some-cust-number is registered for a plan max some-date : customer that-cust-number is on the some-any-type plan effective some-date = some-latest-date customer that-cust-number is on the some-type plan effective that-latest-date ------------------------------------------------------------------------------------------------------------- customer that-cust-number is currently on the that-type plan customer some-cust-number is on the some-type plan effective some-effect-date ----------------------------------------------------------------------------- customer that-cust-number is registered for a plan customer some-cust-number is currently on the some-type plan sum some-length : on some-date customer some-cust-number made call some-call-number lasting some-length minutes = a-total ------------------------------------------------------------------------------------------------------------------------- customer that-cust-number made calls totalling that-total minutes on some-date customer some-cust-number made call some-call-number starting some-start-time lasting some-length minutes ---------------------------------------------------------------------------------------------------------------------- on that-date customer that-cust-number made call that-call-number lasting that-length minutes some-start-hour followed by some-start-minute separated by a symbol : = some-start-time some-end-hour followed by some-end-minute separated by a symbol : = some-end-time that-end-hour - that-start-hour = some-hour-diff that-hour-diff * 60 = some-minutes1 that-end-minute - that-start-minute = some-minutes2 those-minutes1 + those-minutes2 = some-length -------------------------------------------------------------------------------------- a call starting that-start-time and ending that-end-time lasts for that-length minutes