C_subacc.idl



#ifndef __PROSPECT_SUBSCRIPTION_IDLFILE_C_subacc_idl__
#define __PROSPECT_SUBSCRIPTION_IDLFILE_C_subacc_idl__




// ////////////////////////////////////////////////////////////////////
//
// Common Subscription and Accounting Definitions
// Description: Types common all trial 1 IDL definitions related to
//              BOTH subscription and accounting management.
// Created: 29/7/96
// By: D.Lewis, A.Richter
//
// ////////////////////////////////////////////////////////////////////
// Modifications:
//      Date: 29/7/96
//      By: D.Lewis
//      Reason: initial version based on TINA/TANGRAM accounting and
//              subscription models.
//
//      Date: 1/11/96
//      By: Cliff.Redmond@cs.tcd.ie
//      Reason: Changes detailed in e-mail of 30/10/96
//              - enum t_TariffType changed to two consts because
//                C++ compiler doesn't accept enum as union
//                discriminant.
// 
//      Date: 19/12/96
//      By: Cliff.Redmond@cs.tcd.ie
//      Reason: t_SubscriberDetails and t_Subscriber 
//		moved from C_sub.idl because the BillControlCO
//		needs to know about them too.
//
//	Date: 29/1/97
//	By: D. Lewis
//	Reason: change type of tariff field in t_Subscriber from
//	to t_TariffId. Added t_TariffId and t_TariffIdList typedefs
//
// ////////////////////////////////////////////////////////////////////




#include "C_typ.idl"




// ////////////////////////////////////////////////////////////////////
// A t_BasicTariff specifies how a t_UsageInfo will be converted
// into a charge. For example, when using a telephone the duration
// of the call and the time of the day will be used to calculate
// the price for the telephone call.
 
struct t_BasicTariff {

    	unsigned long		chargePerSession;
				// basic charge for a session based 
				// on duration

    	unsigned long 		chargePerRegistration;
    				// additional charge for setting 
				// up a session

    	unsigned long 		chargePerRequest;
    				// additional charge for requests

    	unsigned long 		chargePerAccept;
    				// additional charge for accepting 
				// an invitation

    				// every service provider will have 
				// its own tariff scheme depending 
				// on the information available in 
				// t_UsageData for a MMC session an 
				// amount of 1 ECU might be charged 
				// per minute plus 10 ECU for every 
				// session initiated.

};




// /////////////////////////////////////////////////////////////////////
// A t_UserPlan contains charges that are not related to the
// collectable usage information of the service. For example,
// information about a general discount, a monthly standing charge
// (e.g. a basic charge that enables other people to call you and
// that enables you to use the phone any time you like).
 
struct t_UserPlan {

    	unsigned long 		standingCharge;
    				// a charge that will be applied every month

    	unsigned long 		discount;
    				// a discount for nice customers

    				// every service provider will have 
				// its own userplan scheme depending 
				// on the information available in t_UsageData
};




// /////////////////////////////////////////////////////////////////////
// t_TariffType specifies if we deal either with a user plan or a
// basic tariff
 
typedef long			t_TariffType;
const t_TariffType		t_baseTariff=0;
const t_TariffType		t_usrPlan=1;



 
// /////////////////////////////////////////////////////////////////////
// A t_TariffBlock contains either a user plan or a basic tariff
 
union t_TariffBlock

	switch (t_TariffType) {
  		case t_baseTariff:
			t_BasicTariff bTariff;
  		case t_usrPlan:
			t_UserPlan uPlan;
};


 
// /////////////////////////////////////////////////////////////////////
// A t_Tariff is an aggregation of either a basic tariff or a user
// plan.


typedef string	t_TariffId;

struct t_Tariff {

    string        tariffID;
    t_TariffBlock tariff;
};

 
typedef sequence  t_Tariff  t_TariffList;





///////////////////////////////////////////////////////////////////////
//      Description:    Some common definitions for the use
//                      in the Subscription Management context.
 
typedef any             t_Credit;
   
struct t_SubscriberDetails {

	string          name;
	string          address;
	short           no_of_groups;
};




///////////////////////////////////////////////////////////////////////
// This structure contains information about subscriber

struct t_Subscriber {

           string                  account_no;
           t_SubscriberDetails     subscriber_details;
           t_TariffId              tariff;
           t_Credit                credit;
};




// End of Common Subscription and Accounting Definitions
// /////////////////////////////////////////////////////////////////////




#endif