This class has information about the configuration of each version of the tariff system. The configuration includes the service class system that it can support, the tariff classification system of each service class, tariff period system of each tariff class and the tariff of each tariff class, tariff period tuple.
Definition at line 272 of file tariffsystem.h.
typedef Id2<TsVersion> OSB_LIB::TsVersion::Oid |
Type-safe object id. Consist of unique id and version of tariff system.
Definition at line 301 of file tariffsystem.h.
typedef Id<ScSystem> OSB_LIB::TsVersion::ScsOid |
Type-safe id of service class system. Consist of unique id and version number of service class system.
Definition at line 306 of file tariffsystem.h.
Type of rating this tariff system supports.
flatRating | Flat Rating: Support rating performed on one Cdr at a time. |
sumRating | Summary Rating: Support rating performed on one Cdr at a time and rating performed on one SumCdr at a time. |
unknownRating | Unknown rating type. |
Definition at line 281 of file tariffsystem.h.
OSB_LIB::TsVersion::TsVersion | ( | const Oid & | oid = Oid() , |
|
RatingType | type = flatRating | |||
) | [explicit] |
Default constructor with optional object id and rating type.
OSB_LIB::TsVersion::TsVersion | ( | const TariffSystem::Oid & | tsId, | |
RatingType | type = flatRating | |||
) | [explicit] |
Construct from TS object id and optional rating type.
void OSB_LIB::TsVersion::copyCfg | ( | const TsVersion & | src | ) |
Get configuration from another TS version.
The class can determine which of the data members can be copied. Other than the name, status and released date, the rest of the data members will be the same as the source version.
src | Tariff system version to copy from. |
bool OSB_LIB::TsVersion::freeze | ( | const OSB_DB::Session & | session, | |
OsbErrors & | errors | |||
) | [private, virtual] |
Set status of the version to standby mode.
To set the status to standby mode, the following rules must be satisfied:
session | Database session. | |
errors | List of errors that occur during checks. |
OsbException | if encountered problems in database. |
Implements OSB_LIB::ToCfgBase.
const Tariff::Oid& OSB_LIB::TsVersion::getFlatTariff | ( | const TariffClass::Oid & | tcId, | |
const TariffPeriod::Oid & | tpId | |||
) | const |
const Tariff::Oid& OSB_LIB::TsVersion::getMassTariff | ( | const TariffClass::Oid & | tcId, | |
const TariffPeriod::Oid & | tpId | |||
) | const |
void OSB_LIB::TsVersion::getSupportedScOid | ( | std::set< ServiceClass::Oid > & | scOids | ) | const |
Get all service classes supported by the tariff system.
Each tariff system supports one service class system. All service classes supported are the one included in the service class system configured.
scOids | Container for the service classes supported. |
void OSB_LIB::TsVersion::getSupportedTcOid | ( | std::set< TariffClass::Oid > & | tcOids | ) | const |
Get all tariff classes supported by the tariff system.
All tariff classes supported are the ones supported by the tariff classification system configured.
tcOids | Container for the tariff classes supported. |
void OSB_LIB::TsVersion::getSupportedTcTpOid | ( | std::set< TcTp > & | tcTpOids | ) | const |
Get all tariff class, tariff period pairs supported by the tariff system.
tcTpOids | Container for the tariff classes supported. |
void OSB_LIB::TsVersion::getSupportedTpOid | ( | std::set< TariffPeriod::Oid > & | tpOids | ) | const |
Get all tariff period supported by the tariff system.
All tariff period supported are the ones supported by the tariff period systems configured.
tpOids | Container for the tariff period supported. |
const TcSystem::Oid& OSB_LIB::TsVersion::getTcSystem | ( | const ServiceClass::Oid & | scId | ) | const |
Get the tariff classification based on service class.
scId | Service class id. |
const TpSystem::Oid& OSB_LIB::TsVersion::getTpSystem | ( | const TariffClass::Oid & | tcId | ) | const |
Get the tariff period system based on tariff class.
tcId | Tariff class id. |
bool OSB_LIB::TsVersion::insert | ( | const OSB_DB::Session & | session | ) | [private] |
Insert a tariff system version into database.
A new object is inserted. All attribute of the object has been set except object id. The object id will only be set by the function if the insertion is successful.
session | Database session. |
OsbException | for the following errors:
|
static RatingType OSB_LIB::TsVersion::longToRt | ( | const long | type | ) | [static] |
Change the long integer into tariff system rating type representation.
RatingType OSB_LIB::TsVersion::ratingType | ( | ) | const |
Get the type of rating supported.
bool OSB_LIB::TsVersion::read | ( | const OSB_DB::Session & | session | ) |
Read a tariff system version from database.
The object id is used to gather other info from database and then populate the object's data members.
session | Database session. |
bool OSB_LIB::TsVersion::release | ( | const OSB_DB::Session & | session, | |
OsbErrors & | errors | |||
) | [private, virtual] |
Set status of configuration to released mode.
To change status to released mode, the following must be fulfilled:
session | Database session. | |
errors | List of errors that occur during checks. |
OsbException | if encountered problems in database. |
Implements OSB_LIB::ToCfgBase.
bool OSB_LIB::TsVersion::remove | ( | const OSB_DB::Session & | session | ) | [private] |
Remove a tariff system version from database.
After the function call, oid of this object will be unset to indicate that there is no such entry anymore in the database.
session | Database session. |
OsbException | for the following errors:
|
void OSB_LIB::TsVersion::repopulateScTcsConfig | ( | ) | [private] |
Repopulate the SC-TCS configuration.
void OSB_LIB::TsVersion::repopulateTcTpFlatTariff | ( | ) | [private] |
Repopulate the TC-TP-simTF configuration.
void OSB_LIB::TsVersion::repopulateTcTpMassTariff | ( | ) | [private] |
Repopulate the TC-TP-massTF configuration.
void OSB_LIB::TsVersion::repopulateTcTpsConfig | ( | ) | [private] |
Repopulate the TC-TPS configuration.
bool OSB_LIB::TsVersion::revoke | ( | const OSB_DB::Session & | session, | |
OsbErrors & | errors | |||
) | [private, virtual] |
Set status from released to standby mode.
To change status from released to standby mode, the following must be satisifed:
session | Database session. | |
errors | List of errors that occur during checks. |
OsbException | if encountered problems in database. |
Implements OSB_LIB::ToCfgBase.
static long OSB_LIB::TsVersion::rtToLong | ( | const RatingType | type | ) | [static] |
Change the tariff system rating type into long integer representation.
const ScsOid& OSB_LIB::TsVersion::scsId | ( | ) | const |
Get version id of service class system.
const ScTcsCfg& OSB_LIB::TsVersion::scTcsCfg | ( | ) | const |
Get serivce class, tariff classification system configuration.
void OSB_LIB::TsVersion::setFlatTariff | ( | const TcTpTariff & | flatTf | ) |
Set the flat tariff for tariff classes and periods.
flatTf | Container with tariff classes, tariff periods to change (it needn't contain all pairs <tariff class, tariff period>). |
OsbException | if the status is not editable. |
void OSB_LIB::TsVersion::setMassTariff | ( | const TcTpTariff & | massTf | ) |
Set the mass tariff for tariff classes and periods.
massTf | Container with tariff classes, tariff periods to change (it needn't contain all pairs <tariff class, tariff period>). |
OsbException | if the status is not editable. |
void OSB_LIB::TsVersion::setRatingType | ( | const RatingType | rt | ) |
Set the rating type.
rt | The rating type of the TS version. |
OsbException | if status is not editable |
void OSB_LIB::TsVersion::setScsId | ( | const ScsOid & | scsId | ) |
Set service class system.
Does not update in the database. Call TariffCatalogue::updTsVersion() to save the newly assigned service class system.
scsId | New service class system version. |
OsbException | if status is not editable. |
void OSB_LIB::TsVersion::setScTcsCfg | ( | const ServiceClass::Oid & | scId, | |
const TcSystem::Oid & | tcsId | |||
) |
Set a service class, tariff classification system configuration to map.
scId | Object id of service class. | |
tcsId | Object id of TC system for scId. |
void OSB_LIB::TsVersion::setScTcsCfg | ( | const ScTcsCfg & | scTcsCfg | ) |
Set the TC system for service classes.
scTcsCfg | Container with service classes to change (it needn't contain all service classes). |
OsbException | if the status is not editable. |
void OSB_LIB::TsVersion::setTcTpFlatTariff | ( | const TcTp & | tcTp, | |
const Tariff::Oid & | tariffOid | |||
) |
Set a flat tariff of a tariff class, tariff period tuple to map.
tcTp | Tariff class, tariff period pair. | |
tariffOid | Unique id of tariff. |
void OSB_LIB::TsVersion::setTcTpMassTariff | ( | const TcTp & | tcTp, | |
const Tariff::Oid & | tariffOid | |||
) |
Set a mass tariff of a tariff class, tariff period tuple to map.
tcTp | Tariff class, tariff period pair. | |
tariffOid | Unique id of tariff. |
void OSB_LIB::TsVersion::setTcTpsCfg | ( | const TariffClass::Oid & | tcOid, | |
const TpSystem::Oid & | tpsOid | |||
) |
Set tariff class, tariff period system configuration to map.
void OSB_LIB::TsVersion::setTcTpsCfg | ( | const TcTpsCfg & | tcTpsCfg | ) |
Set the TP system for tariff classes.
tcTpsCfg | Container with tariff classes to change (it needn't contain all tariff classes). |
OsbException | if the status is not editable. |
const TcTpTariff& OSB_LIB::TsVersion::tcTpFlatTariff | ( | ) | const |
Get flat tariff of tariff class, tariff period tuple.
const TcTpTariff& OSB_LIB::TsVersion::tcTpMassTariff | ( | ) | const |
Get mass tariff of tariff class, tariff period tuple.
const TcTpsCfg& OSB_LIB::TsVersion::tcTpsCfg | ( | ) | const |
Get tariff class, tariff period system configuration.
TariffSystem::Oid OSB_LIB::TsVersion::tsId | ( | ) | const |
Get id of tariff system.
bool OSB_LIB::TsVersion::unfreeze | ( | const OSB_DB::Session & | session, | |
OsbErrors & | errors | |||
) | [private, virtual] |
Set status to from standby to editable.
To change status from standby to editable mode, the following must be satisifed:
session | Database session. | |
errors | List of errors that occur during checks. |
OsbException | if encountered problems in database. |
Implements OSB_LIB::ToCfgBase.
bool OSB_LIB::TsVersion::update | ( | const OSB_DB::Session & | session | ) | [private] |
Update a tariff system version in the database.
Old entry in the database identified by the object id will be replaced with the new data from this object.
session | Database session. |
OsbException | for the following errors:
|
friend struct OSB_DB::TsVersionGw [friend] |
friend class TariffCatalogue [friend] |
Allow tariff catalogue to call private member functions.
Definition at line 278 of file tariffsystem.h.
Oid OSB_LIB::TsVersion::oid_ [private] |
RatingType OSB_LIB::TsVersion::ratingType_ [private] |
ScsOid OSB_LIB::TsVersion::scsOid_ [private] |
ScTcsCfg OSB_LIB::TsVersion::scTcsCfg_ [private] |
Service class, tariff classification system configuration.
Definition at line 805 of file tariffsystem.h.
TcTpsCfg OSB_LIB::TsVersion::tcTpsCfg_ [private] |