Rates
Regular and tiered value storage to replace constants in your application
Install
Usage
Schema
For most applications, just the name and value properties will suffice. For those with more complex requirements, we provide an easy way to implement geographic and tiered rate decks.
Property | Description | Type |
| The user-friendly identifier for the rate |
|
| The purpose/context of the rate value |
|
| The numeric value |
|
| A group/shared rate deck |
|
| A set of geographical regions for which the rate applies |
|
| An equation for qualifying the rate. It must start with "==", ">", "<", "<=" or ">=". |
|
Methods
The Rate schema ships with only one method - a helper function for evaluating threshold values.
Name | Description | Parameters | Returns |
| Evaluates the stored threshold expression |
|
|
Statics
The Rate schema also includes a few static decorators for querying rates that satisfy multiple threshold values.
Name | Description | Parameters | Returns |
| Will find lowest matching value in the rate collection |
|
|
| Will find highest matching value in the rate collection |
|
|
Example
Last updated