From 609c821a50d67cb0cd5e1765f359001e9995d940 Mon Sep 17 00:00:00 2001 From: DanB Date: Thu, 22 Aug 2013 20:45:24 +0200 Subject: [PATCH] Adding partial new documentation structure for tariff plans --- docs/api_accounts.rst | 2 +- docs/csv_tpdestinationrates.rst | 59 +++++++++++++++++++++++ docs/csv_tpdestinations.rst | 21 ++++++++ docs/csv_tprates.rst | 77 +++++++++++++++++++++++++++++ docs/csv_tptimings.rst | 60 +++++++++++++++++++++++ docs/tariffplans.rst | 85 +++++++++++++++++++++++++++++++++ 6 files changed, 303 insertions(+), 1 deletion(-) create mode 100644 docs/csv_tpdestinationrates.rst create mode 100644 docs/csv_tpdestinations.rst create mode 100644 docs/csv_tprates.rst create mode 100644 docs/csv_tptimings.rst create mode 100644 docs/tariffplans.rst diff --git a/docs/api_accounts.rst b/docs/api_accounts.rst index d5d9f809f..acc15e78f 100644 --- a/docs/api_accounts.rst +++ b/docs/api_accounts.rst @@ -1,5 +1,5 @@ ApierV1.SetAccountActions -+++++++++++++++++++++++ ++++++++++++++++++++++++++ Process dependencies and load a specific AccountActions profile from storDb into dataDb. diff --git a/docs/csv_tpdestinationrates.rst b/docs/csv_tpdestinationrates.rst new file mode 100644 index 000000000..7b5be1287 --- /dev/null +++ b/docs/csv_tpdestinationrates.rst @@ -0,0 +1,59 @@ +DestinationRates.csv +++++++++++++++++++++ + +Bind destination group from Destinations.csv_ with rates defined in Rates.csv_ files. + +CSV fields as tabular representation: + ++--------------------+------------------+---------------------+ +| Tag | DestinationsTag | RatesTag | ++====================+==================+=====================+ +| DR_RETAIL_PEAK | GERMANY | LANDLINE_PEAK | ++--------------------+------------------+---------------------+ +| DR_RETAIL_OFFPEAK | GERMANY | LANDLINE_OFFPEAK | ++--------------------+------------------+---------------------+ + +Index 0 - *Tag* + Free-text field used to reference the entry from other files. + +Index 1 - *Years* + Years this timing is valid on. + + Possibile values: + * Semicolon (;) separated list of years as descriptive filter. + * "\*any" metatag used as match-any filter. + +Index 2 - *Months* + Months this timing is valid on. + + Possibile values: + * Semicolon (;) separated list of months as descriptive filter. + * "\*any" metatag used as match-any filter. + +Index 3 - *MonthDays* + Days of a month this timing is valid on. + + Possibile values: + * Semicolon (;) separated list of month days as descriptive filter. + * "\*any" metatag used as match-any filter. + +Index 4 - *WeekDays* + Days of a week this timing is valid on. Week days represented as integers where 1=Monday and 7=Sunday + + Possibile values: + * Semicolon (;) separated list of week days as descriptive filter. + * "\*any" metatag used as match-any filter. + +Index 5 - *Time* + The start time for this time period. + + Possibile values: + * String representation of time (hh:mm:ss). + * "\*asap" metatag used to represent time converted at runtime. + + +.. _Destinations.csv: csv_tpdestinations +.. _Rates.csv: csv_tprates + + + diff --git a/docs/csv_tpdestinations.rst b/docs/csv_tpdestinations.rst new file mode 100644 index 000000000..0babc6429 --- /dev/null +++ b/docs/csv_tpdestinations.rst @@ -0,0 +1,21 @@ +Destinations.csv +++++++++++++++++ + +Group together prefixes into destination groups identified by tag. + +CSV fields example as tabular representation: + ++------------+--------+ +| Tag | Prefix | ++============+========+ +| GERMANY | 49 | ++------------+--------+ +| GERMANY_O2 | 49176 | ++------------+--------+ + +Index 0 - *Tag* + Free-text field used to reference the specific destination from other files. + +Index 1 - *Prefix* + Destination prefix as group element + diff --git a/docs/csv_tprates.rst b/docs/csv_tprates.rst new file mode 100644 index 000000000..60597a779 --- /dev/null +++ b/docs/csv_tprates.rst @@ -0,0 +1,77 @@ +Rates.csv ++++++++++ + +Defines the rates on the system. +Each entry is a part of a rate group, each group having at least one entry. Group entries share *Tag*, *ConnectFee*, *Weight* parameters. + +CSV fields example as tabular representation: + ++---------------------+------------+------+----------+---------------+--------------------+----------------+------------------+---------+ +| Tag | ConnectFee | Rate | RateUnit | RateIncrement | GroupIntervalStart | RoundingMethod | RoundingDecimals | Weight | ++=====================+============+======+==========+===============+====================+================+==================+=========+ +| LANDLINE_PEAK | 0.02 | 0.02 | 60s | 60s | 0s | \*up | 4 | 10 | ++---------------------+------------+------+----------+---------------+--------------------+----------------+------------------+---------+ +| MOBILE_PEAK | 1 | 2 | 60s | 10s | 0s | \*middle | 4 | 10 | ++---------------------+------------+------+----------+---------------+--------------------+----------------+------------------+---------+ +| MOBILE_PEAK | 1 | 1 | 60s | 20s | 40s | \*middle | 4 | 10 | ++---------------------+------------+------+----------+---------------+--------------------+----------------+------------------+---------+ +| MOBILE_PEAK | 1 | 0 | 60s | 10s | 60s | \*middle | 4 | 10 | ++---------------------+------------+------+----------+---------------+--------------------+----------------+------------------+---------+ + + + +Index 0 - *Tag* + Free-text field used to reference the entry from other files. + +Index 1 - *ConnectFee* + Connect fee charged at start of each call. Should be the same for all members of a group interval. + + Possible values: + * Float or integer value, granularity given by rates administrator and not predefined (eg: cent vs euro). + +Index 2 - *Rate* + The rate which will be charged. + + Possible values: + * Float or integer value, granularity given by rates administrator and not predefined (eg: cent vs euro). + +Index 3 - *RateUnit* + The duration unit which is rated by *Rate* field. + + Possible values: + * Duration string. A duration string is a possibly signed sequence of decimal numbers, each with optional fraction and a unit suffix, such as "300ms", "1.5h" or "2h45m". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". + +Index 4 - *RateIncrement* + The total duration will be split and rounded into smaller intervals based on this (eg: for *RateIncrement* of 60s, total duration of 1m2s will be charged as 2 minutes). + + Possible values: + * Duration string. A duration string is a possibly signed sequence of decimal numbers, each with optional fraction and a unit suffix, such as "300ms", "1.5h" or "2h45m". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". + +Index 5 - *GroupIntervalStart* + The position in the rate group. + + Possible values: + * Duration string. A duration string is a possibly signed sequence of decimal numbers, each with optional fraction and a unit suffix, such as "300ms", "1.5h" or "2h45m". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". + +Index 6 - *RoundingMethod* + The routine which will round the cost on each timespan. + + Possible values: + * A *MetaTag* referring the internal routine doing the rounding (eg: \*up, \*down, \*middle) + +Index 7 - *RoundingDecimals* + Round the number of decimals of each timespan based on this setting. + + Possible values: + * An integer value. + +Index 8 - *Weight* + Solve possible conflicts between different rates matching same interval based on this parameter. + Higher *Weight* has bigger priority. + Should be the same for all members of a group interval. + + Possible values: + * Float/Integer representing the rate weight on collisions. + + + diff --git a/docs/csv_tptimings.rst b/docs/csv_tptimings.rst new file mode 100644 index 000000000..450e269d7 --- /dev/null +++ b/docs/csv_tptimings.rst @@ -0,0 +1,60 @@ +mings.csv ++++++++++++ + +Holds time related definitions. + +CSV fields examples as tabular representations: + ++-----------------+--------+--------+-----------+-----------+----------+ +| Tag | Years | Months | MonthDays | WeekDays | Time | ++=================+========+========+===========+===========+==========+ +| WORKDAYS | \*any | \*any | \*any | 1;2;3;4;5 | 00:00:00 | ++-----------------+--------+--------+-----------+-----------+----------+ +| WEEKENDS | \*any | \*any | \*any | 6;7 | 00:00:00 | ++-----------------+--------+--------+-----------+-----------+----------+ +| ALWAYS | \*any | \*any | \*any | \*any | 00:00:00 | ++-----------------+--------+--------+-----------+-----------+----------+ +| ASAP | \*any | \*all | \*all | \*all | \*asap | ++-----------------+--------+--------+-----------+-----------+----------+ + +**Fields** + +Index 0 - *Tag* + Free-text field used to reference the entry from other files. + +Index 1 - *Years* + Years this timing is valid on. + + Possibile values: + * Semicolon (;) separated list of years as descriptive filter. + * "\*any" metatag used as match-any filter. + +Index 2 - *Months* + Months this timing is valid on. + + Possibile values: + * Semicolon (;) separated list of months as descriptive filter. + * "\*any" metatag used as match-any filter. + +Index 3 - *MonthDays* + Days of a month this timing is valid on. + + Possibile values: + * Semicolon (;) separated list of month days as descriptive filter. + * "\*any" metatag used as match-any filter. + +Index 4 - *WeekDays* + Days of a week this timing is valid on. Week days represented as integers where 1=Monday and 7=Sunday + + Possibile values: + * Semicolon (;) separated list of week days as descriptive filter. + * "\*any" metatag used as match-any filter. + +Index 4 - *Time* + The start time for this time period. + + Possible values: + * String representation of time (hh:mm:ss). + * "\*asap" metatag used to represent time converted at runtime. + + diff --git a/docs/tariffplans.rst b/docs/tariffplans.rst new file mode 100644 index 000000000..dc18b2d5d --- /dev/null +++ b/docs/tariffplans.rst @@ -0,0 +1,85 @@ +TariffPlans +=========== + +Major concept within CGRateS architecture, implement mechanisms to load rating as well as account data into CGRateS. + +Currently TariffPlans can be loaded using 2 different approaches: + +Direct load out of TP-CSV files +------------------------------- + +This represents the fastest and easiest way to manage small set of TP definitions. It has the advantage of being simple to define and load but on the other hand as soon as the data set grows it becomes relatively hard to be maintaned. + +Due to complex data definition we have split information necessary on each load process in more .csv files, identified by names close to their utility. + +Each individual CSV file can have any number of rows starting with comment character (#) which will be ignored on processing. + +Depending on CGRateS subsystem, following files are required: + +RatingProfiles +~~~~~~~~~~~~~~ + +.. toctree:: + :maxdepth: 2 + + csv_tptimings + +.. toctree:: + :maxdepth: 2 + + csv_tpdestinations + +.. toctree:: + :maxdepth: 2 + + csv_tprates + +.. toctree:: + :maxdepth: 2 + + csv_tpdestinationrates + +.. toctree:: + :maxdepth: 2 + + csv_tpdestratetimings + +.. toctree:: + :maxdepth: 2 + + csv_tpratingprofiles + +Accounts +~~~~~~~~ + +.. toctree:: + :maxdepth: 2 + + csv_tptimings + +.. toctree:: + :maxdepth: 2 + + csv_tpdestinations + +.. toctree:: + :maxdepth: 2 + + csv_tpactions + +.. toctree:: + :maxdepth: 2 + + csv_tpactiontimings + +.. toctree:: + :maxdepth: 2 + + csv_tpactiontriggers + +.. toctree:: + :maxdepth: 2 + + csv_tpaccountactions + +