//Source file: am.idl
//Date:  14 February 2002
//Account Management for ETSI ES 201 915-11 v.1.2.1, Parlay 3.1


#ifndef __AM_DEFINED
#define __AM_DEFINED



#include "osa.idl"

module org {
	
	module csapi {
		
		module am {
			
			
			
			enum TpChargingEventName {

				
				P_AM_CHARGING,
				
				P_AM_RECHARGING,
				
				P_AM_ACCOUNT_LOW,
				
				P_AM_ACCOUNT_ZERO,
				
				P_AM_ACCOUNT_DISABLED				
			};
			
			
			
			enum TpBalanceQueryError {

				
				P_BALANCE_QUERY_OK,
				
				P_BALANCE_QUERY_ERROR_UNDEFINED,
				
				P_BALANCE_QUERY_UNKNOWN_SUBSCRIBER,
				
				P_BALANCE_QUERY_UNAUTHORIZED_APPLICATION,
				
				P_BALANCE_QUERY_SYSTEM_FAILURE				
			};
			
			
			
			struct TpBalanceInfo {
				TpString Currency;
				TpInt32 ValuePartA;
				TpInt32 ValuePartB;
				TpInt32 Exponent;
				TpString AdditionalInfo;
			};
			
			
			
			struct TpChargingEventInfo {
				TpChargingEventName ChargingEventName;
				TpBalanceInfo CurrentBalanceInfo;
				TpTime ChargingEventTime;
			};
			
			
			
			struct TpBalance {
				TpAddress UserID;
				TpBalanceQueryError StatusCode;
				TpBalanceInfo BalanceInfo;
			};
			
			
			
			typedef sequence <TpBalance> TpBalanceSet;
			
			
			
			struct TpTransactionHistory {
				TpAssignmentID TransactionID;
				TpDateAndTime TimeStamp;
				TpString AdditionalInfo;
			};
			
			
			
			typedef sequence <TpTransactionHistory> TpTransactionHistorySet;
			
			
			
			enum TpTransactionHistoryStatus {

				P_AM_TRANSACTION_ERROR_UNSPECIFIED,
				P_AM_TRANSACTION_INVALID_INTERVAL,
				P_AM_TRANSACTION_UNKNOWN_ACCOUNT,
				P_AM_TRANSACTION_UNAUTHORIZED_APPLICATION,
				P_AM_TRANSACTION_PROCESSING_ERROR,
				P_AM_TRANSACTION_SYSTEM_FAILURE				
			};
			
			
			
			typedef sequence <TpChargingEventName> TpChargingEventNameSet;
			
			
			
			struct TpChargingEventCriteria {
				TpChargingEventNameSet ChargingEvents;
				TpAddressSet Users;
			};
			
			
			
			struct TpChargingEventCriteriaResult {
				TpChargingEventCriteria ChargingEventCriteria;
				TpAssignmentID AssignmentID;
			};
			
			exception P_UNAUTHORIZED_APPLICATION {
				TpString ExtraInformation;
			};
			
			typedef sequence <TpChargingEventCriteriaResult> TpChargingEventCriteriaResultSet;
			


			interface IpAppAccountManager : IpInterface {
				
				void reportNotification (
					in TpChargingEventInfo chargingEventInfo,	
					in TpAssignmentID assignmentId	
					);
					
				
				void queryBalanceRes (
					in TpAssignmentID queryId,	
					in TpBalanceSet balances	
					);
					
				
				void queryBalanceErr (
					in TpAssignmentID queryId,	
					in TpBalanceQueryError cause	
					);
					
				
				void retrieveTransactionHistoryRes (
					in TpAssignmentID retrievalID,	
					in TpTransactionHistorySet transactionHistory	
					);
					
				
				void retrieveTransactionHistoryErr (
					in TpAssignmentID retrievalID,	
					in TpTransactionHistoryStatus transactionHistoryError	
					);
					
			};
			
			
			
			interface IpAccountManager : IpService {
				
				TpAssignmentID createNotification (
					in TpChargingEventCriteria chargingEventCriteria	
					)					
					raises (TpCommonExceptions, P_INVALID_ADDRESS, P_INVALID_CRITERIA, P_INVALID_EVENT_TYPE, P_UNKNOWN_SUBSCRIBER);
					
				
				void destroyNotification (
					in TpAssignmentID assignmentId	
					)					
					raises (TpCommonExceptions, P_INVALID_ASSIGNMENT_ID);
					
				
				TpAssignmentID queryBalanceReq (
					in TpAddressSet users	
					)					
					raises (TpCommonExceptions, P_UNKNOWN_SUBSCRIBER, P_UNAUTHORIZED_APPLICATION);
					
				
				void changeNotification (
					in TpAssignmentID assignmentID,	
					in TpChargingEventCriteria eventCriteria	
					)					
					raises (TpCommonExceptions, P_INVALID_ASSIGNMENT_ID, P_INVALID_CRITERIA, P_INVALID_EVENT_TYPE, P_UNKNOWN_SUBSCRIBER, P_INVALID_ADDRESS);
					
				
				TpChargingEventCriteriaResultSet getNotification ()					
					raises (TpCommonExceptions);
					
				
				TpAssignmentID retrieveTransactionHistoryReq (
					in TpAddress user,	
					in TpTimeInterval transactionInterval	
					)					
					raises (TpCommonExceptions, P_UNKNOWN_SUBSCRIBER, P_UNAUTHORIZED_APPLICATION, P_INVALID_TIME_AND_DATE_FORMAT);
					
			};
			
			
			
		};
		
	};
	
};

#endif
