Definition at line 295 of file tariff-gw.h.
bool OSB_DB::TfVersionGw::allRatingFnsChecked | ( | const Session & | session, | |
const OSB_LIB::TfVersion::Oid & | oid | |||
) | [private] |
Check whether all the rating functions bound to the tariff version has been checked.
session | Database session. | |
oid | Object id of the tariff version to be checked. |
OsbException | for the following errors:
|
bool OSB_DB::TfVersionGw::allRatingFnsReleased | ( | const Session & | session, | |
const OSB_LIB::TfVersion::Oid & | oid | |||
) | [private] |
Check whether all the rating functions bound to the tariff version has been released.
session | Database session. | |
oid | Object id of the tariff version to be checked. |
OsbException | for the following errors:
|
OSB_LIB::ObjectStatus OSB_DB::TfVersionGw::checkObjVs | ( | const Session & | session, | |
const OSB_LIB::TfVersion & | tfv | |||
) | [private] |
Check the current object version.
session | Database session. | |
tfv | Tariff version which object version is to be verified. |
OsbException | for the following errors:
|
bool OSB_DB::TfVersionGw::delTfVersion | ( | const Session & | session, | |
OSB_LIB::TfVersion & | tfv | |||
) | [private] |
Delete a tariff version from database.
The tariff version to be deleted must exist in the database. Besides that, the object version of the tariff version to be deleted must match the object version in the database. This is to ensure that the object to be deleted truly represents the entry in the databse. After the function call, the object's id will be unset but the object itself is not deleted automatically. Application is responsible to delete the tariff version object itself.
session | Database session. | |
tfv | Tariff object to be deleted. |
OsbException | for the following errors:
|
bool OSB_DB::TfVersionGw::existReleasedTfVs | ( | const Session & | session, | |
const OSB_LIB::Date & | backDate, | |||
const OSB_LIB::TfVersion::Oid & | oid | |||
) | [private] |
Check if a tariff version existing whose released date is between released date of current tariff version and the back-date.
session | Database session, | |
backDate | Date which the tariff version will be shifted back. | |
oid | Object id of current tariff version. |
OsbException | if such a tariff version exist. |
long OSB_DB::TfVersionGw::fetch | ( | const Session & | session, | |
OSB_LIB::TfVersions & | tfvs | |||
) |
Get a list of all available tariff versions.
This function retrieve all the available tariff versions from database.
session | Database session. | |
tfvs | Container that stores all the retrieved object |
OsbException | for the following errors:
|
bool OSB_DB::TfVersionGw::fetch | ( | const Session & | session, | |
OSB_LIB::TfVersion & | tfv | |||
) |
Populate a tariff version object with data.
This function accept an empty tariff version object with only its oid set. It will populate all other data members of the object.
session | Database session. | |
tfv | Tariff version object to be populated. |
OsbException | for the following errors:
|
bool OSB_DB::TfVersionGw::findReplacementFreezedTfVersion | ( | const Session & | session, | |
const OSB_LIB::TfVersion::Oid & | oid | |||
) | [private] |
Find the replacement for a freezed tariff version.
session | Database session. | |
oid | Object id of the tariff version to be replaced. |
OsbException | for the following errors:
|
OSB_LIB::DateTime OSB_DB::TfVersionGw::findReplacementReleasedTfVersion | ( | const Session & | session, | |
const OSB_LIB::TfVersion::Oid & | oid | |||
) | [private] |
Find the replacement for a released tariff version.
session | Database session. | |
oid | Object id of the tariff version to be replaced. |
OsbException | for the following errors:
|
bool OSB_DB::TfVersionGw::hasOtherReleasedTfVersion | ( | const Session & | session, | |
const OSB_LIB::TfVersion::Oid & | oid | |||
) | [private] |
Check is there any other released tariff version exists.
session | Database session. | |
oid | Object id of the tariff version to be checked. |
OsbException | for the following errors:
|
bool OSB_DB::TfVersionGw::insTfVersion | ( | const Session & | session, | |
OSB_LIB::TfVersion & | tfv | |||
) | [private] |
Add a new tariff version object.
Before the function call, the object must have all its member attributes assigned (except oid_.id2 and objVs_). After the function call, the object will have its oid_ and objVs_ set.
session | Database session. | |
tfv | New tariff version to be added into database. |
OsbException | for the following errors:
|
bool OSB_DB::TfVersionGw::isReleasedInFuture | ( | const Session & | session, | |
const OSB_LIB::TfVersion::Oid & | oid | |||
) | [private] |
Ensure the release date is in the future.
This function checks whether the tariff version with the given object id has its release date in the future.
session | Database session. | |
oid | Object id of the tariff version to be checked. |
OsbException | for the following errors:
|
bool OSB_DB::TfVersionGw::isTariffUsedByFreezedTsVersion | ( | const Session & | session, | |
const OSB_LIB::Tariff::Oid & | oid | |||
) | [private] |
Check whether tariff version is in used.
This function checks whether any freezed tariff system version is using the tariff with the object id given.
session | Database session. | |
oid | Object id of the tariff to be checked. |
OsbException | for the following errors:
|
bool OSB_DB::TfVersionGw::isTariffUsedByReleasedTsVersion | ( | const Session & | session, | |
const OSB_LIB::Tariff::Oid & | oid | |||
) | [private] |
Check whether tariff version is in used.
This function checks whether any released tariff system version is using the tariff with the object id given.
session | Database session. | |
oid | Object id of the tariff to be checked. |
OsbException | for the following errors:
|
bool OSB_DB::TfVersionGw::patch | ( | const Session & | session, | |
OSB_LIB::TfVersion & | tfVs, | |||
OSB_LIB::TfVersion & | newTfVs | |||
) | [private] |
Switch the names between two tariff versions.
This function switches the names between the substitute version and the version to be replaced.
session | Database session. | |
tfVs | Tariff version object to be replaced. | |
newTfVs | Substitute tariff version. |
OsbException | if database operation fails. |
bool OSB_DB::TfVersionGw::setStatus | ( | const Session & | session, | |
OSB_LIB::TfVersion & | tfVs, | |||
OSB_LIB::CfgStatus | status | |||
) | [private] |
Change the status of tariff version.
This function will change the status of tariff version with the given object id based on the input status.
session | Database session to use. | |
tfVs | Tariff version for which to set the status. | |
status | New status of the rating function. If the function returns true its object version is increased and its status set to status. |
bool OSB_DB::TfVersionGw::uniqueReleaseTs | ( | const Session & | session, | |
const OSB_LIB::Tariff::Oid & | oid, | |||
const OSB_LIB::DateTime & | ts | |||
) | const [private] |
Check whether the release date is unique.
This function will check whether the release date is unique among the different versions of the same tariff.
session | Database session. | |
oid | Object id of the tariff. | |
ts | Release time stamp to check. |
OsbException | for the following errors:
|
bool OSB_DB::TfVersionGw::updTfVersion | ( | const Session & | session, | |
OSB_LIB::TfVersion & | tfv | |||
) | [private] |
Update a tariff version object.
The function will modify the data of a tariff version in the database with the data contained within the input object. The tariff version object entry in the database will only be updated if the input object truly represent the current entry in the database (the object version is the same).
session | Database session. | |
tfv | Tariff version object to be updated. |
OsbException | for the following errors:
|
friend class OSB_LIB::TfVersion [friend] |
Tariff version needs to call the private member functions.
Definition at line 299 of file tariff-gw.h.